// JavaScript Document

function initMenu() {
	var sublistArray ; 
	
	var menuObj = document.getElementById("menu") ;
	var listArray = menuObj.getElementsByTagName("li") ; 
	
	for (i = 0 ; i < listArray.length ; i = i + 1 ) {


//	Check every LI to see if it contains a UL.  If it does, then gove that LI a class of SUB show 

// give every LI a class of sub_hide 

		if (listArray[i].getElementsByTagName("ul").length > 0) { ;
			listArray[i].className = "sub_hide" ; 
		}
		

		listArray[i].onmouseover = function() {
			if ( this.className == "sub_hide" ) {
				this.setAttribute("oldClass",this.className) ;
				this.className = "sub_show";
			}
		}
		
		listArray[i].onmouseout = function() {
			this.className = this.getAttribute("oldClass")  ; // restore the old class 
		}
		
	}
}


window.onload = initMenu ; 
