﻿//Drop-down menu script
mhover = function() {
	var navUL = $('primary-menu');
	
	if(navUL){		
		var sfEls = navUL.getElementsByTagName("li");
		
		for (var i=0; i<sfEls.length; i++) {
			if(sfEls[i].getAttribute('className').match("first")) {
				sfEls[i].onmouseover=function() {
					this.className+=" mhover-first";
				}
				sfEls[i].onmouseout=function() {
					this.className=this.className.replace(new RegExp(" mhover-first\\b"), "");
				}
			 }
			else if(sfEls[i].getAttribute('className').match("last")) {
				sfEls[i].onmouseover=function() {
					this.className+=" mhover-last";
				}
				sfEls[i].onmouseout=function() {
					this.className=this.className.replace(new RegExp(" mhover-last\\b"), "");
				}
			 }
			 else {
				sfEls[i].onmouseover=function() {
					this.className+=" mhover";
				}
				sfEls[i].onmouseout=function() {
					this.className=this.className.replace(new RegExp(" mhover\\b"), "");
				}
			 }
		}
	}
}

mhoverLocation = function() {
	var navUL = $('location-menu');
	var sfEls = navUL.getElementsByTagName("li");
	
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" mhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" mhover\\b"), "");
		}
	}
}

if(versionInfo.match(IE6)!= null){
		
	if (window.attachEvent) {
		window.attachEvent("onload", mhover);
		window.attachEvent("onload", mhoverLocation);
	}
}