﻿function verif(frm)
				{
					
							

if (frm.nom.value=="")
{				
	alert("Entrez votre nom");
	//errorProcess(frm.nom);
	frm.nom.focus();
	return false;
}


if (frm.cp.value=="")
{				
	alert("Entrez le code postal de votre ville");
	//errorProcess(frm.cp);
	frm.cp.focus();
	return false;
}

if (frm.ville.value=="")
{				
	alert("Entrez le nom de votre ville");
	//errorProcess(frm.ville);
	frm.ville.focus();
	return false;
}

if (frm.tel.value=="")
{				
	alert("Entrez votre numéro de téléphone");
	//errorProcess(frm.tel);
	frm.tel.focus();
	return false;
}

if (frm.enfant.value=="")
{				
	alert("Entrez votre nombre d'enfants");
	//errorProcess(frm.nom);
	frm.enfant.focus();
	return false;
}
if (frm.age.value=="")
{				
	alert("Entrez l'âge de vos enfants");
	//errorProcess(frm.nom);
	frm.age.focus();
	return false;
}


if (frm.message.value=="")
{				
	alert("Entrez votre message");
	//errorProcess(frm.message);
	frm.message.focus();
	return false;
}	

if (frm.email.value=="")
{				
	alert("Votre email est obligatoire");
	frm.email.focus();
	return false;
}
else
{
	if (!echeckemail(frm.email.value))
	{				
		alert("Votre email est incorrect");
		//errorProcess(frm.email);
		frm.email.focus();
		return false;
	}

}
return true;
}
				
function echeckemail(str) {

var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)
if (str.indexOf(at)==-1){
   return false
}
if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
   return false
}

if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
    return false
}

 if (str.indexOf(at,(lat+1))!=-1){
    return false
 }

 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
    return false
 }

 if (str.indexOf(dot,(lat+2))==-1){
    return false
 }

 if (str.indexOf(" ")!=-1){
    return false
 }


 return true					
}

