var timeout; //ne pas toucher, c'est pour declarer la variable
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 blnOk=true;
//pour enlever les "px" pour faire des calculs...
var reg = new RegExp("px", "g");
/* Pour IE uniquement, les balises <select> passent toujours au-dessus du menu, donc
	par défaut on cache les listes déroulantes quand le menu est ouvert, puis on les fait
	réapparaître à la fermeture du menu. Pour empêcher ça, mettre à false. */
var cacher_les_select=true;


function fixPNG(myImage) // correctly handle PNG transparency in Win IE 5.5 or higher.
    {
      if (window.ie55up)
	    {
	 var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
	 var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
	 var imgTitle = (myImage.title) ? "title='" + myImage.title + "' " : "title='" + myImage.alt + "' "
	 var imgStyle = "display:inline-block;" + myImage.style.cssText
	 var strNewHTML = "<span " + imgID + imgClass + imgTitle
	 strNewHTML += " style=\'" + "width:" + myImage.width + "px; height:" + myImage.height + "px;" + imgStyle + ";"
	 strNewHTML += "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
	 strNewHTML += "(src=\'" + myImage.src + "\', sizingMethod='scale');\'></span>"
	 myImage.outerHTML = strNewHTML;
	 
	   }
   }

function preChargement()
{
	if (document.getElementById("bandeau"))
	{
		document.getElementById("bandeau").style.visibility="hidden";
		//IE5 mac a un bug : quand un texte est dans un élément de style float, il n'apparait pas.
		/*if (isIE5mac)
		{
			document.getElementById("bandeau").style="";
		}*/
	}
if (document.getElementById("gauche"))
	{
		document.getElementById("gauche").style.visibility="hidden";
		//IE5 mac a un bug : quand un texte est dans un élément de style float, il n'apparait pas.
		/*if (isIE5mac)
		{
			document.getElementById("bandeau").style="";
		}*/
	}
}


function MontrerMenu(strMenu) {
	if(blnOk) {
		AnnulerCacher();
		CacherMenus();
		if (document.getElementById(strMenu))//undefined
			with (document.getElementById(strMenu).style)
				visibility="visible";
	}
	SelectVisible("hidden",document.getElementsByTagName('select'));
}

function CacherDelai() {
	if (blnOk) {
		timeout = setTimeout('CacherMenus()',600);
	}
}

function AnnulerCacher() {
	if (blnOk && timeout) {
		clearTimeout(timeout);
	}
}

function CacherMenus() {
	if(blnOk) {
		for(i=1;i<=12;i++) {
			if (document.getElementById("smenu"+i))//undefined
				with(document.getElementById("smenu"+i).style) visibility="hidden";
		}
	}
	SelectVisible("visible",document.getElementsByTagName('select'));
}



function SelectVisible(v,elem) {
	if (blnOk && cacher_les_select && (isIE||isIE5win))
		for (var i=0;i<elem.length;i++) elem[i].style.visibility=v;
}


function ouvrir(){fenetre=window.open("mentions_legales.html","","width=300,height=600,toolbar=no, scrollbars=false,status=no")
fenetre.creator=self
}

function afficher(form) {
var testin =document. form.nom.value;
document.form.login.value=testin
}

