// textarea counter on adverts form
  function textCounter(field, countfield) {
      {countfield.value =  field.value.length;}
  }

function Validate_FrmReports() {

  if (document.FrmReports.lstPeriod.selectedIndex == 0)
   {
               alert("Пожалуйста, заполните поле \"Период\".");
               document.FrmReports.lstPeriod.focus();
               return (false);
   }
  if (document.FrmReports.lstYear.selectedIndex == 0)
   {
               alert("Пожалуйста, заполните поле \"Год\".");
               document.FrmReports.lstYear.focus();
               return (false);
   }
   document.FrmReports.hdnyear.value=document.FrmReports.lstYear.value;
   document.FrmReports.hdnperiod.value=document.FrmReports.lstPeriod.value;
  return (true);
 }

 function Validate_FrmPersonal() {  if (document.FrmPersonal.lstPerson1.selectedIndex == 0)
    {
                alert("Пожалуйста, заполните поле \"Характер\".");
                document.FrmPersonal.lstPerson1.focus();
                return (false);
    }  if (document.FrmPersonal.lstPhilos1.selectedIndex == 0)
    {
                alert("Пожалуйста, заполните поле \"Философия\".");
                document.FrmPersonal.lstPhilos1.focus();
                return (false);
    }

   if (document.FrmPersonal.lstSocial1.selectedIndex == 0)
    {
                alert("Пожалуйста, заполните поле \"Социальная группа\".");
                document.FrmPersonal.lstSocial1.focus();
                return (false);
    }

   if (document.FrmPersonal.lstGoal1.selectedIndex == 0)
    {
                alert("Пожалуйста, заполните поле \"Жизненные цели\".");
                document.FrmPersonal.lstGoal1.focus();
                return (false);
    }

   if (document.FrmPersonal.lstHobby1.selectedIndex == 0)
    {
                alert("Пожалуйста, заполните поле \"Хобби\".");
                document.FrmPersonal.lstHobby1.focus();
                return (false);
    }

   if (document.FrmPersonal.lstSport1.selectedIndex == 0)
    {
                alert("Пожалуйста, заполните поле \"Спорт\".");
                document.FrmPersonal.lstSport1.focus();
                return (false);
    }

   if (document.FrmPersonal.lstMusic1.selectedIndex == 0)
    {
                alert("Пожалуйста, заполните поле \"Музыка\".");
                document.FrmPersonal.lstMusic1.focus();
                return (false);
    }

   if (document.FrmPersonal.lstFood1.selectedIndex == 0)
    {
                alert("Пожалуйста, заполните поле \"Еда\".");
                document.FrmPersonal.lstFood1.focus();
                return (false);
    }

   return (true);
 }
