function oninit1(){
  $("a_rechExpress").onclick = function(evt){$("frm_rechExpress").submit()};
  $("inpt_ref").onkeypress = function(evt){rechercheExpress(evt);};
  $("inpt_ref").onfocus=function(evt){this.value='';};
  defBtOnglet();
  $("a_fermeDial").onclick=function(evt){$("div_infoMoteur").style.display="none";};
}

function chargeMoteurG(){
  $("a_rechercheG").onclick=function(evt){
    if(($("inpt_deb").value!="")||($("lst_nbj").value!="")){
      if((($("inpt_deb").value!="")&&($("lst_nbj").value==""))||(($("inpt_deb").value=="")&&($("lst_nbj").value!=""))){
        alertAMalibu("You have to define your arrival date and the numbers of nights !")
      }
      else document.location.href='/listeheb?'+getQueryStringByForm($('frm_gite'));
    }
    else document.location.href='/listeheb?'+getQueryStringByForm($('frm_gite'));
  };
  $("a_criteresG").onclick=function(evt){document.location.href='/listeheb?'+getQueryStringByForm($('frm_gite'))+'#js:plusDeCriteres();';};
  setCalendrierGeneral("gites74","1","ANGLAIS","G","div_calendrierMoteurContent",clicCalendJsAcc,"inpt_deb","","","lst_nbj","1",""); 
  $("img_fermeCalend").onclick=function(evt){afficheEffaceCalendJs("div_calendrierMoteur");};
  $("inpt_deb").onfocus=function(evt){afficheEffaceCalendJs("div_calendrierMoteur");};
  $("lst_domaines_g").onchange=function(evt){desactiveListeRub("lst_domaines_g","lst_lacsMassifs_g");};
  $("lst_lacsMassifs_g").onchange=function(evt){desactiveListeRub("lst_lacsMassifs_g","lst_domaines_g");};
}

function chargeMoteurH(){
  $("a_rechercheH").onclick=function(evt){document.location.href='/listeheb?'+getQueryStringByForm($('frm_chambre'));};
  $("a_criteresH").onclick=function(evt){document.location.href='/listeheb?'+getQueryStringByForm($('frm_chambre'))+'#js:plusDeCriteres();';};
  $("lst_domaines_h").onchange=function(evt){desactiveListeRub("lst_domaines_h","lst_lacsMassifs_h");};
  $("lst_lacsMassifs_h").onchange=function(evt){desactiveListeRub("lst_lacsMassifs_h","lst_domaines_h");};
}

function chargeMoteurGEGS(){
  $("a_rechercheGEGS").onclick=function(evt){document.location.href='/listeheb?'+getQueryStringByForm($('frm_gegs'));};
  $("a_criteresGEGS").onclick=function(evt){document.location.href='/listeheb?'+getQueryStringByForm($('frm_gegs'))+'#js:plusDeCriteres();';};
  $("lst_domaines_gegs").onchange=function(evt){desactiveListeRub("lst_domaines_gegs","lst_lacsMassifs_gegs");};
  $("lst_lacsMassifs_gegs").onchange=function(evt){desactiveListeRub("lst_lacsMassifs_gegs","lst_domaines_gegs");};
}

function chargeMoteurC(){
  $("a_rechercheC").onclick=function(evt){document.location.href='/listeheb?'+getQueryStringByForm($('frm_camping'));};
  $("a_criteresC").onclick=function(evt){document.location.href='/listeheb?'+getQueryStringByForm($('frm_camping'))+'#js:plusDeCriteres();';};
  $("lst_lacsMassifs_c").onchange=function(evt){desactiveListeRub("lst_lacsMassifs_c","lst_domaines_c");};
}

function clicCalendJsAcc(evt,jour,mois,annee,etat){
  $("inpt_deb").value=jour+mois+annee;
  afficheEffaceCalendJs("div_calendrierMoteur");
}

function rechercheExpress(event){
  if(!event) var event = window.event;
  if(event && event.keyCode==13) $("frm_rechExpress").submit();
}

