function verif_coor(source,source2,source3,source4,source5,source6,source7,source8,source9)
//-------------------------------------------------------------------------------------------------------------------
//-- Utilisation ; exemple
//--<form  method="post" nom="..." action="..."
//--      onSubmit="return verif_coor(this.nom,this.prenom,this.email)">
//---------------------------------------------------------------------------------------------------------------------------------
{


        if (source.value.length == 0){
                alert ("Un champ obligatoire n'a pas été saisi");
                source.focus();
                return false;
        }
       if (source2.value.length == 0){
                alert ("Un champ obligatoire n'a pas été saisi");
                source2.focus();
                return false;
        }
      if (source3 && source3.value.length == 0){
                alert ("Un champ obligatoire n'a pas été saisi");
                source3.focus();
                return false;
        }
        if (source4 && source4.value.length == 0){
                alert ("Un champ obligatoire n'a pas été saisi");
                source4.focus();
                return false;
        }
        if (source5 && source5.value.length == 0){
                alert ("Un champ obligatoire n'a pas été saisi");
                source5.focus();
                return false;
        }
       if (source6 && source6.value.length == 0){
                alert ("Un champ obligatoire n'a pas été saisi");
                source6.focus();
                return false;
        }
        if (source7 && source7.value.length == 0){
                alert ("Un champ obligatoire n'a pas été saisi");
                source7.focus();
                return false;
        }
        if (source8 && source8.value.length == 0){
                alert ("Un champ obligatoire n'a pas été saisi");
                source8.focus();
                return false;
        }
        if (source9 && source9.value.length == 0){
                alert ("Un champ obligatoire n'a pas été saisi");
                source9.focus();
                return false;
        }        
                
       return true;

}
function mdp(){
      if (document.inscription.pass.value!=document.inscription.confirmpass.value){
	      alert('Attention!! Le mot de passe et sa confirmation sont différents! ');
	      return false;
      } else {
      	return true;
	}

 }
 
 function radiovide() {
        var a=0;
        for ( i = 0; i < document.formulaire.length; i++) {
	       if ( document.formulaire.elements[i].checked==true ) {
			a++;
               }
        }
        if(a == 0) {
                alert('Vous n\'avez pas choisi de secteur d\'activité.')
		return false;
        }

}

function del_client(id) {
        if(confirm('Etes-vous sûr de vouloir supprimer ce client ?')) {
              window.location='new_clients.php?id_client=' + id + '&supp=1';  
        }
        
        
}
function popup(page,nom,largeur,hauteur,options) {
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	window.open(page,nom,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}
function popupTelecharge(page,nom,largeur,hauteur,options) {
	var top=(screen.height-hauteur)/2 - 70;
	var left=(screen.width-largeur)/2;
	force = window.open(page,nom,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
	return force;
}



function verifMail(mail) {
	if(mail!="") {
		var tabMail = mail.split('@');
		if(tabMail.length<2) {
			alert('Votre e-mail est invalide car il n\'a pas de @ !')
			return false;	
		} else {
			var tabDom = tabMail[1].split('.');
			if(tabDom.length<2) {
				alert('Le nom de domaine de votre e-mail est invalide !')
				return false;				
			}
		}

	}
	return true;
}

function verifCommandeRapide() {
	
	tabExt = document.form.file.value.split('.');
	var dernier = (tabExt.length - 1);
	var ext = tabExt[dernier].toLowerCase();
	if(ext!="txt") {
		alert('Extension txt uniquement !');
		return false;	
	}		
	return true;
}

function SelAll ()
{
	var nb;
	var chk;

	if (document.liste.SEL_ALL.value == 0)
	{
		chk=1
	}
	else
	{
		chk=0
	}

	nb = document.liste.elements.length
	for (var i=0;i<nb;i++)
	{
		var e = document.liste.elements[i];
		e.checked = chk
	}
	document.liste.SEL_ALL.value = chk;
}

function verif()
{

  if (document.formulaire.mots.value.length <= 2)
  {
    alert('Saisissez au moins 3 lettres');
    return false;
    document.formulaire.mots.focus();
  }
}
