function validateP3(theForm)
{

  if (theForm.Serial.value == "")
  {
    alert("Please enter a value for the \"Serial Number\" field.");
    theForm.Serial.focus();
    return (false);
  }

  if (theForm.Serial.value.length < 10)
  {
    alert("Please enter 10 characters for the \"Serial Number\" field.");
    theForm.Serial.focus();
    return (false);
  }


  if (theForm.Serial.value.length > 16)
  {
    alert("Please enter 16 characters for the \"Serial Number\" field.");
    theForm.Serial.focus();
    return (false);
  }

  if (theForm.UUID.value == "")
  {
    alert("Please enter a value for the \"UUID\" field.");
    theForm.UUID.focus();
    return (false);
  }

  if (theForm.UUID.value.length < 16)
  {
    alert("Please enter 16 characters for the \"UUID\" field.");
    theForm.UUID.focus();
    return (false);
  }


  if (theForm.UUID.value.length > 16)
  {
    alert("Please enter 16 characters for the \"UUID\" field.");
    theForm.UUID.focus();
    return (false);
  }



  var checkOK = "ABCDEFabcdef0123456789";
  var checkStr = theForm.UUID.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 0-9, A-F characters in the \"UUID\" field.");
	theForm.UUID.focus();
	return (false);
  }


document.registration.submit();
//return (true);
}




function validateP4(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 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 = "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 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 = "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.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.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);
  }

    // 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.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);
  }


  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);
  }
*/

document.registration.submit();
}



function validateP5(theForm)
{

if (theForm.CCFirstName)
{


    if (theForm.CCFirstName.value == "")
  {
    alert("Please enter a value for the \"CCFirstName\" field.");
    theForm.CCFirstName.focus();
    return (false);
  }

  if (theForm.CCFirstName.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"CCFirstName\" field.");
    theForm.CCFirstName.focus();
    return (false);
  }

  if (theForm.CCFirstName.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"CCFirstName\" field.");
    theForm.CCFirstName.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789--. \t\r\n\f";
  var checkStr = theForm.CCFirstName.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 \"CCFirstName\" field.");
    theForm.CCFirstName.focus();
    return (false);
  }
  
  
  if (theForm.CCLastName.value == "")
  {
    alert("Please enter a value for the \"CCLastName\" field.");
    theForm.CCLastName.focus();
    return (false);
  }

  if (theForm.CCLastName.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"CCLastName\" field.");
    theForm.CCLastName.focus();
    return (false);
  }

  if (theForm.CCLastName.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"CCLastName\" field.");
    theForm.CCLastName.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789--. \t\r\n\f";
  var checkStr = theForm.CCLastName.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 \"CCLastName\" field.");
    theForm.CCLastName.focus();
    return (false);
  }
  






  if (theForm.CCNumber.value == "")
  {
    alert("Please enter a value for the \"Credit Card Number\" field.");
    theForm.CCNumber.focus();
    return (false);
  }

  if (theForm.CCNumber.value.length < 14)
  {
    alert("Please enter at least 14 number in the \"Credit Card Number\" field.");
    theForm.CCNumber.focus();
    return (false);
  }

  if (theForm.CCNumber.value.length > 16)
  {
    alert("Please enter at most 16 numbers in the \"Credit Card Number\" field.");
    theForm.CCNumber.focus();
    return (false);
  }




  if (theForm.CSC.value == "")
  {
    alert("Please enter a value for the \"Security Code\" field.");
    theForm.CSC.focus();
    return (false);
  }

  if (theForm.CSC.value.length < 3)
  {
    alert("Please enter at least 3number in the \"Security Code\" field.");
    theForm.CSC.focus();
    return (false);
  }

  if (theForm.CSC.value.length > 4)
  {
    alert("Please enter at most 4 numbers in the \"Security Code\" field.");
    theForm.CSC.focus();
    return (false);
  }


}


document.registration.submit();
}
