		function aller_a(adress) {
			window.open(adress,'_blank','toolbar=1, location=1, directories=1, status=1, scrollbars=1, resizable=1, copyhistory=0, menuBar=1, width=800, height=600,left='+((screen.width - 800)/2)+',top='+((screen.height - 600)/2));
		}
		
		function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v;}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// Verifie si une date siaie est valide

function verifDate(f,nom) {
	
	annee = eval('document.forms[0].annee_'+nom+'.options[document.forms[0].annee_'+nom+'.selectedIndex].value');
	mois = eval('document.forms[0].mois_'+nom+'.options[document.forms[0].mois_'+nom+'.selectedIndex].value');
	les_jours = eval('document.forms[0].jour_'+nom);

	if( (mois == 02) || (mois == 04) || (mois == 06) || (mois == 09) || (mois == 11) ){
		les_jours.options[31].value = "";
		les_jours.options[31].text = "--";
	}
	else{
		les_jours.options[31].value = "31";
		les_jours.options[31].text = "31";
	}

	if(mois == 02){
		les_jours.options[30].value = "";
		les_jours.options[30].text = "--";
	}
	else{
		les_jours.options[30].value = "30";
		les_jours.options[30].text = "30";
	}

	if((annee % 4) == 0){
		les_jours.options[29].value = "29";
		les_jours.options[29].text = "29";
	}
	else{
		if(mois == 02){
			les_jours.options[29].value = "";
			les_jours.options[29].text = "--";
		}
		else{
			les_jours.options[29].value = "29";
			les_jours.options[29].text = "29";
		}
	}
	
}


function date_complete(f, nom) {
	var returnValue = true;
	if (eval("f.jour_"+ nom +".options[f.jour_"+ nom +".selectedIndex].value==''")) {
		returnValue = false;
	}
	if (eval("f.mois_"+ nom +".options[f.mois_"+ nom +".selectedIndex].value==''")) {
		returnValue = false;
	}
	if (eval("f.annee_"+ nom +".options[f.annee_"+ nom +".selectedIndex].value==''")) {
		returnValue = false;
	}
	return returnValue;
}

function verif_date2(f,nom) {
	
	annee = eval(f+'.annee_'+nom+'.options['+f+'.annee_'+nom+'.selectedIndex].value');
	mois = eval(f+'.mois_'+nom+'.options['+f+'.mois_'+nom+'.selectedIndex].value');
	les_jours = eval(f+'.jour_'+nom);

	if( (mois == 02) || (mois == 04) || (mois == 06) || (mois == 09) || (mois == 11) ){
		les_jours.options[31].value = "";
		les_jours.options[31].text = "--";
	}
	else{
		les_jours.options[31].value = "31";
		les_jours.options[31].text = "31";
	}


	if(mois == 02){
		les_jours.options[30].value = "";
		les_jours.options[30].text = "--";
	}
	else{
		les_jours.options[30].value = "30";
		les_jours.options[30].text = "30";
	}

	if((annee % 4) == 0){
		les_jours.options[29].value = "29";
		les_jours.options[29].text = "29";
	}
	else{
		if(mois == 02){
			les_jours.options[29].value = "";
			les_jours.options[29].text = "--";
		}
		else{
			les_jours.options[29].value = "29";
			les_jours.options[29].text = "29";
		}
	}
	
}

function exist_date(f,nom,message){
	annee = eval(f+'.annee_'+nom);
	mois = eval(f+'.mois_'+nom);
	jour = eval(f+'.jour_'+nom);
	ok=0;
	if (jour.options[jour.selectedIndex].text=="--"){
		alert(message);
		jour.focus();
		ok=1;
	}
	if (mois.options[mois.selectedIndex].text=="--"){
		alert(message);
		mois.focus();
		ok=1;
	}
	if (annee.options[annee.selectedIndex].text=="--"){
		alert(message);
		annee.focus();
		ok=1;
	}
	return ok;
	
	
}

function verif_champ_text(f,nom,message){
	annee = eval('document.forms[0].annee_'+nom);
	mois = eval('document.forms[0].mois_'+nom);
	jour = eval('document.forms[0].jour_'+nom);
	ok=0;
	if (jour.options[jour.selectedIndex].text=="--"){
		alert(message);
		jour.focus();
		ok=1;
	}
	if (mois.options[mois.selectedIndex].text=="--"){
		alert(message);
		mois.focus();
		ok=1;
	}
	if (annee.options[annee.selectedIndex].text=="--"){
		alert(message);
		annee.focus();
		ok=1;
	}
	return ok;
	
	
}



function verif_nombre(zone_texte){
		if (isNaN(zone_texte.value)) {
			return false;
		}
	return true;
}

