
function setBrowser(browVer) {
	br = browVer
}

// shows the navigation menu 

function showNavMenu(){
//alert("show nav menu");
	args = showNavMenu.arguments;
	if(br=="NS"){
		var args, theObj;
		args = showNavMenu.arguments;
		theObj = eval(args[1]);
  		if (theObj) if(theObj.visibility=='hide'){theObj.visibility = 'show';}
	}
	else if(br=="IE"){
		theObj=eval(args[0]);
		if (theObj) if(theObj.style.visibility=='hidden'){hideElement('SELECT');theObj.style.visibility = 'visible'}
		}
	else{return}
}


// hides the navigation menu 

function hideNavMenu(){
	args = hideNavMenu.arguments;
	if(br=="NS"){
		var args, theObj;
		args = hideNavMenu.arguments;
		theObj = eval(args[1]);
		if (theObj) if(theObj.visibility=='show'){theObj.visibility = 'hide';}
	}
	else if(br=="IE"){
		theObj=eval(args[0]);
		if (theObj) if(theObj.style.visibility=='visible'){showElement('SELECT');theObj.style.visibility = 'hidden'}
		}
	else{return}
}


// hides navigation menu when menu is active

function hideDiv(){
	args = hideDiv.arguments;
	if(br=="NS"){}
	else if(br=="IE"){
		theObj=eval(args[0]);
		// calculate active size of menu
		leftDiv=theObj.offsetLeft +2
		rightDiv=theObj.offsetLeft + theObj.clientWidth -2 - document.body.scrollLeft
		topDiv=theObj.offsetTop +2
		bottomDiv=theObj.offsetTop + theObj.clientHeight -2 - document.body.scrollTop
		if(window.event.clientY > bottomDiv || 
			window.event.clientY < topDiv || 
			window.event.offsetX < 0 || 
			window.event.clientX > rightDiv )
			{theObj.style.visibility = 'hidden';showElement('SELECT');}				
		}
	else{return}
}


// highlight menuitem

function divOver(){
	args = divOver.arguments;
	if(br=="NS"){}
	else if(br=="IE"){
		theObj=eval(args[0]);
		if(theObj.style.backgroundColor="0065A8"){
			theObj.style.backgroundColor="004474";
		}
	}
	else{return}
}

// highlight off menuitem

function divOut(){
	args = divOut.arguments;
	if(br=="NS"){}
	else if(br=="IE"){
	theObj=eval(args[0]);
		if(theObj.style.backgroundColor="004474"){
			theObj.style.backgroundColor="0065A8";
		}
	}
	else{return}
}


// highlight on menuitem in netscape

function menuOver(){
	var args, theMenu;
	args = menuOver.arguments;
	theMenu = eval(args[0]);
	theMenu.bgColor="#004474" 
}


// highlight off menuitem in netscape

function menuOut(){
	var args, theMenu;
	args = menuOut.arguments;
	theMenu = eval(args[0]);
	theMenu.bgColor="#0065A8" 
}

// goes to specified url

function gotoUrl(){
	args = gotoUrl.arguments;
	location.href=args[0]
}


// hides specified tag

function hideElement(HTMLtag)
{
	for (i = 20; i < document.all.tags(HTMLtag).length; i++)
	{
		obj = document.all.tags(HTMLtag)[i];
		obj.style.visibility = "hidden";
	}
}


// shows specified tag

function showElement(HTMLtag)
{
	for (i = 1; i < document.all.tags(HTMLtag).length; i++)
	{
		obj = document.all.tags(HTMLtag)[i];
		obj.style.visibility = "visible";
	}
}


// build the divs for IE

