var mouseInMain = false;
var mouseInChild = false;
hoverMenuForIE = function() {
	if(document.getElementById("mainMenu"))
	{	// menu is a horizontal hover
		var menuLIs = document.getElementById("mainMenu").getElementsByTagName("li");
		for (var i=0; i<menuLIs.length; i++) {
			menuLIs[i].onmouseover=function() {
				mouseInMain = true;
				this.className+=" hover";
				var objULs = this.getElementsByTagName("ul");				
				if( objULs.length >0 && objULs[0]!= null && objULs[0] != "undefined"){
					objULs[0].style.visibility = "visible";
					objULs[0].onmouseover = function(){ this.parentNode.className += " hover"; }
					objULs[0].onmouseout = function(){this.parentNode.className=this.parentNode.className.replace(new RegExp(" hover\\b"), "");}
				}
			}
			menuLIs[i].onmouseout=function() {
				//mouseInMain = false;
				//if(!mouseInMain && !mouseInChild){
					//this.className=this.className.replace(new RegExp(" hover\\b"), "");
					var objULs = this.getElementsByTagName("ul");
					if( objULs.length >0 && objULs[0]!= null && objULs[0] != "undefined"){
						objULs[0].style.visibility = "hidden";
					}
				//}
			}
		}
	}
	if(document.getElementById("verticalMenu"))
	{	// menu is a vertical hover
		var menuLIs = document.getElementById("verticalMenu").getElementsByTagName("li");
		for (var i=0; i<menuLIs.length; i++) {
			menuLIs[i].onmouseover=function() {
				this.className+=" hover";
			}
			menuLIs[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" hover\\b"), "");
			}
		}
	}
}
schedule("window", hoverMenuForIE);


sfHover = function() 
{
    if(document.getElementById("mainMenu") != null)
    {
      var sfEls = document.getElementById("mainMenu").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);

