// JavaScript Document

sfHoverHorizontal = function() {
	var stlinks = document.getElementById("stlinks");
	if (stlinks != null) {
		var sfEls = stlinks.getElementsByTagName("LI");
		if (sfEls != null) {
			for (var i=0; i<sfEls.length; i++) {
				sfEls[i].onmouseover=function() {
					if (this.className.indexOf("sp2") >= 0)
						this.className+=" sfhover2";
					else
						this.className+=" sfhover";
				}
				sfEls[i].onmouseout=function() {
					this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
					this.className=this.className.replace(new RegExp(" sfhover2\\b"), "");
				}
			}
		}
	}
}

sfHoverVertical = function() {
	var stlinks = document.getElementById("nav");
	if (stlinks != null) {
		var sfEls = stlinks.getElementsByTagName("LI");
		if (sfEls!= null){
			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"), "");
				}
			}
		}
	}
}

ieFix = function() {
    var browser = BrowserDetect.browser;
    var version = BrowserDetect.version;

    if (!(browser == "Explorer" && version < 7)) {
        return;
    }
    //var os = BrowserDetect.OS;
    var navUl = document.getElementById("nav");
    if (navUl != null) {
        var lisInNavUl = navUl.getElementsByTagName("LI");
        if (lisInNavUl != null) {
            for (var i = 0; i < lisInNavUl.length; i++) {
                var ulsWithinli = lisInNavUl[i].getElementsByTagName("UL");
                if (ulsWithinli != null && ulsWithinli.length > 0) {
                    lisInNavUl[i].className += " ieFix";
                }
            }
        }
    }
}

if (window.attachEvent) window.attachEvent("onload", sfHoverHorizontal);
if (window.attachEvent) window.attachEvent("onload", sfHoverVertical);
if (window.attachEvent) window.attachEvent("onload", ieFix);

