var timeOutId;

var sfHover=function()
{
	var sfEls = document.getElementById("nav").getElementsByTagName("li");
       
	for (var i=0; i<sfEls.length; i++) 
	{
	     pointer = sfEls[i];
	     if(pointer.parentNode.parentNode.tagName == "DIV")
	     {
		pointer .onmouseover=function() 
		{
			aux = this;
			hideAll(aux);
			show(aux);
			clearTimeout(timeOutId);                           
		}
		pointer.onmouseout=function() 
		{
			auxi = this;
			timeOutId = setTimeout("hide(auxi);",1000);
		}
	     }
              if(pointer.parentNode.parentNode.tagName == "LI")
              {
		pointer.onmouseover=function() 
		{	
			clearTimeout(timeOutId);
		}
		pointer.onmouseout=function() 
		{
			auxi2 = this;
			timeOutId = setTimeout("hide(auxi2);",1000);
		}
              }        
	}
}

if (window.addEventListener) window.addEventListener("load", sfHover, true);
if (window.attachEvent) window.attachEvent("onload", sfHover);


function show(aux)
{
	aux.className=" sfhover";
}

function hide(aux)
{
	//aux.className=aux.className.replace(new RegExp(" sfhover\\b"),"");
	aux.className = "";
}

function hideAll(aux)
{
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) 
	{
		if(!(aux == sfEls[i]))
		{
                  		//aux = sfEls[i];
			//aux.className=aux.className.replace(new RegExp(" sfhover\\b"), "");
			sfEls[i].className = "";
		}
	}
}



