function isValideMail(str){
var reg = new RegExp("^[\\w\\-]+(\\.[\\w\\-]+)*@[\\w\\-]+(\\.[\\w\\-]+)*\\.[\\w\\-]{2,3}$", "i");
if(!reg.test(str)){
}
return reg.test(str);
}
function email_valid() {
	if (document.UserContact.WAS_NAME.value!=""){
	if (document.UserContact.WAS_PRENOM.value!=""){
	if (document.UserContact.WAS_EMAIL.value!="") {
	if(isValideMail(document.UserContact.WAS_EMAIL.value)){
		return true;
		}
		else {
		document.getElementById('messagerror').style.display='none';
		document.getElementById('invalidmail').style.display='inline';
		document.UserContact.WAS_EMAIL.focus();
		return false;
		}
	}
	}
	}else {
	return true;
	}
}

function formulaire_contact_valid() {
	if (document.UserContact.WAS_CIVIL.value!="") {
	if (document.UserContact.WAS_NAME.value!=""){
	if (document.UserContact.WAS_PRENOM.value!=""){
	if (document.UserContact.WAS_EMAIL.value!="") {
		if(isValideMail(document.UserContact.WAS_EMAIL.value)){
			return true;
		}
		else {
			document.getElementById('messagerror').style.display='none';
			document.getElementById('invalidmail').style.display='inline';
			document.UserContact.WAS_EMAIL.focus();
			return false;
		}	
	if (document.UserContact.WAS_PHONE.value!="") {
	if (document.UserContact.WAS_RAISON.value!="") {
	if (document.UserContact.WAS_CLIENT.value!="") {
	if (document.UserContact.WAS_COUNTRY.value!="") {
	if (document.UserContact.WAS_REQUEST_TYPE.value!="") {
	if (document.UserContact.WAS_REGARDING.value!="") {
	if (document.UserContact.WAS_QUESTION.value!="") {
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}else {
	return true;
	}
}

/* field_valid() fait la vérification des champs sans passer par servlet! mais pas comptatible mozilla
<!--
function field_valid(){

	if (document.UserContact.WAS_NAME.value==""){alert("was");
		document.getElementById('messagerror').innerHTML='<BR>The name is mandatory ';
		document.getElementById('messagerror').style.display='inline';
		return false;
		}
	if (document.UserContact.WAS_PRENOM.value==""){
		document.getElementById('messagerror').innerHTML='<BR>The first name is mandatory ';
		document.getElementById('messagerror').style.display='inline';
		return false;
		}
	if (document.UserContact.WAS_EMAIL.value==""){
		document.getElementById('messagerror').innerHTML='<BR>The e-mail is mandatory ';
		document.getElementById('messagerror').style.display='inline';
		return false;
		}else{
			if(!isValideMail(document.UserContact.WAS_EMAIL.value)){
			document.getElementById('messagerror').innerHTML='<BR>Your E-mail address is not correct!';
			document.getElementById('messagerror').style.display='inline';
			document.UserContact.WAS_EMAIL.focus();
			return false;
			}
		}
	if (document.UserContact.WAS_RAISON.value==""){
		document.getElementById('messagerror').innerHTML='<BR>Please indicate your company name ';
		document.getElementById('messagerror').style.display='inline';
		return false;
		}	
	if (document.UserContact.WAS_COUNTRY.value==""){
		document.getElementById('messagerror').innerHTML='<BR>Please indicate your country ';
		document.getElementById('messagerror').style.display='inline';
		return false;
		}	
	var wasclient = get_radio_value();
	alert(wasclient);
	if (wasclient==null){
		document.getElementById('messagerror').innerHTML='<BR>Please indicate if your company is a BNP Paribas client ';
		document.getElementById('messagerror').style.display='inline';
		return false;
		}	
	return true;
}

function var get_radio_value()
{
for (var i=0; i < document.UserContact.WAS_CLIENT.length; i++)
   {
   if (document.UserContact.WAS_CLIENT[i].checked)
      {
      return document.UserContact.WAS_CLIENT[i].value;
      }
   }
}
//-->*/