/*----------------------------------------------------------------------------
    This file is part of thewebmaster.fr

    Copyright (c) 2007 Alain Debaiffe.

    url: http://www.thewebmaster.fr

    All rights reserved.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with the script; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

------------------------------------------------------------------------------*/


function verif_submit(){
	var verif = document.contact;

	//nom
	if(verif.nom.value == "")
	{alert("Veuillez mettre un sujet");return(false);}
	//prenom
	if(verif.prenom.value == "")
	{alert("Veuillez mettre un prénom");return(false);}
	//telephone
	if (verif.telephone.value != "") {
		if(verif.telephone.value.length != 10)
		{alert("Le téléphone requiert 10 chiffres");return(false);}
	}
	//mobile
	if (verif.mobile.value != "") {
		if(verif.mobile.value.length != 10)
		{alert("Le mobile requiert 10 chiffres");return(false);}
	}
	//Mail
	if(verif.mail.value == "")
	{alert("Veuillez indiquer votre e-mail");return(false);}
	if(verif.mail.value.search(/ /)!='-1')
	{alert('Une adresse e-mail ne peut contenir un espace !');return(false);}
	if(verif.mail.value.search(';')!='-1')
	{alert('Une adresse e-mail ne peut contenir un point virgule !');return(false);}
	s=verif.mail.value.split(/@/);
	if((s.length != 2) || s[0] == '' || s[1] == '')
	{alert('Une adresse e-mail doit avoir le format "Utilisateur@Domain.com",\n');return(false);}

return(true);
}