
/** 
* initNav() adds handlers enabling the expandable menu.
* function should be called after each of required elements has
* been rendered, or onload.
*/
function initNav(){
	if (document.getElementById && document.getElementById("expandableMenu")) {
		navRoot = document.getElementById("expandableMenu");
		
		// add handlers for show/hide-ing subnav 
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.className != "static"){
				node.onmouseover = function() { this.className = 'expanded';  }
				node.onmouseout = function()  { this.className = 'collapsed'; }
			}
		}
		
		// add handlers for subnav rollovers
		subitems = navRoot.getElementsByTagName("li");
		for (j=0; j<subitems.length; j++) {
			if (subitems.item(j).className == "menuItem") {
				dropElem = subitems.item(j);
				dropElem.onmouseover = function() { this.className = 'menuItemOver'; }
				dropElem.onmouseout = function()  { this.className = 'menuItem'; }
			}
		}
	}
}	