function class_assign_mouseover() {
	if (this.nodeName!="LI") return;
		if (this.className=="arrow_down") {
			this.className="arrow_down_rollover";
		} else if (this.className=="arrow_clicked") {
			this.className="arrow_clicked_rollover";
		} else {
			this.className="rollover";
		}
		var nodes = this.childNodes;
		for (var i = 0; i< nodes.length; i++) {
			if (nodes[i].nodeName=="A") nodes[i].className="rollover";
		}
}
function class_assign_mouseout() {
	if (this.nodeName!="LI") return;
		if (this.className=="arrow_down_rollover") {
			this.className="arrow_down";
		} else if (this.className=="arrow_clicked_rollover") {
			this.className="arrow_clicked";
		} else {
			this.className="";
		}
		var nodes = this.childNodes;
		for (var i = 0; i< nodes.length; i++) {
			if (nodes[i].nodeName=="A") nodes[i].className="";
		}
}
function class_assign(e) {
	if (this.nodeName!="A" && this.nodeName!="input") {
		
		//NEW CODE TO FIX MIGHTY-MENU - SHOW NEW CLASS ON OPEN
		if (this.className == "arrow_down") {
			this.className = "arrow_clicked";
		} else if (this.className == "arrow_down_rollover") {
			this.className = "arrow_clicked_rollover";
		} else if (this.className == "arrow_clicked_rollover") {
			this.className = "arrow_down_rollover";
		} else if (this.className == "arrow_clicked") {
			this.className = "arrow_down";
		} 		
		var nodes = this.childNodes;
		if (nodes.length <3) return;
		manageMenuArray(this.id);
		for (var i = 0; i< nodes.length; i++) {
			if (nodes[i].nodeName=="UL") {
			
				if (nodes[i].className!="show_class") { 
					nodes[i].className="show_class";
				} else  {
					nodes[i].className = '';
				}
			} else continue;
		}
	} else {
		document.location.href=this.href;
	}
	if (document.all&&document.getElementById) {
		window.event.cancelBubble = true;
	} else {
		e.stopPropagation(); 
	}
}
displayNodes =  function() {
	if (document.getElementById('MightyMenu')) {
		navRoot = document.getElementById('MightyMenu').getElementsByTagName("LI");
		navRootHref = document.getElementById('MightyMenu').getElementsByTagName("A");
		for(i=0; i<navRoot.length; i++) { 
			navRoot[i].onmouseover = class_assign_mouseover;
			navRoot[i].onmouseout = class_assign_mouseout;
			navRoot[i].onclick = class_assign;
		}
		for(i=0; i<navRootHref.length; i++) navRootHref[i].onclick = class_assign;
	}
	if (document.getElementById('MightyMenu2')) {
		navRoot = document.getElementById('MightyMenu2').getElementsByTagName("LI");
		navRootHref = document.getElementById('MightyMenu2').getElementsByTagName("A");
		for(i=0; i<navRoot.length; i++) { 
			navRoot[i].onmouseover = class_assign_mouseover;
			navRoot[i].onmouseout = class_assign_mouseout;
			navRoot[i].onclick = class_assign;
		}
		for(i=0; i<navRootHref.length; i++) navRootHref[i].onclick = class_assign;
	}
	if (document.getElementById('MightyMenu3')) {
		navRoot = document.getElementById('MightyMenu3').getElementsByTagName("LI");
		navRootHref = document.getElementById('MightyMenu3').getElementsByTagName("A");
		for(i=0; i<navRoot.length; i++) { 
			navRoot[i].onmouseover = class_assign_mouseover;
			navRoot[i].onmouseout = class_assign_mouseout;
			navRoot[i].onclick = class_assign;
		}
		for(i=0; i<navRootHref.length; i++) navRootHref[i].onclick = class_assign;
	}
	if (document.getElementById('MightyMenu4')) {	
		navRoot = document.getElementById('MightyMenu4').getElementsByTagName("LI");
		navRootHref = document.getElementById('MightyMenu4').getElementsByTagName("A");
		for(i=0; i<navRoot.length; i++) { 
			navRoot[i].onmouseover = class_assign_mouseover;
			navRoot[i].onmouseout = class_assign_mouseout;
			navRoot[i].onclick = class_assign;
		}
		for(i=0; i<navRootHref.length; i++) navRootHref[i].onclick = class_assign;
	}
}
function addOnloadEvent(fnc){
 if ( typeof window.addEventListener != "undefined" )
   window.addEventListener( "load", fnc, false );
 else if ( typeof window.attachEvent != "undefined" ) {
   window.attachEvent( "onload", fnc );
 }
 else {
   if ( window.onload != null ) {
     var oldOnload = window.onload;
     window.onload = function ( e ) {
       oldOnload( e );
       window[fnc]();
     };
   }
   else
     window.onload = fnc;
 }
}



openMenuArray = Array();
addOnloadEvent(displayNodes);
//window.onload=displayNodes;