function e(emailStr) {
	var checkTLD=1;
	var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
	var emailPat=/^(.+)@(.+)$/;
	var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
	var validChars="\[^\\s" + specialChars + "\]";
	var quotedUser="(\"[^\"]*\")";
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
	var atom=validChars + '+';
	var word="(" + atom + "|" + quotedUser + ")";
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
	var matchArray=emailStr.match(emailPat);
	if(matchArray==null){alert("Votre email est incorrect");return false;}	
	var user=matchArray[1];
	var domain=matchArray[2];
	for(i=0; i<user.length; i++){if(user.charCodeAt(i)>127){alert("Votre email est incorrect");return false;}}
	for(i=0; i<domain.length; i++){if(domain.charCodeAt(i)>127){alert("Votre email est incorrect");return false;}}
	if (user.match(userPat)==null){alert("Le nom d'utilisateur ne semble pas valide.");return false;}
	var IPArray=domain.match(ipDomainPat);
	if(IPArray!=null){for(var i=1;i<=4;i++){if(IPArray[i]>255){alert("L'adresse IP est invalide !");return false;}}return true;}
	var atomPat=new RegExp("^" + atom + "$");
	var domArr=domain.split(".");
	var len=domArr.length;
	for(i=0;i<len;i++){if(domArr[i].search(atomPat)==-1){alert("Le nom de domaine, de votre email,\n ne semble pas correct.");return false;}}
	if(checkTLD&&domArr[domArr.length-1].length!=2 && domArr[domArr.length-1].search(knownDomsPat)==-1){alert("Votre email doit finir avec un domaine connu.");return false;}
	if(len<2){alert("Il manque le nom de domaine a votre email !");return false;}
	return true;
}
function g(v,t){if(v.value.length<1){v.focus();alert(t);return true;}else{return false}}
function l(t)
{
	if (!e(t.pm_email.value)){t.pm_email.focus();return false;}
	if (g(t.pm_password,"Merci d'entrer votre mot de passe.")) return false;
	return true;
}
function i(t)
{
	if (!e(t.pm_email.value)){t.pm_email.focus();return false;}
	if(!confirm('Acceptez-vous nos conditions général ?')) return false;
	return true;
}
function o(t)
{
	if (!e(t.pm_email.value)){t.pm_email.focus();return false;}
	return true;
}
function ci(t)
{
	if (g(t.pm_nom,"Merci d'entrer votre nom")) return false;
	if (g(t.pm_prenom,"Merci d'entrer votre prénom")) return false;
	if (g(t.pm_code_postal,"Merci d'entrer votre code postal")) return false;
	return true;
}
function cp(t)
{
	if (g(t.pm_password,"Merci d'entrer votre mot de passe.")) return false;
	if(t.pm_password.value.length<3){t.pm_password.focus();alert("Votre mot de passe doit contenir au moins 3 caractères."); return false;}
	return true;
}
