function FrontPage_Form1_Validator(theForm)
{

// Required for All Orders

  
  if (theForm.Email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }


  if (theForm.FirstName.value == "")
  {
    alert("Please enter a value for the \"FirstName\" field.");
    theForm.FirstName.focus();
    return (false);
  }

  if (theForm.FirstName.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"FirstName\" field.");
    theForm.FirstName.focus();
    return (false);
  }

  if (theForm.FirstName.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"FirstName\" field.");
    theForm.FirstName.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789--. \t\r\n\f";
  var checkStr = theForm.FirstName.value;
  var allValid = true;
  var validGroups = 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 \"FirstName\" field.");
    theForm.FirstName.focus();
    return (false);
  }
  
  
  if (theForm.LastName.value == "")
  {
    alert("Please enter a value for the \"LastName\" field.");
    theForm.LastName.focus();
    return (false);
  }

  if (theForm.LastName.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"LastName\" field.");
    theForm.LastName.focus();
    return (false);
  }

  if (theForm.LastName.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"LastName\" field.");
    theForm.LastName.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789--. \t\r\n\f";
  var checkStr = theForm.LastName.value;
  var allValid = true;
  var validGroups = 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 \"LastName\" field.");
    theForm.LastName.focus();
    return (false);
  }





  if (theForm.Phone.value == "")
  {
    alert("Please enter a value for the \"Phone\" field.");
    theForm.Phone.focus();
    return (false);
  }

  if (theForm.Phone.value.length < 10)
  {
    alert("Please enter at least 10 characters in the \"Phone\" field.");
    theForm.Phone.focus();
    return (false);
  }

  if (theForm.Phone.value.length > 20)
  {
    alert("Please enter at most 20 characters in the \"Phone\" field.");
    theForm.Phone.focus();
    return (false);
  }

  var checkOK = "0123456789-()- \t\r\n\f";
  var checkStr = theForm.Phone.value;
  var allValid = true;
  var validGroups = 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 digit, whitespace and \"()-\" characters in the \"Phone\" field.");
    theForm.Phone.focus();
    return (false);
  }


  if (theForm.Password.value == "")
  {
    alert("Please enter a value for the \"Password\" field.");
    theForm.Password.focus();
    return (false);
  }

  if (theForm.Password.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Password\" field.");
    theForm.Password.focus();
    return (false);
  }

  if (theForm.Password.value.length > 25)
  {
    alert("Please enter at most 25 characters in the \"Password\" field.");
    theForm.Password.focus();
    return (false);
  }

  if (theForm.Password2.value == "")
  {
    alert("Please enter a value for the \"Password2\" field.");
    theForm.Password2.focus();
    return (false);
  }

  if (theForm.Password2.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Password2\" field.");
    theForm.Password2.focus();
    return (false);
  }

  if (theForm.Password2.value.length > 25)
  {
    alert("Please enter at most 25 characters in the \"Password2\" field.");
    theForm.Password2.focus();
    return (false);
  }


    if (theForm.Password.value != theForm.Password2.value)
    {
    	alert("Please re-enter your password so that it matches.");
    	theForm.Password2.focus();
    	return (false);
    }





// required for US & Canada


