/* 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="";
			//alert(node.className);
			node.className = node.className.replace(" hover", "");
			node.className = node.className.replace("hover", "");
		}
	}
}

/* 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";
					this.className = this.className+" hover";
					clearTimeout(horizNavTimer);
				}
				node.onmouseout=function() {
					//this.className=this.className.replace(" over", "");
					horizNavTimer = setTimeout("clearHorizNav();",750)
				}
			}
		}
	}
}
