function onClick_form_valider()
{

// Contact Name
if ( isEmpty(document.forms['form1'].name.value) )
{
	alert("Mandatory field : Contact name");
	document.forms['form1'].name.focus();
	return false;
}

// E Mail 
if ( isEmpty(document.forms['form1'].email.value) )
{
	alert("Mandatory field : E-mail address");
	document.forms['form1'].email.focus();
	return false;
}


if ( ! verifiermail(document.forms['form1'].email.value) )
{
	 alert("Mail invalid !");
	document.forms['form1'].email.focus();
	return false;
}


// Company Name
if ( isEmpty(document.forms['form1'].company.value) )
{
	alert("Mandatory field : Company Name");
	document.forms['form1'].company.focus();
	return false;
}

// Address 01
if ( isEmpty(document.forms['form1'].add01.value) )
{
	alert("Mandatory field : Address");
	document.forms['form1'].add01.focus();
	return false;
}

// Address 02
/*if ( isEmpty(document.forms['form1'].add02.value) )
{
	alert("Mandatory field : Address");
	document.forms['form1'].add02.focus();
	return false;
}*/
	
// PostCode
if ( isEmpty(document.forms['form1'].postcode.value) )
{
	alert("Mandatory field : PostCode");
	document.forms['form1'].postcode.focus();
	return false;
}

// Town
if ( isEmpty(document.forms['form1'].town.value) )
{
	alert("Mandatory field : Town");
	document.forms['form1'].town.focus();
	return false;
}

// Country
if ( isEmpty(document.forms['form1'].country.value) )
{
	alert("Mandatory field : Country");
	document.forms['form1'].country.focus();
	return false;
}

// Numero de tel : prefix

if ( ! isEmpty(document.forms['form1'].prefix.value)  )
{
	if ( ! verifierprefix(document.forms['form1'].prefix.value) )
	{
	alert("Bad  Phone prefix");
	document.forms['form1'].prefix.focus();
	return false;
	}
}
// Numero de tel : tel
if ( ! isEmpty(document.forms['form1'].phone.value)  )
{
	if ( ! verifiertel(document.forms['form1'].phone.value) )
	{
	alert("Bad  Phone ");
	document.forms['form1'].phone.focus();
	return false;
	}
}





	
}


// Verifier si un champ est vide ou non 
function isEmpty(inputStr) 
{

	if (inputStr == null || inputStr == "") 
	{
		return true;
	}
	else
	{
		return false;
	}
}


function verifiermail(mail) {
      if ((mail.indexOf("@")>=0)&&(mail.indexOf(".")>=0)) {
         return true 
      } else {
         return false
      }
}



function verifierprefix(prefix) {
	
regprefixtel=/^[0-9][0-9]*$/;	
return regprefixtel.test(prefix)	
}


function verifiertel(tel) {
	
regtelephone=/^[0-9][0-9]*$/;	
return regtelephone.test(tel)	
}