function vide_blanc(obj_ch)
{
if (obj_ch.value.length==1) {
	 	i=obj_ch.value.length;
} else {
 		i=obj_ch.value.length-1;
}


 nb=0;

 while ( (obj_ch.value.charAt(i) ==" ") && (i>0) )
 {
 nb++;
 i--; 
 }
 if(i>0) 
 obj_ch.value= obj_ch.value.substring(0,obj_ch.value.length-nb);
 else obj_ch.value=""
 
 i=0;
 nb=obj_ch.value.length;
 
 while ( (obj_ch.value.charAt(i) ==" ") && (i<nb) )
 {
 i++; 
 }
 if(i<nb) 
 obj_ch.value= obj_ch.value.substring(i,obj_ch.value.length);
 else obj_ch.value=""
}


function ReplaceWord(str) {
	//"'" + "." + "-" +"-" + "-" + "-" + "E" + "-" + "," + "f" + "," + "-" + "-" + "^" + "%" + "S" + "<" + "-" + "-" + "Z" + "-" + "-" + "'" + "'" + "'" + "-" + "~" + " " + "s" + ">" + "-" + "z" + "Y" + " " + "	 " + " " + " "  + " " + " " + " " + " "  + " " + " "  + " " + " " + " " + " " + " " + " "  + " " + " " + " " + " " + " "  + " " + " " + " " + " " + " "  + " " + " " + " " + " " 
	var ms = "-" + "	 " + " " + " "  + " " + " " + " " + " "  + " " + " "  + " " + " " + " " + " " + " " + " "  + " " + " " + " " + " " + " "  + " " + " " + " " + " " + " "  + " " + " " + " " + " " 
	var msi = 0
	var i,c,rs,ts 
	while (msi < ms.length) {
		c = ms.charAt(msi)
		rs = ms.substring(++msi, msi +1)
		msi += 1
		i = 0
		while (true) { 
			i = str.indexOf(c, i)
			if (i == -1) break
			ts = str.substring(0, i)
			str = ts + rs + str.substring(++i, str.length)
		}
	}
	return str
}





// Fonction JavaScript qui transforme les carateres ascii dont le code > 128 en code html
function HtmlCode(str)
{
        i = 0;
        while (i < str.length)
        {
                ascii = str.charCodeAt(i);
                if (ascii > 128)
                        str = str.substring(0, i) + '&#' + ascii + ';' + str.substring(i+1, str.length);
          i++;
        }
        return ReplaceWord(str);
}

//Encode en HTML touts les champs d'un formaulaire
//en utilisant la fonction HtmlCode ci-dessus
function FormHTMLEncode(formulaire) {
    for (fhe_i=0; fhe_i<formulaire.elements.length; fhe_i++) {
       if (formulaire.elements[fhe_i].type!="select-one") {
          formulaire.elements[fhe_i].value = HtmlCode(formulaire.elements[fhe_i].value);
       }
       else {
          for (fhe_j=0; fhe_j<formulaire.elements[fhe_i].options.length; fhe_j++) {
               formulaire.elements[fhe_i].options[fhe_j].value = HtmlCode(formulaire.elements[fhe_i].options[fhe_j].value);
          }
      }
   }
}


function ShowHides(div)
{
	if (div=="comm")
	{
   	document.getElementById("comm").style.visibility="visible";
	document.getElementById("ind").style.visibility="hidden";
	
	document.getElementById("tdgblanc").className = "tdgblanc";
	document.getElementById("tdcblanc").className = "tdcblanc";
	document.getElementById("tddblanc").className = "tddblanc";
	
	document.getElementById("tdggris").className = "tdggris";
	document.getElementById("tdcgris").className = "tdcgris";
	document.getElementById("tddgris").className = "tddgris";
	}
	else
	{
	document.getElementById("ind").style.visibility="visible";
	document.getElementById("comm").style.visibility="hidden";
	
	document.getElementById("tdggris").className = "tdgblanc";
	document.getElementById("tdcgris").className = "tdcblanc";
	document.getElementById("tddgris").className = "tddblanc";
	
	document.getElementById("tdgblanc").className = "tdggris";
	document.getElementById("tdcblanc").className = "tdcgris";
	document.getElementById("tddblanc").className = "tddgris";

	}
}

function visible(thingId)
{
	var targetElement;
	targetElement = document.getElementById(thingId) ;
	targetElement.style.display = "" ;
}

function masque(thingId)
{
	var targetElement;
	targetElement = document.getElementById(thingId) ;
	targetElement.style.display = "none" ;
}

function visible_masque(id1,id2)
{
	var targetElement;
	targetElement = document.getElementById(id1) ;
	targetElement.style.display = "" ;
	targetElement = document.getElementById(id2) ;
	targetElement.style.display = "none" ;
}
	


