<!-- 
/*
------------------------------------------------------------------------------
File Name: simple_menu.js
Company: pH2 Enterprises
Author: Phillip J. Henslee II <ph2@ph2enterprises.com> ©2002
Purpose: Creates simple drop down menu
Functions: 6
Date Created: January 15, 2002
Last Modified: February 6, 2002
Dependent Files: config.js, detection.js, utility_lib.js, simple_menu_data.js
File Status: Optional

** Begin Simple Menu Functions **
These functions create simple drop-down menus. These menus work
in IE 4 or greater and Netscape 4 or greater. Use code builder to create
these menus for you and create example pages.
------------------------------------------------------------------------
*/

/* 
------------------------------------------------------------------------
Function showMenu()
Purpose: makes the current menu visiable.
Arguments: 1
Arg 0: sMenu - name of the menu to show
------------------------------------------------------------------------
*/ 

function showMenu(sMenu){
var theMenuObj;
	
if(document.getElementById)
	{ 
	theMenuObj = document.getElementById(sMenu);
	theMenuObj.style.visibility = 'visible';
	}
else if(document.all)
	{ 
	theMenuObj = document.all[sMenu];
	theMenuObj.style.visibility = 'visible';
	}
else if(document.layers)
	{ 
	theMenuObj = document.layers[sMenu];
	theMenuObj.visibility = 'show';
	}
}


/* 
------------------------------------------------------------------------
Function hideMenu()
Purpose: makes the current menu hidden.
Arguments: 1
Arg 0: sMenu - name of the menu to hide
------------------------------------------------------------------------
*/ 

function hideMenu(sMenu){
var theMenuObj;
	
if(document.getElementById)
	{
	theMenuObj = document.getElementById(sMenu);
	theMenuObj.style.visibility = 'hidden';
	}
else if(document.all)
	{ 
	theMenuObj = document.all[sMenu];
	theMenuObj.style.visibility = 'hidden';
	}
else if(document.layers)
	{
	theMenuObj = document.layers[sMenu];
	theMenuObj.visibility = 'hide';
	}
}

/* 
------------------------------------------------------------------------
Function menuOver()
Purpose: menu rollover event
Arguments: 1
Arg 0: sMenu - name of the menu 
------------------------------------------------------------------------
*/ 

function menuOver(sMenu,sColor,sfontColor){

	var theMenuObj;

	if(document.getElementById)
		{
		theMenuObj = document.getElementById(sMenu);
		theMenuObj.style.backgroundColor= sColor;
		theMenuObj.style.color= sfontColor;
		}
		
	else if(document.all)
		{ 
		theMenuObj = document.all[sMenu];
		theMenuObj.style.backgroundColor= sColor;
		theMenuObj.style.color= sfontColor;
		}
	else if(document.layers)
		{
		var args, theMenu;
		args = menuOver.arguments;
		theMenuObj = eval(args[0]);
		theMenuObj.bgColor= sColor; 
		}	
}

/* 
------------------------------------------------------------------------
Function menuOut()
Purpose: menu rollout event
Arguments: 1
Arg 0: sMenu - name of the menu
------------------------------------------------------------------------
*/

function menuOut(sMenu,sColor,sfontColor){

	var theMenuObj;

	if(document.getElementById)
		{
		theMenuObj = document.getElementById(sMenu);
		theMenuObj.style.backgroundColor=sColor;
		theMenuObj.style.color=sfontColor;
		}
	else if(document.all)
		{	
		theMenuObj = document.all[sMenu];
		theMenuObj.style.backgroundColor=sColor;
		theMenuObj.style.color=sfontColor;
		}
	else if(document.layers)
		{
		var args, theMenu;
		args = menuOut.arguments;
		theMenuObj = eval(args[0]);
		theMenuObj.bgColor=sColor; 
		}
	
}


/* 
------------------------------------------------------------------------
Function buildMenuDiv()
Purpose: creates a div for each menu
Arguments: 4
Arg 0: sMenu - name of the menu to show
------------------------------------------------------------------------
*/ 

var tdID = 0;
var separator="<img src=images/spacer.gif height=1 width=1>";
var alreadyRendered = false;

