<!--

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_showHideLayers() { //v3.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 VerifEmail(adresse)
{
//	adresse = formulaire.adresse_email.value;
	var place = adresse.indexOf("@",1);
	var point = adresse.indexOf(".",place+1);
	if ((place > -1)&&(adresse.length >2)&&(point > 1))
	{ return(true);	}
	else
	{return(false);	}
}

function jour()
{
// cette fonction passe l'an 2000 et est valable jusqu'en 2080
var now = new Date();
var dayNames = new Array("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi");
var monthNames = new Array("Janvier","F&eacute;vrier","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre");
var date_en_toute_lettre = new String();
var Old_annee = new String();
var annee = new String();

Old_annee ="" + now.getYear();
deb=Old_annee.length-2
annee=Old_annee.substring(deb,deb+2);

if (eval(annee)<80) { annee="20" + annee; } else { annee="19" + annee; } date_en_toute_lettre=dayNames[now.getDay()] + " " + now.getDate() + " " + monthNames[now.getMonth()] + " "+annee; return date_en_toute_lettre; 
} 


function test_fiel(champ, cat)
{
	var longueur =  champ.length;
	var message = "" ;
	if ( cat == "cp" && longueue != 5)
	{
		
	}
}


function verifieMail(email) 
{
	if (email == "") { return true ; }
	var aroba = email.indexOf("@");
	//test si @ est présent
	//si il n'est pas présent, l'adresse n'est pas valide
	if (aroba == -1) 
	{
	  alert("L'adresse email n'est pas valide...\nIl n'y a pas de caractère @\nUne adresse mail valide est du type \"adresse@domaine.com\"");
	  return false;
	}
	//vérifie si il y a un . après @ et qu'il ne se trouve pas juste derrière ("adresse@.com" non valide)
	var point = email.indexOf(".", aroba);
	if ((point == -1) || (point == (aroba + 1))) 
	{
	  alert("L'adresse email n'est pas valide...\nIl ne peut pas y avoir un point (.) juste après @\nUne adresse mail valide est du type \"adresse@domaine.com\"");
	  return false;
	}
	//vérifie si il y a au moins 1 caractère après le point
	//point + 1 car indexOf commence à 0.
	//Si l'index est 4 et la longueur de la chaîne 5, erreur
	var point = email.lastIndexOf(".");
	if ((point + 1) == email.length) 
	{
	  alert("L'adresse email n'est pas valide...\nL'adresse mail ne peut pas finir par un point (.)\nUne adresse mail valide est du type \"adresse@domaine.com\"");
	  return false;
	}
	//vérifie s'il n'y a pas deux . qui se suivent
	point = email.indexOf("..")
	if (point != -1) 
	{
	  alert("L'adresse email n'est pas valide...\nL'adresse mail ne peut pas contenir 2 points (.) qui se suivent.\nUne adresse mail valide est du type \"adresse@domaine.com\"");
	  return false;
	 }
     return true;
}

/* -------------------------------------------- 
			bloque/grise un champs txt
--------------------------------------------  */



function lock_text(object)
{
	object.disabled=true ;
//	object.value="" ;
	object.style.background = "#E0E0E0"; // grise

}

/* ----------------------------------------------- 
			debloque/degrise un champs txt
-----------------------------------------------  */

function unlock_text(object)
{
	object.disabled=false ;  // empeche d'ecrire 
	object.style.background = "#FFFAEF"; // jaune

}

/* ----------------------------------------------- 
		Efface la valeur d'un champ texte
-----------------------------------------------  */
function erase(object)
{
	object.value = "" ;
}



function verif_obligatoire(object,alpha ,message) 
{
// alpha : numeric, date ...
// type : text, checkbox, radiobutton, select, textarea
	if (object.type == "text" && object.value == "")
	{ 	}
}




//DHTML Window script- Copyright Dynamic Drive (http://www.dynamicdrive.com)
//For full source code, documentation, and terms of usage,
//Visit http://www.dynamicdrive.com/dynamicindex9/dhtmlwindow.htm

var dragapproved=false
var minrestore=0
var initialwidth,initialheight
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all

function iecompattest(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function drag_drop(e){
if (ie5&&dragapproved&&event.button==1){
document.getElementById("dwindow").style.left=tempx+event.clientX-offsetx+"px"
document.getElementById("dwindow").style.top=tempy+event.clientY-offsety+"px"
}
else if (ns6&&dragapproved){
document.getElementById("dwindow").style.left=tempx+e.clientX-offsetx+"px"
document.getElementById("dwindow").style.top=tempy+e.clientY-offsety+"px"
}
}

function initializedrag(e){
offsetx=ie5? event.clientX : e.clientX
offsety=ie5? event.clientY : e.clientY
document.getElementById("dwindowcontent").style.display="none" //extra
tempx=parseInt(document.getElementById("dwindow").style.left)
tempy=parseInt(document.getElementById("dwindow").style.top)

dragapproved=true
document.getElementById("dwindow").onmousemove=drag_drop
}

function loadwindow(url,width,height){
if (!ie5&&!ns6)
window.open(url,"","width=width,height=height,scrollbars=1")
else{
document.getElementById("dwindow").style.display=''
document.getElementById("dwindow").style.width=initialwidth=width+"px"
document.getElementById("dwindow").style.height=initialheight=height+"px"
document.getElementById("dwindow").style.left="30px"
document.getElementById("dwindow").style.top=ns6? window.pageYOffset*1+30+"px" : iecompattest().scrollTop*1+30+"px"
document.getElementById("cframe").src=url
}
}

function maximize(){
if (minrestore==0){
minrestore=1 //maximize window
document.getElementById("maxname").setAttribute("src","restore.gif")
document.getElementById("dwindow").style.width=ns6? window.innerWidth-20+"px" : iecompattest().clientWidth+"px"
document.getElementById("dwindow").style.height=ns6? window.innerHeight-20+"px" : iecompattest().clientHeight+"px"
}
else{
minrestore=0 //restore window
document.getElementById("maxname").setAttribute("src","max.gif")
document.getElementById("dwindow").style.width=initialwidth
document.getElementById("dwindow").style.height=initialheight
}
document.getElementById("dwindow").style.left=ns6? window.pageXOffset+"px" : iecompattest().scrollLeft+"px"
document.getElementById("dwindow").style.top=ns6? window.pageYOffset+"px" : iecompattest().scrollTop+"px"
}

function closeit(){
document.getElementById("dwindow").style.display="none"
}

function stopdrag(){
dragapproved=false;
document.getElementById("dwindow").onmousemove=null;
document.getElementById("dwindowcontent").style.display="" //extra
}


// -->
