<script Language="JavaScript"><!--
function Validate(theForm)
{
 if (theForm.Firstname.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    theForm.Firstname.focus();
    return (false);
  }

  if (theForm.Firstname.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"First Name\" field.");
    theForm.Firstname.focus();
    return (false);
  }

  if (theForm.country.selectedIndex <= 0)
  {
    alert("Please select one of the \"Country\" options.");
    theForm.country.focus();
    return (false);
  }

  if (theForm.EPusername.value == "")
  {
    alert("Please enter a value for the \"Username\" field.");
    theForm.EPusername.focus();
    return (false);
  }

  if (theForm.EPusername.value.length > 15)
  {
    alert("Please enter at most 15 characters in the \"Username\" field.");
    theForm.EPusername.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&#402;c&#338;Rü&#339;?&#376;&Agrave;&Atilde;&Aring;&AElig;&Egrave;&Ecirc;&Igrave;&Iuml;&ETH;&Ntilde;&Ograve;&Otilde;&Oslash;&Ugrave;&Ucirc;&THORN;&agrave;Ą˘&atilde;¤&aring;&aelig;§&egrave;Š&ecirc;Ť&igrave;­Ž&iuml;&eth;&ntilde;&ograve;ăä&otilde;ć&oslash;&ugrave;ę&ucirc;ěí&thorn;&yuml;0123456789--_. \t\r\n\f";
  var checkStr = theForm.EPusername.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, digit, whitespace and \"-_.\" characters in the \"Username\" field.");
    theForm.EPusername.focus();
    return (false);
  }

  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.Email1.value == "" )
  {
    alert("Please enter a value for the \"Verify email\" field.");
    theForm.Email1.focus();
    return (false);
  }

  if (theForm.Email1.value != theForm.Email.value )
  {
    alert("The values for \"Email\" and \"Verify email\" fields must be equal.");
    theForm.Email1.focus();
    return (false);
  }


 
    return (true);
}
//--></script>

