//-- Register Form--

function validation(theForm)
{

  if (theForm.txtfirstname.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    theForm.txtfirstname.focus();
    return (false);
  }

  if (theForm.txtfirstname.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"First Name\" field.");
    theForm.txtfirstname.focus();
    return (false);
  }

  if (theForm.txtfirstname.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"First Name\" field.");
    theForm.txtfirstname.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f";
  var checkStr = theForm.txtfirstname.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 and whitespace characters in the \"First Name\" field.");
    theForm.txtfirstname.focus();
    return (false);
  }

  if (theForm.txtlastname.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    theForm.txtlastname.focus();
    return (false);
  }

  if (theForm.txtlastname.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"Last Name\" field.");
    theForm.txtlastname.focus();
    return (false);
  }

  if (theForm.txtlastname.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"Last Name\" field.");
    theForm.txtlastname.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f";
  var checkStr = theForm.txtlastname.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 and whitespace characters in the \"Last Name\" field.");
    theForm.txtlastname.focus();
    return (false);
  }

  if (theForm.day.selectedIndex < 0)
  {
    alert("Please select one of the \"Day\" options.");
    theForm.day.focus();
    return (false);
  }

  if (theForm.day.selectedIndex == 0)
  {
    alert("The first \"Day\" option is not a valid selection.  Please choose one of the other options.");
    theForm.day.focus();
    return (false);
  }

  if (theForm.month.selectedIndex < 0)
  {
    alert("Please select one of the \"Month\" options.");
    theForm.month.focus();
    return (false);
  }

  if (theForm.month.selectedIndex == 0)
  {
    alert("The first \"Month\" option is not a valid selection.  Please choose one of the other options.");
    theForm.month.focus();
    return (false);
  }

  if (theForm.year.selectedIndex < 0)
  {
    alert("Please select one of the \"Year\" options.");
    theForm.year.focus();
    return (false);
  }

  if (theForm.year.selectedIndex == 0)
  {
    alert("The first \"Year\" option is not a valid selection.  Please choose one of the other options.");
    theForm.year.focus();
    return (false);
  }

  if (theForm.txtemail.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.txtemail.focus();
    return (false);
  }

  if (theForm.txtemail.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Email\" field.");
    theForm.txtemail.focus();
    return (false);
  }

  if (theForm.txtemail.value.length > 100)
  {
    alert("Please enter at most 100 characters in the \"Email\" field.");
    theForm.txtemail.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789--_@.";
  var checkStr = theForm.txtemail.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 \"Email\" field.");
    theForm.txtemail.focus();
    return (false);
  }

  if (theForm.txtCity.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    theForm.txtCity.focus();
    return (false);
  }

  if (theForm.txtCity.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"City\" field.");
    theForm.txtCity.focus();
    return (false);
  }

  if (theForm.txtstate.value == "")
  {
    alert("Please enter a value for the \"State\" field.");
    theForm.txtstate.focus();
    return (false);
  }

  if (theForm.txtstate.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"State\" field.");
    theForm.txtstate.focus();
    return (false);
  }

  if (theForm.txtstate.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"State\" field.");
    theForm.txtstate.focus();
    return (false);
  }

  if (theForm.txtpincode.value == "")
  {
    alert("Please enter a value for the \"Zip Code\" field.");
    theForm.txtpincode.focus();
    return (false);
  }

  if (theForm.txtpincode.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Zip Code\" field.");
    theForm.txtpincode.focus();
    return (false);
  }

  if (theForm.txtpincode.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"Zip Code\" field.");
    theForm.txtpincode.focus();
    return (false);
  }

  if (theForm.txtcountry.value == "")
  {
    alert("Please enter a value for the \"Country\" field.");
    theForm.txtcountry.focus();
    return (false);
  }

  if (theForm.txtcountry.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"Country\" field.");
    theForm.txtcountry.focus();
    return (false);
  }

  if (theForm.txtcountry.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"Country\" field.");
    theForm.txtcountry.focus();
    return (false);
  }

  if (theForm.txtusername.value == "")
  {
    alert("Please enter a value for the \"Login ID\" field.");
    theForm.txtusername.focus();
    return (false);
  }

  if (theForm.txtusername.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"Login ID\" field.");
    theForm.txtusername.focus();
    return (false);
  }

  if (theForm.txtusername.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"Login ID\" field.");
    theForm.txtusername.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-_.";
  var checkStr = theForm.txtusername.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 \"Login ID\" field.");
    theForm.txtusername.focus();
    return (false);
  }

  if (theForm.txtpasswd.value == "")
  {
    alert("Please enter a value for the \"Password\" field.");
    theForm.txtpasswd.focus();
    return (false);
  }

  if (theForm.txtpasswd.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"Password\" field.");
    theForm.txtpasswd.focus();
    return (false);
  }

 

  if (theForm.txtrepasswd.value == "")
  {
    alert("Please enter a value for the \"Re-enter Password\" field.");
    theForm.txtrepasswd.focus();
    return (false);
  }

  if (theForm.txtrepasswd.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"Re-enter Password\" field.");
    theForm.txtrepasswd.focus();
    return (false);
  }

  if (theForm.txtpasswd.value != theForm.txtrepasswd.value )
  {
    alert("Please enter Same \"Password\" for both  field.");
    theForm.txtpasswd.focus();
    return (false);
  }
  
  var radioSelected = false;
  for (i = 0;  i < theForm.subscription.length;  i++)
  {
    if (theForm.subscription[i].checked)
        radioSelected = true;
  }
  if (!radioSelected)
  {
    alert("Please select one of the \"Subscription\" options.");
    return (false);
  }
  return (true);
}
//-->
