//These define the three menu tracking vars
var M;
var ON;
var SM;

// Dynamic dopdown menus using css, JS, and html unordered lists	
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

// Swap styles on the navigation elements.
function changeNav(id,css) {
	if (document.getElementById(id)) {
		document.getElementById(id).className = css;
	}
}

// Turn off the mouse out event if the main menu item is selected
function mouseOutOff(id) {
	if (document.getElementById(id + "_UL")) {
		document.getElementById(id + "_UL").setAttribute("onmouseout","changeNav('"+ id +"','mainwt');");
	}
}

