// JavaScript Document
<!-- 
function verifString(txt,lettres) {
	validity = true;
	for (var i=0 ; i<(txt.length) ; i++) {
		validity_char = false;
		for (var j=0 ; j<(lettres.length) ; j++) {
			if ( txt.charAt(i) == lettres.charAt(j))
			validity_char = true;
		}
		if ( validity_char == false)
		validity = false;
	}
	return validity;
}

function validate_mail(elt)
{
// Verification de l'email			
	var validity = true; 
	var test = false;
	mail = elt.value.toLowerCase();
	if (mail == "")
		return true;
	// si fin de boucle sur 1 alors c'est pas bo
	for (var i=1 ; i<(mail.length) ; i++) {
		// on va jusqu'a l'arobase
		if (mail.charAt(i)=='@') { 
			// on s'assure qu'il y a des caracteres apres
			if (i<(mail.length-4)){ 
				for (var j = i + 2 ; j<(mail.length-2) ; j++) { 
					// on s'assure qu'il y a un point apres l'arobase
					if (mail.charAt(j)=='.')
						// on verifie que l'extension compte entre 2 et 4 caracteres
						if ((j+1<mail.length) && (String(mail.substring(j+1,mail.length)).length<5))
							test = true; 
					} 
				} 
			} 
		} 

	validity = verifString(mail,'abcdefghijklmnopqrstuvwxyz.@0123456789-_');
	if ((!test) || (!validity))
	{
		alert("L'adresse e-mail est incorrecte");
		return false;
	}
	else
		return true;
}
-->