<!--

	// Affichage d'une boite d'alerte proposant le choix oui/non avec un message en parametre
 	function confirmationAlert(url,msg)
 	{
   		res = confirm(msg);
   		if(res) document.location.href = url;
   	}

   	function openWin(url, largeur, hauteur ,param, nom){
			if(document.all) { 
				var x = (screen.width-largeur)/2;
				var y = (screen.height-hauteur)/2; 
			}else {
				var x=100; var y=100; 
			}
			window.open(url,nom,param+(param!="" ? "," : "")+"width="+largeur+",height="+hauteur+",left="+x+",top="+y);
		}
   	
   	
   	// Fonction de mise en surbrillance d'un ligne ( ex : cas d'une lise )
   	function surbrillanceON(ligne, classe)
    	{
    		ligne.className = classe;
   	}

   	// Fonction de désavtivation de la surbrillance d'un ligne ( ex : cas d'une lise )
   	function surbrillanceOFF(ligne, classe)
   	{
   		ligne.className = classe;
   	}

   	// Fonction de séléction en surbrillance d'un ligne ( ex : cas d'une lise )
   	function surbrillanceSel(ligne, colorSel)
   	{
   		var nb_cell=ligne.cells.length;
          	for(var c=0; c < nb_cell; c++)
          	{
          		if(ligne.cells[c].className== colorSel)
	    		{
	    			ligne.cells[c].className= '';// Déséléction ligne
	    		}else{
	    			ligne.cells[c].className=colorSel;// Séléction ligne
	    		}
          	}
   	}


var obj_bloc = 0;

// Cette fonction permet de vérifier la validité d'une date au format jj/mm/aa ou jj/mm/aaaa
function isDate(obj)  {
 	if(obj_bloc == obj || obj_bloc == 0){
	  	var ok = 1;
	  	var d = obj.value;

	  	if (d == ""){ // si la variable est vide on retourne vrai
	    	obj_bloc = 0;
	    	return true;
	    }

	  	e = new RegExp("^[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{4}$");
	  	if (!e.test(d)) // On teste l'expression régulière pour valider la forme de la date
	    	ok = 0; // Si pas bon, retourne faux

		// On sépare la date en 3 variables pour vérification, parseInt() converti du texte en entier
	  	j = parseInt(d.split("/")[0], 10); // jour
	  	m = parseInt(d.split("/")[1], 10); // mois
	  	a = parseInt(d.split("/")[2], 10); // année

	  	// Si l'année n'est composée que de 2 chiffres on complète automatiquement
	  	if (a < 1000) {
	    	if (a < 89)  a+=2000; // Si a < 89 alors on ajoute 2000 sinon on ajoute 1900
	    	else a+=1900;
	  	}
	  	// Définition du dernier jour de février
	  	// Année bissextile si annnée divisible par 4 et que ce n'est pas un siècle, ou bien si divisible par 400
	  	if (a%4 == 0 && a%100 !=0 || a%400 == 0) fev = 29;
	  	else fev = 28;

	  	// Nombre de jours pour chaque mois
	  	nbJours = new Array(31,fev,31,30,31,30,31,31,30,31,30,31);

	  	// Enfin, retourne vrai si le jour est bien entre 1 et le bon nombre de jours, idem pour les mois, sinon retourn faux
	  	if(!( m >= 1 && m <=12 && j >= 1 && j <= nbJours[m-1] ))
	  		ok = 0;

	 	if(ok != 1){
			obj_bloc = obj;
			alert("Le format de la date est incorrect, veuillez le modifier.");
			return false;
		}
		else{
			obj_bloc = 0;
			return true;
		}
	}
	else
		return true;
}

