<div class="top search-form__box py-4 py-xl-5">
  <div class="row m-0 d-flex flex-column w100">
    <div class="search-form__holder offset-lg-2 col-lg-8">
      <div class="row-title">
        <h3 class="headline headline--lg center white">Znajdź kancelarię</h3>
      </div>
      <div class="row-search">
        <div class="search-holder">
          <input type="text" class="pole_wyszukiwania pt" placeholder="Wpisz imię i nazwisko lub miasto" title="Wpisz imię i nazwisko lub miasto"><button id="szukaj" class="search pt btn btn--small">Wyszukaj</button>
        </div>
      </div>
      <div class="row-input">
        <ul id="list" class="list-none d-flex white">
          <li id="name" class="choosen"><span></span> Imię i nazwisko komornika</li>
          <li id="city"><span></span> Miasto</li>
        </ul>
      </div>
    </div>
  </div>

<script type="text/javascript">
jQuery('#name').click(function(){
	if(jQuery(this).hasClass('choosen')){

	}else{
		jQuery(this).addClass('choosen');
		jQuery('#city').removeClass('choosen');
		jQuery('#city img').attr("src","/wp-content/themes/komornik/assets/img/empty.png");
		jQuery('#name img').attr("src","/wp-content/themes/komornik/assets/img/selected.png");
	}
})
jQuery('#city').click(function(){
	if(jQuery(this).hasClass('choosen')){

	}else{
		jQuery(this).addClass('choosen');
		jQuery('#name').removeClass('choosen');
		jQuery('#name img').attr("src","/wp-content/themes/komornik/assets/img/empty.png");
		jQuery('#city img').attr("src","/wp-content/themes/komornik/assets/img/selected.png");
	}
})
jQuery('#szukaj').click(function(){
	var fraza = jQuery('.pole_wyszukiwania').val();
	var nazwa = ""
	if(jQuery('#name').hasClass('choosen')){
		 nazwa="nazwa";
	}else{
		 nazwa="miasto";
	}

	window.location.href = "?s="+fraza+"&k="+nazwa;


});
</script>



</div>
<br>
<div id="mar" style="margin-bottom:0px;"></div>
<script type="text/javascript">
o(1);
jQuery(document).keypress(function(e) {
    if(e.which == 13) {
        szukaj();
    }
});
  function szukaj(){
          for(var j=0;j!=6;j++){
              if(jQuery('#s'+j).hasClass( "search2" )){
                var val = jQuery("#szukm").val();
                if (val.length <3){
                  jQuery('#warn').show(1000);
                  jQuery('#zwin').animate({ marginTop: '0px' }, 1200);
                  jQuery('#rozwin').animate({ marginTop: '0px' }, 1200);
                }else{
                  jQuery('#warn').hide(1000);
                  switch(j) {
                      case 1:
                          window.location.href = "?s="+val+"&k=nazwa";
                      break;
                      case 2:
                          window.location.href = "?s="+val+"&k=miasto";
                      break;
                      case 3:
                          window.location.href = "?s="+val+"&k=okregowy";
                      break;
                      case 4:
                          window.location.href = "?s="+val+"&k=rejonowy";
                      break;
                  }
                }
              }
           }
          //
  }
  function o(i){
    for(var j=0;j!=6;j++){
      jQuery('#s'+j).removeClass('search2');
    }
    jQuery('#s'+i).addClass('search2');
    var place = null;
    if(i==1)place="Wprowadź imię / nazwisko";
    if(i==2)place="Wprowadź miasto";
    if(i==3)place="Wprowadź miasto";
    if(i==4)place="Wprowadź miasto";
    jQuery('#szukm').attr("placeholder", place);
  }

  jQuery('#zwin').click(function() {
      jQuery('#zwin').hide(0);
      jQuery('#rozwin').show(0);
      jQuery('.bott').slideUp(1000);
      jQuery('#mar').animate({ marginBottom: '-10px' }, 1200);
  });
  jQuery('#rozwin').click(function() {
      jQuery('#rozwin').hide(0);
      jQuery('#zwin').show(0);
      jQuery('.bott').slideDown(1000);
      jQuery('#mar').animate({ marginBottom: '0px' }, 1200);
  });

</script>
{"id":195,"date":"2015-09-05T14:47:42","date_gmt":"2015-09-05T12:47:42","guid":{"rendered":"http:\/\/dev.szmagli.info\/?page_id=195"},"modified":"2024-08-08T12:18:23","modified_gmt":"2024-08-08T10:18:23","slug":"kancelarie-komornicze","status":"publish","type":"page","link":"https:\/\/www.komornik.pl\/?page_id=195","title":{"rendered":"Kancelarie Komornicze"},"content":{"rendered":"\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":23,"featured_media":0,"parent":191,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"templates\/search-map-izby.php","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-195","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.komornik.pl\/index.php?rest_route=\/wp\/v2\/pages\/195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.komornik.pl\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.komornik.pl\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.komornik.pl\/index.php?rest_route=\/wp\/v2\/users\/23"}],"replies":[{"embeddable":true,"href":"https:\/\/www.komornik.pl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=195"}],"version-history":[{"count":8,"href":"https:\/\/www.komornik.pl\/index.php?rest_route=\/wp\/v2\/pages\/195\/revisions"}],"predecessor-version":[{"id":15331,"href":"https:\/\/www.komornik.pl\/index.php?rest_route=\/wp\/v2\/pages\/195\/revisions\/15331"}],"up":[{"embeddable":true,"href":"https:\/\/www.komornik.pl\/index.php?rest_route=\/wp\/v2\/pages\/191"}],"wp:attachment":[{"href":"https:\/\/www.komornik.pl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}