activateTopNav = function() {	

	if (document.getElementById && document.getElementById("topnava")) {
		navRoot = document.getElementById("topnava");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="DIV") {
					node.onmouseover=function() {
						this.className+="over";
					}
					node.onmouseout=function() {
						this.className=this.className.replace("over", "");
					}
				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() {
									this.className+="over";
								tempArray = this.id.split("_");
							}
								node3.onmouseout=function() {
									this.className=this.className.replace("over", "");
								}
							}
						}
					}
				}
			}
		}
	if (document.getElementById && document.getElementById("topnavb")) {
		navRoot = document.getElementById("topnavb");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="DIV") {
					node.onmouseover=function() {
						this.className+="over";
					}
					node.onmouseout=function() {
						this.className=this.className.replace("over", "");
					}
				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() {
									this.className+="over";
								tempArray = this.id.split("_");
							}
								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) {
		//alert("fixing!");
		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;