window.onerror = null;
    var bName = navigator.appName;
 	var bVer = parseInt(navigator.appVersion);
 	var isIE
 	var isDOM
 	var isNS4
 	
 	isNS4 = (bName == "Netscape" && document.layers);
 	isIE = (document.all ? true : false);
 	isDOM = (document.getElementById ? true : false);
 	var isIExplorer = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;		// true if we're on ie
    var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; // true if we're on windows
 
  	var menuActive = null
	var submenuActive = null
 	var onLayer = null
	var secondLevel = null
 	var timeOn = null
	var timeOn2 = null
	var timeOn3 = null
	var timeOn4 = null
	var timeOn5 = null
	var activeTab = 'section2'
	var activeSubmenu = null
	var tempSubmenu1 = null
	var tempSubmenu2 = null
 
 	function getDivStyle (divname) {
 		var style;
 		if (isDOM) { style = document.getElementById(divname).style;}
 		else{style = isIE ? document.all[divname].style : document.layers[divname];}
 		return style;
 	}
 	
	
	function showLayer(divname) {
	     if (timeOn != null) {
	     	clearTimeout(timeOn);
	     	}
		 if (timeOn5 != null){
		clearTimeout(timeOn5);
			}	
		document.body.className = divname;
	}
	
	function hideLayer2(){
		document.body.className = activeTab;
	}
	
	// MENU MOUSE OVER  
	function menuOver(submenuID) {
		if (timeOn != null){
			clearTimeout(timeOn);
			}
		//alert(submenuID);
		tempSubmenu1 = submenuID;
		if (tempSubmenu2 != null){
			if (tempSubmenu1 == tempSubmenu2){
					clearTimeout(timeOn3);
				}
			}
		if (timeOn4 != null){
			clearTimeout(timeOn4);
			}
			if (timeOn5 != null){
			clearTimeout(timeOn5);//set by btnTimer2
			}
			//alert(document.getElementById(submenuID).style.zIndex);
			document.getElementById(submenuID).style.display = 'inline';
			document.getElementById(submenuID).style.zIndex = 200;
	}
	
	
	
	// TIMER FOR BUTTON MOUSE OUT
	function btnTimer() {
		 timeOn = setTimeout("hideLayer2()", 500);
	}
	
	function btnTimer2(subId) {
		if (timeOn3 != null){
	 	clearTimeout(timeOn3);
		}
	 timeOn2 = setTimeout("btnOut2(\"" + subId + "\")",200);
	 timeOn5 = setTimeout("hideLayer2()",300);
	}
	
	function btnTimer3(subId){
		timeOn3 = setTimeout("btnOut3(\"" + subId + "\")",200);
		timeOn4 = setTimeout("hideLayer2()", 300);
	}
	
	// BUTTON MOUSE OUT
	function btnOut(layerName) {
	document.getElementById(layerName).style.display = 'none';
	document.body.className = activeTab;
	}
	
	function btnOut2(layerName) {
	 document.getElementById(layerName).style.display = 'none';
	 document.getElementById(layerName).style.zIndex = 1;
	}
	
	function btnOut3(layerName){
	document.getElementById(layerName).style.display = 'none';
	document.getElementById(layerName).style.zIndex = 1;
	}
	
	function setTimer(subItem){
		clearTimeout(timeOn);
		clearTimeout(timeOn2);
		clearTimeout(timeOn3);	
		clearTimeout(timeOn4);
		clearTimeout(timeOn5);
		tempSubmenu2 = subItem;
		}
	
	
	function setSubs() {
	if (submenuActive == 1 ){
		document.getElementById(activeSubmenu).style.display = 'none';
	}else{
		if (timeOn != null){
		clearTimeout(timeOn);}
		if (timeOn4 != null){	
		clearTimeout(timeOn4);}
		if (timeOn5 != null){
		clearTimeout(timeOn5);}
	 	if (activeSubmenu != null){document.getElementById(activeSubmenu).style.display = 'none';}
	 }
	}
	
	
function chgActiveTab(aTab){
	activeTab = aTab;
	if (secondLevel != null){
		document.getElementById(secondLevel).style.color = '#000000';
		secondLevel = null;
		}
	document.body.className = activeTab;
	
	}

function selectLevel2(secondLayer,activeLayer){
	var temp;
	if (activeLayer != activeTab){
		document.body.className = activeLayer;
		activeTab = activeLayer;
		}
	if (secondLayer != secondLevel){
		temp = secondLevel;
		secondLevel = secondLayer;
		document.getElementById(secondLayer).style.color = '#ffffff';}
		if (temp != null){
			document.getElementById(temp).style.color = '#000000';
			}
	
	}