sfHover = function() {

  try {
		var sfEls = document.getElementById("nav").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
				//fix for ie6 display issue
				//dropdown forms appear ontop of navbar dropdown listings.
				//To solve this, we put an iframe behind the navbar dropdown to cover up the form dropdown
				//we make sure this function is only called for top level buttons, not listings in the navbar dropdown.
				//we also make sure to only call this if there is a dropdown listing
				if( (navigator.appVersion.indexOf('MSIE 6.0')!=-1) && (this.parentNode.id=="nav") && (this.getElementsByTagName("UL").length != 0) )
				{
					ie6CoverDropDowns(this, 'mouseover');
				}
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
				//fix for ie6 display issue
				//turn off iframe cover up onmouseout
				if( (navigator.appVersion.indexOf('MSIE 6.0')!=-1) && (this.parentNode.id=="nav") && (this.getElementsByTagName("UL").length != 0) )
				{
					ie6CoverDropDowns(this, 'mouseout');
				}
			}
		}
	}catch(e) {
		// Do nothing in case of error. Added for audio player page
	}
}

if (window.attachEvent) window.attachEvent("onload", sfHover);

function ie6CoverDropDowns(menuButton, newState) 
{
	if(newState == 'mouseover')
	{
	   var DivRef = menuButton.getElementsByTagName("UL")[0];
	   var IfrRef = document.getElementById('DivShim');
	    DivRef.style.display = "block";
	    IfrRef.style.top = DivRef.offsetTop;
	    IfrRef.style.left = DivRef.offsetLeft;
	    IfrRef.style.width = DivRef.offsetWidth;
	    IfrRef.style.height = DivRef.offsetHeight;
	    IfrRef.style.zIndex = DivRef.style.zIndex + 1;
	    IfrRef.style.display = "block";
		if ( menuButton.getElementsByTagName("UL").length > 1 ) //for the teams drop down which is two ULs
		{
		   var DivRef2 = menuButton.getElementsByTagName("UL")[1];
		    DivRef2.style.display = "block";
		    IfrRef.style.width = (DivRef.offsetWidth + DivRef2.offsetWidth) - 1;  // the second UL for teams overflaps the first one, so the -1 removes a not so pretty white line next to the that dropdown in ie6
		}

	} else {
	   var DivRef = menuButton.getElementsByTagName("UL")[0];
	   var IfrRef = document.getElementById('DivShim');
	    DivRef.style.display = "none";
	    IfrRef.style.display = "none";
		if ( menuButton.getElementsByTagName("UL").length > 1 ) //for the teams drop down which is two ULs
		{
		   var DivRef2 = menuButton.getElementsByTagName("UL")[1];
		    DivRef2.style.display = "none";
		}
	}
}


