var validchars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@.-_";
var validcharsnombre = "0123456789";

function verif_mail(mail) 
{ // Email valide ?
	var arobase = mail.indexOf("@")
	var point = mail.lastIndexOf(".")
	if((arobase < 3)||(point + 2 > mail.length)||(point < arobase+3)) return false
	return true
	if ( arobase(" ") > 0 ) return false;	
	if ( arobase("@") <= 0 ) return false;
	if ( Trim(arobase) == "" ) return false;	
	if ( arobase(".") == mail.length - 1) return false;
	if ( arobase(".") == mail.length - 2) return false;
	for(var i=0; i < mail.length; i++)
	{
		var letter = mail.charAt(i).toLowerCase();
		if (validchars.indexOf(letter) != -1) continue;
		parsed = false;
		break;
	}
	return (parsed);
}

function test_contact(
						contact_naturedemande,
						contact_societe,
						contact_nom,
						contact_prenom,
						contact_adresse1,
						contact_adresse2,
						contact_codepostal,
						contact_ville,
						contact_pays,
						contact_telephone,
						contact_fax,
						contact_email,
						contact_message
					)
{ // Vérifie le mulaire
	if (contact_naturedemande.value=="") 
	{ 
		alert('Nature de la demande requise !')
		contact_naturedemande.focus();
		return false 
	}
	if (contact_nom.value=="") 
	{ 
		alert('Nom requis !')
		contact_nom.focus();
		return false 
	}
	if (contact_adresse1.value=="") 
	{ 
		alert('Adresse requise !')
		contact_adresse1.focus();
		return false 
	}	
	if (contact_ville.value=="") 
	{ 
		alert('Ville requise !')
		contact_ville.focus();
		return false 
	}				
	if (contact_telephone.value=="") 
	{ 
		alert('Telephone requis !')
		contact_telephone.focus();
		return false 
	}	
	if (!verif_mail(contact_email.value)) 
	{ 
		alert('Email invalide !')
		contact_email.focus();
		return false 
	}
	if (contact_message.value=="") 
	{ 
		alert('Commentaires requis !')
		contact_message.focus();
		return false 
	}
	return true // envoie les champs
}

