/* auteur: ML */
/* Date de création: 08/01/2010 */
function verifSelection() {

		if (mail_form.test.value != "formulaire") {
			alert("Il faut taper le mot qui est imprimé en bleu dansle texte au-dessus")
			return false
			}
		
		document.mail_form.champ1.value = document.mail_form.champ1.value.replace(/\b((href)|(url)|(URL)|(http)|(ALTER)|(DROP)|(CREATE)|(DELETE)|(SELECT)|(INSERT)|(REPLACE)|(LOAD)|(UPDATE)|(FLUSH)|(LOCK)|(SET)|(GRANT)|(REVOKE))\b/g,"***");
		if (mail_form.champ1.value == "") {
			alert("Quel est votre nom ?")
			return false
			}
		document.mail_form.champ2.value = document.mail_form.champ2.value.replace(/\b((href)|(url)|(URL)|(http)|(ALTER)|(DROP)|(CREATE)|(DELETE)|(SELECT)|(INSERT)|(REPLACE)|(LOAD)|(UPDATE)|(FLUSH)|(LOCK)|(SET)|(GRANT)|(REVOKE))\b/g,"***");
		if (mail_form.champ2.value == "") {
			alert("Quel est votre prénom ?")
			return false
			}
		document.mail_form.champ3.value = document.mail_form.champ3.value.replace(/\b((href)|(url)|(URL)|(http)|(ALTER)|(DROP)|(CREATE)|(DELETE)|(SELECT)|(INSERT)|(REPLACE)|(LOAD)|(UPDATE)|(FLUSH)|(LOCK)|(SET)|(GRANT)|(REVOKE))\b/g,"***");
		if (mail_form.champ3.value == "") {
			alert("Quelle est votre adresse ?")
			return false
			}
		document.mail_form.champ4.value = document.mail_form.champ4.value.replace(/\b((href)|(url)|(URL)|(http)|(ALTER)|(DROP)|(CREATE)|(DELETE)|(SELECT)|(INSERT)|(REPLACE)|(LOAD)|(UPDATE)|(FLUSH)|(LOCK)|(SET)|(GRANT)|(REVOKE))\b/g,"***");
		if (mail_form.champ4.value == "") {
			alert("Quel est votre code postal ?")
			return false
			}
		if (5 < mail_form.champ4.value.length)	{		// au plus 5 chiffres
			alert('Il ne doit pas y avoir plus de cinq chiffres. Veuillez vérifier.')
			return false;
			}
		document.mail_form.champ5.value = document.mail_form.champ5.value.replace(/\b((href)|(url)|(URL)|(http)|(ALTER)|(DROP)|(CREATE)|(DELETE)|(SELECT)|(INSERT)|(REPLACE)|(LOAD)|(UPDATE)|(FLUSH)|(LOCK)|(SET)|(GRANT)|(REVOKE))\b/g,"***");
		if (mail_form.champ5.value == "") {
			alert("Quelle est votre commune ?")
			return false
			}
			
		document.mail_form.zone_email.value = document.mail_form.zone_email.value.replace(/\b((href)|(url)|(URL)|(http)|(ALTER)|(DROP)|(CREATE)|(DELETE)|(SELECT)|(INSERT)|(REPLACE)|(LOAD)|(UPDATE)|(FLUSH)|(LOCK)|(SET)|(GRANT)|(REVOKE))\b/g,"***");
		if (mail_form.zone_email.value == "") {
			alert("Quelle est votre adresse mail ?")
			return false
			}
		
		document.mail_form.champ4.value = document.mail_form.champ4.value.replace(/\b((href)|(url)|(URL)|(http)|(ALTER)|(DROP)|(CREATE)|(DELETE)|(SELECT)|(INSERT)|(REPLACE)|(LOAD)|(UPDATE)|(FLUSH)|(LOCK)|(SET)|(GRANT)|(REVOKE))\b/g,"***");
				
		invalidChars = " /:,;'"
		
		for (i=0; i<invalidChars.length; i++) {	// does it contain any invalid characters?
		badChar = invalidChars.charAt(i)
		
		if (mail_form.zone_email.value.indexOf(badChar,0) > -1) {
			alert("Votre adresse e-mail contient des caractères invalides. Veuillez vérifier.")
			mail_form.zone_email.focus()
			return false
			}
		}
		
		atPos = mail_form.zone_email.value.indexOf("@",1)			// there must be one "@" symbol
			if (atPos == -1) {
			alert('Votre adresse e-mail ne contient pas le signe "@". Veuillez vérifier.')
			mail_form.zone_email.focus()
			return false
			}
		
		if (mail_form.zone_email.value.indexOf("@",atPos+1) != -1) {	// and only one "@" symbol
			alert('Il ne doit y avoir qu\'un signe "@". Veuillez vérifier.')
			mail_form.zone_email.focus()
			return false
			}
		
		periodPos = mail_form.zone_email.value.indexOf(".",atPos)
		
		if (periodPos == -1) {					// and at least one "." after the "@"
			alert('Vous avez oublié le point "." après le signe "@". Veuillez vérifier.')
			mail_form.zone_email.focus()
			return false
			}
		
		if (periodPos+3 > mail_form.zone_email.value.length)	{		// must be at least 2 characters after the 
			alert('Il doit y avoir au moins deux caractères après le signe ".". Veuillez vérifier.')
			mail_form.zone_email.focus()
			return false
			}
	} // Fin de la fonction
