 function Validate_FrmRegister_1(mode) {

   if (mode == 'create') {

           if (document.FrmRegister.txtHandle.value == "")
           {
             alert("Please enter at least 6 characters in the \"Username\" field.");
             document.FrmRegister.txtHandle.focus();
             return (false);
           }
           if (document.FrmRegister.txtHandle.value.length > 25)
           {
             alert("Please enter no more than 25 characters in the \"Username\" field.");
             document.FrmRegister.txtHandle.focus();
             return (false);
           }
           if (document.FrmRegister.txtHandle.value.length < 6)
           {
             alert("Please enter at least 6 characters in the \"Username\" field.");
             document.FrmRegister.txtHandle.focus();
             return (false);
           }
           var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ1234567890-\t\r\n\f";
           var checkStr = document.FrmRegister.txtHandle.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 letters, numbers and \"-\" characters, no spaces allowed, in the \"Username\" field.");
             document.FrmRegister.txtHandle.focus();
             return (false);
           }
   }
   if (document.FrmRegister.txtPassword.value.length < 6)
   {
     alert("Please enter between 6-10 characters in the \"Password\" field.");
     document.FrmRegister.txtPassword.focus();
     return (false);
   }

   var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ1234567890";
   var checkStr = document.FrmRegister.txtPassword.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 letters and numbers in the \"Password\" field.");
     document.FrmRegister.txtPassword.focus();
     return (false);
   }

   if (document.FrmRegister.txtPassword.value.length > 10)
    {
      alert("Please enter no more than 10 characters in the \"Password\" field.");
      document.FrmRegister.txtPassword.focus();
      return (false);
   }

   if (document.FrmRegister.txtConfirm.value.length < 6)
   {
     alert("Please enter between 6-10 characters in the \"Re-Enter Password\" field.");
     document.FrmRegister.txtConfirm.focus();
     return (false);
   }

   var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ1234567890";
   var checkStr = document.FrmRegister.txtConfirm.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 letters and numbers in the \"Re-Enter Password\" field.");
     document.FrmRegister.txtConfirm.focus();
     return (false);
   }

   if (document.FrmRegister.txtConfirm.value.length > 10)
    {
      alert("Please enter no more than 10 characters in the \"Re-Enter Password\" field.");
      document.FrmRegister.txtConfirm.focus();
      return (false);
   }
   if (document.FrmRegister.txtPassword.value != document.FrmRegister.txtConfirm.value)
    {
      alert("Password confirmation does not match password - please re-enter");
      document.FrmRegister.txtPassword.focus();
      return (false);
   }
   if (document.FrmRegister.txtSurname.value.length < 2)
   {
     alert("Please enter at least 2 characters in the \"Last Name\" field.");
     document.FrmRegister.txtSurname.focus();
     return (false);
   }

   var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ- \t\r\n\f";
   var checkStr = document.FrmRegister.txtSurname.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 letters, whitespace and \"-\" characters in the \"Last name or 2 Initials\" field.");
     document.FrmRegister.txtSurname.focus();
     return (false);
   }

   if (document.FrmRegister.txtSurname.value.length > 25)
    {
      alert("Please enter no more than 25 characters in the \"Last name\" field.");
      document.FrmRegister.txtSurname.focus();
      return (false);
   }

   if (document.FrmRegister.txtForename.value.length > 25)
    {
      alert("Please enter no more than 25 characters in the \"First name\" field.");
      document.FrmRegister.txtForename.focus();
      return (false);
   }

   if (document.FrmRegister.txtForename.value.length < 2)
   {
     alert("Please enter at least 2 characters in the \"First name\" field.");
     document.FrmRegister.txtForename.focus();
     return (false);
   }

   var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ- \t\r\n\f";
   var checkStr = document.FrmRegister.txtForename.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, whitespace and \"-\" characters in the \"First name\" field.");
     document.FrmRegister.txtForename.focus();
     return (false);
   }

   if (mode=='create' && document.FrmRegister.lstDay.selectedIndex == 0) {
               alert("Please select your Day of Birth.");
               document.FrmRegister.lstDay.focus();
               return (false);
   }

   if (mode=='create' && document.FrmRegister.lstMonth.selectedIndex == 0) {
               alert("Please select your Month of Birth.");
               document.FrmRegister.lstMonth.focus();
               return (false);
   }


    if (document.FrmRegister.txtYear.value.length < 2)
     {
       alert("Please enter 2 digits in the \"Year of Birth\" field.");
       document.FrmRegister.txtYear.focus();
       return (false);
     }

     if (document.FrmRegister.txtYear.value.length > 2)
     {
       alert("Please enter at most 2 digits in the \"Year of Birth\" field.");
       document.FrmRegister.txtYear.focus();
       return (false);
     }

     var checkOK = "0123456789";
     var checkStr = document.FrmRegister.txtYear.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 digits in the \"Year of Birth\" field.");
       document.FrmRegister.txtYear.focus();
       return (false);
   }


   if (mode=='create' && document.FrmRegister.lstSex.selectedIndex == 0) {
             alert("Please select your gender.");
             document.FrmRegister.lstSex.focus();
             return (false);
   }

   if (document.FrmRegister.txtEmail.value.length < 5)
   {
     alert("Please enter at least 5 characters in the \"Email\" field.");
     document.FrmRegister.txtEmail.focus();
     return (false);
   }

   if (document.FrmRegister.txtEmail.value.indexOf("@") < 0 || document.FrmRegister.txtEmail.value.indexOf(".") < 0)
   {
     alert("An invalid \"Email\" address has been supplied please re-enter.");
     document.FrmRegister.txtEmail.focus();
     return (false);
   }
   if (document.FrmRegister.txtEmail.value != document.FrmRegister.txtEmail_Confirm.value)
    {
      alert("E-mail confirmation does not match E-mail - please re-enter");
      document.FrmRegister.txtEmail_Confirm.focus();
      return (false);
   }

   if (mode=='create' && document.FrmRegister.chkTerms.checked == false)
   {
      alert("You must read and approve the Terms and Conditions before registering.");
      document.FrmRegister.chkTerms.focus();
      return (false);
   }
   
   if (document.FrmRegister.txtHowdyahear.value.length < 1)
   {
     alert("Please tell us how you heard about FarmersOnly.");
     document.FrmRegister.txtHowdyahear.focus();
     return (false);
   }
   
   return (true);
 }







 function Validate_FrmRegister_2(mode) {

   if (document.FrmRegister.lstCountry &&
       document.FrmRegister.lstCountry.value <= 0)
    {
        alert("Please enter a value for the \"Country\" field.");
        document.FrmRegister.lstCountry.focus();
        return (false);
    }

   if (document.FrmRegister.lstCity &&
       document.FrmRegister.lstCity.value <= 0)
    {
        alert("Please enter a value for the \"State\" or \"City\" field.");
        document.FrmRegister.lstCity.focus();
        return (false);
    }
	return (true);
 }


