// JavaScript Document

function zipsearch(zip) {
	var xmlDoc
	var campus
	campus = "";
	if (window.XMLHttpRequest)
  {
  xhttp=new XMLHttpRequest();
  }
	else // Internet Explorer 5/6
  {
  xhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
	xhttp.open("GET","campuses.xml",false);
	xhttp.send("");
	xmlDoc=xhttp.responseXML;
	x=xmlDoc.documentElement.getElementsByTagName("campus");
	for (i=0;i<x.length;i++) {
		if (x[i].attributes.item(0).nodeValue == zip) {
			campus = "/campus/" + x[i].childNodes.item(0).nodeValue;
		}
	}
	if (campus.length == 0) {
		document.location.href = "/campus/notfound.asp"
	} else {
		document.location.href = campus
	}
	return false;
}

function mainnav () {
	if (document.all&&document.getElementById) {
		var navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			var node = navRoot.childNodes[i];
				if (node.nodeName=="LI") {
					node.onmouseover=function() {
						this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

myfunctions = function() {
	mainnav();
}


window.onload=myfunctions;