function Validate_FrmSendMail() {
  if (document.FrmSendMail.txtSubject.value.length < 1)
  {
    alert("Пожалуйста, заполните поле \"Тема\" field.");
    document.FrmSendMail.txtSubject.focus();
    return (false);
  }
  if (document.FrmSendMail.txtMessage.value.length < 1)
  {
    alert("Пожалуйста, заполните поле \"Сообщение\" field.");
    document.FrmSendMail.txtMessage.focus();
    return (false);
  }

  return (true);
 }

 function Validate_FrmLogin() {

   if (document.FrmLogin.txtHandle.value.length < 5)
   {
     alert("Поле  \"Логин\" Должно содержать не менее 5 символов.");
     document.FrmLogin.txtHandle.focus();
     return (false);
   }

   if (document.FrmLogin.txtHandle.value.length > 25)
   {
     alert("Поле \"Логин\" не должно превышать 25 символов.");
     document.FrmLogin.txtHandle.focus();
     return (false);
   }

   if (document.FrmLogin.txtPassword.value.length < 6)
   {
     alert("Поле  \"Пароль\" должно содержать не менее 6 символов.");
     document.FrmLogin.txtPassword.focus();
     return (false);
   }

   if (document.FrmLogin.txtPassword.value.length > 35)
   {
     alert("Поле \"Пароль\" должно содержать не более 35 символов.");
     document.FrmLogin.txtPassword.focus();
     return (false);
   }

   return (true);
 }

 function Validate_FrmRegister(mode) {

   if (mode == 'create') {

           if (document.FrmRegister.txtHandle.value == "")
           {
             alert("Поле  \"Логин\" Должно содержать не менее 5 символов.");
             document.FrmRegister.txtHandle.focus();
             return (false);
           }
           if (document.FrmRegister.txtHandle.value.length > 25)
           {
             alert("Поле  \"Логин\" Должно содержать не более 25 символов..");
             document.FrmRegister.txtHandle.focus();
             return (false);
           }
           if (document.FrmRegister.txtHandle.value.length < 5)
           {
             alert("Поле  \"Логин\" Должно содержать не менее 5 символов.");
             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("Поле \"Логин\" может содержать только буквы, цифры и знак \"-\".");
             document.FrmRegister.txtHandle.focus();
             return (false);
           }
   }
if((!document.FrmRegister.txtLastPassword)||(document.FrmRegister.txtLastPassword.value.length>0)){var LastPassword=1;}	

if (LastPassword == 1){
   if (document.FrmRegister.txtPassword.value.length < 6)
   {
     alert("Поле \"Пароль\" должно содержать не менее 6 символов.");
     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("Поле  \"Пароль\" может содержать только буквы и цифры.");
     document.FrmRegister.txtPassword.focus();
     return (false);
   }

   if (document.FrmRegister.txtPassword.value.length > 35)
    {
      alert("Поле \"Пароль\" не должно содержать более 35 символов.");
      document.FrmRegister.txtPassword.focus();
      return (false);
   }

   if (document.FrmRegister.txtConfirm.value.length < 6)
   {
     alert("Поле \"Повоторить\" должно содержать не менее 6 символов.");
     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("Поле  \"Повторить\" может содержать только буквы и цифры.");
     document.FrmRegister.txtConfirm.focus();
     return (false);
   }

   if (document.FrmRegister.txtConfirm.value.length > 35)
    {
     alert("Поле \"Повторить\" должно содержать не более 35 символов.");
      document.FrmRegister.txtConfirm.focus();
      return (false);
   }
   if (document.FrmRegister.txtPassword.value != document.FrmRegister.txtConfirm.value)
    {
      alert("Пароль и повтор пароля не совпадают. Попробуйте еще раз.");
      document.FrmRegister.txtPassword.focus();
      return (false);
   }
}
   if (document.FrmRegister.txtSurname.value.length < 1)
   {
     alert("Пожалуйста, заполните поле  \"Фамилия\".");
     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("Пожалуйста, используйте только буквы, пробел и символ \"-\" в поле \"Фамилия\" .");
     document.FrmRegister.txtSurname.focus();
     return (false);
   }

   if (document.FrmRegister.txtSurname.value.length > 25)
    {
      alert("Поле \"Фамилия\" должно содержать не более 25 символов.");
      document.FrmRegister.txtSurname.focus();
      return (false);
   }

   if (document.FrmRegister.txtForename.value.length > 25)
    {
      alert("Поле \"Имя\" должно содержать не более 25 символов.");
      document.FrmRegister.txtForename.focus();
      return (false);
   }

   if (document.FrmRegister.txtForename.value.length < 2)
   {
      alert("Поле \"Имя\" должно содержать не менее 2 символов.");
     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("Пожалуйста, используйте только буквы, пробел и символ \"-\" в поле \"Имя\" .");
     document.FrmRegister.txtForename.focus();
     return (false);
   }

   if (mode=='create' && document.FrmRegister.lstDay.selectedIndex == 0) {
               alert("Пожалуйста, выберите день Вашего рождения.");
               document.FrmRegister.lstDay.focus();
               return (false);
   }

   if (mode=='create' && document.FrmRegister.lstMonth.selectedIndex == 0) {
               alert("Пожалуйста, выберите месяц Вашего рождения.");
               document.FrmRegister.lstMonth.focus();
               return (false);
   }


    if (document.FrmRegister.txtYear.value.length < 2)
     {
       alert("Пожалуйста, введите 2 последние цифры в поле \"Год рождения\".");
       document.FrmRegister.txtYear.focus();
       return (false);
     }

     if (document.FrmRegister.txtYear.value.length > 2)
     {
       alert("Пожалуйста, введите 2 последние цифры в поле \"Год рождения\".");
       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("Пожалуйста, испольуйте только цифры в поле \"Год рождения\".");
       document.FrmRegister.txtYear.focus();
       return (false);
   }


   if (mode=='create' && document.FrmRegister.lstSex.selectedIndex == 0) {
             alert("Пожалуйста, заполните поле \"Пол\".");
             document.FrmRegister.lstSex.focus();
             return (false);
   }

   if (document.FrmRegister.txtEmail.value.length < 5)
   {
     alert("Поле \"E-mail\" должно содержать не менее 5 символов.");
     document.FrmRegister.txtEmail.focus();
     return (false);
   }

   if (document.FrmRegister.txtEmail.value.indexOf("@") < 0 || document.FrmRegister.txtEmail.value.indexOf(".") < 0)
   {
     alert("Поле \"E-mail\" заполнено неверно. Попробуйте еще раз.");
     document.FrmRegister.txtEmail.focus();
     return (false);
   }

   if (mode=='create' && document.FrmRegister.chkDisclaimer.checked == false)
   {
      alert("Для регистрации, Вы должны прочитать и принять условия соглашения.");
      document.FrmRegister.chkDisclaimer.focus();
      return (false);
   }

   if (document.FrmRegister.lstCountry.value == '0')
    {
        alert("Пожалуйста, заполните поле \"Страна\".");
        document.FrmRegister.lstCountry.focus();
        return (false);
    }

   if (document.FrmRegister.lstCity.value == '0')
    {
        alert("Пожалуйста, заполните поле \"Город\".");
        document.FrmRegister.lstCity.focus();
        return (false);
    }

	if (mode=='create' && document.FrmRegister.lstSeeking.selectedIndex == 0) {
        alert("Пожалуйста, выберите, цель знакомства.");
                document.FrmRegister.lstSeeking.focus();
                return (false);
   }

/*   if (mode=='create' && document.FrmRegister.lstBodyType.selectedIndex == 0) {
        alert("Пожалуйста, заполните поле \"Телосложение\".");
                document.FrmRegister.lstBodyType.focus();
                return (false);
   }


   if (mode=='create' && document.FrmRegister.lstHeight.selectedIndex == 0) {
        alert("Пожалуйста, заполните поле \"Рост\".");
                document.FrmRegister.lstHeight.focus();
                return (false);
   }

   if (mode=='create' && document.FrmRegister.lstChildren.selectedIndex == 0) {
        alert("Пожалуйста, заполните поле \"Дети\".");
                document.FrmRegister.lstChildren.focus();
                return (false);
   }


   if (mode=='create' && document.FrmRegister.lstSmoker.selectedIndex == 0) {
                  alert("Пожалуйста, заполните поле \"Курение\".");
                  document.FrmRegister.lstSmoker.focus();
                  return (false);
     }
   if (mode=='create' && document.FrmRegister.lstReligion.selectedIndex == 0) {
                alert("Пожалуйста, заполните поле \"Религия\".");
                document.FrmRegister.lstReligion.focus();
                return (false);
   }

   if (mode=='create' && document.FrmRegister.lstMarital.selectedIndex == 0) {
                alert("Пожалуйста, заполните поле \"Семейное положение\".");
                document.FrmRegister.lstMarital.focus();
                return (false);
   }

   if (mode=='create' && document.FrmRegister.lstEthnicity.selectedIndex == 0) {
                alert("Пожалуйста, заполните поле \"Расса\".");
                document.FrmRegister.lstEthnicity.focus();
                return (false);
   }

   if (mode=='create' && document.FrmRegister.lstEducation.selectedIndex == 0) {
                alert("Пожалуйста, заполните поле \"Образование\".");
                document.FrmRegister.lstEducation.focus();
                return (false);
   }

   if (mode=='create' && document.FrmRegister.lstEmployment.selectedIndex == 0) {
                alert("Пожалуйста, заполните поле \"Профессия\".");
                document.FrmRegister.lstEmployment.focus();
                return (false);
   }
   if (mode=='create' && document.FrmRegister.lstIncome.selectedIndex == 0) {
                alert("Пожалуйста, заполните поле \"Доход\".");
                document.FrmRegister.lstIncome.focus();
                return (false);
   }

*/
   if (mode=='create' && document.FrmRegister.chkSeekmen.checked == false && document.FrmRegister.chkSeekwmn.checked == false && document.FrmRegister.chkSeekcpl.checked == false)
   {
     alert("Пожалуйста, выберите, кого вы ищите.");
     document.FrmRegister.chkSeekmen.focus();
     return (false);
   }

   if (mode=='create' && (document.FrmRegister.txtTitle.value.length < 5 || document.FrmRegister.txtTitle.value.length > 30))
   {
       alert("Поле  \"Заголовок\" должно содержать не менее 5 символов.");
       document.FrmRegister.txtTitle.focus();
       return (false);
   }

/*   if (mode=='create' && (document.FrmRegister.txtComment.value.length < 120 || document.FrmRegister.txtComment.value.length > 4000))
   {
     alert("Please enter between 120 and 4000 characters in the \"Message\" field.");
     document.FrmRegister.txtComment.focus();
     return (false);
   }
*/

   return (true);
 }

 function Validate_FrmAffiliate() {

   if (document.FrmAffiliate.txtUsername.value.length > 25)
   {
     alert("Поле \"Логин\" должно содержать не более 25 символов.");
     document.FrmAffiliate.txtUsername.focus();
     return (false);
   }

   if (document.FrmAffiliate.txtUsername.value.length < 6)
   {
     alert("Поле \"Логин\" должно содержать не менее 6 символов..");
     document.FrmAffiliate.txtUsername.focus();
     return (false);
   }

   var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzѓЉЊЋљњћџАБВГДЕЖЗИЙКЛМНОПРСТУФХЦШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцшщъыьэюя1234567890-\t\r\n\f";
   var checkStr = document.FrmAffiliate.txtUsername.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("Поле \"Логин\" может содержать только буквы, цифры и знак \"-\".");
     document.FrmAffiliate.txtUsername.focus();
     return (false);
   }

   if (document.FrmAffiliate.txtSurname.value.length < 2)
   {
     alert("Поле \"Фамилия\" должно содержать не менее 2 символов.");
     document.FrmAffiliate.txtSurname.focus();
     return (false);
   }

   var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzѓЉЊЋљњћџАБВГДЕЖЗИЙКЛМНОПРСТУФХЦШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцшщъыьэюя- \t\r\n\f";
   var checkStr = document.FrmAffiliate.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("Поле  \"Фамилия\" может содержать только буквы, пробелы и символ \"-\".");
     document.FrmAffiliate.txtSurname.focus();
     return (false);
   }

   if (document.FrmAffiliate.txtSurname.value.length > 25)
    {
     alert("Поле \"Фамилия\" должно содержать не более 25 символов.");
      document.FrmAffiliate.txtSurname.focus();
      return (false);
   }

   if (document.FrmAffiliate.txtForename.value.length > 25)
    {
     alert("Поле \"Имя\" должно содержать не более 25 символов.");
      document.FrmAffiliate.txtForename.focus();
      return (false);
   }

   if (document.FrmAffiliate.txtForename.value.length < 2)
   {
     alert("Поле \"Имя\" должно содержать не менее 2 символов.");
     document.FrmAffiliate.txtForename.focus();
     return (false);
   }

   var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzѓЉЊЋљњћџАБВГДЕЖЗИЙКЛМНОПРСТУФХЦШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцшщъыьэюя- \t\r\n\f";
   var checkStr = document.FrmAffiliate.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("Поле  \"Имя\" может содержать только буквы, пробелы и символ \"-\".");
     document.FrmAffiliate.txtForename.focus();
     return (false);
   }

   if (document.FrmAffiliate.txtBusiness.value == "")
   {
     alert("Please enter a value for the \"Business name\" field.");
     document.FrmAffiliate.txtBusiness.focus();
     return (false);
   }

   if (document.FrmAffiliate.txtAddress.value == "")
   {
     alert("Please enter a value for the \"Address\" field.");
     document.FrmAffiliate.txtAddress.focus();
     return (false);
   }

   if (document.FrmAffiliate.txtStreet.value == "")
   {
     alert("Please enter a value for the \"Street\" field.");
     document.FrmAffiliate.txtStreet.focus();
     return (false);
   }

   if (document.FrmAffiliate.txtTown.value == "")
   {
     alert("Please enter a value for the \"Town\" field.");
     document.FrmAffiliate.txtTown.focus();
     return (false);
   }

   if (document.FrmAffiliate.txtState.value == "")
   {
     alert("Please enter a value for the \"State\" field.");
     document.FrmAffiliate.txtState.focus();
     return (false);
   }

   if (document.FrmAffiliate.txtZip.value == "")
   {
     alert("Please enter a value for the \"Zip\" field.");
     document.FrmAffiliate.txtZip.focus();
     return (false);
   }

   if (document.FrmAffiliate.lstCountry.selectedIndex == 0)
    {
                alert("Пожалуйста, заполните поле \"Страна\".");
                document.FrmAffiliate.lstCountry.focus();
                return (false);
    }

   if (document.FrmAffiliate.txtEmail.value.length < 5)
   {
     alert("Please enter at least 5 characters in the \"Email\" field.");
     document.FrmAffiliate.txtEmail.focus();
     return (false);
   }

   if (document.FrmAffiliate.txtEmail.value.indexOf("@") < 0 || document.FrmAffiliate.txtEmail.value.indexOf(".") < 0)
   {
     alert("An invalid \"Email\" address has been supplied please re-enter.");
     document.FrmAffiliate.txtEmail.focus();
     return (false);
   }

    if (document.FrmAffiliate.txtWebsite.value == "http://")
    {
      alert("Please enter a value for the \"Website\" field.");
      document.FrmAffiliate.txtWebsite.focus();
      return (false);
    }


    if (document.FrmAffiliate.txtPayable.value == "")
    {
      alert("Please enter a value for the \"Payable\" field.");
      document.FrmAffiliate.txtPayable.focus();
      return (false);
    }


   return (true);
 }

 function Validate_FrmAdvert(mode) {

   if (document.FrmAdvert.lstCountry.value == '0')
    {
        alert("Пожалуйста, заполните поле \"Страна\".");
        document.FrmAdvert.lstCountry.focus();
        return (false);
    }

   if (document.FrmAdvert.chkSeekmen.checked == false && document.FrmAdvert.chkSeekwmn.checked == false && document.FrmAdvert.chkSeekcpl.checked == false)
   {
     alert("Пожалуйста, выберите, кого вы ищите.");
     document.FrmAdvert.chkSeekmen.focus();
     return (false);
   }


   if (document.FrmAdvert.txtTitle.value.length < 5 || document.FrmAdvert.txtTitle.value.length > 30)
   {
       alert("Поле \"Заголовок\" должно содержать от 5 до 30 символов.");
       document.FrmAdvert.txtTitle.focus();
       return (false);
   }

/*   if (document.FrmAdvert.txtComment.value.length < 120 || document.FrmAdvert.txtComment.value.length > 4000 )
   {
     alert("Please enter between 120 and 4000 characters in the \"Message\" field.");
     document.FrmAdvert.txtComment.focus();
     return (false);
   }
*/

   return (true);
 }


