 function noEntry2() {

             if (document.search.poisk.value==""){
             alert("Введите слово для поиска!");
             document.search.poisk.focus();
             return false
             }
             }

 var htUri = "www.kalitva.ru";

     /*  выбор рубрики */
  function send(form, reg){
var chosen = document.form.ads_rub.options[document.form.ads_rub.selectedIndex].value;

   var myRe=/(\s*.*)-(\s*.*)/i;
  myArray = myRe.exec(chosen);
     var r1 = myArray[1];
     var r2 = myArray[2];
		self.location="http://"+ htUri +"/doska/"+reg+"/"+r1+"/"+r2+"/";
   //window.location.href = URL;
}

     /*  выбор региона */
  function sendRegion7(form, r1, r2){
var chosen3 = document.form2.ads_reg.options[document.form2.ads_reg.selectedIndex].value;

  if (r1==0) { self.location="http://"+ htUri +"/doska/"+chosen3+"/"; }
   else if (r2==0) { self.location="http://"+ htUri +"/doska/"+chosen3+"/"+r1+"/"; }
   else {	self.location="http://"+ htUri +"/doska/"+chosen3+"/"+r1+"/"+r2+"/"; }
   //window.location.href = URL;
}

/*------------------------------------------------------------------------------*/

function netscapeKeyPress(e) {
    if ((e.which < 48) ||(e.which > 57))
        alert('Вводить можно только цифры');
}

function microsoftKeyPress(e) {
var kk = navigator.appName == 'Netscape' ? e.which : e.keyCode;
    if ((kk < 48) || (kk > 57))
        alert('Вводить можно только цифры');
}

if (navigator.appName == 'Netscape') {
    window.captureEvents(Event.KEYPRESS);
    window.onKeyPress = netscapeKeyPress;
}


 /*------------------*/
 function ads_region2(ui2,cat,rub){
    if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  { xmlHttp.open('GET','http://'+ htUri +'/engine/modules/doska/ajax.php?id=' + ui2+'&cat='+cat+'&rub='+rub,true);
  xmlHttp.onreadystatechange = handleRegion; //http://www.kalitva.ru
     xmlHttp.send(null);}
  else setTimeout('ads_region2(ui2)', 1000);
}

function handleRegion()
{

  if (xmlHttp.readyState == 4)
  {

    if (xmlHttp.status == 200)
    {
      try
      {

      // document.location.reload("false");
    var xmlResponse = decodeURIComponent(xmlHttp.responseText);
   // alert(xmlResponse);
        var myRe=/(\s*.*)-(\s*.*)/i;
        myArray = myRe.exec(xmlResponse);
        var cat = myArray[1];
        var rub = myArray[2];
        if (rub == 0) {          document.location.href="http://"+ htUri +"/doska/"+cat+"/" ;
        }else{
       document.location.href="http://"+ htUri +"/doska/"+cat+"/"+rub+"/";
       }
      }
      catch(e)
      {

        displayError(e.toString());
      }
    }

    else
    {
      alert("There was a problem accessing the server: " + xmlHttp.statusText);
    }
  }
}

 function send_region(form2,cat,rub){
var chosen2 = document.form2.ads_reg.options[document.form2.ads_reg.selectedIndex].value;
     //                  alert ("chosen  "+chosen2);
 ads_region2(chosen2,cat,rub);
}





     function noDelete() {

if (confirm("\nВы уверены,\nчто хотите удалить?"))
        return true;
else                       //onsubmit="return check()"
 return false;

     }

