//document.write("<meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE8\"/>");

//document.write("<script src=js/all.js></script>");
//document.write("<script src=js/prototype.effects.js></script>");
document.write("<script src=/js/menu_haut_2012_01.js></script>");
document.write("<script src=/js/calendarview.js></script>");

// pour moteur de rechercher
function format_date(ma_date)
{
	var format = /^(\d{1,2}-){2}\d{4}$/;
	if(!format.test(ma_date))
		document.frm_moteur_recherche.DEB.value = "0";
  if (ma_date == 'date d\'arrivée (JJ-MM-AAAA)')
  {
    document.frm_moteur_recherche.DEB.value = "0";
  }
}


function format_nbj(nombre_jour,type_location)
{
  if (nombre_jour == '0' && type_location == "G")
  {
    document.frm_moteur_recherche.nbj.value = "7";
  }
  
  if (nombre_jour == '0' && type_location == "H")
  {
    document.frm_moteur_recherche.nbj.value = "1";
  }
}

function change_nbj(type_location)
{
  if (type_location == 'H')
  {
      document.getElementById('a_plus_criteres').href="/date?ACC=H";
      
      var val_nbj = new Array();
      val_nbj[0] = new Array("0")
      val_nbj[1] = new Array("1")
      val_nbj[2] = new Array("2")
      val_nbj[3] = new Array("3")
      val_nbj[4] = new Array("4")
      val_nbj[5] = new Array("5")
      
      var lbl_nbj = new Array();
      lbl_nbj[0] = new Array("indifférent")
      lbl_nbj[1] = new Array("1 nuit")
      lbl_nbj[2] = new Array("2 nuits")
      lbl_nbj[3] = new Array("3 nuits")
      lbl_nbj[4] = new Array("4 nuits")
      lbl_nbj[5] = new Array("5 nuits")
  
      document.frm_moteur_recherche.nbj.options.length = val_nbj.length;
      for (i=0;i<val_nbj.length;i++)
        {
        document.frm_moteur_recherche.nbj.options[i].value = val_nbj[i];
        document.frm_moteur_recherche.nbj.options[i].text = lbl_nbj[i];
        }
      document.frm_moteur_recherche.nbj.options.selectedIndex = 0;    
      
  }
  
  if (type_location == 'G')
  {
    document.getElementById('a_plus_criteres').href="/date?ACC=G";
    
    var val_nbj = new Array();
    val_nbj[0] = new Array("0")
    val_nbj[1] = new Array("7")
    val_nbj[2] = new Array("14")
    val_nbj[3] = new Array("21")
    val_nbj[4] = new Array("28")
    
    var lbl_nbj = new Array();
    lbl_nbj[0] = new Array("indifférent")
    lbl_nbj[1] = new Array("1 semaine")
    lbl_nbj[2] = new Array("2 semaines")
    lbl_nbj[3] = new Array("3 semaines")
    lbl_nbj[4] = new Array("4 semaines et +")

    document.frm_moteur_recherche.nbj.options.length = val_nbj.length;
    for (i=0;i<val_nbj.length;i++)
      {
      document.frm_moteur_recherche.nbj.options[i].value = val_nbj[i];
      document.frm_moteur_recherche.nbj.options[i].text = lbl_nbj[i];
      }
    document.frm_moteur_recherche.nbj.options.selectedIndex = 0;  
  }
}

function change_table(type_location)
{
  if (type_location == 'H')
  {

     document.getElementById('form_div_tab').style.display="block";
  }
  else
  {
     document.getElementById('form_div_tab').style.display="none";
  }
}


