<!--

//////////////////////////////////////////////////////////////////////
//	CHAMPS CACHES A AJOUTER DANS LE FORMULAIRE MESSAGE :
//		obligatoires : listes des champs obligatoires séparés par ! (ex, !nom!email!telephone!)
// 	ATTENTION : NE PEUT PA ETES UTILISE POUR LES CASES A COCHER
//////////////////////////////////////////////////////////////////////


function VerifForm(form){
	
	var chp, champs, message = '', nbre_champs, obligatoires = '';
	
	try{obligatoires = form.obligatoires.value;}catch(e){}
	champs  = obligatoires.split('!');
	nbre_champs = champs.length;
	
	for(i=0;i<nbre_champs;i++){
		if(champs[i]){
			chp = eval('form.' + champs[i]);
			choix = 0;
			try{
				if(
					chp.type == 'checkbox' && chp.checked
					|| chp.type != 'checkbox' && chp.value
				){
					choix = 1;
				}
			}
			catch(e){
			}
			try{
				if(choix == 0 && chp.length){
					nbre_choix = chp.length;
					for(j=0;j<nbre_choix;j++){
						if(chp[j].checked){	
							choix = 1;
							j = nbre_choix;
						}
					}
				}
			}
			catch(e){	
			}
			if(!choix){
				message = 'Le formulaire est rempli de façon incomplète.\n';
				i = nbre_champs;
			}
		}
	}
	
	try{if(form.telephone.value && !form.telephone.value.match(/^[0-9\(\) ]+$/)) message += 'Format du téléphone incorrect\n';}catch(e){}
	try{if(form.mobile.value && !form.mobile.value.match(/^[0-9\(\) ]+$/)) message += 'Format du mobile incorrect\n';}catch(e){}
	try{if(form.telecopie.value && !form.telecopie.value.match(/^[0-9\(\) ]+$/)) message += 'Format de la télécopie incorrect\n';}catch(e){}
	try{if(form.fax.value && !form.fax.value.match(/^[0-9\(\) ]+$/)) message += 'Format du fax incorrect\n';}catch(e){}
	try{if(form.email.value && !form.email.value.match(/^[^@ ]+@[^@ ]+\.[a-z]{2,}$/i)) message += 'Format de l\'email incorrect\n';}catch(e){}
	
	if(message){
		alert(message);	
		return false;
	}
	else {
		return true;
	}
}

//-->
