
if(document.getElementById) {// DOM1 compliant
	// Global menu element handle:
	var LiveMenu = null;
	// Global menu timeout handle:
	var Timeout_ID = null;
	
	// Global sub menu element handle:
	var SubMenu = null;
	
	// Global sub menu timeout handle:
	var Sub_Timeout_ID = null;
	
	
	// Opens or keeps open a given menu and shuts any previous menu:
	function menuOver(MenuID){
	  	// If element exists ...
	  	if(document.getElementById(MenuID)!=null){
	    	// If this menu is already open do not close it
	    	if(LiveMenu==document.getElementById(MenuID)){ clearTimeout(Timeout_ID); }
	    	else{
	      		// If another menu is open Do not wait, shut it now
	      		if(LiveMenu!=null){
	        		clearTimeout(Timeout_ID);
	        		hideNow();
	      			}
	    		}
	    	// This is the new 'live' menu, make it visible
	    	LiveMenu = document.getElementById(MenuID);
	    	// LiveMenu.style.visibility is initially empty in IE5 until
	    	// it is assigned by these functions, so must check that
	    	// it's not null before proceeding...
	    	if((LiveMenu.style)&&(LiveMenu.style.visibility!=null)){
				LiveMenu.style.visibility = 'visible';
	    		}
	  		}
		}
		
	
	// Stops menu links from opening menu onmouseover when shut to
	// workaround mouse events which are not hidden by z-index in Opera 4!
	function stayOpen(MenuID){
	  	// If menuOver has not been called or the menu is hidden, do nothing
	 	if((LiveMenu==null)||((LiveMenu.style)&&(LiveMenu.style.visibility)&&(LiveMenu.style.visibility=='hidden')))return;
	  	else menuOver(MenuID);
		}

	// Shuts a given menu in x ms, unless timeout is cleared by menuOver()
	function menuOut(MenuID){
	 	// If DOM1 supported and a menu is open ...
	  	if((document.getElementById)&&(document.getElementById(MenuID)!=null)){
	    	// Get the current live menu
	    	LiveMenu = document.getElementById(MenuID);
	    	// Prepare to shut it in x milliseconds
	    	Timeout_ID = window.setTimeout('hideNow();',1000);
	  		}
		}
		

	// Called by menu handlers to shut previous menu immediately
	function hideNow(){
  		if((LiveMenu.style)&&(LiveMenu.style.visibility)){
    		LiveMenu.style.visibility = 'hidden';
  			}
		}
		
		
		
	// Opens or keeps open a given submenu and it's parent and shuts any previous menu unless it's the parent:
	function subOver(MenuID){
	  	// If element exists ...
	  	if(document.getElementById(MenuID)!=null){
	    	// If this menu is already open do not close it
	    	if(SubMenu==document.getElementById(MenuID)){ clearTimeout(Sub_Timeout_ID); }
	    	else{
	      		// If another menu is open Do not wait, shut it now
	      		if(SubMenu!=null){
	        		clearTimeout(Sub_Timeout_ID);
	        		hideSub();
	      			}
	    		}
	    	// This is the new 'live' menu, make it visible
	    	SubMenu = document.getElementById(MenuID);
	    	// LiveMenu.style.visibility is initially empty in IE5 until
	    	// it is assigned by these functions, so must check that
	    	// it's not null before proceeding...
	    	if((SubMenu.style)&&(SubMenu.style.visibility!=null)){
				SubMenu.style.visibility = 'visible';
	    		}
	  		}
		}
		
	// Stops menu links from opening menu onmouseover when shut to
	// workaround mouse events which are not hidden by z-index in Opera 4!
	function subStayOpen(MenuID){
	  	// If menuOver has not been called or the menu is hidden, do nothing
	 	if((SubMenu==null)||((SubMenu.style)&&(SubMenu.style.visibility)&&(SubMenu.style.visibility=='hidden')))return;
	  	else subOver(MenuID);
		}

		
	// Shuts a given sub menu in x ms, unless timeout is cleared by menuOver()
	function subOut(MenuID){
	 	// If DOM1 supported and a menu is open ...
	  	if((document.getElementById)&&(document.getElementById(MenuID)!=null)){
	    	// Get the current live menu
	    	SubMenu = document.getElementById(MenuID);
	    	// Prepare to shut it in x milliseconds
	    	Sub_Timeout_ID = window.setTimeout('hideSub();',1000);
	  		}
		}
		
	// Called by menu handlers to shut previous sub menu immediately
	function hideSub(){
  		if((SubMenu.style)&&(SubMenu.style.visibility)){
    		SubMenu.style.visibility = 'hidden';
  			}
		}
	
	function hilite(tid) {
		document.getElementById(tid).style.backgroundColor='#0A8A98';
		}
	function unlite(tid) {
		document.getElementById(tid).style.backgroundColor='';
		}
		
		
	}

