<!--
// javascript to validate register.jsp form data
function register_Validator(theForm)
{


  if (theForm.username.value == "")
  {
    alert("Please enter a value for the \"Username\" field.");
    theForm.username.focus();
    return (false);
  }

  if (theForm.username.value.length < 6)
  {
    alert("Please enter at least 6 characters in the \"Username\" field.");
    theForm.username.focus();
    return (false);
  }

  if (theForm.username.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"Username\" field.");
    theForm.username.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789-";
  var checkStr = theForm.username.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 digit characters in the \"Username\" field.");
    theForm.username.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 < 6)
  {
    alert("Please enter at least 6 characters in the \"Password\" field.");
    theForm.password.focus();
    return (false);
  }

  if (theForm.password.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"Password\" field.");
    theForm.password.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789-";
  var checkStr = theForm.password.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 digit characters in the \"Password\" field.");
    theForm.password.focus();
    return (false);
  }

  if (!(theForm.repassword.value == theForm.password.value))
  {
 alert("The \"Re-Enter Password\" should be same as the \"Password\" .");
    theForm.repassword.focus();
    return (false);
  }
  
  if (theForm.email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.email.focus();
    return (false);
  }
  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.@";
  var checkStr = theForm.email.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 a valid email address in the \"Email\" field.");
    theForm.email.focus();
    return (false);
  }

  if (!(theForm.terms.checked))
  {
 alert("Please agree to the Terms and Conditions to Register.");
    theForm.terms.focus();
    return (false);
  }

   return (true);
}
//-->
 
