//*---------------------------------------------------
// shows the drop down menu 
// expected arg is active div
//--------------------------------------------------*/
function showDDNav(){
	args = showDDNav.arguments;
	if(br=="N" & Version > 3){
		var args, theObj;
		args = showDDNav.arguments;
		theObj = eval(args[1]);
  		if (theObj) if(theObj.visibility=='hide'){theObj.visibility = 'show';}
	}
	else if(br=="IE" & Version > 3){
		theObj=eval(args[0]);
		if (theObj) if(theObj.style.visibility=='hidden'){theObj.style.visibility = 'visible'}
		}
	else{return}
}

//*---------------------------------------------------
// hides the drop down menu 
// expected arg is active div 
//--------------------------------------------------*/
function hideDDNav(){
	args = hideDDNav.arguments;
	if(br=="N" & Version > 3){
		var args, theObj;
		args = hideDDNav.arguments;
		theObj = eval(args[1]);
		if (theObj) if(theObj.visibility=='show'){theObj.visibility = 'hide';}
	}
	else if(br=="IE" & Version > 3){
		theObj=eval(args[0]);
		if (theObj) if(theObj.style.visibility=='visible'){theObj.style.visibility = 'hidden'}
		}
	else{return}
}

//*---------------------------------------------------
// hides drop down menu when menu is active
// expected arg is active menu
//--------------------------------------------------*/
function hideDiv(){
	args = hideDiv.arguments;
	if(br=="N" & Version > 3){}
	else if(br=="IE" && Version > 3){
		theObj=eval(args[0]);
		// calculate active size of menu
		leftDiv=theObj.offsetLeft +2
		rightDiv=theObj.offsetLeft + theObj.clientWidth -2
		topDiv=theObj.offsetTop +2
		bottomDiv=theObj.offsetTop + theObj.clientHeight -2
		if(window.event.clientY > bottomDiv || 
			window.event.clientY < topDiv || 
			window.event.clientX < leftDiv || 
			window.event.clientX > rightDiv){
			// added line below
			if(window.event.clientX < leftDiv || 
			window.event.clientX > rightDiv)
				{theObj.style.visibility = 'hidden';}
			}
		}
	else{return}
}

//*---------------------------------------------------
// highlight menuitem
// expected arg is active menuitem
//--------------------------------------------------*/
function divOver(){
	args = divOver.arguments;
	if(br=="N" & Version > 3){}
	else if(br=="IE" & Version > 3){
		theObj=eval(args[0]);
		if(theObj.style.backgroundColor="#666666"){
			theObj.style.backgroundColor="#ff9900";
		}
	}
	else{return}
}

//*---------------------------------------------------
// highlight off menuitem
// expected arg is active menuitem
//--------------------------------------------------*/
function divOut(){
	args = divOut.arguments;
	if(br=="N" & Version > 3){}
	else if(br=="IE" & Version > 3){
	theObj=eval(args[0]);
		if(theObj.style.backgroundColor="#ff9900"){
			theObj.style.backgroundColor="#666666";
		}
	}
	else{return}
}

//*---------------------------------------------------
// highlight on menuitem in netscape
// expected arg is active menuitem
//--------------------------------------------------*/
function menuOver(){
	var args, theMenu;
	args = menuOver.arguments;
	theMenu = eval(args[0]);
	theMenu.bgColor="#ff9900" 
}

//*---------------------------------------------------
// highlight off menuitem in netscape
// expected arg is active menuitem
//--------------------------------------------------*/
function menuOut(){
	var args, theMenu;
	args = menuOut.arguments;
	theMenu = eval(args[0]);
	theMenu.bgColor="#666666" 
}

//*---------------------------------------------------
// goes to specified url
// expected arg is url 
//--------------------------------------------------*/
function gotoUrl(){
	args = gotoUrl.arguments;
	if (args[0].length > 0)
		{location.href=args[0];}
}