// Cette fonction permet de vérifier la validité d'une heure au format hh:mm
function isHeure(obj) {
	if(obj_bloc == obj || obj_bloc == 0){
	  	var ok = 1;
	  	var h = obj.value;

	  	if (h == ""){ // si la variable est vide on retourne vrai
	    	obj_bloc = 0;
	    	return true;
	    }

		E = new RegExp("^[0-9]{1,2}:[0-9]{2}$");
	  	if (!E.test(h)) // On teste l'expression régulière pour valider la forme de la date
	    	ok = 0; // Si pas bon, retourne faux

	 	if(ok != 1){
			obj_bloc = obj;
			alert("Le format de l'heure est incorrect, veuillez le modifier.");
			return false;
		}
		else{
			obj_bloc = 0;
			return true;
		}
	 }
	else
		return true;
}
function Deplacercritere(form, de, vers) {

  if (document.forms[form].elements[de].options.selectedIndex >= 0) {
    	while (document.forms[form].elements[de].options.selectedIndex >= 0) {
	      	ind = document.forms[form].elements[de].options.selectedIndex;
	      	texte  = document.forms[form].elements[de].options[ind].text;
	      	valeur = document.forms[form].elements[de].options[ind].value;
        	document.forms[form].elements[de].options[ind] = null;
      		var user = new Option(texte, valeur);
      		lg = document.forms[form].elements[vers].options.length;
      		document.forms[form].elements[vers].options[lg] = user;
    	}
  } else {
    	alert("Aucun critère sélectionné !");
  }
  return(false);
  
}
	 
function Selectionnercritere(listeDeplacer) {
  for(i=0; i< listeDeplacer.length; i++){
  	form=listeDeplacer[i][0];
  	de=listeDeplacer[i][1];
  	vers=listeDeplacer[i][2];
		  lg = document.forms[form].elements[de].options.length;
		  for (cpt = 0; cpt < lg; cpt++) {
		    document.forms[form].elements[de].options[cpt].selected = true;
		  }
		  lg = document.forms[form].elements[vers].options.length;
		  for (cpt = 0; cpt < lg; cpt++) {
		    document.forms[form].elements[vers].options[cpt].selected = true;
		  }
 }
  return( true );
}

//vars et fct spécifique à l'affichage de l'heure
var Compteur = null; 
var CompteurTourne = false;
function DemarreHorloge () {
  if(CompteurTourne)
  clearTimeout(Compteur);
  CompteurTourne = false;
  AfficheTemps();
}

function AfficheTemps () {
  var Temps = new Date();
  var TempsLocal = Temps.getTime()+ (Temps.getTimezoneOffset()-60)*60;
  var Maintenant = new Date(TempsLocal);
  var Heure = " " + Maintenant.getHours();
  var minutes = Maintenant.getMinutes();
  var secondes = Maintenant.getSeconds();
  Heure += ((minutes < 10) ? ":0" : ":") + minutes;
  Heure += ((secondes < 10) ? ":0" : ":") + secondes;
  if(document.getElementById('FenetreHeure') ) document.getElementById('FenetreHeure').innerHTML = "<b>"+Heure+"</b>";
  Compteur = setTimeout("AfficheTemps()",1000);
  CompteurTourne = true;
}

function ChangeBouton(id, chemin, btn){
	x=id.substring(id.length-1,id.length);//type d'action
	elt =id.substring(0,id.length-1);// nom de l'élément
	if(x=='V'){
		//mouse Over
		document.getElementById('btnG'+elt).background= chemin+'/img/bouton/'+btn+'G2.gif';
		document.getElementById('btnM'+elt).background= chemin+'/img/bouton/'+btn+'M2.gif';
		document.getElementById('btnD'+elt).background= chemin+'/img/bouton/'+btn+'D2.gif';
	}
	if(x=='T'){
		//mouse Out
		document.getElementById('btnG'+elt).background= chemin+'/img/bouton/'+btn+'G.gif';
		document.getElementById('btnM'+elt).background= chemin+'/img/bouton/'+btn+'M.gif';
		document.getElementById('btnD'+elt).background= chemin+'/img/bouton/'+btn+'D.gif';
	}
}

