activateTopNav = function() {
	if (document.getElementById && document.getElementById("topnav")) {
		navRoot = document.getElementById("topnav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="DIV") {
				if (document.all && document.getElementById) {
					node.onmouseover=function() {
						this.className+="over";
						//if (formRef) {
						//formRef.style.display = "none";
						//}
						
					}
					node.onmouseout=function() {
						this.className=this.className.replace("over", "");
						//if (formRef) {
						//formRef.style.display = "block";
						//}
						
					}
				}
				navRoot2 = node;
				for (j=0; j<navRoot2.childNodes.length; j++) {
					node2 = navRoot2.childNodes[j];
					if (node2.nodeName == "UL") {
						navRoot3 = node2;
						var m = 0;
						for (k=0; k<navRoot3.childNodes.length; k++) {
							node3 = navRoot3.childNodes[k];
							node3.onmouseover=function() {
								if (document.all && document.getElementById) {
									this.className+="over";
								}
								tempArray = this.id.split("_");
								//document.getElementById(tempArray[0]+"_ul").style.backgroundImage = "url(images/"+eval(tempArray[0])[tempArray[1]]+")";
							}
							if (document.all && document.getElementById) {
								node3.onmouseout=function() {
									this.className=this.className.replace("over", "");
								}
							}
						}
					}
				}
			} 
		}
	}
	
// If Mac IE, run function to insert clearing divs
	if (navigator.appVersion.indexOf('Mac')!=-1 && document.all) {
		fixmacie("clearthis");
	}
}

function fixmacie(classname) {
	//alert("fixing mac ie");
	var divs=document.getElementsByTagName("DIV");
	for(var d=0; d < divs.length; d++) {
		(divs[d].className==classname)?divs[d].innerHTML += "<div style='clear: both'><span></span></div>":"";
	}
}


window.onload=activateTopNav;

