
// main navigation
var nav1 = {};
nav1.activeImg = null;

nav1.mouseOver = function(obj) {
	img = obj.getElementsByTagName('IMG')[0];
	ext = img.src.substring(img.src.lastIndexOf('.'), img.src.length);
	if (img.src.indexOf('_o' + ext) == -1) img.src = img.src.replace(ext, '_o'+ext);
	
	if (obj != this.activeObj) { this.hide(); }
	clearTimeout(this.timeoutId);
	if (!this.activeObj) obj.className = "hover";
	this.activeObj = obj;
} 

nav1.mouseOut = function(obj) {
	nav1.activeImg = obj.getElementsByTagName('IMG')[0];
	var obj = this;
	hide = function() { obj.hide(); }
	this.timeoutId = setTimeout('hide()', 300);
}

nav1.hide = function() {
	clearTimeout(this.timeoutId);
	if (this.activeObj) {
		if (nav1.activeImg) {
			img = nav1.activeImg;
			ext = img.src.substring(img.src.lastIndexOf('.'), img.src.length);
			if (img.src.indexOf('_o' + ext) != -1) img.src = img.src.replace('_o'+ext, ext);
		}
	
		this.activeObj.className = '';
		this.activeObj = null;
	}
}


