<!--
//This code supports the name, address, city, state, country, phone and email fields
//contained in the include file ssi_form_namaddr.inc
function FormValidator(theForm)
{

  if (theForm.FirstName.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    theForm.FirstName.focus();
    return (false);
  }

  if (theForm.LastName.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    theForm.LastName.focus();
    return (false);
  }

  if (theForm.Title.value == "")
  {
    alert("Please enter a value for the \"Title\" field.");
    theForm.Title.focus();
    return (false);
  }

  if (theForm.Organization.value == "")
  {
    alert("Please enter a value for the \"Organization\" field.");
    theForm.Organization.focus();
    return (false);
  }

  if (theForm.Department.value == "")
  {
    alert("Please enter a value for the \"Department\" field.");
    theForm.Department.focus();
    return (false);
  }

  if (theForm.Address.value == "")
  {
    alert("Please enter a value for the \"Address\" field.");
    theForm.Address.focus();
    return (false);
  }

  if (theForm.City.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    theForm.City.focus();
    return (false);
  }

  //STATE or PROVINCE field JavaScript coding here
  if ((theForm.Country.selectedIndex == 1) || (theForm.Country.selectedIndex == 2)) {
    if (theForm.State.selectedIndex < 0)
    {
      alert("Please select one of the \"State or Province\" options.");
      theForm.State.focus();
      return (false);
    }

    if ((theForm.State.selectedIndex == 0) || (theForm.State.selectedIndex == 1) || (theForm.State.selectedIndex == 53))
      {
      alert("The \"State or Province\" option you selected is not a valid selection.\nPlease choose one of the other options.");
      theForm.State.focus();
      return (false);
    }
  }

  if (theForm.Postal_Code.value == "")
  {
    alert("Please enter a value for the \"Zip code or postal code\" field.");
    theForm.Postal_Code.focus();
    return (false);
  }

  if (theForm.Country.selectedIndex < 0)
  {
    alert("Please select one of the \"Country\" options.");
    theForm.Country.focus();
    return (false);
  }

  if (theForm.Country.selectedIndex == 0)
  {
    alert("The first \"Country\" option is not a valid selection.\nPlease choose one of the other options.");
    theForm.Country.focus();
    return (false);
  }

  if (theForm.Telephone.value == "")
  {
    alert("Please enter a value for the \"Telephone\" field.");
    theForm.Telephone.focus();
    return (false);
  }

  if (theForm.Email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  var radioSelected = false;
  for (i = 0;  i < theForm.PurchaseTiming.length;  i++)
  {
    if (theForm.PurchaseTiming[i].checked)
        radioSelected = true;
  }
  if (!radioSelected)
  {
    alert("Please select one of the \n\"Please indicate your purchasing time frame\" options.");
    return (false);
  }
  
  var radioSelected = false;
  for (i = 0;  i < theForm.LabType.length;  i++)
  {
    if (theForm.LabType[i].checked)
        radioSelected = true;
  }
  if (!radioSelected)
  {
    alert("Please select one of the \n\"What type of lab do you work in?\" options.");
    return (false);
  }
  
  var radioSelected = false;
  for (i = 0;  i < theForm.Interest.length;  i++)
  {
    if (theForm.Interest[i].checked)
        radioSelected = true;
  }
  if (!radioSelected)
  {
    alert("Please select one of the \n\"Please indicate your inquiry interest\" options.");
    return (false);
  }

  return (true);
}
//-->