/*
	Son of a Suckerfish menu javascript code
	Source provided by http://www.htmldog.com/articles/suckerfish/dropdowns/
	Modifications made by Matthew Elliott:  matt _ elliott (at) sonic dot com
	Rev A1: 2006-2-27
	Rev A2: 2006-2-28
*/
sfHover = function() {
	if ((document.getElementById) && 
	    (document.getElementById("nav") != null) &&
	    (document.getElementById("nav").getElementsByTagName("LI") != null)) {
	    var sfEls = document.getElementById("nav").getElementsByTagName("LI");
		var onStateNav = false;
	    for (var i=0; i<sfEls.length; i++) {
		    sfEls[i].onmouseover=function() {
			    if ((this.className != "locale") && 
					  (this.className.indexOf("_on") < 1)) {
			       this.className+="_on over";
					 childMenuOn(this);
			    }
				 else if ((this.className.indexOf("specialNavOn") >= 0) && (this.className.indexOf("_on") > 0)) {
					 this.className+=" over";
					 onStateNav = true;
					 childMenuOn(this);
				 }
		    }
		    sfEls[i].onmouseout=function() {
			    //alert(this.className.indexOf("specialNavOn"));
			    if (this.className.indexOf("specialNavOn") >= 0) {
			        onStateNav = true;
			    }
			    if (this.className != "locale" && onStateNav == false) {
			       this.className=this.className.replace(new RegExp("_on over\\b"), "");
					 childMenuOff(this);
			    }
				 else if (this.className != "locale" && onStateNav == true) {
					 this.className=this.className.replace(new RegExp(" over\\b"), "");
					 onStateNav = false;
					 childMenuOff(this);
				 }
		    }
	    }
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function childMenuOff(ulNode) {
	if (ulNode.childNodes[2] != null && ulNode.childNodes[2].style != null) {
		ulNode.childNodes[2].style.left="-999em";
	}
}

function childMenuOn(ulNode) {
		if (ulNode.childNodes[2] != null && ulNode.childNodes[2].style != null) {
		ulNode.childNodes[2].style.left="auto";
	}
}
