var mmHideMenuTimer = null;
var mmHideMenuTimer1 = null;
var cm=null; 
document.onclick = new Function("show(null)");  

function menuStartTimeout(hideTimeout) {
	mmHideMenuTimer = setTimeout("show(null)", hideTimeout);	
}

function menuStartTimeout1(hideTimeout) {
	mmHideMenuTimer1 = setTimeout("showservice(null)", hideTimeout);	
}


function menuResetTimeout() {
	if (mmHideMenuTimer) clearTimeout(mmHideMenuTimer);
	mmHideMenuTimer = null;
}

function menuResetTimeout1() {
	if (mmHideMenuTimer1) clearTimeout(mmHideMenuTimer1);
	mmHideMenuTimer1 = null;
}


function getPos(el,sProp)  
{ 
  var iPos = 0 ;
  while (el!=null){
    iPos+=el["offset" + sProp]; 
	if(navigator.appName!="Netscape")
	{
       el = el.offsetParent;
	   //alert(iPos);
	}
	
	if(navigator.appName=="Netscape")
	{
		
		el = el.offsetParent;

		/*iPos+=el.parentNode["offset" + sProp]; */
		
		/*iPos=document.getElementById("products").offsetLeft;*/
	}
  } 
   return iPos;
}  
function show(el,m)  
{
       
	menuResetTimeout();
    if (m) 
	{
	     
		if(navigator.appName=="Netscape")
	    {
	           var i; 
	       
	        i=document.getElementById("products").offsetLeft;
			document.getElementById("smenu1").style.display = "";
			document.getElementById("smenu1").style.left=i +"px";
			/*i=document.getElementById("products").offsetHeight+1;*/
			i=document.getElementById("products").offsetParent.offsetTop+document.getElementById("products").offsetParent.clientHeight+10;
            document.getElementById("smenu1").style.top=i+"px";
                			
		}
		if(navigator.appName!="Netscape")
	    {
	         m.style.display=""; 
             m.style.pixelLeft = getPos(el,"Left") ;
             m.style.pixelTop = (getPos(el,"Top") + el.offsetHeight);
		}
		
		

    }  
	
    if (el==null) 
	{
		if(navigator.appName=="Netscape")
	    {
		    document.getElementById("smenu1").style.display = "none"
		    
	    }
		if(navigator.appName!="Netscape")
	    {
		   document.getElementById("smenu1").style.display = "none"
		   
	       /*cm.style.display="none" */
		}
	   cm=m ;
	}
}  

function showservice(el,m)  
{
       
	menuResetTimeout1();
    if (m) 
	{
	     
		if(navigator.appName=="Netscape")
	    {
	           var i; 
	       
	        i=document.getElementById("services").offsetLeft;
			document.getElementById("srvmenu").style.display = "";
			document.getElementById("srvmenu").style.left=i +"px";
			/*i=document.getElementById("products").offsetHeight+1;*/
			i=document.getElementById("services").offsetParent.offsetTop+document.getElementById("services").offsetParent.clientHeight+10;
            document.getElementById("srvmenu").style.top=i+"px";
                			
		}
		if(navigator.appName!="Netscape")
	    {
	         m.style.display=""; 
             m.style.pixelLeft = getPos(el,"Left") ;
             m.style.pixelTop = (getPos(el,"Top") + el.offsetHeight);
		}
		
		

    }  
	
    if (el==null) 
	{
		if(navigator.appName=="Netscape")
	    {
		    document.getElementById("srvmenu").style.display = "none"
		    
	    }
		if(navigator.appName!="Netscape")
	    {
		   document.getElementById("srvmenu").style.display = "none"
		   
	       /*cm.style.display="none" */
		}
	   cm=m ;
	}

}  


