function divmenu(divID,divHeight)
{
   if (!document.all){
      divHeight=divHeight+150;
   }
   var theDoc =document;
   if (divID=="menu_2" && (theDoc.getElementById("menu_2").style.height=="" || theDoc.getElementById("menu_2").style.height<"50")){
      for (i=1;i<3;i++){
         eval ("document.getElementById('menu_"+i+"').style.display='none';");
      }
      theDoc.getElementById(divID).style.display="";

      if (navigator.platform.indexOf("Mac") != 0){
         theDoc.getElementById(divID).style.height="28";
         speed = ((500/12.5)+8);
         open_it(divHeight,divID,speed)
      }
   }else{
      if (document.all){
         if (divID=="menu_1" && theDoc.getElementById("menu_2").style.height=="750px"){
            if (navigator.platform.indexOf("Mac") != 0){
               theDoc.getElementById('menu_2').style.height="750";
               speed = ((500/12.5)+8);
               open_it_2("750",'menu_2',speed)
            }
         }
      }else{
         if (divID=="menu_1" && theDoc.getElementById("menu_2").style.height=="900px"){
            if (navigator.platform.indexOf("Mac") != 0){
               theDoc.getElementById('menu_2').style.height="900";
               speed = ((500/12.5)+8);
               open_it_2("900",'menu_2',speed)
            }
         }
      }
   }
}

function open_it(max,name,hm)
{
 var theDoc = document;
 maxi = max;
 divname = name;
 act = theDoc.getElementById(divname).style.height;
 act1 = ((act.length)-2);
 act2 = act.substr(act,act1);

 if (act2>=maxi) { clearTimeout(tempoO); theDoc.getElementById(divname).style.height=maxi;  return; };

 y = ((act2-1)+hm);
 hr = hm-1;
 theDoc.getElementById(divname).style.height=(y);
 tempoO = setTimeout('open_it(maxi,divname,hr)', 2);
}

function open_it_2(max,name,hm)
{
 var theDoc = document;
 var tempoO;
 divname = name;
 act = theDoc.getElementById(divname).style.height;
 act1 = ((act.length)-2);
 act2 = act.substr(act,act1);
 if (act2<=50) {clearTimeout(tempoO); theDoc.getElementById('menu_1').style.height=28; theDoc.getElementById('menu_2').style.display='none';theDoc.getElementById('menu_1').style.display=''; return; };
 y = ((act2-1)-hm);
 hr = hm-1;
 if (y<0){
   y=0;
 }
 theDoc.getElementById(divname).style.height=(y);
 if (document.all){
   tempoO = setTimeout('open_it_2("750",divname,hr)', 2);
 }else{
   tempoO = setTimeout('open_it_2("900",divname,hr)', 2);
 }
}

function setMenu(){
   document.getElementById('menu_1').style.display="none";
   document.getElementById('menu_2').style.display="";
   if (document.all){
      document.getElementById('menu_2').style.height="750";
   }else{
      document.getElementById('menu_2').style.height="900";
   }
}


/*
  * Début fonctions pour menu recherche par date
  */
function showLabel( id ){
	document.getElementById( 'label_'+id ).style.display = 'none' ;
}

function hideLabel( id ){
	document.getElementById( 'label_'+id ).style.display = ( document.getElementById( 'date_'+id ).value != '' )? 'none' : 'block' ;
}

function submitRecherche(){
	var reg = new RegExp("^[0-9]{2}[/]{1}[0-9]{2}[/]{1}[0-9]{4}$","g");
	debut = document.getElementById( 'date_debut' ).value;
	test_debut = reg.test( debut );
	var reg = new RegExp("^[0-9]{2}[/]{1}[0-9]{2}[/]{1}[0-9]{4}$","g");
	fin = document.getElementById( 'date_fin' ).value;
	test_fin = reg.test( fin );

	if( test_debut && test_fin ){
		var docForm=document.formRechercheByDate;
		docForm.action = 'recherche.php';
		docForm.submit();
	}else{
		alert( "Le format n'est pas valide. Format valide : JJ/MM/AAAA." );
	}
}
/*
  * Fin fonctions pour menu recherche par date
  */