var IE = "Microsoft Internet Explorer";
var NS = "Netscape";
var OP = "Opera"

function fnSubMenuTurnOffIEFix(whichMenu, whichContainer, whichLyr){
	if(navigator.appName == IE){
		document.getElementById(whichMenu).style.visibility = "hidden";
		document.getElementById(whichContainer).style.visibility = "hidden";
		document.getElementById(whichLyr).style.visibility = "hidden";
	} else {
		// do nothing as all other browsers do what they're supposed to!
	}
}

function fnSubMenuTurnOff(whichMenu, whichContainer, whichLyr){
	document.getElementById(whichMenu).style.visibility = "hidden";
	document.getElementById(whichContainer).style.visibility = "hidden";
	document.getElementById(whichLyr).style.visibility = "hidden";
}

function fnSubMenuTurnOn(whichMenu, whichContainer, whichLyr){
	document.getElementById(whichMenu).style.visibility = "visible";
	document.getElementById(whichContainer).style.visibility = "visible";
	document.getElementById(whichLyr).style.visibility = "visible";
}

function fnFindPosition( oLink, whichID ) {
	
	var whichDDMenu = "";
	var whichDDContMenu = "";
	var whichDDLyrMenu = "";
	
	for( var posX = 0, posY = 0; oLink.offsetParent; oLink = oLink.offsetParent ) {
		posX += oLink.offsetLeft;
		posY += oLink.offsetTop;
	}
	
	switch(whichID){
		case "about" :
			whichDDMenu = "menuDDAbout";
			whichDDContMenu = "menuDDContainerAbout";
			whichDDLyrMenu = "menuLyrAbout";
			break;
		case "services" :
			whichDDMenu = "menuDDServices";
			whichDDContMenu = "menuDDContainerServices";
			whichDDLyrMenu = "menuLyrServices";
			break;
		case "clients" :
			whichDDMenu = "menuDDClients";
			whichDDContMenu = "menuDDContainerClients";
			whichDDLyrMenu = "menuLyrClients";
			break;
	}
	
	//return [ posX, posY ];
	document.getElementById(whichDDMenu).style.left = posX - 10;
	document.getElementById(whichDDContMenu).style.left = posX;
	document.getElementById(whichDDContMenu).style.top = posY;
	
	if(navigator.appName == IE){
		document.getElementById(whichDDMenu).style.top = posY + 17;
	} else if(navigator.appName == NS) {
		document.getElementById(whichDDMenu).style.top = posY + 16;
		document.getElementById(whichDDContMenu).style.top = posY - 1;
	} else if(navigator.appName == OP) {
		document.getElementById(whichDDMenu).style.top = posY + 16;
		document.getElementById(whichDDContMenu).style.top = posY - 0;
	}

	document.getElementById(whichDDMenu).style.visibility = "visible";
	document.getElementById(whichDDContMenu).style.visibility = "visible";
	
	document.getElementById(whichDDLyrMenu).style.left = 0;
	document.getElementById(whichDDLyrMenu).style.visibility = "visible";
}