function changeDate(idSelect,numMois,numJour)
{

  // tables de mois et de jours
  var tabMois=new Array();
  //     tabMois[0]=new Array();

  tabMois[1]=new Array(2);
  tabMois[1][0]="janvier"; tabMois[1][1]=31;

  tabMois[2]=new Array(2);
  tabMois[2][0]="février"; tabMois[2][1]=29;

  tabMois[3]=new Array(2);
  tabMois[3][0]="mars"; tabMois[3][1]=31;

  tabMois[4]=new Array(2);
  tabMois[4][0]="avril"; tabMois[4][1]=30;

  tabMois[5]=new Array(2);
  tabMois[5][0]="mai"; tabMois[5][1]=31;

  tabMois[6]=new Array(2);
  tabMois[6][0]="juin"; tabMois[6][1]=30;

  tabMois[7]=new Array(2);
  tabMois[7][0]="juillet"; tabMois[7][1]=31;

  tabMois[8]=new Array(2);
  tabMois[8][0]="août"; tabMois[8][1]=31;

  tabMois[9]=new Array(2);
  tabMois[9][0]="septembre"; tabMois[9][1]=30;

  tabMois[10]=new Array(2);
  tabMois[10][0]="octobre"; tabMois[10][1]=31;

  tabMois[11]=new Array(2);
  tabMois[11][0]="novembre"; tabMois[11][1]=30;

  tabMois[12]=new Array(2);
  tabMois[12][0]="décembre"; tabMois[12][1]=31;

  
  // construction de la chaîne à remplacer dans le SELECT
  var chaineSelect="<select name=\""+idSelect+"\" id=\""+idSelect+"\">\n";

  var i=0;

  //     var valNumMois=parseInt(numMois);
  var valNumMois=numMois/1;

  var joursDansMois=tabMois[valNumMois][1];

  var selectCourant=0;


  
  // cas où le jour ne convient pas : on remet au premier du mois
  if (numJour != undefined)
  {
    // 	    selectCourant=parseInt(numJour);
    selectCourant=numJour/1;
  }
  else
  {
    if (selectCourant > joursDansMois || document.getElementById(idSelect).options.length == 0)
    {
      selectCourant=1;
    }
    else
    {
      selectCourant=(document.getElementById(idSelect).options[document.getElementById(idSelect).selectedIndex].value)/1;
    }
  }



  while (i<joursDansMois)
  {
    i++;

    if (chaineSelect == "a") chaineSelect="";

    // 	    chaineSelect+="<option value=\""+i+"\"";
    var chaineTemp="<option value=\""+i+"\"";


    // on met le selected si c'est le bon jour
    if (i == selectCourant)
    {
      // 		    chaineSelect+=" selected";
      chaineTemp+=" selected";
    }

    // 	    chaineSelect+=">"+i+"</option>\n"; // selected 
    chaineTemp+=">"+i+"</option>\n";

    chaineSelect+=chaineTemp;
  }

  chaineSelect+="</select>";

  // réécriture du SELECT
  document.getElementById("span_"+idSelect).innerHTML = chaineSelect;

}

/**
* Initialisation des dates pour les statiques
*/
function initDates()
{
  // récup du disabled
  // var disabled1=document.getElementById('jour_debut_location').disabled;
  // var disabled2=document.getElementById('jour_fin_location').disabled;
  //document.getElementById("mois_debut_location").selectedIndex=2;
  //document.getElementById("mois_fin_location").selectedIndex=12;
  changeDate('jour_debut_location','1','1');
  changeDate('jour_fin_location','12','31');

  document.getElementById('mois_debut_location').selectedIndex=0;
  document.getElementById('mois_fin_location').selectedIndex=11;
  
  // màj des disabled
  // document.getElementById('jour_debut_location').disabled=disabled1;
  // document.getElementById('jour_fin_location').disabled=disabled2;
}

