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";
					}
					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() {
								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 (document.all && document.getElementById && document.getElementById("leftsubnav")) {
		leftNavRoot = document.getElementById("leftsubnav");
		liArray = leftNavRoot.getElementsByTagName('li');
		for (n=0; n<liArray.length; n++) {
			liArray[n].onmouseover=function() {
				this.className+="over";
			}
			liArray[n].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;