function FrontPage_Form1_Validator(theForm)
{


  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 5 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 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789--. \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 5 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 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789--. \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);
  }


// Shipping
// ===========================================================================


  if (theForm.ShipFirstName.value == "")
  {
    alert("Please enter a value for the \"ShipFirstName\"Ship field.");
    theForm.ShipFirstName.focus();
    return (false);
  }

  if (theForm.ShipFirstName.value.length < 2)
  {
    alert("Please enter at least 5 characters in the \"ShipFirstName\"Ship field.");
    theForm.ShipFirstName.focus();
    return (false);
  }

  if (theForm.ShipFirstName.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"ShipFirstName\"Ship field.");
    theForm.ShipFirstName.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789--. \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 \"Ship-.\"Ship characters in the \"ShipFirstName\"Ship field.");
    theForm.ShipFirstName.focus();
    return (false);
  }
  
  
  if (theForm.ShipLastName.value == "")
  {
    alert("Please enter a value for the \"ShipLastName\"Ship field.");
    theForm.ShipLastName.focus();
    return (false);
  }

  if (theForm.ShipLastName.value.length < 2)
  {
    alert("Please enter at least 5 characters in the \"ShipLastName\"Ship field.");
    theForm.ShipLastName.focus();
    return (false);
  }

  if (theForm.ShipLastName.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"ShipLastName\"Ship field.");
    theForm.ShipLastName.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789--. \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 \"Ship-.\"Ship characters in the \"ShipLastName\"Ship field.");
    theForm.ShipLastName.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 == "")
  {
    alert("Please enter a value for the \"ShipAddress1\"Ship field.");
    theForm.ShipAddress1.focus();
    return (false);
  }

  if (theForm.ShipAddress1.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"ShipAddress1\"Ship field.");
    theForm.ShipAddress1.focus();
    return (false);
  }

  if (theForm.ShipAddress1.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"ShipAddress1\"Ship field.");
    theForm.ShipAddress1.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789--. \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 \"Ship-.\"Ship characters in the \"ShipAddress1\"Ship field.");
    theForm.ShipAddress1.focus();
    return (false);
  }

  if (theForm.ShipCity.value == "")
  {
    alert("Please enter a value for the \"ShipCity\"Ship field.");
    theForm.ShipCity.focus();
    return (false);
  }

  if (theForm.ShipCity.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"ShipCity\"Ship field.");
    theForm.ShipCity.focus();
    return (false);
  }

  if (theForm.ShipCity.value.length > 25)
  {
    alert("Please enter at most 25 characters in the \"ShipCity\"Ship 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 \"Ship-\"Ship characters in the \"ShipCity\"Ship field.");
    theForm.ShipCity.focus();
    return (false);
  }

  if (theForm.ShipState.value == "")
  {
    alert("Please enter a value for the \"ShipState\"Ship field.");
    theForm.ShipState.focus();
    return (false);
  }


  if (theForm.ShipPostalCode.value == "")
  {
    alert("Please enter a value for the \"ShipPostalCode\"Ship field.");
    theForm.ShipPostalCode.focus();
    return (false);
  }

  if (theForm.ShipPostalCode.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"ShipZip Code\"Ship field.");
    theForm.ShipPostalCode.focus();
    return (false);
  }

  if (theForm.ShipPostalCode.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"ShipZip Code\"Ship field.");
    theForm.ShipPostalCode.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890- ";
  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 \"ShipZip Code\"Ship field.");
    theForm.ShipPostalCode.focus();
    return (false);
  }



// ===========================================================================
// End Shipping


// === Email ========================================================================
  
  if (theForm.Email.value == "")
  {
    alert("Please enter a valid Email address.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length < 5)
  {
    alert("Please enter at least 5 characters for \"Email\".");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length > 50)
  {
    alert("Please enter at most 50 characters for \"Email\".");
    theForm.Email.focus();
    return (false);
  }


// === Password ========================================================================


  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);
    }
    
    
// ===========================================================================



  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 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789--. \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.State.value == "")
  {
    alert("Please enter a value for 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 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890- ";
  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);
  }


// = Phone ==========================================================================

  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 > 15)
  {
    alert("Please enter at most 15 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);
  }



  return (true);
}

function chkShipping(theForm)
{

  var radioSelected = false;
  for (i = 0;  i < theForm.Shipping.length;  i++)
  {
    if (theForm.Shipping[i].checked)
        radioSelected = true;
  }
  if (!radioSelected)
  {
    alert("Please select one of the Shipping options.");
    return (false);
  }
  return (true);
}

function chkPromo(theForm)
{
  if (theForm.PromoCode.value == "")
  {
    alert("Please enter a value for the \"PromoCode\" field.");
    theForm.PromoCode.focus();
    return (false);
  }

  if (theForm.PromoCode.value == "Enter Promo Code Here")
  {
    alert("Please enter a value for the \"PromoCode\" field.");
    theForm.PromoCode.focus();
    return (false);
  }

  if (theForm.PromoCode.value.length < 2)
  {
    alert("Please enter at least 5 characters in the \"PromoCode\" field.");
    theForm.PromoCode.focus();
    return (false);
  }

  if (theForm.PromoCode.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"PromoCode\" field.");
    theForm.PromoCode.focus();
    return (false);
  }

  return (true);
}


function NewUserCart(theForm)
{


  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 5 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 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789--. \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 5 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 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789--. \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.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);
    }

  return (true);
}







// Used on template_confirmorder.asp

  function FrontPage_Form2_Validator(theForm)
  {
  
    if (theForm.Email.value == "")
    {
      alert("Please enter your email address");
      theForm.Email.focus();
      return (false);
    }
  
    if (theForm.Email.value.length < 8)
    {
      alert("Please enter your email address");
      theForm.Email.focus();
      return (false);
    }
  
    if (theForm.Email.value.length > 50)
    {
      alert("Please enter at most 50 characters in the \"email address\" field.");
      theForm.Email.focus();
      return (false);
    }
  
    var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-@._-";
    var checkStr = theForm.Email.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 and \"@._-\" characters in the \"Please enter your email address\" field.");
      theForm.Email.focus();
      return (false);
    }
    
    // test if valid email address, must have @ and .
    var checkEmail = "@.";
    var checkStr = theForm.Email.value;
    var EmailValid = false;
    var EmailAt = false;
    var EmailPeriod = false;
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkEmail.length;  j++)
    {
    if (ch == checkEmail.charAt(j) && ch == "@")
    EmailAt = true;
    if (ch == checkEmail.charAt(j) && ch == ".")
    EmailPeriod = true;
    	  if (EmailAt && EmailPeriod)
    		break;
    	  if (j == checkEmail.length)
    		break;
    	}
    	// if both the @ and . were in the string
    if (EmailAt && EmailPeriod)
    {
    		EmailValid = true
    		break;
    	}
    }
    if (!EmailValid)
    {
    alert("The \"email\" field must contain an \"@\" and a \".\".");
    // theForm.Email.focus();
    return (false);
    }
    
    
    if (theForm.NewUser[1].checked && theForm.Password.value == "")
    {
      alert("Please fill in your password.");
      return (false);
    }
    
    return (true);
  }



