/*
 * Adds onmouseover, onmouseout events to navigation menu elements
 * Needed because IE, being the crappy browser that it is, doesn't support the CSS :hover pseudoclass
 * This javascript is required for menu flyout functionality in IE6
 */

sfHover = function() {
	
	// grab all the LI elements in header-nav
	var sfEls = document.getElementById("header-nav").getElementsByTagName("LI");
	// set up mouse events on each LI to dynamically add and remove the 'sfhover' class 
	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"), "");
		}
	}
}