if (theForm.ShipCountry.value == "United States" || theForm.ShipCountry.value == "Canada")
  {
  

  if (theForm.ShipFirstName.value == "")
  {
    alert("Please enter a value for the \"Shipping FirstName\" field.");
    theForm.ShipFirstName.focus();
    return (false);
  }

  if (theForm.ShipFirstName.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"Shipping FirstName\" field.");
    theForm.ShipFirstName.focus();
    return (false);
  }

  if (theForm.ShipFirstName.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"Shipping FirstName\" field.");
    theForm.ShipFirstName.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789--. \t\r\n\f";
  var checkStr = theForm.ShipFirstName.value;
  var allValid = true;
  var validGroups = 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 \"FirstName\" field.");
    theForm.ShipFirstName.focus();
    return (false);
  }
  
  
  if (theForm.ShipLastName.value == "")
  {
    alert("Please enter a value for the \"Shipping LastName\" field.");
    theForm.ShipLastName.focus();
    return (false);
  }

  if (theForm.ShipLastName.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"Shipping LastName\" field.");
    theForm.ShipLastName.focus();
    return (false);
  }

  if (theForm.ShipLastName.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"Shipping LastName\" field.");
    theForm.ShipLastName.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789--. \t\r\n\f";
  var checkStr = theForm.ShipLastName.value;
  var allValid = true;
  var validGroups = 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 \"Shipping LastName\" field.");
    theForm.ShipLastName.focus();
    return (false);
  }
  

  if (theForm.Address1.value == "")
  {
    alert("Please enter a value for the \"Address1\" field.");
    theForm.Address1.focus();
    return (false);
  }

  if (theForm.Address1.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Address1\" field.");
    theForm.Address1.focus();
    return (false);
  }

  if (theForm.Address1.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"Address1\" field.");
    theForm.Address1.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-/-. \t\r\n\f";
  var checkStr = theForm.Address1.value;
  var allValid = true;
  var validGroups = 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 \"Address1\" field.");
    theForm.Address1.focus();
    return (false);
  }

  if (theForm.City.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    theForm.City.focus();
    return (false);
  }

  if (theForm.City.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"City\" field.");
    theForm.City.focus();
    return (false);
  }

  if (theForm.City.value.length > 25)
  {
    alert("Please enter at most 25 characters in the \"City\" field.");
    theForm.City.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz- \t\r\n\f";
  var checkStr = theForm.City.value;
  var allValid = true;
  var validGroups = 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, whitespace and \"-\" characters in the \"City\" field.");
    theForm.City.focus();
    return (false);
  }


  if (theForm.ShipAddress1.value == "")
  {
    alert("Please enter a value for the \"Shipping Address1\" field.");
    theForm.ShipAddress1.focus();
    return (false);
  }


  if (theForm.ShipAddress1.value.indexOf('PO Box') > -1)
  {
    alert("Please enter a street address for the \"Shipping Address1\" field.");
    theForm.ShipAddress1.focus();
    return (false);
  }

  if (theForm.ShipAddress1.value.indexOf('po box') > -1)
  {
    alert("Please enter a street address for the \"Shipping Address1\" field.");
    theForm.ShipAddress1.focus();
    return (false);
  }

  if (theForm.ShipAddress1.value.indexOf('PO box') > -1)
  {
    alert("Please enter a street address for the \"Shipping Address1\" field.");
    theForm.ShipAddress1.focus();
    return (false);
  }

  if (theForm.ShipAddress1.value.indexOf('P O Box') > -1)
  {
    alert("Please enter a street address for the \"Shipping Address1\" field.");
    theForm.ShipAddress1.focus();
    return (false);
  }


  if (theForm.ShipAddress1.value.indexOf('P.O. Box') > -1)
  {
    alert("Please enter a street address for the \"Shipping Address1\" field.");
    theForm.ShipAddress1.focus();
    return (false);
  }

  if (theForm.ShipAddress1.value.indexOf('p.o. box') > -1)
  {
    alert("Please enter a street address for the \"Shipping Address1\" field.");
    theForm.ShipAddress1.focus();
    return (false);
  }

  if (theForm.ShipAddress1.value.indexOf('P. O. Box') > -1)
  {
    alert("Please enter a street address for the \"Shipping Address1\" field.");
    theForm.ShipAddress1.focus();
    return (false);
  }

  if (theForm.ShipAddress1.value.indexOf('P.O.Box') > -1)
  {
    alert("Please enter a street address for the \"Shipping Address1\" field.");
    theForm.ShipAddress1.focus();
    return (false);
  }

  if (theForm.ShipAddress1.value.indexOf('p.o.box') > -1)
  {
    alert("Please enter a street address for the \"Shipping Address1\" field.");
    theForm.ShipAddress1.focus();
    return (false);
  }

  if (theForm.ShipAddress1.value.indexOf('p o box') > -1)
  {
    alert("Please enter a street address for the \"Shipping Address1\" field.");
    theForm.ShipAddress1.focus();
    return (false);
  }


  
  if (theForm.ShipAddress1.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Shipping Address1\" field.");
    theForm.ShipAddress1.focus();
    return (false);
  }

  if (theForm.ShipAddress1.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"Shipping Address1\" field.");
    theForm.ShipAddress1.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789--/. \t\r\n\f";
  var checkStr = theForm.ShipAddress1.value;
  var allValid = true;
  var validGroups = 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 \"Shipping Address1\" field.");
    theForm.ShipAddress1.focus();
    return (false);
  }

  if (theForm.ShipCity.value == "")
  {
    alert("Please enter a value for the \"Shipping City\" field.");
    theForm.ShipCity.focus();
    return (false);
  }

  if (theForm.ShipCity.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"Shipping City\" field.");
    theForm.ShipCity.focus();
    return (false);
  }

  if (theForm.ShipCity.value.length > 25)
  {
    alert("Please enter at most 25 characters in the \"Shipping City\" field.");
    theForm.ShipCity.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz- \t\r\n\f";
  var checkStr = theForm.ShipCity.value;
  var allValid = true;
  var validGroups = 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, whitespace and \"-\" characters in the \"Shipping City\" field.");
    theForm.ShipCity.focus();
    return (false);
  }


}



