//only necessary if using opacity - alleviate IE5 bug
var IEnot5 = false;
version = navigator.appVersion;
versionbit = version.split(';');
versionbit2 = versionbit[1].split(" ");
//end

var totalMenus = 3;
var menu = "menu";

if (!document.layers && (versionbit2[2] > 5.40)) IEnot5 = true;
var activeSub=0;
var SubNum=0;

function reDo(){ 
	window.location.reload() 
}
window.onresize = reDo;

//Define global variables
var timerID = null;
var timerOn = false;
var timecount = 400;
var what = null;
var newbrowser = true;
var check = false;


if(document.all){
//  alert ("Running IE");
	layerRef="document.all";
	styleSwitch=".style";
    visibleVar="visible";
	screenSize = document.body.clientWidth + 18;
	what ="ie";
}else if(document.getElementById){
//  alert ("Running Netscape 6");
	layerRef="document.getElementByID";
    styleSwitch=".style";
    visibleVar="visible";
	what="moz";
}else{
//alert("Older than 4.0 browser.");
	what="none";
	newbrowser = false;
}
		  
/* place status bar text within '' */
window.status='';
check = true;

// Turns the layers on and off
function showMenu(layerName){
	if(check){
    	if (what =="none"){
        	return;
		}
		else if (what == "moz"){
    		document.getElementById(layerName).style.visibility="visible";
		}
    	else{
    		eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
		}
	}
    else {// alert ("Please wait for the page to finish loading.");
    	return;
	}
}

function hideMenu(layerName){
	if(check){
		if (what =="none"){
        	return;
		}
		if (what == "moz"){
        	document.getElementById([layerName]).style.visibility = "hidden";
			return;
        }
        else{
        	eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
			return;
		}
	}
    else {// alert ("Please wait for the page to finish loading.");
    	return;}
}

function hideAllMenu(){
	for (i=1; i <= totalMenus; i++)
		hideMenu(menu+i);
	iC('company','');
	iC('services','');
	iC('clients','');
}

function startTime() {
	if (timerOn == false) {
    	timerID=setTimeout( "hideAllMenu()" , timecount);
        timerOn = true;
	}
}

function stopTime() {
	if (timerOn) {
    	clearTimeout(timerID);
        timerID = null;
        timerOn = false;
	}
}

if (window.innerWidth == null) var w = document.body.clientWidth;
else var w = window.innerWidth;
var width = ((w-735)/2)

var m1 = width + 140;
var m2 = width + 255;
var m3 = width + 365;

var styles = "<style type=\"text/css\" media=\"all\">\n";
for (i = 1; i <= 3; i++){
	layer = eval("m"+i);
	styles += "#menu" + i + " {left:"+ layer + "px;}\n";
}
styles += "</style>\n";

document.write(styles);
