  var sUrlFiltre = "";
  var aFiltre = new Array();
  
  function SetFiltre(pForm, bReset) {
    sUrl = sUrlFiltre;
    if (!sUrl.match(/ModLevel/)) sUrl += "|ModLevel_1";
    if (!bReset) {
      for (i=0;i<aFiltre.length;i++) {
        pObj = eval("pForm."+aFiltre[i]);
        if (pObj && pObj.options && pObj.options[pObj.selectedIndex].value) {
          if (pObj.options[pObj.selectedIndex].value.match(/\d+/)) {
            sUrl += "|"+aFiltre[i]+"_"+pObj.options[pObj.selectedIndex].value;
          } else {
            eval(pObj.options[pObj.selectedIndex].value);
            return false;
          }
        }
      }
      sUrl+="|NOCLEAN_1";
      document.location.href = sUrl;
    } else document.location.href = sUrl+"|START_1";
  }
  
  function SetLetter(sLetter) {
    sUrl = sUrlFiltre;
    sUrl += "NOCLEAN_1|LETTER_"+sLetter;
    document.location.href = sUrl;
  }

  function adjustIFrameSize (iframeWindow) {
    if (iframeWindow.document.height) {
      var iframeElement = document.getElementById(iframeWindow.name);
      iframeElement.style.height = iframeWindow.document.height +  'px';
      }
    else if (document.all) {
      var iframeElement = document.all[iframeWindow.name];
      if (iframeWindow.document.compatMode && iframeWindow.document.compatMode != 'BackCompat') 
      {
        iframeElement.style.height = iframeWindow.document.documentElement.scrollHeight +  5 +  'px';
      }
      else {
        iframeElement.style.height = iframeWindow.document.body.scrollHeight  + 5 +  'px';
      }
    }
  }
  
function select_inputs(elt){
	var formulaire = elt.parentNode.parentNode;
	if(formulaire.tagName =='FORM'){
		var inputs = formulaire.getElementsByTagName('INPUT');
		if (elt.checked){
			var check = true;
		}else{
			var check = false;
		}
		for(var i=0 ; i<inputs.length ; i++){
			if(check){
				inputs[i].checked = true;
			}else{
				inputs[i].checked = false;
			}
		}
	}
}

// -------------------------------------------------------------
// Fonctions Menu
	var iIsMenIn = new Array();
	var curMenu = "";

	function SetMenuON(IdMenu, aTo) {
    aTab = IdMenu.split(/_/);
    if (aTab[1]) { // show preview element
      iIsMenIn[aTab[0]]=aTab[0];
      showLayer(aTab[0]);
      // hide brother nodes
      for (i=0;i<document.all.tags("DIV").length;i++) {
        s = document.all.tags("DIV")[i];
        re = new RegExp("^"+aTab[0]);
        if (s.id != IdMenu && s.id != aTab[0] && s.id.match(re)) {
          iIsMenIn[s.id]=s.id;
          hideLayer(s.id);
        }
      }
    }
    iIsMenIn[IdMenu]=IdMenu;
    
    // hide previous menu
    if (curMenu != IdMenu && !curMenu.match(/_/)) {
      hideLayer(curMenu);
      iIsMenIn[curMenu]=false;
    }
        
		lay = getLayer(IdMenu);
		if (lay) { // show and place menu
      iIsMenIn[IdMenu]=IdMenu;
      showLayer(lay);
      if (aTo) {
    		layTo = getLayer(aTo[0]);
        if (layTo) moveLayerToLayer(lay, layTo, aTo[1], aTo[2]);
      }
    }
		curMenu = IdMenu ;
  }
  
  function SetMenuOFF(Id, bForce, iTime) {
    if (bForce) {
  		if (!iIsMenIn[Id]) {
        hideLayer(Id);
        for (i=0;i<document.all.tags("DIV").length;i++) { // hide all son nodes
          s = document.all.tags("DIV")[i];
          re = new RegExp("^"+Id);
          if (s.id != Id && s.id.match(re)) {
            iIsMenIn[s.id]=false;
            hideLayer(s.id);
          }
        }

        aTab = Id.split(/_/);
        if (aTab[1]) { // hide preview element
          SetMenuOFF(aTab[0],false,1);
        }
      }
    } else {
      iIsMenIn[Id]=false;
      if (!iTime) iTime = 750;
      setTimeout('SetMenuOFF(\"'+Id+'\", true);', iTime);
    }
  }

  function SetMenuColor(Id, sColor, bFirst) {
    e = getElement(Id);
    eb = getElement(Id+"b");
    if (bFirst) {
      e.style.background=sColor;
      eb.style.background=sColor;
    }
    if (!e.restorebackground) {
      e.restorebackground=e.style.background;
    }
    if (!eb.restorebackground) {
      eb.restorebackground=eb.style.background;
    }
    if (!sColor) {
      e.style.background=e.restorebackground;
      eb.style.background=eb.restorebackground;
    } else {
      e.style.background=sColor;
      eb.style.background=sColor;
   }
  }
  
  var IdRubPrev = false;
  var IdRupPrev = false;
  
  function SetOpenRub(IdRup, IdRub) {
    l = "MENU_INF"+IdRub;
    im = getImage("im_rub"+IdRup+"_"+IdRub);
    if (IdRubPrev) {
      lprev = "MENU_INF"+IdRubPrev;
      closeLayer(lprev);
      imprev = getImage("im_rub"+IdRupPrev+"_"+IdRubPrev);
      if (imprev) imprev.src = "/images/im_left/im_plus_n2.gif";
    }
    IdRubPrev = IdRub;
    IdRupPrev = IdRup;
    l = getLayer(l);
    if (!l) return;
    if (!l.bIsOpen) {
      openLayer(l);
      if (im) im.src = "/images/im_left/im_moins_n2.gif";
      l.bIsOpen=1;
    } else {
      closeLayer(l);
      im.src = "/images/im_left/im_plus_n2.gif";
      l.bIsOpen=0;
    }
  }
  
// -------------------------------------------------------------

// gestion du menu déroulant
	sfHover = function() {
		var sfEls = document.getElementById("menuhaut").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
	if (window.attachEvent) window.attachEvent("onload", sfHover);


//fonction qui permet de masque ou afficher des zones
function show_zone(id, elt){
	var zone = document.getElementById(id);
	if(zone && zone.style){
		zone.style.display = (zone.style.display == 'none') ? 'block' : 'none';
	}
	var image = elt.getElementsByTagName('IMG')[0];
	if(image && image.src){
		if(zone.style.display == 'block'){
			elt.setAttribute('class', 'moins');
			elt.setAttribute('className', 'moins');
			image.src = '/images/moins.gif';			
		}else{
			elt.setAttribute('class', 'plus');
			elt.setAttribute('className', 'plus');
			image.src = '/images/plus.gif';
		}
	}
}	