function Validate_FrmRegister_3(mode) {
    if (mode=='create' && document.FrmRegister.lstSeeking.selectedIndex == 0) {
                alert("Please select the type of Relationship you are seeking.");
                document.FrmRegister.lstSeeking.focus();
                return (false);
   }

   if (mode=='create' && document.FrmRegister.lstBodyType.selectedIndex == 0) {
                alert("Please enter a value for the \"Body Type\" field.");
                document.FrmRegister.lstBodyType.focus();
                return (false);
   }


   if (mode=='create' && document.FrmRegister.lstHeight.selectedIndex == 0) {
                alert("Please enter a value for the \"Height\" field.");
                document.FrmRegister.lstHeight.focus();
                return (false);
   }

   if (mode=='create' && document.FrmRegister.lstChildren.selectedIndex == 0) {
                alert("Please enter a value for the \"Children\" field.");
                document.FrmRegister.lstChildren.focus();
                return (false);
   }


   if (mode=='create' && document.FrmRegister.lstSmoker.selectedIndex == 0) {
                  alert("Please enter a value for the \"Smoker\" field.");
                  document.FrmRegister.lstSmoker.focus();
                  return (false);
     }
   if (mode=='create' && document.FrmRegister.lstReligion.selectedIndex == 0) {
                alert("Please enter a value for the \"Religion\" field.");
                document.FrmRegister.lstReligion.focus();
                return (false);
   }

   if (mode=='create' && document.FrmRegister.lstMarital.selectedIndex == 0) {
                alert("Please enter a value for the \"Marital Status\" field.");
                document.FrmRegister.lstMarital.focus();
                return (false);
   }

   if (mode=='create' && document.FrmRegister.lstEthnicity.selectedIndex == 0) {
                alert("Please enter a value for the \"Ethnicity\" field.");
                document.FrmRegister.lstEthnicity.focus();
                return (false);
   }

   if (mode=='create' && document.FrmRegister.lstEducation.selectedIndex == 0) {
                alert("Please enter a value for the \"Education\" field.");
                document.FrmRegister.lstEducation.focus();
                return (false);
   }

   if (mode=='create' && document.FrmRegister.lstEmployment.selectedIndex == 0) {
                alert("Please enter a value for the \"Employment\" field.");
                document.FrmRegister.lstEmployment.focus();
                return (false);
   }
   if (mode=='create' && document.FrmRegister.lstDrink.selectedIndex == 0) {
                alert("Please enter a value for the \"Drinking\" field.");
                document.FrmRegister.lstDrink.focus();
                return (false);
   }


   if ((document.FrmRegister.chkSeekmen.checked == false) && (document.FrmRegister.chkSeekwmn.checked == false))
   {
     alert("Please select the genders you are \"Seeking\".");
     document.FrmRegister.chkSeekmen.focus();
     return (false);
   }
   return (true);
 }





 function Validate_FrmRegister_4(mode) {

   if (mode=='create' && document.FrmRegister.txtTitle.value.length < 5)
   {
       alert("Please enter at least 5 characters in the \"Your Headline\" field.");
       document.FrmRegister.txtTitle.focus();
       return (false);
   }

   if (mode=='create' && document.FrmRegister.txtTitle.value.length > 30)
   {
       alert("Please do not enter more than 30 characters in the \"Your Headline\" field.");
       document.FrmRegister.txtTitle.focus();
       return (false);
   }

   if (mode=='create' && document.FrmRegister.txtComment.value.length < 120)
   {
     alert("Please at least 120 characters in the \"Message About Yourself\" field.");
     document.FrmRegister.txtComment.focus();
     return (false);
   }

   if (mode=='create' && document.FrmRegister.txtComment.value.length > 4000)
   {
     alert("Please do not enter more than 4000 characters in the \"Message About Yourself\" field.");
     document.FrmRegister.txtComment.focus();
     return (false);
   }
   return (true);
 }