var tdID = 0
function doDiv(){
	args = doDiv.arguments;
	var divID = args[0];
	var x = args[1];
	var divLeft = args[2];
	var arrowPos = args[3];
	var divTop = args[4];
	var panelWidth = 119;
	
	objDiv = "<div id=\"" + divID + "\" style=\"position:absolute; left:"+ divLeft +"px; top:"+ divTop +"px; width:"+(panelWidth+5)+"px; z-index:300; font-weight:bold; font-size:10px; color:white; background-color:004D82; visibility:hidden; padding-left:2;\" onMouseover=\"showNavMenu('document.all[\\'"+ divID +"\\']')\"  onMouseout=\"hideDiv('document.all[\\'" + divID + "\\']')\">"
	objDiv += "<div id=\"arrow\" style=\"position:relative; background-color:004D82; width:"+panelWidth+"px;\"><img src=images/space2.gif width=2 height=2 align="+ arrowPos +"></div>"
	
	for (y = 0; y < 10; y++){
	    if(navLink[x][y][0]!=null){
		objDiv += "<div id=\"line\" style=\"position:relative; background-color:#021A2A; width:"+panelWidth+"px;\"><img src=images/bar.gif width="+(panelWidth+1)+" height=2></div>";
		objDiv += "<div id=\"x" + tdID + "\" style=\"position:relative; background-color:0065A8; width:"+panelWidth+"px;\" onMouseover=\"divOver('document.all[\\'x" + tdID + "\\']')\" onMouseout=\"divOut('document.all[\\'x" + tdID + "\\']')\"><span style=\"cursor:hand;\" class=\"nav\" onClick=\"gotoUrl('"+navLink[x][y][1]+"')\">"+ navLink[x][y][0] +"&nbsp;</span></div>"
		tdID = tdID +1
		}
	}
	
	objDiv +="<div id=\"line\" style=\"position:relative; background-color:004D82; width:"+(panelWidth+3)+"px; height:2px;\"><img src=images/bar.gif width="+(panelWidth+3)+" height=2></div></div>"
	
	document.write(objDiv);
}


// build the layers for netscape

function doNSLayer(){
	args = doNSLayer.arguments;
	var nestNSLayerID=0
	var layerID = args[0];
	var x = args[1];
	var layerLeft = args[2];
	var layerTop = args[4];
	var panelWidth = 110;

	if(navigator.platform.indexOf("Win") < 0){layerInc=15;layerStyle="navMenu";}
	else{layerInc=22;layerStyle="navMenu";}	
		
	objDiv = "<layer id=\""+ layerID +"\" Z-INDEX=100 BGCOLOR=\"004D82\" font-size=10px font-weight=bold WIDTH="+panelWidth+" LEFT="+ layerLeft +" TOP="+ layerTop +" VISIBILITY=HIDE onmouseover=\"showNavMenu('','document.layers[\\'"+ layerID +"\\']')\" onmouseout=\"hideNavMenu('','document.layers[\\'"+ layerID +"\\']')\">"
//	objDiv +="<layer id=\"line\" BGCOLOR=\"004D82\" WIDTH="+(panelWidth+17)+" HEIGHT=4 Z-INDEX=700><center><img src=images/bar.gif width="+(panelWidth+10)+" height=2></center></layer>"
	
	var nestTop=3
		for (y = 0; y < 10; y++){
		    if(navLink[x][y][0]!=null){
			
	objDiv += "<layer id=\"x"+nestNSLayerID+"\" CLIP=\"2,0,"+(panelWidth+17)+",22\" class=\""+ layerStyle +"\" Z-INDEX=700 BGCOLOR=\"0065A8\" HEIGHT=21 WIDTH="+panelWidth+" TOP="+ nestTop +" onmouseover=\"menuOver('document.layers[\\'"+ layerID +"\\'].document.layers[\\'x"+nestNSLayerID+"\\']')\" onmouseout=\"menuOut('document.layers[\\'"+ layerID +"\\'].document.layers[\\'x"+nestNSLayerID+"\\']')\"><a id=navstyle href=javascript:gotoUrl('"+navLink[x][y][1]+"')><font color=#FFFFFF>"+ navLink[x][y][0]
	objDiv +="</font></a></layer>"		

	nestNSLayerID=nestNSLayerID+1
	nestTop=nestTop+layerInc
	objDiv +="<layer id=\"line2\" BGCOLOR=\"004D82\" WIDTH="+panelWidth+" HEIGHT=2 Z-INDEX=700 TOP="+ nestTop +"><center><img src=images/bar.gif width="+(panelWidth+17)+" height=2></center></layer>"
	nestTop=nestTop+2
			}
		}
	objDiv +="<layer id=\"lineEnd\" BGCOLOR=\"004D82\" WIDTH="+panelWidth+" HEIGHT=1 Z-INDEX=700 TOP="+ nestTop +"></layer></layer>"

	document.write(objDiv)
}
