// JavaScript Document

// test visiteur
function validate() {

        if ( document.frmcontact.firstname.value == "" ) {
                alert("Entrez votre prénom SVP!!!")
                document.frmcontact.firstname.focus();
                return false;
         }
		 
		 if ( document.frmcontact.lastname.value == "" ) {
                alert("Entrez votre nom SVP!!!")
                document.frmcontact.lastname.focus();
                return false;
         }
		 
        if ( document.frmcontact.job.value == "" ) {
                alert("Entrez Votre fonction SVP!!!")
                document.frmcontact.job.focus();
                return false;
         }

		if ( document.frmcontact.email.value == "" ) {
                alert("Entrez votre email SVP!!!")
                document.frmcontact.email.focus();
                return false;

         }

		
	   var validate=/^.+@.+\..{2,3}$/;

	   if (!validate.test(frmcontact.email.value))
		{	alert("Entrez un email valide");
			document.frmcontact.email.focus() 
			document.frmcontact.email.select()
			return false;
		}	
	    
        return true;
}


//test exposant
function validatexposant() {

        if ( document.frmExposant.raison.value == "" ) {
                alert("Entrez votre Raison sociale SVP!!!")
                document.frmExposant.raison.focus();
                return false;
         }
		 
		 if ( document.frmExposant.ville.value == "" ) {
                alert("Entrez votre ville SVP!!!")
                document.frmExposant.ville.focus();
                return false;
         }
		 
        if ( document.frmExposant.pays.value == "" ) {
                alert("Entrez Votre pays SVP!!!")
                document.frmExposant.pays.focus();
                return false;
         }
		 
        if ( document.frmExposant.tel.value == "" ) {
                alert("Entrez Votre numéro de téléphone SVP!!!")
                document.frmExposant.tel.focus();
                return false;
         }
		 
		if ( document.frmExposant.email2.value == "" ) {
                alert("Entrez votre email personnel SVP!!!")
                document.frmExposant.email2.focus();
                return false;

         }

	   var validate_exposant=/^.+@.+\..{2,3}$/;

	   if (!validate_exposant.test(frmExposant.email1.value))
		{	alert("Entrez un email valide");
			document.frmExposant.email1.focus() 
			document.frmExposant.email1.select()
			return false;
		}	
	    
		if ( document.frmExposant.resp_stand.value == "" ) {
                alert("Entrez le nom du responsable SVP!!!")
                document.frmExposant.resp_stand.focus();
                return false;

         }
		 
		 if ( document.frmExposant.nom_societe1.value == "" ) {
                alert("Entrez le nom du Co-exposant1 SVP!!!")
                document.frmExposant.nom_societe1.focus();
                return false;
         }
		 
		  
		 if ( document.frmExposant.nom_societe2.value == "" ) {
                alert("Entrez le nom du Co-exposant2 SVP!!!")
                document.frmExposant.nom_societe2.focus();
                return false;
         }
		 
		if ( document.frmExposant.espacenu.checked == false ) {
                alert("Choisissez votre Espace nu SVP!!!")
                return false;
         }
		 
		 if ( document.frmExposant.type_prdt.value == "" ) {
                alert("Entrez votre activité SVP!!!")
                document.frmExposant.type_prdt.focus();
                return false;
         }
		
		
		//fonction
		ln=0;
		result=false;
		ref=document.forms['frmExposant'];
		
		for (i=0; i<ref.fonction.length; i++)

		{

			if (ref.fonction[i].checked) 

			{

				result=true;

				ln=ln+1

				//break;

			}

		}
		
		if(ln<3){
          
		  alert("Cochez au moins 3 Fonctions SVP !");
		   return false;

		}


		
      //fin fonction
	  if (!document.frmExposant.condition.checked) {
                alert("Acceptez les conditions de participation SVP!!!")
                return false;
         }
	  
		
        return true;
}


// test exposant
function validExp() {

        if ( document.frmExp.nom.value == "" ) {
                alert("Entrez votre nom SVP!!!");
                document.frmExp.nom.focus();
                return false;
         }
		 
		 if ( document.frmExp.prenom.value == "" ) {
                alert("Entrez votre prenom SVP!!!");
                document.frmExp.prenom.focus();
                return false;
         }
		 
        if ( document.frmExp.societe.value == "" ) {
                alert("Entrez Votre societe SVP!!!");
                document.frmExp.societe.focus();
                return false;
         }

		if ( document.frmExp.email.value == "" ) {
                alert("Entrez votre email SVP!!!");
                document.frmExp.email.focus();
                return false;

         }

		
	   var valid=/^.+@.+\..{2,3}$/;

	   if (!valid.test(frmExp.email.value))
		{	alert("Entrez un email valide");
			document.frmExp.email.focus();
			document.frmExp.email.select();
			return false;
		}	
		
		if ( document.frmExp.pays.value == "" ) {
                alert("Entrez votre pays SVP!!!");
                document.frmExp.pays.focus();
                return false;

         }
		
	    if ( document.frmExp.ville.value == "" ) {
                alert("Entrez votre ville SVP!!!");
                document.frmExp.ville.focus();
                return false;

         }
		 
		 if ( document.frmExp.tel.value == "" ) {
                alert("Entrez votre telephone SVP!!!");
                document.frmExp.tel.focus();
                return false;

         }
		
        return true;
}

