//Pop-it menu- By Dynamic Drive For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//extremly modified by red5design.com
//vars used
var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1;
var opera=navigator.userAgent.indexOf("Opera")!=-1;
if(opera){
	ie4=opera;
}
var ns6=document.getElementById&&!document.all;
var ns4=document.layers;
var macSafari=navigator.userAgent.indexOf("Safari")!=-1;
var mac = navigator.appVersion.indexOf("Mac")!=-1;
var menuArray = new Array("menu1","menu2","menu3","menu4","menu5","menu6","menu7");
var menuLeftMacIEArray = new Array(115,341,420,253,481,524,171);
var menuLeftMacSafariArray = new Array(115,341,420,253,481,524,171);
var menuTop = 131;
var flashPage=0;
//functions
function showmenu(num){
	if (!document.all&&!document.getElementById&&!document.layers)
		return
	if (flashPage && mac)
		return
	clearhidemenu();
	if(ie4){
		temp=eval("document.all." + menuArray[num]);
		temp.style.visibility="visible";
	}else if(ns6){
		document.getElementById(menuArray[num]).style.visibility="visible";
	}else{
		temp=eval('document.' + menuArray[num]);
		temp.visibility="visible";
	}
	//menuobj.thestyle.visibility="visible"
	return false
}

function hidemenu(num){
	if (flashPage && mac)
		return
	//alert('you called hidemenu?' + num);
	if(ie4){
		temp=eval("document.all." + menuArray[num]);
		temp.style.visibility="hidden";
	}else if(ns6){
		document.getElementById(menuArray[num]).style.visibility="hidden";
	}else{
		temp=eval('document.' + menuArray[num]);
		temp.visibility="hide";
	}
}

function delayhidemenu(num){
	if (flashPage && mac)
		return
	var funCall = "hidemenu(" + num + ")";
	//alert(funCall);
	if (ie4||ns6||ns4)
		delayhide=setTimeout(funCall,200)
}

function clearhidemenu(){
	if (flashPage && mac)
		return
	if (window.delayhide)
		clearTimeout(delayhide)
	//loop through menus and hide them all
	for(i=0;i<7;i++){
		if(ie4){
			temp=eval("document.all." + menuArray[i]);
			temp.style.visibility="hidden";
		}else if(ns6){
			document.getElementById(menuArray[i]).style.visibility="hidden";
		}else{
			temp=eval('document.' + menuArray[i]);
			temp.visibility="hide";
		}
	}
}

function menuInit(){
	if(mac){
		//special alignment for macs!
		for(i=0;i<7;i++){
			if(ie4){
				temp=eval("document.all." + menuArray[i]);
				temp.style.left=menuLeftMacIEArray[i];
				temp.style.top=menuTop;
			}else if (macSafari){
				document.getElementById(menuArray[i]).style.left=menuLeftMacSafariArray[i];
			}else if (ns6){
				document.getElementById(menuArray[i]).style.top=132;
				document.getElementById(menuArray[i]).style.left=menuLeftMacIEArray[i];
			}
		}
	}
}
/*
if (ie4||ns6)
	document.onclick=hidemenu;
*/	