var menuTimeout;
var currentMenu;
var imgPath = "/m/static/i/";
var navIsLoaded = false;

function init() {
	DynLayerInit();
	navIsLoaded = true;
}

function menuOn(menuName) {
	var theMenu;
	
	if (!navIsLoaded) return;
	
	clearTimeout(menuTimeout);
	
	if (currentMenu) {
		theMenu = eval(currentMenu);
		theMenu.hide();
	}
	currentMenu = menuName;
	theMenu = eval(currentMenu);
	theMenu.show();
	menuTimeout = setTimeout(currentMenu + '.hide()', 3000);
}

function menuOff(menuName) {
	
	if (!navIsLoaded) return;
	
	clearTimeout(menuTimeout);
	menuTimeout = setTimeout(menuName + '.hide()', 330);
}

function menuLinkOn(imgName) {
	var theImage;
	
	clearTimeout(menuTimeout);
	theImage = (is.ns) ? eval("document.layers['" + currentMenu + "Div'].document.images['" + imgName + "']") : eval("document." + imgName);
	theImage.src = imgPath + "tnav_lnk_" + imgName + "_on.gif";
}

function menuLinkOff(imgName) {
	var theImage;

	theImage = (is.ns) ? eval("document.layers['" + currentMenu + "Div'].document.images['" + imgName + "']") : eval("document." + imgName);
	theImage.src = imgPath + "tnav_lnk_" + imgName + ".gif";
	menuTimeout = setTimeout(currentMenu + '.hide()', 165);
}

function linkSwap(imgName, ON) {
	var theImage = eval("document." + imgName);
	theImage.src = imgPath + imgName + ((ON) ? "_on":"") + ".gif";
}

function arrowSwap(linkName, ON, outerLayer, innerLayer) {
	var theImage	
	
	if ((is.ns) && (outerLayer > "") && (innerLayer > "")) {
 		theImage = "document." + outerLayer + ".document." + innerLayer + ".document." + linkName;
	} else if ((is.ns) && (outerLayer > "")) {
 		theImage = "document." + outerLayer + ".document." + linkName;
	} else {
 		theImage = "document." + linkName;
	}		
	
	theImageObj = eval(theImage)
	theImageObj.src = imgPath + "gl_arrow" + ((ON) ? "_on":"") + ".gif";
}
