/* Fonction gestionDownload - gestion des formulaires dMessage */
function gestion_download(mode)
{
var error=0;
    /*Envoi du formulaire de contact*/
                      if(mode=='contact'){
					  
                      	/* vérification du nom. On vérifie que le champ n'est pas vide */
                      	 if (document.contactForm.nom.value=="")
                      	 { alert("Veuillez entrer votre nom");
                      		document.contactForm.nom.focus();
                      		error=1;
                      		return false;
                      	 } 
						
                      	 
                      	 if (document.contactForm.email.value=="")
                      	 { alert("Veuillez entrer une adresse e-mail valide");
                      		document.contactForm.email.focus();
                      		error=1;
                      		return false;
                      	 } 
                      	
                      	if(document.contactForm.email.value != "") 
                      	{	if(document.contactForm.email.value.indexOf('@') == -1) {
                         		alert("Veuillez verifier votre adresse e-mail");
                         		document.contactForm.email.focus();
                      		error=1;
                         		return false;}
                        	}
                      
						if(document.contactForm.message.value==""){
                         		alert("Veuillez saisir votre message");
                         		document.contactForm.message.focus();
								error=1;
                         		return false;
                        	}
					  
                      	if(error==0)
                      	{
                      		//window.open("DDesktop/DDSetup.exe","Telechargement","");
                      		document.contactForm.action="thanks.php";
                      		//document.contactForm.target="_self";
                      		document.contactForm.target=window.open('thanks.php','mywindow','width=566,height=350,toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,copyhistory=no,resizable=no').name;
                      		document.contactForm.submit();
                      	}
                      }
/*Fin envoi du formulaire de contact*/


  /*Envoi du formulaire d'achat*/
                      if(mode=='buy'){
                      	/* vérification du nom. On vérifie que le champ n'est pas vide */
                      	 if (document.buyForm.nom.value=="")
                      	 { alert("Veuillez entrer votre nom");
                      		document.buyForm.nom.focus();
                      		error=1;
                      		return false;
                      	 } 
                      	 
                      	 if (document.buyForm.email.value=="")
                      	 { alert("Veuillez entrer une adresse e-mail valide");
                      		document.buyForm.email.focus();
                      		error=1;
                      		return false;
                      	 } 
                      	
                      	if(document.buyForm.email.value != "") 
                      	{	if(document.buyForm.email.value.indexOf('@') == -1) {
                         		alert("Veuillez verifier votre adresse e-mail");
                         		document.buyForm.email.focus();
                      		error=1;
                         		return false;}
						}
						
						if(!(document.buyForm.nbPostes[0].checked || document.buyForm.nbPostes[1].checked || document.buyForm.nbPostes[2].checked 
						|| document.buyForm.nbPostes[3].checked || document.buyForm.nbPostes[4].checked))
						{   alert("Veuillez preciser le nombre de postes concernes");
                         		document.buyForm.nbPostes.focus();
                      		error=1;
                         		return false;
						}
					  
                      	if(error==0)
                      	{
                      		//window.open("DDesktop/DDSetup.exe","Telechargement","");
                      		document.buyForm.action="thanks_buy.php";
                      		//document.contactForm.target="_self";
                      		document.buyForm.target=window.open('thanks_buy.php','mywindow','width=566,height=350,toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,copyhistory=no,resizable=no').name;
                      		document.buyForm.submit();
                      	}
                      }
/*Fin envoi du formulaire d'achat*/

/*Envoi du formulaire call me back*/
                      if(mode=='call'){
					  
                      	/* vérification du nom. On vérifie que le champ n'est pas vide */
                      	 if (document.callForm.nom.value=="")
                      	 { alert("Veuillez entrer votre nom");
                      		document.callForm.nom.focus();
                      		error=1;
                      		return false;
                      	 } 
                      	 
                      	 if (document.callForm.tel.value=="")
                      	 { alert("Veuillez entrer votre numero de telephone");
                      		document.callForm.tel.focus();
                      		error=1;
                      		return false;
                      	 } 

						 
						  if (document.callForm.date.value=="")
                      	 { alert("Veuillez entrer la date a laquelle vous souhaitez etre rappele");
                      		document.callForm.date.focus();
                      		error=1;
                      		return false;
                      	 } 
						 
						  if (!(document.callForm.heure[1].selected || document.callForm.heure[2].selected))
                      	 { alert("Veuillez selectionner la plage horaire a laquelle vous souhaitez etre rappele");
                      		document.callForm.heure.focus();
                      		error=1;
                      		return false;
                      	 } 
						 
						
						if(!(document.callForm.nbPostes[0].checked || document.callForm.nbPostes[1].checked || document.callForm.nbPostes[2].checked 
						|| document.callForm.nbPostes[3].checked || document.callForm.nbPostes[4].checked))
						{   alert("Veuillez preciser le nombre de postes concernes");
                         		document.callForm.nbPostes.focus();
                      		error=1;
                         		return false;
						}
					  
                      	if(error==0)
                      	{
                      		//window.open("DDesktop/DDSetup.exe","Telechargement","");
                      		document.callForm.action="thanks_call.php";
                      		//document.contactForm.target="_self";
                      		document.callForm.target=window.open('thanks_call.php','mywindow','width=566,height=350,toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,copyhistory=no,resizable=no').name;
                      		document.callForm.submit();
                      	}
                      }
/*Fin envoi du formulaire call me back*/
                      
/*Envoi du sondage*/
                      if(mode=='sondage'){
                      		//window.open("DDesktop/DDSetup.exe","Telechargement","");
                      		
                          document.sondageForm.action="thanks_sondage.php";
                      		document.sondageForm.target=window.open('thanks_sondage.php','mywindow','width=566,height=350,toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,copyhistory=no,resizable=no').name;
                      		sondageForm.submit();
   
                      }
                      
/*Fin Envoi du sondage*/

/*Envoi ŕ un ami*/
                      if(mode=='friend'){
                    		//window.open("DDesktop/DDSetup.exe","Telechargement","");
                    		if (document.friendForm.mail_source.value=="")
                    	       { 
                            alert("Veuillez entrer votre adresse mail");
                  		      document.friendForm.mail_source.focus();
                  		      error=1;
                  		      return false;
                  	       } 
                  	 
							if(document.friendForm.mail_source.value != "") 
                  	       {	
                            if(document.friendForm.mail_source.value.indexOf('@') == -1) 
                                {
                     		          alert("Veuillez verifier votre adresse e-mail");
                     		          document.friendForm.mail_source.focus();
                  		            error=1;
                     		          return false;
                                }
                    	     }	
                       
                  	if (document.friendForm.mail_target.value=="")
                  	       { 
                            alert("Veuillez entrer l'adresse de votre destinataire");
                  		      document.friendForm.mail_target.focus();
                  		      error=1;
                  		      return false;
                  	       } 
              	 
                  	if(document.friendForm.mail_target.value != "") 
                  	       {	
                            if(document.friendForm.mail_target.value.indexOf('@') == -1) {
                     		    alert("Veuillez verifier votre adresse e-mail");
                     		    document.friendForm.mail_target.focus();
                  		      error=1;
                     		    return false;
                             }
                    	     }	 
                    	
                    if (document.friendForm.title.value=="")
                  	 { 
                      document.friendForm.title.value='dMessage';
                  		document.friendForm.mail_source.focus();
                  		error=1;
                  		return false; }
                    	
                  	if (document.friendForm.message.value=="")
                  	 { 
                      alert("Veuillez indiquer votre message");
                  		document.friendForm.message.focus();
                  		error=1;
                  		return false;
                  	 }  	
                    	
                    	
                  		document.friendForm.action="sent.php";
                  		document.friendForm.target="_self";
                  		friendForm.submit();  
                   }
/*Fin envoi ŕ un ami*/


/*Téléchargement*/
                      if(mode=='download'){
                      	/* vérification du nom. On vérifie que le champ n'est pas vide */
                      	 if (document.downloadForm.nom.value=="")
                      	 { alert("Veuillez entrer votre nom");
                      		document.downloadForm.nom.focus();
                      		error=1;
                      		return false;
                      	 } 
                      	 
						  if (document.downloadForm.societe.value=="")
                      	 { alert("Veuillez entrer le nom de votre societe")
                      		document.downloadForm.societe.focus();
                      		error=1;
                      		return false;
                      	 }
						 
						 
                      	 if (document.downloadForm.email.value=="")
                      	 { alert("Veuillez entrer une adresse e-mail valide")
                      		document.downloadForm.email.focus();
                      		error=1;
                      		return false;
                      	 } 
                      	
						if(!(document.downloadForm.nbPostes[0].checked || document.downloadForm.nbPostes[1].checked || document.downloadForm.nbPostes[2].checked 
						|| document.downloadForm.nbPostes[3].checked || document.downloadForm.nbPostes[4].checked))
						{   alert("Veuillez preciser le nombre de postes concernes");
                      		error=1;
                         		return false;
						}
						
						
                      	if(document.downloadForm.email.value != "") 
                      	{	if(document.downloadForm.email.value.indexOf('@') == -1) {
                         		alert("Veuillez verifier votre adresse e-mail");
                         		document.downloadForm.email.focus();
                      		error=1;
                         		return false;}
                        	}

                      	if(error==0)
                      	{
                      		document.downloadForm.action="thanks_download.php";
                      		//document.downloadForm.target="_self";
                      		
                      		document.downloadForm.target=window.open('thanks_download.php','mywindow','width=566,height=350,toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,copyhistory=no,resizable=no').name;
                      		
							document.downloadForm.submit();
							document.downloadForm.target=window.close();
                      	}
                      }
/*Fin téléchargement*/

}
function maximize()
{
	window.moveTo(0,0);
	window.resizeTo(screen.width,screen.height);
}


