sfHover = function() {
	var menu = document.getElementById("mainMenu").getElementsByTagName("UL")
	var sfEls = menu[0].getElementsByTagName("LI");
	//alert(menu.length);
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			submenu = this.getElementsByTagName("UL")[0];
			if (submenu) {
				submenu.style.left = this.offsetLeft + "px";
			}
			if (this.className.indexOf("active")!=-1) {
				this.className = this.className.replace(new RegExp("active"), "activesfhover");
			}
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			if (submenu) {
				submenu.style.left = "-999em";
			}
			if (this.className.indexOf("activesfhover")!=-1) {
				this.className=this.className.replace(new RegExp("activesfhover"), "active");
			}
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

if (window.attachEvent) window.attachEvent("onload", sfHover);

