sfHover = function() {
	// Find all unordered lists.
	var ieNavs = document.getElementsByTagName('ul');
	for(i=0; i<ieNavs.length; i++) {
		var ul = ieNavs[i];
		// If they have a class of nav add the menu hover.
		if(ul.id == "lista")
			setHover(ul);
	}
}

function setHover(nav) {	
		var url= window.location.href;
		var ieULs = nav.getElementsByTagName('ul');
		// IE script to change class on mouseover
		var ieLIs = nav.getElementsByTagName('li');
		
		for (var i=0; i<ieLIs.length; i++) if (ieLIs[i]) 
		{
			// Does this LI have children? If so add a sfnode class.
			if (ieLIs[i].getElementsByTagName("UL").length>0)
			{
				var name=null;
				if ((ieLIs[i].name))
				{
					 name= "/"+ieLIs[i].name+"/";
				}
				var hide = ieLIs[i].getElementsByTagName("A");
				for (var j=0; j<hide.length; j++)
				{
					if (hide[j] && hide[j].className=='padre')
					{
						hide[j].onclick= function () {oculta(this);return false;}
						//mostrar todo oculto
						oculta(hide[j]);
						if (name && url.indexOf(name)>0)
						{
							oculta(hide[j]);
						}
						
					}
				}
			}
		}
}

function getNextSibling(el) 
{
   var nextSib = el.nextSibling;
   // hack for Gecko browsers
   if (nextSib && nextSib.nodeType != 1) {
      nextSib = nextSib.nextSibling;
   }
   return nextSib;
}

function oculta(obj)
{
	var ul = getNextSibling(obj);	
	if (ul.className && ul.className == 'hide')
	{
		ul.className='show';
	}
	else
	{	ul.className='hide'; }
}

window.onload=sfHover;