/*
#########################################################
#	Nom 			:	plongeursdusud.com				#
#	Page			:	controles.js					#
#	Création 		:	07/02/2004						#
#	Auteur 			:	Marc Guillaume					#
#	Statut 			:	GNU/GPL							#
#	Version 		:	0.0.1							#
#														#
#	Modifications 	:					 				#
#                       								#
#	Editeur			:	Quanta Plus Linux				#
#########################################################

/*
		Copyright (c)  2004 Marc GUILLAUME
		Permission is granted to copy, distribute and/or modify this document
		under the terms of the GNU Free Documentation License, Version 1.2
		or any later version published by the Free Software Foundation;
		with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
		A copy of the license is included in the file entitled "licence".

                                  ,,,
                                 /'~'\
                                ( 0 0 )
+---------------------------oOOO--(_)--OOOo----------------------------+

marc.guillaume@yakati.org         °   Oooo.
                              oooO    (   )
+----------------------------(   )-----) /----------------------------+
                              \ (     (_/
                               \_)

*/


function controle_saisie(formu){
	var regMail=/^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$/;
    var mail_existe=true;
	var mail_ok=true;
	var question_ok=true;

	if(formu.mail.value ==""){
    	mail_existe=false;
	}
	else if(!regMail.test(formu.mail.value)){
    	mail_ok=false;
	}

	if(formu.question.value==""){
    	question_ok=false;
	}

	if(mail_ok && question_ok){
		return true;
	}
	else if(!mail_existe){
		alert("L'adresse mail est obligatoire.");
		return false;
	}
	else if(!mail_ok){
    	alert("Vous devez saisir une adresse mail valide.");
		return false;
	}
	else if(!question_ok){
        alert("Vous devez obligatoirement poser une question.");
		return false;
	}
}