function PopupImage(img, titre) {
	w = open("",'image','width=400,height=400,toolbar=no,scrollbars=no,resizable=yes'); 
	w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
	w.document.write("<SCRIPT language=javascript>function checksize()  { if (document.images[0].complete) {  window.resizeTo(document.images[0].width+12,document.images[0].height+30); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
	w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><IMG src='"+img+"' border=0>");
	w.document.write("");
	w.document.write("</BODY></HTML>");
	w.document.close();
}

function PopupImage_pos(img, titre, input_x, input_y, curseur) {
	w=open("",'image','width=400,height=400,toolbar=no,scrollbars=no,resizable=yes');	
	w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD> \n");
	w.document.write("<SCRIPT language=javascript>function checksize()  { if (document.images[0].complete) {  window.resizeTo(document.images[0].width+12,document.images[0].height+60); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>  \n");
	w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0> \n");
	w.document.write("<IMG src='"+img+"' border=0  \n");
	w.document.write("onclick='javascript:var f=window.event;document.getElementById(\"Layer0\").style.top=f.y-(document.icone.height/2);   \n");
	w.document.write("         document.getElementById(\"Layer0\").style.left=f.x-(document.icone.width/2);   \n");
	w.document.write("         eval (\"window.opener."+input_x+".value=f.x - (document.icone.width/2)\"); \n");
	w.document.write("         eval (\"window.opener."+input_y+".value=f.y - (document.icone.height/2)\"); '> \n");
	w.document.write("<DIV id='Layer0' style='position: absolute; left: "+eval(input_x+'.value')+"px; top: "+eval(input_y+'.value')+"px; z-index:1 '> \n");
	w.document.write("<IMG name='icone' SRC='"+curseur+"' border='0'> \n");
	w.document.write("</DIV>  \n");
	w.document.write("<center><button type='custom'  onclick='window.close()'>Fermer</button></center> \n");
	w.document.write(" \n");
	w.document.write("</BODY></HTML> \n");
	w.document.close();
}


function verifiermail(mail) {
  if ((mail.indexOf("@")>=0)&&(mail.indexOf(".")>=0)) {
     return true
  } else {
    return false
  }
}

//attention liste de fcts du WEB :

function testNews(monForm, nomEmail, nvlleFenetre){
		var retour = true;
		if(!verifiermail(monForm.elements[nomEmail].value)){
			retour = false;
			alert("Veuillez saisir un email valide");
		}else{
			window.open('"+monForm.action+"', nvlleFenetre, 'height=200,width=400,scrollbars=no, toolbars=no');
			monForm.target=nvlleFenetre;
		}
		return retour;
	}

function message() { 
	sms = window.open("","sms","toolbar=no,status=no,directories=no,menubar=no,location=no,scrollbars=no,resizable=no,left=5,top=5,width=610,height=520");

	if( self.focus ) sms.focus(); 
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_findObj(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_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_setTextOfTextfield(objName,x,newText) { //v3.0
  var obj = MM_findObj(objName); if (obj) obj.value = newText;
}

function YY_checkform() { //v4.66
//copyright (c)1998,2002 Yaromat.com
  var args = YY_checkform.arguments; var myDot=true; var myV=''; var myErr='';var addErr=false;var myReq;
  for (var i=1; i<args.length;i=i+4){
    if (args[i+1].charAt(0)=='#'){myReq=true; args[i+1]=args[i+1].substring(1);}else{myReq=false}
    var myObj = MM_findObj(args[i].replace(/\[\d+\]/ig,""));
    myV=myObj.value;
    if (myObj.type=='text'||myObj.type=='password'||myObj.type=='hidden'){
      if (myReq&&myObj.value.length==0){addErr=true}
      if ((myV.length>0)&&(args[i+2]==1)){ //fromto
        var myMa=args[i+1].split('_');if(isNaN(myV)||myV<myMa[0]/1||myV > myMa[1]/1){addErr=true}
      } else if ((myV.length>0)&&(args[i+2]==2)){
          var rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-z]{2,4}$");if(!rx.test(myV))addErr=true;
      } else if ((myV.length>0)&&(args[i+2]==3)){ // date
        var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);
        if(myAt){
          var myD=(myAt[myMa[1]])?myAt[myMa[1]]:1; var myM=myAt[myMa[2]]-1; var myY=myAt[myMa[3]];
          var myDate=new Date(myY,myM,myD);
          if(myDate.getFullYear()!=myY||myDate.getDate()!=myD||myDate.getMonth()!=myM){addErr=true};
        }else{addErr=true}
      } else if ((myV.length>0)&&(args[i+2]==4)){ // time
        var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);if(!myAt){addErr=true}
      } else if (myV.length>0&&args[i+2]==5){ // check this 2
            var myObj1 = MM_findObj(args[i+1].replace(/\[\d+\]/ig,""));
            if(myObj1.length)myObj1=myObj1[args[i+1].replace(/(.*\[)|(\].*)/ig,"")];
            if(!myObj1.checked){addErr=true}
      } else if (myV.length>0&&args[i+2]==6){ // the same
            var myObj1 = MM_findObj(args[i+1]);
            if(myV!=myObj1.value){addErr=true}
      }
    } else
    if (!myObj.type&&myObj.length>0&&myObj[0].type=='radio'){
          var myTest = args[i].match(/(.*)\[(\d+)\].*/i);
          var myObj1=(myObj.length>1)?myObj[myTest[2]]:myObj;
      if (args[i+2]==1&&myObj1&&myObj1.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
      if (args[i+2]==2){
        var myDot=false;
        for(var j=0;j<myObj.length;j++){myDot=myDot||myObj[j].checked}
        if(!myDot){myErr+='* ' +args[i+3]+'\n'}
      }
    } else if (myObj.type=='checkbox'){
      if(args[i+2]==1&&myObj.checked==false){addErr=true}
      if(args[i+2]==2&&myObj.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
    } else if (myObj.type=='select-one'||myObj.type=='select-multiple'){
      if(args[i+2]==1&&myObj.selectedIndex/1==0){addErr=true}
    }else if (myObj.type=='textarea'){
      if(myV.length<args[i+1]){addErr=true}
    }
    if (addErr){myErr+='* '+args[i+3]+'\n'; addErr=false}
  }
  if (myErr!=''){alert('The required information is incomplete or contains errors:\t\t\t\t\t\n\n'+myErr)}
  document.MM_returnValue = (myErr=='');
}function YY_checkform() { //v4.71
//copyright (c)1998,2002 Yaromat.com
  var a=YY_checkform.arguments,oo=true,v='',s='',err=false,r,o,at,o1,t,i,j,ma,rx,cd,cm,cy,dte,at;
  for (i=1; i<a.length;i=i+4){
    if (a[i+1].charAt(0)=='#'){r=true; a[i+1]=a[i+1].substring(1);}else{r=false}
    o=MM_findObj(a[i].replace(/\[\d+\]/ig,""));
    o1=MM_findObj(a[i+1].replace(/\[\d+\]/ig,""));
    v=o.value;t=a[i+2];
    if (o.type=='text'||o.type=='password'||o.type=='hidden'){
      if (r&&v.length==0){err=true}
      if (v.length>0)
      if (t==1){ //fromto
        ma=a[i+1].split('_');if(isNaN(v)||v<ma[0]/1||v > ma[1]/1){err=true}
      } else if (t==2){
        rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-zA-Z]{2,4}$");if(!rx.test(v))err=true;
      } else if (t==3){ // date
        ma=a[i+1].split("#");at=v.match(ma[0]);
        if(at){
          cd=(at[ma[1]])?at[ma[1]]:1;cm=at[ma[2]]-1;cy=at[ma[3]];
          dte=new Date(cy,cm,cd);
          if(dte.getFullYear()!=cy||dte.getDate()!=cd||dte.getMonth()!=cm){err=true};
        }else{err=true}
      } else if (t==4){ // time
        ma=a[i+1].split("#");at=v.match(ma[0]);if(!at){err=true}
      } else if (t==5){ // check this 2
            if(o1.length)o1=o1[a[i+1].replace(/(.*\[)|(\].*)/ig,"")];
            if(!o1.checked){err=true}
      } else if (t==6){ // the same
            if(v!=MM_findObj(a[i+1]).value){err=true}
      }
    } else
    if (!o.type&&o.length>0&&o[0].type=='radio'){
          at = a[i].match(/(.*)\[(\d+)\].*/i);
          o2=(o.length>1)?o[at[2]]:o;
      if (t==1&&o2&&o2.checked&&o1&&o1.value.length/1==0){err=true}
      if (t==2){
        oo=false;
        for(j=0;j<o.length;j++){oo=oo||o[j].checked}
        if(!oo){s+='* '+a[i+3]+'\n'}
      }
    } else if (o.type=='checkbox'){
      if((t==1&&o.checked==false)||(t==2&&o.checked&&o1&&o1.value.length/1==0)){err=true}
    } else if (o.type=='select-one'||o.type=='select-multiple'){
      if(t==1&&o.selectedIndex/1==0){err=true}
    }else if (o.type=='textarea'){
      if(v.length<a[i+1]){err=true}
    }
    if (err){s+='* '+a[i+3]+'\n'; err=false}
  }
  if (s!=''){alert('The required information is incomplete or contains errors:\t\t\t\t\t\n\n'+s)}
  document.MM_returnValue = (s=='');
}



-->