function menuFix() {
	var navUl = document.getElementById("nav");
	var sfEls = document.getElementById("nav").getElementsByTagName("li"); 
	for (var i=0; i<sfEls.length; i++) { 


		if(sfEls[i].parentNode == navUl){
			sfEls[i].onmouseover=function() {
				var imgObj = this.getElementsByTagName("img");
				if(imgObj && imgObj[0]){
					var index = imgObj[0].id.substring(2);
					imgObj[0].src = "images/menu"+index+"_1.gif";
				}
				this.className+=(this.className.length>0? " ": "") + "sfhover"; 
			} 
			sfEls[i].onmouseout=function() {
				var imgObj = this.getElementsByTagName("img");
				if(imgObj && imgObj[0]){
					var index = imgObj[0].id.substring(2);
					imgObj[0].src = "images/menu"+index+"_0.gif";
				}
				this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), ""); 
			}
		}else{
			sfEls[i].onmouseover=function() {
				this.className+=(this.className.length>0? " ": "") + "sfhover"; 
			} 
sfEls[i].onmouseout=function() { 
var oldClass = this.className;
this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), ""); 
} 
		}
		
		sfEls[i].onMouseDown=function() { 
			this.className+=(this.className.length>0? " ": "") + "sfhover"; 
		} 
		sfEls[i].onMouseUp=function() { 
			this.className+=(this.className.length>0? " ": "") + "sfhover"; 
		} 
	} 
} 


window.onload=menuFix; 
