var sAgent = navigator.userAgent.toLowerCase() ;
var browser_IE6=false;
if ( sAgent.indexOf("msie") != -1 && sAgent.indexOf("mac") == -1 && sAgent.indexOf("opera") == -1 )
{
	var sBrowserVersion = navigator.appVersion.match(/MSIE (.\..)/)[1] ;
	browser_IE6= ( sBrowserVersion <= 6 ) ;
}

sfHover = function() 
{
	if(document.getElementById("nav")!=null)
	{
		var sfEls = document.getElementById("nav").getElementsByTagName("li");
		for (var i=0; i<sfEls.length; i++) 
		{
			sfEls[i].onmouseover=function() 
			{
				if(browser_IE6) 
				{
					this.className+=" sfhover";
				}
				else
				{
					hover(this);
				}
			}
			sfEls[i].onmouseout=function() 
			{
				if(browser_IE6) 
				{
					this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
				}
				else
				{
					hover(this);
				}
			}
		}
	}
}

function hover(obj)
{
  if(document.all)
  {
    UL = obj.getElementsByTagName('ul');
    if(UL.length > 0)
    {
    	if(UL[0]!=null)
    	{
	      sousMenu = UL[0].style;
	      if(sousMenu.display == 'none' || sousMenu.display == '')
	      {
	        sousMenu.display = 'block';
	      }
	      else
	      {
	        sousMenu.display = 'none';
	      }
       }
    }
  }
}

sfHover2 = function() 
{
	if(document.getElementById("nav2")!=null)
	{
		var sfEls = document.getElementById("nav2").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) 
		{
			sfEls[i].onmouseover=function() 
			{
				if(browser_IE6) 
				{
					this.className+=" sfhover";
				}
				else
				{
					hover(this);
				}
			}
			sfEls[i].onmouseout=function() 
			{
				if(browser_IE6) 
				{
					this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
				}
				else
				{
					hover(this);
				}
			}
		}
	}
}

sfHover3 = function() 
{
	if(document.getElementById("nav3")!=null)
	{
		var sfEls = document.getElementById("nav3").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) 
		{
			sfEls[i].onmouseover=function() 
			{
				if(browser_IE6) 
				{
					this.className+=" sfhover";
				}
				else
				{
					hover(this);
				}
			}
			sfEls[i].onmouseout=function() 
			{
				if(browser_IE6) 
				{
					this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
				}
				else
				{
					hover(this);
				}
			}
		}
	}
}

	if (window.attachEvent) window.attachEvent("onload", sfHover);
	if (window.attachEvent) window.attachEvent("onload", sfHover2);
	if (window.attachEvent) window.attachEvent("onload", sfHover3);
