// a inserer dans la balise form : onsubmit="return Validator(this)"
function Validator(theForm)
	{
	/* Company name */
		if (theForm.company.value == "")
			{
				alert("Please fill your \"company\" name.\n\n(fields with \" * \" are required!)");
				theForm.company.focus();
				return (false);
			}
	/* Contact name */
		if (theForm.name.value == "")
			{
				alert("Please fill the \"Contact name\".\n\n(fields with \" * \" are required!)");
				theForm.name.focus();
				return (false);
			}
	/*  Phone */
		if (theForm.phone.value == "")
			{
				alert("Field \"Phone\" is required.\n\n(fields with \" * \" are required!)");
				theForm.phone.focus();
				return (false);
			}
	/* E-mail */	
		if (theForm.submit_by.value == "")
			{
				alert("Please fill the \"Email\".\n\n(fields with \" * \" are required!)");
				theForm.submit_by.focus();
				return (false);
			}
		if (theForm.submit_by.value != "")
			{
				var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&#402;&#352;&#338;&#381;&#353;&#339;&#382;&#376;ÀÁÂÃÆÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßáâåëìíîïñóôøúýþÿ0123456789-@-_.";
				var checkStr = theForm.submit_by.value;
				var allValid = true;
				for (i = 0;  i < checkStr.length;  i++)
					{
					ch = checkStr.charAt(i);
					for (j = 0;  j < checkOK.length;  j++)
					if (ch == checkOK.charAt(j))
								break;
					if (j == checkOK.length)
						{
						allValid = false;
							break;
						}
					}
		
				if (!allValid)
					{
					alert("Please enter only letter, digit and \".@_-\" characters in the \"Email\" field.");
					theForm.submit_by.focus();
					return (false);
					}
		
				adresse = theForm.submit_by.value;
				var place = adresse.indexOf("@",1);
				var point = adresse.indexOf(".",place+1);
				if (!((place > -1)&&(adresse.length >2)&&(point > 1)))
					{
					alert('Please enter a valid Email address!!!\r ie: firstname.lastname@domain.com');
					theForm.submit_by.focus();
					return (false);
					}
			}
	return (true);
	}

