﻿

function  setany1(txt)
	{
		if (txt != "") document.add_form.city_otpr.value = txt;
    }


function  setany2(txt)
	{
    	if (txt != "") document.add_form.city_nazn.value = txt;
    }



function switch_find(id, aid) {
		if (document.getElementById && document.getElementById(id) != null)
      {
          if (!document.getElementById(id).style.display) {
              return false;
          }
          if (document.getElementById(id).style.display == 'none')
          {
              document.getElementById(id).style.display = 'block';
			  var a = document.getElementById(aid);
			  var b = a.childNodes[0];
			  b.nodeValue = "Ñêðûòü ïîèñê";

          } else {
              document.getElementById(id).style.display = 'none';
              var a = document.getElementById(aid);
			  var b = a.childNodes[0];
			  b.nodeValue = "Ïîêàçàòü ïîèñê";
          }
      }

      else {
          return false;
      }
      return true;
  }


function show(id){

    var divs = document.getElementsByTagName("div");
 	for (i=0; i<divs.length; i++)
 	{
  		if (divs[i].style.display=="block")
  		{
   			divs[i].style.display="none";
  		}
 	}
   document.getElementById('id'+id).style.display = 'block';

  }

function hide(){

    var divs = document.getElementsByTagName("div");
 	for (i=0; i<divs.length; i++)
 	{
  		if (divs[i].style.display=="block")
  		{
   			divs[i].style.display="none";
  		}
 	}

  }

function print_msg(p_path)
	{
		if (p_path && confirm("Распечатать объявление?"))
			window.open("/print.php?"+p_path, 'Print', 'top=30,left=30,width=600,height=600,resizable=1,scrollbars=1').focus();
	}
