// JavaScript for Vertical Popup Nav 
// javascript for IE/win, since it does not support li:hover


//and autoOnState
//Using the addLoadEvent found http://simon.incutio.com/archive/2004/05/26/addLoadEvent
function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            oldonload();
            func();
        }
    }
}
addLoadEvent(function() {
	l=window.location.toString(); s=l.split("/");
	// ********* CHANGE ME  ****************************************************************
	f=s[4]; // Change this number to the number of slashes in the URL before the home page
	
	if (f == "index.html" || f == "") {
		return;
	}
	else if (f == "apply.html") {
		var nli = document.getElementById("n-apply");
		nli.className+="location";
	}
	else {
		cn = "n-" + f;
		var nli = document.getElementById(cn);
		nli.className+="location";
	}
})

// JavaScript for Vertical Popup Nav
// javascript for IE/win, since it does not support li:hover

addLoadEvent(function() {
if (document.all) { 
	var li = document.getElementById("subNav").getElementsByTagName("li");
	for (var i=0; i<li.length; i++) {
		li[i].onmouseover=function() {
			if(this.className != "nosub") {
				this.className+="iewin";
			}
		}
		li[i].onmouseout=function() {
			if (this.className == "locationiewin") {
				this.className=this.className.replace(new RegExp("locationiewin\\b"), "location");
			}		
			else {
				this.className=this.className.replace(new RegExp("iewin\\b"), "");
			}
		}
	}
	}
	else {
		return;
		}
})