/******* VARIABLES *********/

var gstrActiveLayer = ""
var is;

/******* Browser detection *********/
function Is (){
    var agt=navigator.userAgent.toLowerCase();
    this.major		= parseInt(navigator.appVersion);
    this.minor		= parseFloat(navigator.appVersion);
    this.nav		= ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    this.nav4		= (this.nav && (this.major == 4));
    this.nav6up		= (this.nav && (this.major >= 5));
    this.ie			= ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    this.ie4		= (this.ie && (this.major == 4) && (agt.indexOf("msie 5")==-1) );
    this.ie4up		= (this.ie && (this.major >= 4));
    this.mac		= (agt.indexOf("mac")!=-1);
}
is = new Is(); 
/******* End Browser detection ******/		


/******* MENU FUNCTIONS *********/	
function ShowMenu(MenuID,iLeft,iTop){
		HideMenu();
		ShowLayer(MenuID,iLeft,iTop);
}
function ShowLayer(MenuID,iLeft,iTop){
	if (is.nav4){
		document.layers[MenuID].left = iLeft;
		document.layers[MenuID].top = iTop;
		document.layers[MenuID].visibility = "show";
	}else if(is.ie4up){
		document.all[MenuID].style.pixelLeft = iLeft;
		document.all[MenuID].style.pixelTop = iTop;
		document.all[MenuID].style.visibility = "visible";
	}else if(is.nav6up){
		document.getElementById(MenuID).style.left = iLeft;
		document.getElementById(MenuID).style.top = iTop;
		document.getElementById(MenuID).style.visibility = "visible";
	}
	gstrActiveLayer = MenuID;
}

function HideLayer(LayerName){
	if (is.nav4){
		document.layers[LayerName].visibility = "hide";
	}else if(is.ie4up){
		document.all[LayerName].style.visibility = "hidden";
	}else if(is.nav6up){
		document.getElementById(LayerName).style.visibility = "hidden";
	}
	gstrActiveLayer = "";
}
function HideMenu(){
	if (gstrActiveLayer != "" || null){
		HideLayer(gstrActiveLayer);
	}	
}

function Popup(strURL, intWidth, intHeight)	
{
	var intLeft = (screen.width - intWidth) / 2;
	var intTop = (screen.height - intHeight - 35) / 2;
	NewChild = window.open(strURL,'_blank','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=' + intWidth + ',height=' + intHeight + ',top=' + intTop + ',left=' + intLeft)
}


//Hide's the Menus when you click anywhere
document.onmouseup = HideMenu;
/******* /END MENU FUNCTIONS *********/	