// ---------------------------------------------------------
//	GLOBAL VARIABLES
//----------------------------------------------------------
function GetBr() {
	var agt = navigator.userAgent.toLowerCase();
	var browser = navigator.appName.toLowerCase();
	var isNav = (browser=="netscape");
	if (agt.indexOf("msie") !=-1) { br = 'ie' }
	var isMac = (agt.indexOf("mac") != -1);
	if (isMac)	{
		platform='mac'
	} else {
		platform='pc'
	}
	if (isNav && agt.indexOf("netscape6") != -1) { 
		ver=agt.substr(agt.indexOf("netscape6")).split("/")[1];
		br='nn6';
		
	} else if (isNav) { 
		ver=(isNav)?parseFloat(navigator.appVersion):agt.split(";")[1].substr(6) ;
		 br='nn4'		 
	}
	return br;
        return platform; 
	}
// ---------------------------------------------------------
//	FUNCTIONS
//----------------------------------------------------------
function Submitter(formName)
{
  document.forms[formName].submit();
}

function checkMenu(menuName) {
	//document[menuName].src = eval([menuName] + "_off.src");
		
		if ( menuOpen == null) {
		} else if (menuOpen == menuName){
		} else {
		SetCurrentMenu(menuName)
		
		}
	}

function closer() 

{ 
 
	for (var n = 0; n < menuArray.length; n++) 
	{
		menuName=menuArray[n].name;	
        	SwitchVis(menuName,'hidden'); 
 	}
}
	
function SetCurrentMenu(menuName) {
	//document[menuName].src = eval([menuName] + "_on.src");
	
	if (currentMenu == menuName) {
		SwitchVis(menuName,'hidden') 

	
	} else if (currentMenu == null){
			
		SwitchVis(menuName,'visible');
		currentMenu = menuName
		menuOpen = menuName

	} else {
		SwitchVis(currentMenu,'hidden');
		SwitchVis(menuName,'visible');
		currentMenu = menuName
		menuOpen = menuName
	}
}


function SwitchVis(theParent,visState) {
	GetBr();

	GetTheObj(theParent);
	eval("theObj." + style + "visibility ='" + visState + "'")

	if (visState == 'hidden') {
		currentMenu = null
		menuOpen = null
	}
}


function SwitchImg(imageName,state) {
	 if (document.images) {
			imgSource = document[imageName].src;
			if (state == "on") {
				onState = imgSource.replace(/_off/i,"_on");
  				//onState = imageName + "_on.gif";
				document[imageName].src = onState;
			} else //while (currentMenu != null)
				{
				offState = imgSource.replace(/_on/i,"_off");
				//offState = imageName + "_off.gif"
				document[imageName].src = offState;
			}
		}
	}


function GetTheObj(theItm,theWrp) {
	GetBr()
	if (br == 'ie') {
		theObj = eval("document.all." + theItm)
		style = "style."
	} else if (br == 'nn4') {
		if(theWrp) {
			theObj = eval("document.layers." + theWrp + ".layers. " + theItm )
			style = ""
		} else {
			theObj = eval("document.layers." + theItm)
			style = ""		
		}
	} else if (br == 'nn6'){ 
		theObj = eval("document.getElementById(theItm)")
		style = "style."
	}

	return theObj
	return style
}

function SwitchBg(theColor,theItm,theWrp) {
theObj = GetTheObj(theItm,theWrp)
if (br == 'nn4') { 
	
		theObj.Color = theColor
		
	} else {
	theObj.style.Color = theColor
	}
}

function WriteValues() {
	GetBr();
	args = "/js/menu_" + br + platform + "Values.js";
	document.write('<script src="' + args + '"></script>');
	
}



function Write(args) {
	document.write(args)
}


function wndOpen(URL,hT,scl)

{
	 s2=new String(hT);
 	x=s2.charAt(0);
 
 	if(x=='u')
  		hT=400;

	if(hT=='yes')
 	{	 hT=400;
  		scl='yes';
 	}

	if(scl=="")
 		scl="no";
 
	y="toolbar=0,width=380,height=" + hT+ ",scrollbars=" + scl;
 	wndHandle=window.open(URL,'pop_up',y);
}

function wndOpenWithScroll(URL)
{
 wndHandle=window.open(URL,'pop_up','toolbar=0,width=350,height=500,scrollbars=yes');
}


function wndOpenmap(URL)
{
 wndHandle=window.open(URL,'pop_up','toolbar=0,width=350,height=400');
}

function netscaperesizeFix() {

	if (pageWidth != window.innerWidth || pageHeight != window.innerHeight)
	document.location.reload();
}

function clearText(thefield){
	if (thefield.defaultValue==thefield.value)
	thefield.value = "";
} 

//----------------------------------------------------------------------------------------------



