/* -------------- */
/*                */
/* MENU DEROULANT */
/*                */
/* -------------- */

window.onload=montre;
function montre(id) {
var d = document.getElementById(id);
for (var i = 1; i<=10; i++) {
if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
}
if (d) {d.style.display='block';}
}

/* --------------------- */
/*                       */
/* FORMULAIRE DE CONTACT */
/*                       */
/* --------------------- */

function verifSelection() {if (document.mail_form.champ1.value == "") {
alert("Le nom de votre société est obligatoire")
return false
} if (document.mail_form.champ2.value == "") {
alert("Votre civilité est obligatoire")
return false
} if (document.mail_form.champ3.value == "") {
alert("Votre nom est obligatoire")
return false
} if (document.mail_form.zone_email.value == "") {
alert("Votre adresse eMail est obligatoire")
return false
}

invalidChars = " /:,;'"

for (i=0; i<invalidChars.length; i++) {	// does it contain any invalid characters?
badChar = invalidChars.charAt(i)

if (document.mail_form.zone_email.value.indexOf(badChar,0) > -1) {
alert("Votre adresse e-mail contient des caractères invalides. Veuillez vérifier.")
document.mail_form.zone_email.focus()
return false
}
}

atPos = document.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.')
document.mail_form.zone_email.focus()
return false
}

if (document.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.')
document.mail_form.zone_email.focus()
return false
}

periodPos = document.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.')
document.mail_form.zone_email.focus()
return false
}

if (periodPos+3 > document.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.')
document.mail_form.zone_email.focus()
return false
}if (document.mail_form.zone_texte.value == "") {
alert("Vous avez oublié de saisir votre message !")
return false
} } // Fin de la fonction
