// window.onload=montre;

// Teste si a est ancêtre de source
function isAncestor(source,a)
{

  ancetre = document.getElementById(a);
  while(source) {
    if(source==ancetre)
       return true;
     source=source.parentNode;
  }

  return false;

}


function montre(id) {
var d = document.getElementById(id);
if (d) {
  d.style.display='block';
	
}


}


function cachetout() {

		for (i=1;i<=20;i++) 
    {
      if (document.getElementById('smenu'+i)) document.getElementById("smenu"+i).style.display = "none";
    }

}


function cache(e) {
  var objSrc;
  objSrc=e.relatedTarget?e.relatedTarget:e.toElement?e.toElement:null;
  
	if (!isAncestor(objSrc,"menugauche"))
  {
    cachetout();
  }
}

function popUpWin (url, win, width, height, options) {
	var leftPos = (screen.availWidth - width) / 2;
	var topPos = (screen.availHeight - height) / 2;
	options += 'width=' + width + ',height=' + height + ',left=' + leftPos + ',top=' + topPos + ',scrollbars=yes,resizable=yes';
	return window.open(url, win, options);
}

