window.onload = function() {
	initNav();
}


var timers=new Array();
var menuFall=50;
function initNav() {
	var menuElements=getEl('mnu').getElementsByTagName("ul");
	for(var i=0;i<menuElements.length;i++) {
		if(browser.isIE) {
			menuElements[i].onmouseover=function() {
				if(timers[this.parentNode.id]) clearTimeout(timers[this.parentNode.id]);
					if(this.parentNode.parentNode.parentNode.id=="mnu") {
						this.parentNode.parentNode.firstChild.style.color="#fff";
						this.parentNode.parentNode.firstChild.lastChild.style.backgroundPosition="0px -32px";
					} else {
						this.parentNode.parentNode.firstChild.style.color="#1078b9";
						this.parentNode.parentNode.firstChild.style.backgroundColor="#98c8e8";
						this.parentNode.parentNode.firstChild.style.fontWeight="bold";
					}
			}
			
			menuElements[i].parentNode.parentNode.onmouseover=function() {
				if(timers[this.lastChild.id]) clearTimeout(timers[this.lastChild.id]);							
				setVVObj(this.lastChild);
			}

			menuElements[i].parentNode.parentNode.onmouseout=function() {
				timers[this.lastChild.id]=setTimeout('setVH("'+this.lastChild.id+'");var liEl=getEl("'+this.id+'");liEl.firstChild.style.color="#fff";liEl.firstChild.style.fontWeight="normal";liEl.firstChild.style.backgroundColor="#1078b9";if(liEl.parentNode.id=="mnu")liEl.firstChild.lastChild.style.backgroundPosition="0px 0px";',menuFall);
			}

		}
	}
}

function toggleTree(liNode){
  var cls = liNode.className;
  if ( cls ){
       liNode.className = ( cls == 'expanded' ? 'collapsed' : 'expanded' );
  }
}

