
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function change_menu(menu, etat) {
	if(etat) {
		MM_changeProp(menu,'','style.backgroundImage','url(images/menu/bouton-b.gif)','DIV');
	}else{
		MM_changeProp(menu,'','style.backgroundImage','url(images/menu/bouton-a.gif)','DIV');
	}
}

function coucou() {
	alert("ok");
}

var MonTimer;

function View_Deroulant(deroulant, etat) {
	clearTimeout(MonTimer);
	var filterFunction = "progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0, wipeStyle=1, motion='forward') alpha(opacity=90) progid:DXImageTransform.Microsoft.Shadow(color=#777777,direction=135,strength=4)";
	var tx;
	var ty;
	var NomDeroulant = "Deroulant" + deroulant
	var NomMenu = "Menu" + deroulant

	var LeMenu = document.getElementById(NomMenu);
	ty = getTop(LeMenu);
	tx = getLeft(LeMenu);

	ty += 23;
	tx += 5;

	if (document.getElementById) {
		target= document.getElementById(NomDeroulant);
		document.getElementById(NomDeroulant).style.display=etat;
		document.getElementById(NomDeroulant).style.top = ty;
		document.getElementById(NomDeroulant).style.left = tx;

		target.style.filter=filterFunction;
		if (target.filters && target.filters[0]) {
			target.filters[0].Apply();
			target.filters[0].Play();
		}
		if(etat == "block") {
			document.getElementById(NomDeroulant).style.visibility = "visible";
		}else{
			document.getElementById(NomDeroulant).style.visibility = "hidden";
		}
		document.getElementById(NomDeroulant).style.display=etat;

	} else if (document.all) {
		document.all[NomDeroulant].style.display=etat;
		document.all[NomDeroulant].style.top = ty;
		document.all[NomDeroulant].style.left = tx;
	} else if (document.layers) {
		document.layers[NomDeroulant].display=etat;
		document.layers[NomDeroulant].top=ty;
		document.layers[NomDeroulant].left=tx;
	}
	if(etat=="block") {
		//MonTimer = setTimeout("Hide_Deroulant()", 3000) ;
	}
}

function Hide_After(n) {	// cache les menus après n secondes
	clearTimeout(MonTimer);
	MonTimer = setTimeout("Hide_Deroulant()", n*1000) ;
}

function Hide_Deroulant() {
	clearTimeout(MonTimer);
	View_Deroulant("5", "none");
	View_Deroulant("1", "none");
}

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);
}