function affMoteurGite(){
  if($("div_chaqueMoteur").hasClassName("moteurChambre")) $("div_chaqueMoteur").removeClassName("moteurChambre");
  if($("div_chaqueMoteur").hasClassName("moteurGEGS")) $("div_chaqueMoteur").removeClassName("moteurGEGS");
  if($("div_chaqueMoteur").hasClassName("moteurCamping")) $("div_chaqueMoteur").removeClassName("moteurCamping");
  if(!$("div_chaqueMoteur").hasClassName("moteurGite")) $("div_chaqueMoteur").addClassName("moteurGite");
  
  $("div_moteurGite").style.display="block";
  $("div_moteurChambre").style.display="none";
  $("div_moteurGEGS").style.display="none";
  $("div_moteurCamping").style.display="none";
}

function affMoteurChambre(){
  if($("div_chaqueMoteur").hasClassName("moteurGite")) $("div_chaqueMoteur").removeClassName("moteurGite");
  if($("div_chaqueMoteur").hasClassName("moteurGEGS")) $("div_chaqueMoteur").removeClassName("moteurGEGS");
  if($("div_chaqueMoteur").hasClassName("moteurCamping")) $("div_chaqueMoteur").removeClassName("moteurCamping");
  if(!$("div_chaqueMoteur").hasClassName("moteurChambre")) $("div_chaqueMoteur").addClassName("moteurChambre");
  
  $("div_moteurGite").style.display="none";
  $("div_moteurChambre").style.display="block";
  $("div_moteurGEGS").style.display="none";
  $("div_moteurCamping").style.display="none";
}

function affMoteurGEGS(){
  if($("div_chaqueMoteur").hasClassName("moteurGite")) $("div_chaqueMoteur").removeClassName("moteurGite");
  if($("div_chaqueMoteur").hasClassName("moteurChambre")) $("div_chaqueMoteur").removeClassName("moteurChambre");
  if($("div_chaqueMoteur").hasClassName("moteurCamping")) $("div_chaqueMoteur").removeClassName("moteurCamping");
  if(!$("div_chaqueMoteur").hasClassName("moteurGEGS")) $("div_chaqueMoteur").addClassName("moteurGEGS");
  
  $("div_moteurGite").style.display="none";
  $("div_moteurChambre").style.display="none";
  $("div_moteurGEGS").style.display="block";
  $("div_moteurCamping").style.display="none";
}

function affMoteurCamping(){
  if($("div_chaqueMoteur").hasClassName("moteurGite")) $("div_chaqueMoteur").removeClassName("moteurGite");
  if($("div_chaqueMoteur").hasClassName("moteurChambre")) $("div_chaqueMoteur").removeClassName("moteurChambre");
  if($("div_chaqueMoteur").hasClassName("moteurGEGS")) $("div_chaqueMoteur").removeClassName("moteurGEGS");
  if(!$("div_chaqueMoteur").hasClassName("moteurCamping")) $("div_chaqueMoteur").addClassName("moteurCamping");
  
  $("div_moteurGite").style.display="none";
  $("div_moteurChambre").style.display="none";
  $("div_moteurGEGS").style.display="none";
  $("div_moteurCamping").style.display="block";
}

function defBtOnglet(){
  $("li_ongletG").onclick=function(){affMoteurGite();};
  $("li_ongletH").onclick=function(){affMoteurChambre();};
  $("li_ongletGEGS").onclick=function(){affMoteurGEGS();};
  $("li_ongletC").onclick=function(){affMoteurCamping();};
}

function desactiveListeRub(lst1,lst2){
  if($(lst1).value!=""){
    $(lst2).disabled=true;
    $("p_infoMoteur").innerHTML="You have to choose between Lakes and Massifs OR Ski areas";
    $("div_infoMoteur").style.display="block";
  }
  else {
    $(lst2).disabled=false;
    $("div_infoMoteur").style.display="none";
  }
}
