var to ;
var ouvert = null;
var tmp = true;
  var agt = navigator.userAgent.toLowerCase();
  var isMac = (agt.indexOf('mac') != -1);
  var isOpera = (agt.indexOf('opera') != -1);
  var IEver = parseInt(agt.substring(agt.indexOf('msie ') + 5));
  var isIE = ((agt.indexOf('msie')!=-1 && !isOpera && (agt.indexOf('webtv')==-1)) && !isMac);
  var isIE5win = (isIE && IEver >= 5);
  var isIE5mac = ((agt.indexOf('msie') != -1) && isMac);
  var isSafari = (agt.indexOf('safari') != -1);

	var theishim = null;


function cacher(id)
{
	if(id != '')
	{			
		document.getElementById('menu'+id).style.visibility='hidden';
		document.getElementById('menu'+id).style.display='none';
		
		if(isIE && tmp)
		{
			if(theishim != null)
			{
				theishim.parentNode.removeChild(theishim);
				theishim = null;
			}
		}
	}
}


function over()
{
	clearTimeout(to);
}

function afficher(id,rub)
{
	if(id != '')
	{
		if(ouvert != null)
		{
			over();
			cacher(ouvert);
		}
		
		var menutoopen = document.getElementById('menu'+id);
		
		menutoopen.style.top = getTop(rub)+28;
		menutoopen.style.left = getLeft(rub);
		menutoopen.style.visibility='visible';
		menutoopen.style.display='block';
		ouvert = id;
		
		if(isIE && tmp)
		{
			if(document.readyState != "interactive")
			{
				var newishim = document.createElement("iframe");
				newishim.style.position = "absolute" ;
				newishim.src = "" ;
				newishim.frameborder = "0";
				newishim.style.display = "none" ;
				newishim.style.zIndex = 1 ;
				newishim.style.top = menutoopen.style.top;
				newishim.style.left = menutoopen.style.left;
				newishim.style.width = menutoopen.offsetWidth;
				newishim.style.height = menutoopen.offsetHeight;
				newishim.style.display = "block";
				theishim = newishim;
				document.body.appendChild(newishim); 
			}
		}
	}
}

function getLeft(MyObject)
{
	if (MyObject.offsetParent)
		return (MyObject.offsetLeft + getLeft(MyObject.offsetParent));
	else
		return (MyObject.offsetLeft);
}
function getTop(MyObject)
{
	if (MyObject.offsetParent)
		return (MyObject.offsetTop + getTop(MyObject.offsetParent));
	else
		return (MyObject.offsetTop);
}

function delai(id)
{
	if(id != '')
	{
		to = setTimeout('cacher('+id+')',200);
	}
}

