/* Global variables and initialization of variables */
var horizNavTimer;

function clearHorizNav(){
	navRoot = document.getElementById("horiz_nav");
	for (i=0; i<navRoot.childNodes.length; i++) {
		node = navRoot.childNodes[i];
		if (node.nodeName=="LI" && node.className != "selected") {
			node.className="";
		}
	}
}

/* Parts that only work after page has loaded. */

window.onload = function(){
	
	/* Horizontal Navigation */
	// http://www.alistapart.com/articles/horizdropdowns
	
	if (document.getElementById && document.getElementById("horiz_nav")) {
		navRoot = document.getElementById("horiz_nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					clearHorizNav();
					this.className = "over";
					clearTimeout(horizNavTimer);
				}
				node.onmouseout=function() {
					//this.className=this.className.replace(" over", "");
					horizNavTimer = setTimeout("clearHorizNav();",500)
				}
			}
		}
	}
}