﻿ieHover_Old = function()
{
    var ieLIs = document.getElementById("spcMainMenu").getElementsByTagName("LI");
    for (var iMenu = 0; iMenu < ieLIs.length; iMenu++)
    {
        ieLIs[iMenu].onmouseover = function()
		{
			this.className = "ieHover";
        }
        ieLIs[iMenu].onmouseout = function()
        {
            this.className = this.className.replace(new RegExp("ieHoverLeft\\b"), "");
            this.className = this.className.replace(new RegExp("ieHover\\b"), "");
        }
    }

    var ieULObject = document.getElementById("spcSubMenu");
    if (ieULObject != null)
    {
        var ieLISubs = document.getElementById("spcSubMenu").getElementsByTagName("LI");
        for (var i=0; i<ieLISubs.length; i++)
        {
            ieLISubs[i].onmouseover=function()
            {
                this.className+="ieHover";
            }
            ieLISubs[i].onmouseout=function()
            {
                this.className=this.className.replace(new RegExp("ieHover\\b"), "");
            }
        }
    }
}
 
var ieHover = {
	attach:function () {
		var lis = document.getElementById("spcMainMenu").getElementsByTagName("LI"), i,
			setUl = function (pA, pStyle) {
				var ul = pA.getElementsByTagName("UL");
				if (ul !== null && ul !== undefined && ul.length > 0) {
					ul[0].style["visibility"] = pStyle;
				}
			};
		
		for (i = 0; i < lis.length; i++) {
			lis[i].onmouseover = function () {
				this.className += " hover";
				setUl(this, "visible");
			};
			lis[i].onmouseout = function () {
				this.className = this.className.replace(" hover", "");
				setUl(this, "hidden");
			};
		}
	}
};

if (window.attachEvent) {
    window.attachEvent("onload", ieHover.attach);
}
