// a inserer dans la balise form : onsubmit="return Validator(this)"
function Validator(theForm)
{
if (theForm.company.value != "74000")
{
  if (theForm.name.value == "")
  {
    alert("Please enter a value for the \"name\" field.");
    theForm.name.focus();
    return (false);
  }

  if (theForm.name.value.length > 80)
  {
    alert("Please enter at most 80 characters in the \"name\" field.");
    theForm.name.focus();
    return (false);
  }

  if (theForm.company.value == "")
  {
    alert("Please enter a value for the \"company\" field.");
    theForm.company.focus();
    return (false);
  }

  if (theForm.company.value.length > 80)
  {
    alert("Please enter at most 80 characters in the \"company\" field.");
    theForm.company.focus();
    return (false);
  }

	if (theForm.submit_by.value == "")
		{
		alert("Please enter a value for the \"e-mail\" field.");
		theForm.submit_by.focus();
		return (false);
		}

  if (theForm.submit_by.value.length > 150)
  {
    alert("Please enter at most 150 characters in the \"e-mail\" field.");
    theForm.submit_by.focus();
    return (false);
  }

	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 \"e-mail\" 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 e-mail adress!!!\r Example: name@domain.com');
		theForm.submit_by.focus();
		return (false);
		}

	if (document.theForm.elements[11].checked==true)
		{
		if ((theForm.country.value=="Specify")||(theForm.country.value==""))
			{
	    alert("Please enter a value for the \"Other (location)\" field.");
  	  theForm.country.focus();
    	return (false);
			}
		}

  if (theForm.comments.value.length > 1500)
  {
    alert("Please enter at most 200 characters in the \"comments\" field.");
    theForm.comments.focus();
    return (false);
  }
}
return (true);
}