function delete_alert() {
        if (window.confirm("Вы действительно хотите удалить всю информацию о себе, включая логин и пароль?")) {
                return true;
        } else {
                return false;
        }
}
function delete_alert2() {
        if (window.confirm("Вы действительно хотите удалить всю информацию о себе, включая логин и пароль?")) {
                return true;
        } else {
                return false;
        }
}
function delete_alert3() {
        if (window.confirm("Вы действительно хотите удалить всю информацию о себе, включая логин и пароль?")) {
                return true;
        } else {
                return false;
        }
}
function delete_alert4() {
        if (window.confirm("Вы действительно хотите удалить всю информацию о себе, включая логин и пароль?")) {
                return true;
        } else {
                return false;
        }
}
function skip_alert() {
        if (window.confirm("Вы хотитет пропустить эту часть заполнения профайла?")) {
                return true;
        } else {
                return false;
        }
}
function MDM_openWindow(theURL,winName,features) {
        var _W=window.open(theURL,winName,features);
        _W.focus();
        _W.moveTo(50,50);
}
function selected(oRow){ oRow.style.backgroundColor='#FFFFE6'; }
function deselected(oRow){ oRow.style.backgroundColor='#DCE8FC'; }

function cupid_alert() {
        if (window.confirm("Are you sure you wish to run this process? Please check the documentation if unsure.")) {
                return true;
        } else {
                return false;
        }
}


function wopen(wurl,wname,w,h)
{
wfeatures='height=60,width=468,scrollbars=yes,menubar=yes,status=yes';
window.open(wurl,wname,wfeatures); 
}

 function changeCity()
  {
    if ((document.forms)&&(document.forms.dating_service))
     {
       sindex=document.forms.dating_service.elements.lstDatingCountry.selectedIndex;
       if (document.forms.dating_service.elements.lstDatingCountry[sindex].value=="more")
        {
          wopen('/anketa/search.html','SearchCity','0','0');
        }
     }

  }