function createMenuDiv(divID,arrMenuItems,posLeft,posTop,imenuWidth,color,colorActive,fontColor,fontColorActive,borderColor,lineColor,style,useDivisions,useCaps,capHeight,capColor,isPreview){
	
	var isFirstItem = true;
	
	if (isNav6) {
	
		strMenuDiv = "<div id=\"" + divID + "\" style=\"position:absolute; width:" + ((imenuWidth -2))  + "; z-index:1; top:"+ posTop +"px; left: " + posLeft + "px; background-color:" + color +"; border:1px  solid " + borderColor +"; visibility: hidden;\" onMouseover=\"showMenu(\'"+ divID +"\');\"  onMouseout=\"hideMenu(\'" + divID + "\');\">"        
	    
	    if(useCaps){
			  	strMenuDiv += "<div id=\"topcap\" style=\"position:relative; height:" + capHeight +"px; width:" + (imenuWidth -2)  + "; z-index:3; left: 0; background-color:" + capColor + ";\">" + separator + "</div>"
	    }
	    
	    for (x = 0; x < arrMenuItems.length; x++){
	    
          if(arrMenuItems[x][0]!=null){
	        if (!isFirstItem){
	      	strMenuDiv += "<div id=\"division\" style=\"position:relative; height:1; width:" + (imenuWidth -2)  + "; z-index:3; left: 0; background-color:" + lineColor + ";\">" + separator + "</div>"
	        }
	      	strMenuDiv += "<div id=\"menuItem" + tdID + "\" style=\"position:relative; background-color:"+ color +"; padding:1px; padding-left:2px; z-index:2; \" onMouseover=\"menuOver(\'menuItem" + tdID + "\',\'" + colorActive +"\',\'"+ fontColorActive +"\');\" onMouseout=\"menuOut(\'menuItem" + tdID + "\',\'" + color + "\',\'" + fontColor +"\' );\" class=\" " + style + "\" onClick=\"loadURL('"+ arrMenuItems[x][1] + "')\">" + arrMenuItems[x][0] + "</div>";
	    	tdID = tdID +1
	    	isFirstItem = false;
	    	}
	      	}
		
		if(useCaps){
			  	strMenuDiv += "<div id=\"topcap\" style=\"position:relative; height:" + capHeight +"px; width:" + (imenuWidth -2)  + "; z-index:3; left: 0; background-color:" + capColor + ";\">" + separator + "</div>"
	    }
		
		strMenuDiv += "</div>"
		document.write(strMenuDiv);
		if(debugState){  
			alert(strMenuDiv);
        }
        
    }else{
        
		strMenuDiv = "<div id=\"" + divID + "\" style=\"position:absolute; width:" + ((imenuWidth -2))  + "; z-index:1; top:"+ posTop +"px; left: " + posLeft + "px; background-color:" + color +"; border:1px  solid " + borderColor +"; visibility: hidden;\" onMouseover=\"showMenu(\'"+ divID +"\');\""
		
		if (!isPreview){
		strMenuDiv += " onMouseout=\"hideMenu(\'" + divID + "\');\">" 
		}else{
		strMenuDiv += ">"
		}      
	    
	      if(useCaps){
			  	strMenuDiv += "<div id=\"topcap\" style=\"position:relative; height:" + capHeight +"px; width:" + (imenuWidth -2)  + "; z-index:3; left: 0; background-color:" + capColor + ";\">" + separator + "</div>"
	    }
	    
	    for (x = 0; x < arrMenuItems.length; x++){
	    
          if(arrMenuItems[x][0]!=null){
	        if (!isFirstItem){
	      	strMenuDiv += "<div id=\"division\" style=\"position:relative; height:1; width:" + (imenuWidth -2)  + "; z-index:3; left: 0; background-color:" + lineColor + ";\">" + separator + "</div>"
	        }
	      	strMenuDiv += "<div id=\"menuItem" + tdID + "\" style=\"position:relative; background-color:"+ color +"; padding:1px; padding-left:2px; width:" + (imenuWidth -2)  + "; z-index:2; left:0px;\" onMouseover=\"menuOver(\'menuItem" + tdID + "\',\'" + colorActive +"\',\'"+ fontColorActive +"\');\" onMouseout=\"menuOut(\'menuItem" + tdID + "\',\'" + color + "\',\'" + fontColor +"\' );\" class=\"" + style + "\" onClick=\"loadURL('"+ arrMenuItems[x][1] + "')\">" + arrMenuItems[x][0] + "</div>";
	    	tdID = tdID +1
	    	isFirstItem = false;
	    	}
	      	}
		
		 if(useCaps){
			  	strMenuDiv += "<div id=\"topcap\" style=\"position:relative; height:" + capHeight +"px; width:" + (imenuWidth -2)  + "; z-index:3; left: 0; background-color:" + capColor + ";\">" + separator + "</div>"
	    }
		
		strMenuDiv += "</div>"
		
		if (isPreview){
			if(alreadyRendered){
			lastMenu = document.getElementById("testmenu")
			document.body.removeChild(lastMenu);
			}
			var testmenu = document.createElement("DIV");
			testmenu.id = 'testmenu';
			testmenu.innerHTML = strMenuDiv
			document.body.appendChild(testmenu);
			alreadyRendered = true;
		}else{
			document.write(strMenuDiv);
		}
		
		
		if(debugState){  
			alert(strMenuDiv);
        }
        
    }
	
}

