_cfscriptLocation = "/ajax/ehmc/functions.cfm";

function showHover(id) {
	var sfEls = document.getElementById(id).getElementsByTagName("a");
	if(sfEls[0].className != 'here') {	sfEls[0].className = "sfhover";	}
}
function clearHover(id) {
	var sfEls = document.getElementById(id).getElementsByTagName("a");
	if(sfEls[0].className != 'here') {	sfEls[0].className = "";	}
}

setMainNavHovers = function() {
		
	var obj = document.getElementById("nav_aboutus").getElementsByTagName("UL");
	obj.onmouseover = function() { showHover('nav_aboutus'); }
	obj.onmouseout = function() { clearHover('nav_aboutus'); }
		
	var obj = document.getElementById("nav_locations").getElementsByTagName("UL");
	obj.onmouseover = function() { showHover('nav_locations'); }
	obj.onmouseout = function() { clearHover('nav_locations'); }
		
	var obj = document.getElementById("nav_findadoctor").getElementsByTagName("UL");
	obj.onmouseover = function() { showHover('nav_findadoctor'); }
	obj.onmouseout = function() { clearHover('nav_findadoctor'); }
		
	var obj = document.getElementById("nav_classes").getElementsByTagName("UL");
	obj.onmouseover = function() { showHover('nav_classes'); }
	obj.onmouseout = function() { clearHover('nav_classes'); }
		
	var obj = document.getElementById("nav_services").getElementsByTagName("UL");
	obj.onmouseover = function() { showHover('nav_services'); }
	obj.onmouseout = function() { clearHover('nav_services'); }
		
	var obj = document.getElementById("nav_healthtopics").getElementsByTagName("UL");
	obj.onmouseover = function() { showHover('nav_healthtopics'); }
	obj.onmouseout = function() { clearHover('nav_healthtopics'); }
		
	var obj = document.getElementById("nav_patientandvisitor").getElementsByTagName("UL");
	obj.onmouseover = function() { showHover('nav_patientandvisitor'); }
	obj.onmouseout = function() { clearHover('nav_patientandvisitor'); }
		
	var obj = document.getElementById("nav_careers").getElementsByTagName("UL");
	obj.onmouseover = function() { showHover('nav_careers'); }
	obj.onmouseout = function() { clearHover('nav_careers'); }
}

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);
