﻿//Drop-down menu script
mhover = function() {
	var navUL = getElementsByClass("menu-professional",null,null)[0];
	var sfEls = navUL.getElementsByTagName("li");
	
	for (var i=0; i<sfEls.length; i++) {
	    var itemNum = i + 1;
	    if(sfEls[i].getAttribute('className').match("item1")) {
		    sfEls[i].onmouseover=function() {
			    this.className+=" mhover-item1";
		    }
		    sfEls[i].onmouseout=function() {
			    this.className=this.className.replace(new RegExp(" mhover-item1\\b"), "");
		    }
		 }
	    else if(sfEls[i].getAttribute('className').match("item2")) {
		    sfEls[i].onmouseover=function() {
			    this.className+=" mhover-item2";
		    }
		    sfEls[i].onmouseout=function() {
			    this.className=this.className.replace(new RegExp(" mhover-item2\\b"), "");
		    }
		 }
	    else if(sfEls[i].getAttribute('className').match("item3")) {
		    sfEls[i].onmouseover=function() {
			    this.className+=" mhover-item3";
		    }
		    sfEls[i].onmouseout=function() {
			    this.className=this.className.replace(new RegExp(" mhover-item3\\b"), "");
		    }
		 }
	    else if(sfEls[i].getAttribute('className').match("item4")) {
		    sfEls[i].onmouseover=function() {
			    this.className+=" mhover-item4";
		    }
		    sfEls[i].onmouseout=function() {
			    this.className=this.className.replace(new RegExp(" mhover-item4\\b"), "");
		    }
		 }
		 else {
		    sfEls[i].onmouseover=function() {
			    this.className+=" mhover";
		    }
		    sfEls[i].onmouseout=function() {
			    this.className=this.className.replace(new RegExp(" mhover\\b"), "");
		    }
		 }
	}
}


if (window.attachEvent) window.attachEvent("onload", mhover);

mhover2 = function() {
	var navUL = $("menu");
	var sfEls = navUL.getElementsByTagName("li");
	
	for (var i=0; i<sfEls.length; i++) {
	    var itemNum = i + 1;
	    sfEls[i].onmouseover=function() {
		    this.className+=" mhover";
	    }
	    sfEls[i].onmouseout=function() {
		    this.className=this.className.replace(new RegExp(" mhover\\b"), "");
	    }
	}
}


if (window.attachEvent) window.attachEvent("onload", mhover2);