<!-- This script makes the dropmenus work in IE on the PC -->


<!--//--><![CDATA[//><!--


// Taken from http://carroll.org.uk/sandbox/suckerfish/bones2.html ;
// they mention their sources as well.  The keyboard accessibility stuff
// is a bonus; try tabbing through links in IE.  (Tabbing through links
// is available in firefox but it's in an about:config option.)
// - Taper

sfHover = function() {
    var sfEls = document.getElementById("mainnav").getElementsByTagName("LI");
    for (var i=0; i<sfEls.length; i++) {
        sfEls[i].onmouseover=function() {
            this.className+=(this.className.length>0? " ": "") + "sfhover";
        }
        sfEls[i].onmouseout=function() {
            this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
        }
    }
}

mcAccessible = function() {
    var mcEls = document.getElementById("mainnav").getElementsByTagName("A");
    for (var i=0; i<mcEls.length; i++) {
	mcEls[i].onfocus=function() {
	    this.className+=(this.className.length>0? " ": "") + "sffocus"; //a:focus
	    this.parentNode.className+=(this.parentNode.className.length>0? " ": "") + "sfhover"; //li < a:focus
	    if(this.parentNode.parentNode.parentNode.nodeName == "LI") {
		this.parentNode.parentNode.parentNode.className+=(this.parentNode.parentNode.parentNode.className.length>0? " ": "") + "sfhover"; //li < ul < li < a:focus
		if(this.parentNode.parentNode.parentNode.parentNode.parentNode.nodeName == "LI") {
		    this.parentNode.parentNode.parentNode.parentNode.parentNode.className+=(this.parentNode.parentNode.parentNode.parentNode.parentNode.className.length>0? " ": "") + "sfhover"; //li < ul < li < ul < li < a:focus
		}
	    }
	}
	mcEls[i].onblur=function() {
	    this.className=this.className.replace(new RegExp("( ?|^)sffocus\\b"), "");
	    this.parentNode.className=this.parentNode.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
	    if(this.parentNode.parentNode.parentNode.nodeName == "LI") {
		this.parentNode.parentNode.parentNode.className=this.parentNode.parentNode.parentNode.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
		if(this.parentNode.parentNode.parentNode.parentNode.parentNode.nodeName == "LI") {
		    this.parentNode.parentNode.parentNode.parentNode.parentNode.className=this.parentNode.parentNode.parentNode.parentNode.parentNode.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
		}
	    }
	}
    }
}

// only ie needs the sfHover script. all need the accessibility script...
// thanks http://www.brothercake.com/site/resources/scripts/onload/
if(window.addEventListener) { // gecko, safari, konqueror and standard
    window.addEventListener('load', mcAccessible, false); 
} else if(document.addEventListener) { // opera 7
    document.addEventListener('load', mcAccessible, false); 
} else if(window.attachEvent) { // win/ie
    window.attachEvent('onload', sfHover);
    window.attachEvent('onload', mcAccessible);
} else { // mac/ie5
    if(typeof window.onload == 'function') {
	var existing = onload;
	window.onload = function() {
	    existing();
	    sfHover();
	    mcAccessible();
	}
    } else {
	window.onload = function() {
	    sfHover();
	    mcAccessible();
	}
    }
}


/*
sfHover = function() {
	var sfEls = document.getElementById("nav").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);
*/

//--><!]]>