var oldClass=false;

function initEngelNav(){
	var wrapperEl=document.getElementById("topContent");
	var navUl=wrapperEl.getElementsByTagName("UL")[0];
	if (navUl){
		var childList=navUl.getElementsByTagName("UL");
		if (childList.length>0){
			var l=childList.length;
			for (var i=0; i<l; i++){
				if(childList[i].parentNode.parentNode.parentNode.parentNode.tagName!="UL"){
					childList[i].parentNode.onmouseover=function(){showSubNav(this);}
					childList[i].parentNode.onmouseout=function(){hideSubNav(this);}
					if (childList[i].parentNode.className=="open"||childList[i].parentNode.className=="active"){
						var newEl=childList[i].cloneNode(true);
						newEl.id="replNav";
						navUl.parentNode.appendChild(newEl);
						childList[i].style.display="none";
					}
				}
			}
		}
	}
}

function showSubNav(parentEl){
	oldClass=parentEl.className;
	parentEl.className="hover";
}

function hideSubNav(parentEl){
	parentEl.className=oldClass;
}
