if (window.attachEvent) window.attachEvent("onload", sfHover); 
else 
	window.addEventListener('load',sfHover,false); 

function sfHover() {   

	/* Assumed: target class of UL is 'sf' */   
	var regSfUL = /\bsf\b/;   
	var ULs, UL, LIs, LI, i=j= -1;   


	ULs = document.getElementsByTagName("ul");   
		
	/* Loop stops when ULs[n]--> null */   
	
	while( UL=ULs[++i] )   {     
		/* Tested className with RE       
		- so multiple classNames are handled       
		RE predefined for extra a fish in sea     */     
		if( regSfUL.test(UL.className) )     {       
			j = -1;       
			LIs=UL.getElementsByTagName("li");       
		
		while( LI=LIs[++j] ) {         
			LI.onmouseover = over;         
			LI.onmouseout = out;      
			setActive(LI);
		}     
	}   
}   

/* Defined event handler functions outside the loop     
- more efficient (speed & memory).     
Kept as inner functions to preserve global namespace     
- OK, since outer function is only called once.      
If you are paranoid about memory leaks you could      
define these externally.   */   
function out()   {  
	this.className=this.className.replace(/ sfhover\b/, "");   
	//this.style.zIndex=-1;		
}   

function over()   {     
	this.className+=" sfhover";   
	this.style.zIndex=1;	
} 

function setActive(li) {
	var strLocation = window.location.href;   
									
	if (li.className == 'active') 
	    li.className = '';

	
	if ((li.firstChild.nodeName.toLowerCase() == 'a') &&
		(li.firstChild.href == strLocation))
		{
			li.className = 'active';
		}
	}
	
}








