function oninit1(){
  affUrlInDiv("divMeteo","/config_v3/73/G.v3/STANDARDAJX2.FRANCAIS/librairie/bloc_html/meteo.php");
  setScrollHorizontalOnDiv('div_contentThemes','ul_theme',{nextButton:"bt_suiv",prevButton:"bt_prec"});
  setScrollHorizontalOnLstGenerePage("div_selectionContent","ul_selection",{idDivPastePage:"div_selection",position:"top"});  
}

function initMoteurAcc(){
  initDuree();
  $$(".inpt_type").each(function(obj){obj.observe("click",initDuree);});
  $("sp_libDuree").onclick=function(evt){afficheEffaceCalendJsMenu("ul_dureeSejour");};
  $$(".lstDuree").each(function(obj){obj.onclick=function(evt){definitionDuree(obj);}});
  $("sp_nbp").onclick=function(evt){afficheEffaceCalendJsMenu("ul_nbp");};
  $$(".lstNbp").each(function(obj){obj.onclick=function(evt){definitionNbp(obj);}});
  $("bt_lanceRecherche").onclick=function(evt){lanceRechercheMoteurAcc();};
  $("bt_lanceRechercheCarto").onclick=function(evt){lanceRechercheMoteurAccCarte();};
}

function lanceRechercheMoteurAcc(){
  if(($("inpt_dateDeb").value && !$("lst_nbj").value) || (!$("inpt_dateDeb").value && $("lst_nbj").value)) alertAMalibu("Vous devez choisir une date et une dur&eacute;e pour votre recherche");
  else document.location.href='/liste?'+getQueryStringByForm($('frm_accueil'));
}

function lanceRechercheMoteurAccCarte(){
  document.location.href='/liste?'+getQueryStringByForm($('frm_accueil'))+"#js:afficheOngletCarto();";
}

function clicCalendJsMenu(evt,jour,mois,annee,etat){
  $("inpt_dateDeb").value=jour+mois+annee;
  $("inptPasDate").checked=false;
  afficheEffaceCalendJsMenu("calendrierMoteur");
}

function definitionDuree(obj){
  $("lst_nbj").value=obj.getAttribute("valeur");
  $("sp_libDuree").innerHTML=obj.innerHTML;
  afficheEffaceCalendJsMenu("ul_dureeSejour");
}

function definitionNbp(obj){
  $("lst_nbp").value=obj.getAttribute("valeur");
  $("sp_nbp").innerHTML=obj.innerHTML;
  afficheEffaceCalendJsMenu("ul_nbp");
}

