var blnIsLoaded = false
var blnIsHome = false
var blnIsMac = false
var strPlatform = window.navigator.platform.toLowerCase()

startMenus();


if (strPlatform.indexOf("mac") > -1)
{ blnIsMac = true; }

var strLastMenu = "divvalues"

function showMenu(strMenu) {
	if (blnIsLoaded && !blnIsMac) {
		var objLayer
		// "divProducts" and "divServices" are defined in /products_services/overview.aspx
		if (strLastMenu != "divbusiness" && strLastMenu != "divacd" && strLastMenu != "divsed" && strLastMenu != "divvalues" && strLastMenu != "divcorpinfo") {
			hideMenu(strLastMenu);
		}
		if (document.all) {
			objLayer = document.all[strMenu]
		}
		else if (document.getElementById) {
			objLayer = document.getElementById(strMenu)
		}
		else if (document.layers) {
			objLayer = getLayer(strMenu)
		}
	
		// show
		if (document.all) {
			objLayer.style.visibility = "visible";
		}
		else if (document.getElementById) {
			objLayer.style.visibility = "visible"
		}
		else if (document.layers) {
			if (parseFloat(navigator.appVersion) >= 4.08) {
				// move to position relative to image
				objImage = getImage("l_" + strMenu.substring(3, strMenu.length))
				intTop = getImagePageTop(objImage)
				intLeft = getImagePageLeft(objImage)
				objLayer.top = intTop + objImage.height
				objLayer.left = intLeft - 1
				
				// show
				objLayer.visibility = "show"
			}
		}
	
		strLastMenu = strMenu
	}
}



function hideMenu(strMenu) {

	if (blnIsLoaded && !blnIsMac) {

		var objLayer
		var isIn = false
		var i = 0
		var blnIsFromFlash = false
		
		if (strMenu == "hideFromFlash")
			blnIsFromFlash = true
	
		if (strMenu == "" || blnIsFromFlash)
			strMenu = strLastMenu
	
		if (document.all) {
			objLayer = document.all[strMenu]
		}
		else if (document.getElementById) {
			objLayer = document.getElementById(strMenu)
		}
		else if (document.layers) {
			objLayer = getLayer(strMenu)
		}
	
		// hide
		if (document.all) {
			if (!blnIsFromFlash) {
				while (!isIn && i < document.all[strMenu].all.length) {
					if (window.event.toElement == document.all[strMenu].all[i])
						isIn = true
					i++
				}
				if (!isIn) {
					document.all[strMenu].style.visibility = "hidden"
				}
			}
			else {
				document.all[strMenu].style.visibility = "hidden"
			}
		}
		else if (document.getElementById) {
			objLayer.style.visibility = "hidden"
		}
		else if (document.layers) {
			if (parseFloat(navigator.appVersion) >= 4.08) {
				objLayer.visibility = "hide"
			}
		}
	}
}



function startMenus() {
	// set that the document is loaded
	blnIsLoaded = true
	
	// position menu hiders for netscape 4
	if (document.layers) {
		if (parseFloat(navigator.appVersion) >= 4.08) {
			var objImage = getImage('l_company')
			var intTop = getImagePageTop(objImage)
			var intLeft = getImagePageLeft(objImage)
			
			document.leftHide.left = intLeft - 10
			document.leftHide.top = intTop
			
			document.topHide.left = intLeft - 10
			document.topHide.top = intTop - 10
			
			document.rightHide.left = intLeft + 240
			document.rightHide.top = intTop
		}
	}
	if (document.getElementById && navigator.appName == "Netscape") {
		document.onclick = handler
	}
}
function handler(e) {
	var objElement
	var blnIsIn = false
	
	objElement = e.target
	
	while(objElement.parentNode && !blnIsIn) {
		if (objElement.id != null && objElement.id != "" && objElement.id.substring(0, 3) == "div")
			blnIsIn = true
		objElement = objElement.parentNode
	}
	
	if (blnIsIn != true)
		hideMenu('')
}

function rollOnRow(rowobj)
{
	this.style.backgroundColor = rowobj;
	rowobj="";
}
function rollOffRow(rowobj)
{
	this.style.backgroundColor = rowobj;
	rowobj = "";
}

function Sendemail(emailName, emailDomain){
			document.location.href="mailto:" + emailName + "@" + emailDomain;
		}