/* 
------------------------------------------------------------------------
Function buildMenuLayer()
Purpose: creates a layer for each menu 
Arguments: 4
Arg 0: sMenu - name of the menu to show
------------------------------------------------------------------------
*/ 

function buildMenuLayer(){
	args = buildMenuLayer.arguments;
	var nestLayerID=0
	var layerID = args[0];
	var x = args[1];
	var layerLeft = args[2];
	var layerTop = args[3];

	if(navigator.platform.indexOf("Win") < 0){layerInc=16;layerStyle="netMenuMac";}
	else{layerInc=15;layerStyle="netMenu";}	
		
	strMenuDiv = "<layer id=\""+ layerID +"\" Z-INDEX=1 BGCOLOR=\""+ "#000000" +"\"  WIDTH=160 HEIGHT=4 LEFT="+ layerLeft +" TOP="+ layerTop +" VISIBILITY=HIDE onmouseover=\"showMenu(\'"+ layerID +"\');\" onmouseout=\"hideMenu(\'"+ layerID +"\');\">"
	var nestTop=3
	
		for (y = 0; y < menuData[x].length; y++){
		    if(menuData[x][y][0]!=null){
			strMenuDiv += "<layer id=\"line2\" BGCOLOR=\""+ lineColor +"\" WIDTH=158 HEIGHT=1 Z-INDEX=4 LEFT=1 TOP="+ nestTop +">"+ separator +"</layer>"
			strMenuDiv += "<layer id=\"x"+nestLayerID+"\" class=\""+ layerStyle +"\" Z-INDEX=3 BGCOLOR=\""+ color +"\" HEIGHT=16 WIDTH=158 LEFT=1 TOP="+ nestTop +" onmouseover=\"menuOver('document.layers[\\'"+ layerID +"\\'].document.layers[\\'x"+nestLayerID+"\\']')\" onmouseout=\"menuOut('document.layers[\\'"+ layerID +"\\'].document.layers[\\'x"+nestLayerID+"\\']')\" onClick=\"loadURL('"+menuData[x][y][1]+"')\"><a id=navstyle  href=javascript:loadURL('"+menuData[x][y][1]+"')><font color=" + fontColorActive + ">&nbsp;&nsp;"+ menuData[x][y][0]
			strMenuDiv +="</font></a></layer>"		
			nestLayerID=nestLayerID+1
			nestTop=nestTop+layerInc+1
			}
		}
		strMenuDiv += "<layer id=\"line2\" BGCOLOR=\""+ lineColor +"\" WIDTH=160  HEIGHT=1 Z-INDEX=2 TOP="+ nestTop +">"+ separator +"</layer>"
		strMenuDiv +="<layer id=\"lineEnd\" BGCOLOR=\""+ "#000000" +"\" WIDTH=160 HEIGHT=4 Z-INDEX=4 TOP="+ nestTop +"></layer></layer>"

	document.write(strMenuDiv)
	if(debugState){  
			alert(strMenuDiv);
        }
}

// -->