if (theForm.ShipCountry.value == "United States")
  {

	if (theForm.State.value == "")
	{
	alert("Please enter a value for the \"State\" field.");
	theForm.State.focus();
	return (false);
	}
	
	if (theForm.State.value.length < 2)
	{
	alert("Please enter at least 2 characters in the \"State\" field.");
	theForm.State.focus();
	return (false);
	}
	
	if (theForm.State.value.length > 6)
	{
	alert("Please enter at most 6 characters in the \"State\" field.");
	theForm.State.focus();
	return (false);
	}

	
	  var checkOK = "1234567890-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	  var checkStr = theForm.State.value;
	  var allValid = true;
	  var validGroups = 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 characters in the \"State\" field.");
	    theForm.State.focus();
	    return (false);
	  }
	
	  if (theForm.PostalCode.value == "")
	  {
	    alert("Please enter a value for the \"PostalCode\" field.");
	    theForm.PostalCode.focus();
	    return (false);
	  }
	
	  if (theForm.PostalCode.value.length < 5)
	  {
	    alert("Please enter at least 5 characters in the \"Zip Code\" field.");
	    theForm.PostalCode.focus();
	    return (false);
	  }
	
	  if (theForm.PostalCode.value.length > 10)
	  {
	    alert("Please enter at most 10 characters in the \"Zip Code\" field.");
	    theForm.PostalCode.focus();
	    return (false);
	  }
	
	  var checkOK = "1234567890-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
	  var checkStr = theForm.PostalCode.value;
	  var allValid = true;
	  var validGroups = 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 number characters in the \"Zip Code\" field.");
	    theForm.PostalCode.focus();
	    return (false);
	  }
}




if (theForm.ShipCountry.value == "United States")
    {
  
      if (theForm.ShipState.value == "")
      {
        alert("Please enter a value for the \"Shipping State\" field.");
        theForm.ShipState.focus();
        return (false);
      }
    
      if (theForm.ShipState.value.length < 2)
      {
        alert("Please enter at least 2 characters in the \"Shipping State\" field.");
        theForm.ShipState.focus();
        return (false);
      }
    
      if (theForm.ShipState.value.length > 6)
      {
        alert("Please enter at most 6 characters in the \"Shipping State\" field.");
        theForm.ShipState.focus();
        return (false);
      }
    
      var checkOK = "1234567890-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
      var checkStr = theForm.ShipState.value;
      var allValid = true;
      var validGroups = 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 characters in the \"Shipping State\" field.");
        theForm.ShipState.focus();
        return (false);
      }

}





if (theForm.ShipCountry.value == "United States")
    {


  if (theForm.ShipPostalCode.value == "")
  {
    alert("Please enter a value for the \"Ship-To Postal Code\" field.");
    theForm.PostalCode.focus();
    return (false);
  }

  if (theForm.ShipPostalCode.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Ship-To Postal Code\" field.");
    theForm.PostalCode.focus();
    return (false);
  }

  if (theForm.ShipPostalCode.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"Ship-To Postal Code\" field.");
    theForm.PostalCode.focus();
    return (false);
  }

  var checkOK = "1234567890-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
  var checkStr = theForm.ShipPostalCode.value;
  var allValid = true;
  var validGroups = 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 number characters in the \"Ship-To Postal Code\" field.");
    theForm.ShipPostalCode.focus();
    return (false);
  }

}



  if (theForm.ShipCountry.value != "United States" && theForm.ShipCountry.value != "Canada" )
  {
	   if (theForm.International.value.length < 5)
	  {
	    alert("Please enter at least 5 characters in the \"International Shipping Address\" field.");
	    theForm.International.focus();
	    return (false);
	  }
  }


//alert('validated!');
return (true);
//return (false);
}
