var section;

browsver = navigator.appVersion.toLowerCase();
browsvernum = parseInt(navigator.appVersion);
browsname = navigator.appName;
browsagt = navigator.userAgent.toLowerCase();


function initpage() {
	if (section == "hp") {
		thebodyarea = document.getElementById("flash");
	}
	else {
		thebodyarea = document.getElementById("bodyshell");
	}
	
	if (thebodyarea.addEventListener) {
		thebodyarea.addEventListener("mouseover", hideall, true);
	}
	else if (thebodyarea.attachEvent) {
		thebodyarea.attachEvent("onmouseover", hideall);
	}
}

onload = initpage;

function hideall() {
	showhide();
}


function showhide(thisid) {
//	if (browsagt.indexOf("safari") != -1 && section == "hp") {
	if (browsagt.indexOf("mac") != -1 && section == "hp") {
		return;
	}
	navnum = 7;
	mainsubnav = document.getElementById('mainsubnavigation');
	subnavvis = false;
	for (i=1; i<=navnum; i++) {
		thislink = document.getElementById('navlink'+i);
		thissubnav = document.getElementById('mainsubnav'+i);
		if (thislink && thissubnav) {
			if (thisid == i) {
				thislinktop = getpos('navlink'+i);
				thislink.style.borderBottomWidth = "1px";
				thislink.style.marginBottom = "8px";
				//thislink.style.borderBottomColor = "#666666";
				thissubnav.style.display = "block";
				mainsubnav.style.top = thislinktop + "px";
				subnavvis = true;
			}
			else {
				thislink.style.borderBottomWidth = "0px";
				thislink.style.marginBottom = "9px";
				//thislink.style.borderBottomColor = "transparent";
				thissubnav.style.display = "none";
			}

			if (subnavvis == true) {
				//mainsubnav.style.visibility = "visible";
				mainsubnav.style.display = "block";
			}
			else {
				//mainsubnav.style.visibility = "hidden";
				mainsubnav.style.display = "none";
			}
		}
	}

}

function getpos(id) {
	thenavlink = document.getElementById(id);

	navlinktop = thenavlink.offsetTop;

	if (thenavlink.offsetHeight) {
		navlinkheight = thenavlink.offsetHeight;
	}
	else {
		navlinkheight = 0;
	}

	navlinktop = 0;
	if (thenavlink.offsetParent) {
		while (thenavlink.offsetParent) {
			navlinktop += thenavlink.offsetTop
			thenavlink = thenavlink.offsetParent;
		}
	}
	else if (thenavlink.y) {
		navlinktop += thenavlink.y;
	}

	//navlinktop += navlinkheight;

	return navlinktop;
}





    