function UTIL_showHideLayers() {
  var i,p,v,obj,args=UTIL_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=UTIL_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='block')?'block':(v='none')?'none':v; }
    obj.display=v; }
}  

function MM_findObj2(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj2(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function retour_message() {
document.formulaire.Submit.value="Veuillez patienter ....";
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj2(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') {
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('Champs non renseignes ou incorrects! ');
  document.MM_returnValue = (errors == '');
}
function UTIL_findObj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=UTIL_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
var tablou=new Array;
tablou[1]="off";
tablou[2]="off";
tablou[3]="off";
tablou[4]="off";
tablou[5]="off";
/*tablou[6]="off";
tablou[7]="off";
tablou[8]="off";
tablou[9]="off";*/

var tablou_ss=new Array;
tablou_ss[1]="off";
tablou_ss[2]="off";
tablou_ss[3]="off";
tablou_ss[4]="off";
tablou_ss[5]="off";
/*tablou_ss[6]="off";
tablou_ss[7]="off";
tablou_ss[8]="off";
tablou_ss[9]="off";
tablou_ss[10]="off";*/

function affiche_menu(n) { 
  var p;
  p='menu_contenu_'+n;
  
  if (tablou[n]=="off") {
  UTIL_showHideLayers('menu_contenu_'+n,'','block');
  document.images['img_menu_'+n].src="/images/arrow_bottom.gif";
  tablou[n]="on";
  }
  else{
  UTIL_showHideLayers('menu_contenu_'+n,'','none');
  document.images['img_menu_'+n].src="/images/arrow_right.gif";
  tablou[n]="off";
  }
}
function affiche_ss_menu(n) { 
  var p;
  p='menu_ss_contenu_'+n;
  
  if (tablou_ss[n]=="off") {
  UTIL_showHideLayers('menu_ss_contenu_'+n,'','block');
  tablou_ss[n]="on";
  }
  else{
  UTIL_showHideLayers('menu_ss_contenu_'+n,'','none');
  tablou_ss[n]="off";
  }
}

function disp_delai(annee,mois,jour,heure,min){
//document.forms[0].elements[0].value=delai (2010,1,1,0,0);
document.getElementById('compteur').innerHTML=delai (annee,mois,jour,heure,min);
setTimeout("disp_delai("+annee+","+mois+","+jour+","+heure+","+min+")",1000);
}
function delai(annee,mois,jour,heure,min)
{var date_fin=new Date(annee,mois-1,jour,heure,min)
var date_jour=new Date();
var tps=(date_fin.getTime()-date_jour.getTime())/1000;
var j=Math.floor(tps/3600/24); // récupere le nb de jour
tps=tps % (3600*24);
var h=Math.floor(tps / 3600); // recupère le nb d'heure
tps=tps % 3600;
var m=Math.floor(tps/60); // récupère le nb minute
tps=tps % 60
var s=Math.floor(tps);
var txt=j+" j "+h+" h<br>"+m+" min et "+s+" sec";
date_fin=don_date(date_fin);

if(0>tps) { tps=0-tps; d='-'; } else { d=''; }
//var txt=d+((j<10)?'0':'')+j+' j '+d+((h<10)?'0':'')+h+' h '+d+((m<10)?'0':'')+m+' min et '+d+((s<10)?'0':'')+s+' sec';
var txt=d+j+' j '+d+((h<10)?'0':'')+h+' h<br>'+d+((m<10)?'0':'')+m+' min et '+d+((s<10)?'0':'')+s+' sec';

return txt;}

function don_date_jour()
{var date_jour=new Date();
date_jour=don_date(date_jour);
return date_jour;}

function don_date(une_date)
{var la_date;
var months=new Array(12);
months[1]="Janvier";
months[2]="Février";
months[3]="Mars";
months[4]="Avril";
months[5]="Mai";
months[6]="Juin";
months[7]="Juillet";
months[8]="Aout";
months[9]="Septembre";
months[10]="Octobre";
months[11]="Novembre";
months[12]="Décembre";
var days=new Array(7);
days[1]="Lundi";
days[2]="Mardi";
days[3]="Mercredi";
days[4]="Jeudi";
days[5]="Vendredi";
days[6]="Samedi";
days[7]="Dimanche";
var month=months[une_date.getMonth() + 1];
var day=days[une_date.getDay()];
var date=une_date.getDate();
var year=une_date.getYear();
}