//*---Form Code---*
function FrontPage_Form1_Validator(theForm)
{

  if (theForm.required_lastname.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    theForm.required_lastname.focus();
    return (false);
  }

  if (theForm.required_lastname.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"Last Name\" field.");
    theForm.required_lastname.focus();
    return (false);
  }

  if (theForm.required_lastname.value.length > 30)
  {
    alert("Please enter at most 30 characters in the \"Last Name\" field.");
    theForm.required_lastname.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&#402;&#352;&#338;&#353;&#339;&#376;ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ \t\r\n\f";
  var checkStr = theForm.required_lastname.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 and whitespace characters in the \"Last Name\" field.");
    theForm.required_lastname.focus();
    return (false);
  }

  if (theForm.required_firstname.value == "")
  {
    alert("Please enter a value for the \"First Name/s\" field.");
    theForm.required_firstname.focus();
    return (false);
  }

  if (theForm.required_firstname.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"First Name/s\" field.");
    theForm.required_firstname.focus();
    return (false);
  }

  if (theForm.required_firstname.value.length > 30)
  {
    alert("Please enter at most 30 characters in the \"First Name/s\" field.");
    theForm.required_firstname.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&#402;&#352;&#338;&#353;&#339;&#376;ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ \t\r\n\f";
  var checkStr = theForm.required_firstname.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 and whitespace characters in the \"First Name/s\" field.");
    theForm.required_firstname.focus();
    return (false);
  }

  if (theForm.required_title.selectedIndex < 0)
  {
    alert("Please select one of the \"Personal Title\" options.");
    theForm.required_title.focus();
    return (false);
  }

  if (theForm.required_title.selectedIndex == 0)
  {
    alert("The first \"Personal Title\" option is not a valid selection.  Please choose one of the other options.");
    theForm.required_title.focus();
    return (false);
  }

  if (theForm.required_organization.value == "")
  {
    alert("Please enter a value for the \"Business / Organization\" field.");
    theForm.required_organization.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&#402;&#352;&#338;&#353;&#339;&#376;ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789-' \t\r\n\f";
  var checkStr = theForm.required_organization.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, whitespace and \"'\" characters in the \"Business / Organization\" field.");
    theForm.required_organization.focus();
    return (false);
  }

  if (theForm.required_orgnature.value == "")
  {
    alert("Please enter a value for the \"Nature of organization\" field.");
    theForm.required_orgnature.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&#402;&#352;&#338;&#353;&#339;&#376;ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789-' \t\r\n\f";
  var checkStr = theForm.required_orgnature.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, whitespace and \"'\" characters in the \"Nature of organization\" field.");
    theForm.required_orgnature.focus();
    return (false);
  }

  if (theForm.required_numemployees.value == "")
  {
    alert("Please enter a value for the \"Number of employees\" field.");
    theForm.required_numemployees.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.required_numemployees.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Number of employees\" field.");
    theForm.required_numemployees.focus();
    return (false);
  }

  var chkVal = allNum;
  var prsVal = parseInt(allNum);
  if (chkVal != "" && !(prsVal >= "1"))
  {
    alert("Please enter a value greater than or equal to \"1\" in the \"Number of employees\" field.");
    theForm.required_numemployees.focus();
    return (false);
  }

  if (theForm.required_roleinorg.value == "")
  {
    alert("Please enter a value for the \"Role in organization\" field.");
    theForm.required_roleinorg.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&#402;&#352;&#338;&#353;&#339;&#376;ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789-' \t\r\n\f";
  var checkStr = theForm.required_roleinorg.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, whitespace and \"'\" characters in the \"Role in organization\" field.");
    theForm.required_roleinorg.focus();
    return (false);
  }

  if (theForm.required_productrange.selectedIndex < 0)
  {
    alert("Please select one of the \"Laragh product range\" options.");
    theForm.required_productrange.focus();
    return (false);
  }

  if (theForm.required_productrange.selectedIndex == 0)
  {
    alert("The first \"Laragh product range\" option is not a valid selection.  Please choose one of the other options.");
    theForm.required_productrange.focus();
    return (false);
  }

  if (theForm.required_address1.value == "")
  {
    alert("Please enter a value for the \"Address Line 1\" field.");
    theForm.required_address1.focus();
    return (false);
  }

  if (theForm.required_address2.value == "")
  {
    alert("Please enter a value for the \"Address Line 2\" field.");
    theForm.required_address2.focus();
    return (false);
  }

  if (theForm.required_stateprovince.value == "")
  {
    alert("Please enter a value for the \"State / Province\" field.");
    theForm.required_stateprovince.focus();
    return (false);
  }

  if (theForm.required_postalcode.value == "")
  {
    alert("Please enter a value for the \"Postal / Zip Code\" field.");
    theForm.required_postalcode.focus();
    return (false);
  }

  if (theForm.required_postalcode.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"Postal / Zip Code\" field.");
    theForm.required_postalcode.focus();
    return (false);
  }

  if (theForm.required_country.selectedIndex < 0)
  {
    alert("Please select one of the \"Country\" options.");
    theForm.required_country.focus();
    return (false);
  }

  if (theForm.required_dialcode.value == "")
  {
    alert("Please enter a value for the \"Dial Code\" field.");
    theForm.required_dialcode.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.required_dialcode.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Dial Code\" field.");
    theForm.required_dialcode.focus();
    return (false);
  }

  if (theForm.required_phonenumber.value == "")
  {
    alert("Please enter a value for the \"required_phonenumber\" field.");
    theForm.required_phonenumber.focus();
    return (false);
  }

  if (theForm.required_phonenumber.value.length > 25)
  {
    alert("Please enter at most 25 characters in the \"required_phonenumber\" field.");
    theForm.required_phonenumber.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.required_phonenumber.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"required_phonenumber\" field.");
    theForm.required_phonenumber.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&#402;&#352;&#338;&#353;&#339;&#376;ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789-@.-_";
  var checkStr = theForm.emailaddress.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 Address\" field.");
    theForm.emailaddress.focus();
    return (false);
  }

  if (theForm.required_arrivedhow.selectedIndex < 0)
  {
    alert("Please select one of the \"How did you arrive at this site?\" options.");
    theForm.required_arrivedhow.focus();
    return (false);
  }

  if (theForm.required_arrivedhow.selectedIndex == 0)
  {
    alert("The first \"How did you arrive at this site?\" option is not a valid selection.  Please choose one of the other options.");
    theForm.required_arrivedhow.focus();
    return (false);
  }
  return (true);
}
