// JavaScript Document/* gVerifFrom */GVerifForm_log = Class.create();GVerifForm_log.prototype = {		initialize: function(conteneur,ancre,saisie,id_retour) {						this.erreur ="";			this.conteneur = $(conteneur)			this.ancre = ancre;			this.saisie = $(saisie);			this.id_retour = id_retour;			this.ligne_intro = '<span class="titre_verif_form">INFORMATIONS MAL SAISIES</span><br/><span class="intro_verif_form">Les informations suivantes sont manquantes ou erronées :</span>';			this.liste = "";			this.conteneur_verif = new Array;		},		ecrire: function(){			this.conteneur.innerHTML = "<div>" + this.ligne_intro + this.liste + "</div><div class=\"article\"><a id=\""+this.id_retour+"\" href=\"#_\" class=\"fleche\">retour</a></div>";			//this.conteneur.innerHTML = "<div>dd</div>";			this.retour = $(this.id_retour);			this.retour.onclick = this.alterner.bindAsEventListener(this);		},		alterner: function(){			switch_opacity(this.saisie.id,this.conteneur.id)		},		supprimer: function(){			this.conteneur.innerHTML = ''		},		affiche: function(){			return (this.conteneur.innerHTML == '') ? false : true		},		add:function(element){			this.conteneur_verif.push(element);		},		traitement:function(element){			var traitement = $A(this.conteneur_verif);			var liste = "";			traitement.each(function(element){				if(element.traitement()!="")				{					switch(element.type)					{						case "select":							liste += "<li>Veuillez "+element.intitule+".</li>";						break;						case "radio":							liste += "<li>Veuillez choisir un "+element.intitule+".</li>";						break;						case "condition":							liste += "<li>"+element.intitule+"</li>";						break;						default:							liste += "<li>Le champ "+element.intitule+" est"+element.traitement()+"</li>";						break;					}					element.changeStyle(true)				}			});				// si erreur			if(liste!="")			{				this.liste = "<ul>"+liste+"</ul>";				this.ecrire();				switch_opacity(this.conteneur.id,this.saisie.id)				return false			}			else			{				return true			}		}};/* /gVerifFrom *//* VerifFormTxt */VerifFormTxt_log = Class.create();VerifFormTxt_log.prototype = {	initialize: function(element,intitule,obligatoire,taille_min,taille_max,carac_autorise,type) {		this.element = $(element);		this.intitule = intitule;		this.valeur = $F(this.element);		this.obligatoire = obligatoire;		this.type=type;		this.taille_min = taille_min;		this.taille_max = (taille_max=='max') ? this.element.maxLength : taille_max;		this.regex = null;		switch (carac_autorise)		{			case "chiffre":				this.carac_autorise = "0123456789";			break;			case "nombre":				this.carac_autorise = "0123456789., -";			break;			case "date":				this.carac_autorise = "0123456789/";			break;			case "tel":				this.carac_autorise = "0123456789. -";			break;			case "alpha":				this.carac_autorise = "abcdefghijklmnopqrstuvwxyzéèêëôöîïàâäûüç";			break;			case "alphachiffre":				this.carac_autorise = "abcdefghijklmnopqrstuvwxyzéèêëôöîïàâäûüç0123456789";			break;			case "alphanombre":				this.carac_autorise = "abcdefghijklmnopqrstuvwxyzéèêëôöîïàâäûüç0123456789., -";			break;			case "alpha_2":				this.carac_autorise = "abcdefghijklmnopqrstuvwxyzéèêëôöîïàâäûüç0123456789.,- '()€$£%[]{}&=+@?!/°;:*~_’";			break;			default:				this.carac_autorise = "";			break;		}		this.type = type;	},	changeStyle: function(change){		if(change)		{			Element.addClassName(this.element,"verif_form_erreur")		}		else		{			Element.removeClassName(this.element,"verif_form_erreur")		}	},	traitement: function(){		this.changeStyle(false)		switch (this.type)		{			/* texte */			case "texte" :				return this.verification()			break;						/* email */			case "email" :				this.regex = /^[a-z0-9\._-]+@[a-z0-9_-]+\.([a-z]{2,3})$/;				return this.verification()			break;						/* date */			case "date" :				this.regex = /^([0123])([0123456789])\/([01])([0123456789])\/([012])([0123456789])([0123456789])([0123456789])$/;				return this.verification()			break;						/* defaut */			default:				return ""			break;		}	},	verification: function(){		var valeur_t = this.valeur.toLowerCase();		if (valeur_t.length==0) {			if(this.obligatoire) return " obligatoire - taille: "+this.taille_min+((this.taille_min!=this.taille_max)?" à "+this.taille_max:"")+" caractères."		}		else {			if (this.taille_min==this.taille_max&&valeur_t.length!=this.taille_min) return " de taille incorrecte - taille: "+this.taille_max+" caractères."			if (this.taille_max!=0 && valeur_t.length>this.taille_max) return " trop long - taille maximum: "+this.taille_max+" caractères."			if (valeur_t.length<this.taille_min) return " trop court - taille minimum: "+this.taille_min+" caractères."		}			if (this.carac_autorise=="") return "" // si rien à vérifier renvoi ok			for (var i=0;i<valeur_t.length;i++) {			if (this.carac_autorise.indexOf(valeur_t.charAt(i))==-1 && valeur_t.charAt(i)!="\n" && escape(valeur_t.charAt(i))!="%0D" ) {				return " mal renseigné - caractère non autorisé: "+valeur_t.charAt(i)+".";			}		}				if(this.regex != null)		{			if(!((this.regex).test(valeur_t))&&valeur_t.length!=0) {return " mal renseigné."} 		}		return ""	}};/* VerifFormTxt *//* VerifFormCondition */VerifFormCondition_log = Class.create();VerifFormCondition_log.prototype = {	initialize: function(intitule,elements) {		this.intitule = intitule;		this.type="condition";		this.elements = elements;	},	changeStyle: function(change){		if(this.elements != null)		{			for(var i = 0 ; i < this.elements.length ; i++)			{				if(change)				{					Element.addClassName(this.elements[i],"verif_form_erreur")				}				else				{					Element.removeClassName(this.elements[i],"verif_form_erreur")				}			}		}	},	traitement: function(){		return "intitule"	}};/* VerifFormCondition */function switch_opacity(bloc_a_afficher,bloc_a_desafficher){	if(!browser.isIE55)	{	new Effect.Opacity($(bloc_a_desafficher), {duration:0.5, from:1.0, to:0.0, beforeUpdate:function() {$(bloc_a_afficher).style.display="block";}, afterFinish:function(){$(bloc_a_desafficher).style.display="none";}});	new Effect.Opacity($(bloc_a_afficher), {duration:0.5, from:0.0, to:1.0});	}	else	{		$(bloc_a_desafficher).style.display="none";		$(bloc_a_afficher).style.display="block";	}	}