var chiffre="0123456789"
var nombre = chiffre+"., "
var alpha = "abcdefghijklmnopqrstuvwxyzéèêëôöîïàâäûüç"
var alphanum= alpha+chiffre
var alphanom= alpha+nombre
var alphanom1= alphanom+"- '()€$£%[]{}&=+@?!/°;:*~_’"



// fonction qui affiche les infos invalides du formulaire
function display_show_verif(ob) {if(navigator.appName=="Microsoft Internet Explorer"){getOb(ob).style.display = "block"}else{getOb(ob).style.display = "table-row"} }
function verif_email(dc,facu,min,max,car_vald) {
	// Renvoi une chaine vide si ok, sinon retourne l'erreur
	var unemail = /^((\w+(\-\w+)*)*\.?(\w+(\-\w+)*))+@((\w+(\-\w+)*)*\.(\w+(\-\w+)*))+$/;
	dc = dc.toLowerCase()
	if (dc.length==0) {
		if(!facu) return " obligatoire - taille: "+min+((min!=max)?" à "+max:"")+" caractères."
	}
	else {
		if (dc.length>max) return " trop long - taille maximum: "+max+" caractères."
		if (dc.length<min) return " trop court - taille minimum: "+min+" caractères."
		if (min==max&&dc.length!=min) return " de taille incorrecte - taille: "+max+" caractères."
	}

	if (car_vald=="") return "" // si rien à vérifier renvoi ok

	for (var i=0;i<dc.length;i++) {
		if (car_vald.indexOf(dc.charAt(i))==-1 ) return " mal renseigné - caractère non autorisé: "+dc.charAt(i)+".";
		
	}
	if(!unemail.test(dc)&&dc.length!=0) {return " mal renseigné"} 
	
	return ""
}






function verif_chp(dc,facu,min,max,car_vald) {
	// Renvoi une chaine vide si ok, sinon retourne l'erreur
	dc = dc.toLowerCase()
	if (dc.length==0) {
		if(!facu) return " obligatoire - taille: "+min+((min!=max)?" à "+max:"")+" caractères"
	}
	else {
		if (dc.length>max) return " trop long - taille maximum: "+max+" caractères"
		if (dc.length<min) return " trop court - taille minimum: "+min+" caractères"
		if (min==max&&dc.length!=min) return " de taille incorrecte - taille: "+max+" caractères"
	}

	if (car_vald=="") return "" // si rien à vérifier renvoi ok

	for (var i=0;i<dc.length;i++) {
		if (car_vald.indexOf(dc.charAt(i))==-1 && dc.charAt(i)!="\n" && escape(dc.charAt(i))!="%0D" ) {
			return " mal renseigné - caractère/es non autorisé/és: "//+dc.charAt(i)
		}
	}
	return ""
}



function getChp(f,c) { return eval("document."+f+".elements['"+c+"']") }

function getChptxt(f,c) { return getChp(f,c).value}
function getSelect(f,c) { return eval("document."+f+"."+c+".value")}

function setChptxt(f,c,t) { return getChp(f,c).value=t }

function surbr(o,etat) {
	o.style.backgroundColor=(etat)?"#498DBE":"white"
	o.style.color=(etat)?"white":"black"
	/*o.style.borderTopColor=(etat)?"#003399":"#003399"
	o.style.borderLeftColor=(etat)?"#003399":"#003399"
	o.style.borderBottomStyle="solid"
	o.style.borderRightStyle="solid"
	o.style.borderBottomWidth="1px"
	o.style.borderRightWidth="1px"
	o.style.borderRightColor=(etat)?"#003399":"#003399"
	o.style.borderBottomColor=(etat)?"#003399":"#003399"*/
}

function err(s1,s2) { return "Le champ [ "+s1+" ] est"+s2+"\n" }