//*---------------------------------------------------
// build the divs for IE
// expected args are 'div name','x in menuItem aray',
// 'menu left coord','arrow alignment','top in pixels' 
//--------------------------------------------------*/
var tdID = 0
function menuLayer_IE(){
	args = menuLayer_IE.arguments;
	var divID = args[0];
	var x = args[1];
	var divTop = args[2];
	var divLeft = args[3];
	var linewidth = 130;
	//if (x == 1) {linewidth = 190;}
	
	objDiv = "<div id=\"" + divID + "\" style=\"position:absolute; left:"+ divLeft +"px; top:"+ divTop +"px; "
	objDiv +="width:" + (linewidth + 16) + "px; z-index:3; background-color:#666666; visibility:hidden; padding-left:7; "
	objDiv +="border: 1px solid; border-color: #666666 solid;\" "
	objDiv +="onMouseover=\"showDDNav('document.all[\\'"+ divID +"\\']')\" "
	objDiv +="onMouseout=\"hideDiv('document.all[\\'" + divID + "\\']')\">"
	objDiv +="<div id=\"line\" style=\"position:relative; background-color:#666666; width:" + (linewidth + 2) + "px; height:1px;\">"
	objDiv +="<img src=none.gif width=" + (linewidth + 1) + " height=2></div>"
	
	for (y = 0; y < 15; y++){
	    if(menuItem[x][y][0]!=null){
		if(y > 0){
			objDiv += "<div id=\"line\" style=\"position:relative; background-color:#666666; width:" + (linewidth + 1) + "px;\">"
			objDiv +="<img src=bar.gif width=" + (linewidth + 0) + " height=2></div>";
		}
			objDiv += "<div id=\"x" + tdID + "\" style=\"position:relative; background-color:#666666; width:" + (linewidth + 0) + "px;\" "
			objDiv +="onMouseover=\"divOver('document.all[\\'x" + tdID + "\\']')\" "
			objDiv +="onMouseout=\"divOut('document.all[\\'x" + tdID + "\\']')\">"
			objDiv +="<span class=\"nav\" onClick=\"gotoUrl('"+menuItem[x][y][1]+"')\">"+ menuItem[x][y][0]
			objDiv +="&nbsp;</span></div>"
			tdID = tdID +1
		}
	}
	objDiv +="<div id=\"line\" style=\"position:relative; background-color:#666666; width:131px; height:2px;\">"
	objDiv +="<img src=none.gif width=" + (linewidth + 0) + " height=2></div></div>"
	
	document.write(objDiv);
}

//*---------------------------------------------------
// build the layers for netscape
// expected args are 'div name','x in menuItem aray',
// 'menu left coord','arrow alignment','top in pixels' 
//--------------------------------------------------*/
function menuLayer_N(){
	args = menuLayer_N.arguments;
	var nestLayerID=0
	var layerID = args[0];
	var x = args[1];
	var layerTop = args[2];
	var layerLeft = args[3];

	if(navigator.platform.indexOf("Win") < 0){layerInc=19;layerStyle="netMenuMac";}
	else{layerInc=19;layerStyle="netMenu";}	
		
	objDiv = "<layer id=\""+ layerID +"\" Z-INDEX=1 BGCOLOR=\"#666666\" WIDTH=138 LEFT="+ layerLeft +" "
	objDiv +="TOP="+ layerTop +" VISIBILITY=HIDE onmouseover=\"showDDNav('','document.layers[\\'"+ layerID +"\\']')\" "
	objDiv +="onmouseout=\"hideDDNav('','document.layers[\\'"+ layerID +"\\']')\">"
	objDiv +="<layer id=\"arrow\" BGCOLOR=\"#666666\" WIDTH=138 HEIGHT=1 Z-INDEX=5 TOP=0></layer>"
	objDiv +="<layer id=\"line\" BGCOLOR=\"#666666\" WIDTH=138 HEIGHT=1 Z-INDEX=7 TOP=0><center>"
	objDiv +="<img src=none.gif width=126 height=1></center></layer>"
	
	var nestTop=3
		for (y = 0; y < 15; y++){
		    if(menuItem[x][y][0]!=null){
			
	objDiv += "<layer id=\"x"+nestLayerID+"\" CLIP=\"6,0,132,18\" class=\""+ layerStyle +"\" Z-INDEX=7 "
	objDiv +="BGCOLOR=\"#666666\" HEIGHT=10 WIDTH=138 TOP="+ nestTop +" "
	objDiv +="onmouseover=\"menuOver('document.layers[\\'"+ layerID +"\\'].document.layers[\\'x"+nestLayerID+"\\']')\" "
	objDiv +="onmouseout=\"menuOut('document.layers[\\'"+ layerID +"\\'].document.layers[\\'x"+nestLayerID+"\\']')\">"
	objDiv +="<a href=http://www.iliospartners.com><font color=#ffffff>"+ menuItem[x][y][0]
	objDiv +="</font></a></layer>"		

	nestLayerID=nestLayerID+1
	nestTop=nestTop+layerInc

if(menuItem[x][(y + 1)][0]!=null){
	objDiv +="<layer id=\"line2\" BGCOLOR=\"#666666\" WIDTH=138 HEIGHT=1 Z-INDEX=7 TOP="+ nestTop +">"
	objDiv +="<center><img src=bar.gif width=126 height=2></center></layer>"
	nestTop=nestTop+2
}
			}
		}
	objDiv +="<layer id=\"lineEnd\" BGCOLOR=\"#666666\" WIDTH=138 HEIGHT=1 Z-INDEX=7 TOP="+ nestTop +"></layer></layer>"

	document.write(objDiv)
}