// Verification formulaire de contact
function verifSelection() {
if (mail_form.firstname.value == "") {
alert("Entrez vore prénom SVP.")
return false
} if (mail_form.surname.value == "") {
alert("Entrez vore nom SVP.")
return false
} if (mail_form.email.value == "") {
alert("Entrez vore email SVP.")
return false
} 
if (mail_form.message.value == "") {
alert("Entrez vore message SVP.")
return false
} 

invalidChars = " /:,;'"

for (i=0; i<invalidChars.length; i++) {	// does it contain any invalid characters?
badChar = invalidChars.charAt(i)

if (mail_form.email.value.indexOf(badChar,0) > -1) {
alert("Votre adresse email contient des caractères non valides. Vérifiez SVP.")
mail_form.email.focus()
return false
}
}


atPos = mail_form.email.value.indexOf("@",1)			// there must be one "@" symbol
if (atPos == -1) {
alert('Votre adresse email ne contient pas de "@". Vérifiez SVP.')
mail_form.email.focus()
return false
}

if (mail_form.email.value.indexOf("@",atPos+1) != -1) {	// and only one "@" symbol
alert('Votre adresse email contient plus d un "@". Vérifiez SVP.')
mail_form.email.focus()
return false
}

periodPos = mail_form.email.value.indexOf(".",atPos)

if (periodPos == -1) {					// and at least one "." after the "@"
alert('Vous avez oublié le "." après le "@". Vérifiez SVP.')
mail_form.email.focus()
return false
}

if (periodPos+3 > mail_form.email.value.length)	{		// must be at least 2 characters after the 
alert('Il y a au moins 2 caractères après le "." d une adresse mail. Vérifiez SVP.')
mail_form.email.focus()
return false
}} // Fin de la fonction