function initDuree(){
  $$(".lstDuree").each(function(obj){if(obj.getAttribute("selected")=="selected"){$("lst_nbj").value=obj.getAttribute("valeur");$("sp_libDuree").innerHTML=obj.innerHTML;}});
  $$(".lstNbp").each(function(obj){if(obj.getAttribute("selected")=="selected"){$("lst_nbp").value=obj.getAttribute("valeur");$("sp_nbp").innerHTML=obj.innerHTML;}});
  if($("inpt_g").checked==true){
    $$(".nbpH").each(function(obj){obj.style.display="none";});
    $$(".nbpMaxi").each(function(obj){obj.style.display="none";});
    $$(".nbpT").each(function(obj){obj.style.display="none";});
    $$(".nbpG").each(function(obj){obj.style.display="block";});
    $$(".dureeH").each(function(obj){obj.style.display="none";});
    $$(".dureeG").each(function(obj){obj.style.display="block";});
    setCalendrierGeneral("gites73","1","","G","calendrierMoteurContent",clicCalendJsMenu,"inpt_dateDeb","","","lst_nbj","1","");
    $("div_Nbp").show();
    $("div_date").show();
    if($("inpt_gestheb").value) $("inpt_gestheb").value="";
    if($("inpt_label").value) $("inpt_label").value="";
    if($("lst_nbp").value=="12") $("lst_nbp").value="";
    if($("int_infotour").value=="CHALETSLOISIRS") $("int_infotour").value="";
    if($("rubVille").value=="HVILL") $("rubVille").value="";
  }
  else if($("inpt_maxi").checked==true){
    $$(".nbpH").each(function(obj){obj.style.display="none";});
    $$(".nbpT").each(function(obj){obj.style.display="none";});
    $$(".nbpG").each(function(obj){obj.style.display="none";});
    $$(".nbpMaxi").each(function(obj){obj.style.display="block";});
    $$(".dureeH").each(function(obj){obj.style.display="none";});
    $$(".dureeG").each(function(obj){obj.style.display="block";});
    setCalendrierGeneral("gites73","1","","G","calendrierMoteurContent",clicCalendJsMenu,"inpt_dateDeb","","","lst_nbj","1","");
    $("div_Nbp").show();
    $("div_date").show();
    if($("inpt_gestheb").value) $("inpt_gestheb").value="";
    if($("inpt_label").value) $("inpt_label").value="";
    $("lst_nbp").value="12";
    if($("int_infotour").value=="CHALETSLOISIRS") $("int_infotour").value="";
    if($("rubVille").value=="HVILL") $("rubVille").value="";
  }
  else if($("inpt_chalet").checked==true){
    $$(".nbpH").each(function(obj){obj.style.display="none";});
    $$(".nbpMaxi").each(function(obj){obj.style.display="none";});
    $$(".nbpT").each(function(obj){obj.style.display="none";});
    $$(".nbpG").each(function(obj){obj.style.display="block";});
    $$(".dureeH").each(function(obj){obj.style.display="none";});
    $$(".dureeG").each(function(obj){obj.style.display="block";});
    setCalendrierGeneral("gites73","6","","G","calendrierMoteurContent",clicCalendJsMenu,"inpt_dateDeb","","","lst_nbj","1","");
    $("div_Nbp").show();
    $("div_date").show();
    $("inpt_gestheb").value="H";
    $("inpt_label").value="ALPAG";
    if($("lst_nbp").value=="12") $("lst_nbp").value="";
    if($("int_infotour").value=="CHALETSLOISIRS") $("int_infotour").value="";
    if($("rubVille").value=="HVILL") $("rubVille").value="";
  }
  else if($("inpt_t").checked==true){
    $$(".nbpH").each(function(obj){obj.style.display="none";});
    $$(".nbpMaxi").each(function(obj){obj.style.display="none";});
    $$(".nbpG").each(function(obj){obj.style.display="none";});
    $$(".nbpT").each(function(obj){obj.style.display="block";});
    $$(".dureeG").each(function(obj){obj.style.display="none";});
    $$(".dureeH").each(function(obj){obj.style.display="block";});
    setCalendrierGeneral("gites73","1","","G","calendrierMoteurContent",clicCalendJsMenu,"inpt_dateDeb","","","lst_nbj","1","");
    $("div_Nbp").show();
    $("div_date").show();
    if($("inpt_gestheb").value) $("inpt_gestheb").value="";
    if($("inpt_label").value) $("inpt_label").value="";
    if($("lst_nbp").value=="12") $("lst_nbp").value="";
    if($("int_infotour").value=="CHALETSLOISIRS") $("int_infotour").value="";
    if($("rubVille").value=="HVILL") $("rubVille").value="";
  }
  else if($("inpt_e").checked==true){
    $("div_Nbp").hide();
    $("div_date").hide();
    if($("inpt_gestheb").value) $("inpt_gestheb").value="";
    if($("inpt_label").value) $("inpt_label").value="";
    if($("lst_nbp").value=="12") $("lst_nbp").value="";
    if($("int_infotour").value=="CHALETSLOISIRS") $("int_infotour").value="";
    if($("rubVille").value=="HVILL") $("rubVille").value="";
  }
  else if($("inpt_c").checked==true){
    $("div_Nbp").hide();
    $("div_date").hide();
    if($("inpt_gestheb").value) $("inpt_gestheb").value="";
    if($("inpt_label").value) $("inpt_label").value="";
    if($("lst_nbp").value=="12") $("lst_nbp").value="";
    if($("int_infotour").value=="CHALETSLOISIRS") $("int_infotour").value="";
    if($("rubVille").value=="HVILL") $("rubVille").value="";
  }
  else if($("inpt_ch").checked==true || $("inpt_chville").checked==true){
    $$(".nbpG").each(function(obj){obj.style.display="none";});
    $$(".nbpMaxi").each(function(obj){obj.style.display="none";});
    $$(".nbpT").each(function(obj){obj.style.display="none";});
    $$(".nbpH").each(function(obj){obj.style.display="block";});
    $$(".dureeG").each(function(obj){obj.style.display="none";});
    $$(".dureeH").each(function(obj){obj.style.display="block";});
    $("div_Nbp").show();   
    $("div_date").show();
    setCalendrierGeneral("gites73","1","","H","calendrierMoteurContent",clicCalendJsMenu,"inpt_dateDeb","","","lst_nbj","1","");    
    if($("inpt_gestheb").value) $("inpt_gestheb").value="";
    if($("inpt_label").value) $("inpt_label").value="";
    if($("lst_nbp").value=="12") $("lst_nbp").value="";
    if($("int_infotour").value=="CHALETSLOISIRS") $("int_infotour").value="";
    if($("inpt_chville").checked==true) $("rubVille").value="HVILL";
    else if($("rubVille").value=="HVILL") $("rubVille").value="";
  }
  else if($("inpt_loisir").checked==true){
    $$(".nbpH").each(function(obj){obj.style.display="none";});
    $$(".nbpMaxi").each(function(obj){obj.style.display="none";});
    $$(".nbpT").each(function(obj){obj.style.display="none";});
    $$(".nbpG").each(function(obj){obj.style.display="block";});
    $$(".dureeH").each(function(obj){obj.style.display="none";});
    $$(".dureeG").each(function(obj){obj.style.display="block";});
    setCalendrierGeneral("gites73","1","","G","calendrierMoteurContent",clicCalendJsMenu,"inpt_dateDeb","","","lst_nbj","1","");
    $("div_Nbp").show();
    $("div_date").show();
    if($("inpt_gestheb").value) $("inpt_gestheb").value="";
    if($("inpt_label").value) $("inpt_label").value="";
    if($("lst_nbp").value=="12") $("lst_nbp").value="";
    $("int_infotour").value="CHALETSLOISIRS";
    if($("rubVille").value=="HVILL") $("rubVille").value="";
  }
}
