window.onload=function(){
	initMainMenu('none');
}


//----------------------------------------------------
// initMainMenu
// Loop through all LI elements on the page, find the ones that have an ID
// that contains "menuTab_" then apply onmouseover/onmouseout actions using
// the DOM.
//----------------------------------------------------
function initMainMenu(sActiveSection) {
	var arGlobalLIs = document.getElementsByTagName("li");
	for (var i=0; i < arGlobalLIs.length; i++) {
		if (arGlobalLIs[i].id.indexOf("menuTab_") != -1) {
			arGlobalLIs[i].onmouseover = function () { showSubMenu(this.id); };
			arGlobalLIs[i].onmouseout = function () { hideSubMenu(this.id); };
		}
	}
	highlightActivePageTab(sActiveSection);
}

function highlightActivePageTab(sActiveSection) {
	if ((arguments.length > 0) && (arguments[0] != "none")) {
		document.getElementById(sActiveSection).style.backgroundPosition = "0 -27px";
	}
}

function showSubMenu(sElementID) {
	var sSection = sElementID.substr(8,(sElementID.length-8));
	var sElementId = "subMenu_" + sSection;
	document.getElementById(sElementId).style.display = "block";
	document.getElementById(sElementId).style.zIndex = "10";
}

function hideSubMenu(sElementID) {
	var sSection = sElementID.substr(8,(sElementID.length-8));
	var sElementId = "subMenu_" + sSection;
	document.getElementById(sElementId).style.display = "none";
}
