var m_panel_nr=1,m_photo_nr=1;
function set_tab(a){var b=[1,2,3];for(i=0;i<3;i++)b[i]==a?(getE("panel_tab"+b[i]).className="show",getE("panel_lab"+b[i]).className="show",getE("tab_p"+b[i]+"_on").className="show",getE("tab_p"+b[i]+"_off").className="none"):(getE("panel_tab"+b[i]).className="none",getE("panel_lab"+b[i]).className="none",getE("tab_p"+b[i]+"_on").className="none",getE("tab_p"+b[i]+"_off").className="show");a==2||a==3?(getE("panel_tab_m").className="show",jQuery("#map").mapyEholiday().set_map_for_panel(),set_panel_layer(a)):
getE("panel_tab_m").className="none";getE("step").value=a}var last_art_panel;function set_art_panel(a){var b=["art-content","art-photos"];for(i=0;i<b.length;i++)b[i]==a?(getE(b[i]).className="block",getE("art_p"+(i+1)).className="selected"):(getE(b[i]).className="none",getE("art_p"+(i+1)).className="noselected");last_art_panel=a}var __loc_id,__loc_layer;
function set_photo_loc_li_sel(a){var b=document.getElementById("ul_f");if(b!=void 0){b=b.getElementsByTagName("li");for(i=0;i<b.length;i++)b[i].className="noselected"}a=getE("li_"+a);if(a!=void 0)a.className="selected"}function set_photo_loc(a){m_photo_nr=a.substring(1);set_photo_loc_li_sel(a);set_map_layer("photo_layer","center_point",a)}
function set_photo_loc3(a){m_panel_nr==2?(set_map_layer("article_layer","set_point",{type:"position",id:"art1",position:a.latLng}),update_page_data_latlng("art1","",a.latLng.lat(),a.latLng.lng())):(m_photo_nr==1&&set_photo_loc2("f1"),set_map_layer("photo_layer","set_point",{type:"position",id:"f"+m_photo_nr,position:a.latLng,zoom:1}),update_page_data_latlng("f"+m_photo_nr,m_photo_nr,a.latLng.lat(),a.latLng.lng()))}
function set_panel_loc(){var a,b,c,d;if(im_layers_icons.length==0&&(a=getE("lat").value,b=getE("lng").value,a||(a=null),b||(b=null),d=[],d.push({id:"art1",lat:a,lng:b,layer:"article_layer",icon:null}),im_layers_icons.push({name:"article_layer",icons:d,add:0,show:0}),a=document.getElementById("ul_f"),a!=void 0)){var e=a.getElementsByTagName("li");if(e.length>0){d=[];for(var f=0;f<e.length;f++)c=e[f].id.substring(3),a=getE("lat_"+c).value,b=getE("lng_"+c).value,a||(a=null),b||(b=null),d.push({id:c,
lat:a,lng:b,layer:"photo_layer",icon:null});im_layers_icons.push({name:"photo_layer",icons:d,add:0,show:0})}}}function set_panel_layer(a){m_panel_nr=a;a==2?(set_map_layer("photo_layer","hide_layer"),set_map_layer("article_layer","show_layer")):a==3&&(set_map_layer("article_layer","hide_layer"),set_map_layer("photo_layer","show_layer"))}function view_all_loc(){set_map_layer("photo_layer","show_layer")}
function parse_page_data_latlng(a){var b=getE("lat").value,c=getE("lng").value;b||(b=null);c||(c=null);a.push({id:"art1",lat:b,lng:c,layer_name:"article_layer",typ:"a",data_typ:"parse",mrk:0});b=document.getElementById("ul_f");if(b!=void 0){var d=b.getElementsByTagName("li");if(d.length>0)for(var e=0;e<d.length;e++)id=d[e].id.substring(3),b=getE("lat_"+id).value,c=getE("lng_"+id).value,b||(b=null),c||(c=null),a.push({id:id,lat:b,lng:c,layer_name:"photo_layer",typ:"ap",data_typ:"parse",mrk:e+1})}}
function update_page_data_latlng(a,b,c,d){a=="art1"?(getE("lat").value=c,getE("lng").value=d):(getE("lat_f"+b).value=c,getE("lng_f"+b).value=d)}var __lat_id="lat",__lng_id="lng";function ev_keyup(a,b,c){var a=encodeURI(b.value),b="",d;c=="land"?(b="sindex.php?a=get_list_land_data",d=pull_land):(b="sindex.php?a=get_list_data",d=pull_city);jQuery.ajax({url:b,cache:!1,data:{fraza:a},success:function(a){d(a)}})}
function set_city(a,b){document.getElementById("ms").value=b;document.getElementById("ms2").value=b;document.getElementById("cid").value=a;document.getElementById("ss4").innerHTML=""}
function pull_city(a){for(var b=null,c="",d=RegExp(/(([^\n]+)\n)/ig);(b=d.exec(a))!==null;)b=b[2].split(";"),c+='<li><a href="javascript:void(0)" onClick="set_city(\''+b[3]+"', '"+b[0]+"')\";><b>"+b[0]+"</b>, (gmina "+b[1]+", powiat "+b[2]+", woj. "+b[2]+")</a></li>";document.getElementById("ss4").innerHTML="<ul>"+c+"</ul>"}
function set_land(a,b){document.getElementById("ls").value=b;document.getElementById("ls2").value=b;document.getElementById("lid").value=a;document.getElementById("ss5").innerHTML=""}function pull_land(a){for(var b=null,c="",d=RegExp(/(([^\n]+)\n)/ig);(b=d.exec(a))!==null;)b=b[2].split(";"),c+='<li><a href="javascript:void(0)" onClick="set_land(\''+b[1]+"', '"+b[0]+"')\";>"+b[0]+"</a></li>";document.getElementById("ss5").innerHTML="<ul>"+c+"</ul>"}
function calcHeight(a){var b=parent.document.getElementById(a).contentWindow.document.body.scrollHeight;document.getElementById(a).height=b}function testW(){var a=window;return{w:(typeof a.pageXOffset!="undefined"?a.document.getElementsByTagName("body").item(0):a.document.compatMode&&a.document.compatMode=="CSS1Compat"?a.document.documentElement.getElementsByTagName("body").item(0):a.document.body||null).offsetWidth}}var back="";
function test_resize(){jQuery("#map").length>0&&jQuery("#map").mapyEholiday().set_resize()}
function hid_boxs(a){jQuery("#top-bar").css({display:a?"none":"block"});jQuery(".main-panels").css({display:a?"none":"block"});jQuery(".left-col-container .path").css({display:a?"none":"block"});jQuery(".border-box").each(function(){jQuery(this).css({display:a?"none":"block"})});jQuery(".google-ad").css({display:a?"none":"block"});jQuery(".advert").css({display:a?"none":"block"});jQuery("#crosslinks").css({display:a?"none":"block"});jQuery("#copyright").css({display:a?"none":"block"});jQuery("#footer").css({display:a?
"none":"block"});jQuery("#search-max").css({display:a?"block":"none"});var b=jQuery(window).height()-jQuery("#map").offset().top-jQuery("#search-max").height();jQuery("#map").css({height:b+"px"});jQuery("#map").mapyEholiday().set_resize()}function del_a(){confirm("Czy na pewno skasowa\u0107 ten artyku\u0142?");var a=document.forms.z2;a.elements.wtd.value="art_del";a.submit()}
function del(a){if(confirm("Czy na pewno skasowa\u0107 to zdj\u0119cie?")==!0){if(a!=void 0&&(a=document.getElementById("aph"+a),a!=void 0))document.z2.art_photo_id.value=a.value;a=document.forms.z2;a.elements.wtd.value="del";a.submit()}}function rotate(a,b){if(b!=void 0){var c=document.getElementById("aph"+b);if(c!=void 0)document.z2.art_photo_id.value=c.value}document.z2.rotate.value=a;document.z2.wtd.value="rotate";document.z2.submit()}
function cs1(){var a="";if(document.z1.ms.value!=document.z1.ms2.value||!document.z1.id.value)a='1. wpisz nazw\u0119 miejscowo\u015bci lub jej cz\u0119\u015b\u0107\n2. wybierz miejscowo\u015b\u0107 z listy poni\u017cej\n3. kliknij przycisk "dalej"';if(a)return alert(a),!1;document.z1.action=document.z1.action+"/"+document.z1.id.value;return!0}
function cs2(){var a="";document.z2.foto.value||(a+="\n - wybierz zdj\u0119cie");document.z2.regulamin.checked||(a+="\n - zaakceptuj regulamin");if(a)return alert("UWAGA!"+a),!1;else document.z2.add.disabled=!0;return!0}function cs3(){var a="";if(document.z1.ms.value!=document.z1.ms2.value||!document.z1.cid.value)a='1. wpisz nazw\u0119 miejscowo\u015bci lub jej cz\u0119\u015b\u0107\n2. wybierz miejscowo\u015b\u0107 z listy poni\u017cej\n3. kliknij przycisk "dalej"';return a?(alert(a),!1):!0}
function cs4(){var a="";document.z2.art_title.value||(a+="\n - dodaj tytu\u0142 artyku\u0142u");document.z2.regulamin.checked||(a+="\n - zaakceptuj regulamin");document.z2.regulamin_konkurs.checked||(a+="\n - zaakceptuj regulamin konkursu");var b=document.getElementById("art_text_rEdit");b!=void 0&&b.contentWindow.document.body.innerHTML.length<200&&(a+="\n - dodaj tre\u015b\u0107 artyku\u0142u, min. 200 znak\u00f3w");if(a)return alert("UWAGA!"+a),!1;else document.z2.add.disabled=!0;return!0}
function regulamin(){window.open("/regulamin/regulamin.html","","toolbar=1,top=0,left=0,location=0,resizable=0,directories=0,status=0,menubar=0,scrollbars=1,height=600,width=700")}function getE(a){return document.getElementById(a)}var x2,l2=[],poi_ts=[],poi_td=[],icon1,init_geo_map_u_status=0;function check_submit2(){return!0}
function check_submit(a){var b=a.miejscowosc.value,c=a.ulica.value;if(c=="ulica")c="",a.ulica.value="";if(a.miejscowosc.value!=a.o_miejscowosc.value)return!0;wu(b,c);return!1}var geocoder=null,nr_srch=1;
function wu(a,b){var c=a+", ul."+b;geocoder==null&&(geocoder=new google.maps.Geocoder);geocoder.geocode({address:c},function(d,e){if(e==google.maps.GeocoderStatus.OK&&(d[0].types[0]=="route"||d[0].types[0]=="street_address")){var f=d[0].geometry.location,g=d[0].formatted_address,g=g.replace(RegExp(" ?[0-9]*-[0-9]+","g"),""),h=[];h.push({id:"s"+nr_srch,lat:f.lat(),lng:f.lng(),layer_name:"street_layer",title:c,title2:g,drag:!1,typ:"st",data_typ:"srch",mrk:nr_srch});jQuery("#map").mapyEholiday().set_data("street_layer",
"add_layer",h,"cs2");nr_srch++}else alert("brak adresu:\n\nmiasto: "+a+"\nulica: "+b)})}function input_focus(a){a=document.getElementById(a);if(a.value==a.getAttribute("valueDef"))a.value="";a.style.color="#000"}function input_blur(a){a=document.getElementById(a);a.value==""?(a.value=a.getAttribute("valueDef"),a.style.color="#93999e"):a.style.color="#000"}function cities_pull_my_draw(a){return a.val+(a.tab[1]>1?" ["+a.tab[1]+"]":"")}function gal_pull_my_draw(a){return a.val+" ["+a.tab[1]+"]"}
function sel_run(a,b){b.array=[];for(var c=[],d=RegExp(/(([^\n]+)\n)/ig),e=RegExp(/(([^;]+)([;]|$))/ig),f=null;(f=d.exec(a))!==null;){var g=c.length;c[g]=[];for(var h=null;(h=e.exec(f[2]))!==null;)c[g][c[g].length]=h[2];b.array[b.array.length]=c[g].length>1?{val:c[g][0],tab:c[g]}:{val:c[g][0]}}}function q_in_url(a){var b=0,c="",b=a.indexOf("q=");b!=-1&&(c=a.substr(b+2,a.length));return c}
function start_init_map_u(){var a=0,b=0,c=0,d="",a="",d=window.location.href,e=window.location.pathname;if(d.indexOf("galeria-uzytkownik-")!=-1)return"usr";if(d.indexOf("ulica-")!=-1)return"str";if(d.indexOf("artykul-")!=-1)return"art";if(d.indexOf("noclegi-")!=-1)return"acc";if(d.indexOf("galeria-")!=-1)return"gal";a=d.lastIndexOf("/");b=d.indexOf("?",a);a=d.substr(a,b-a);for(i=0;i<a.length;i++)a.charAt(i)=="-"&&c++;if(c==1)return"city";d=q_in_url(d);return d!=""?(init_geo_map_u_status=1,d=decodeURI(d),
wu(getE("ts").value,d),"street"):e=="/"?"index":"city"}function after_init_map(){status_after_init_map=!0;site_loaded&&start_init_map()}function start_init_map_m(){m()}function start_init_map_mu(){mu()}function start_init_map_n(){mn()}function start_init_map_ur(){mur()}function start_init_map_ar(){mar()}
function start_init_map(){var a=start_init_map_u();a=="city"?start_init_map_m():a=="str"?start_init_map_mu():a=="usr"?start_init_map_ur():a=="art"?start_init_map_ar():a=="acc"&&start_init_map_n()}var getH=null,site_loaded=!1,menu1close=!1,status_after_init_map=!1;function xscore_v_click(){document.getElementById("xscore_v_btn").style.display="block"}var sort_last;
function sort_change(a,b){var c,d,e=document.forms.fs;typeof b=="object"?sort_last=c=b.value:(d=document.getElementById(b),c=d.value);var f=a+".html";c!=""&&(f=a+","+c+".html");c=e.elements.s.value;if(c=="s\u0142owo klucz"||c==""){if(sort_last==void 0)return!1;location.href=f;return!1}else b=="cs_ge"?f=a+","+d.options[3].value+".html":b=="cs_ar"&&(f=a+","+d.options[3].value+".html"),e.action=f;return!0}
function open_popup(a,b,c){typeof b=="undefined"&&(b=600);typeof c=="undefined"&&(c=400);window.open(a,"popup_window","width="+b+",height="+c+",resizable=1,top=100,left=350,scrollbars=yes,menubar=no,status=yes").focus()}function hid_margin(a){var b,c=window.location.host;a==1?(a=1,b=new Date((new Date).getTime()+18E5)):(a="",b=new Date((new Date).getTime()-864E5));setCookie("hid_margin",a,b,"/",c,void 0)}
function setCookie(a,b,c,d,e,f){a=a+"="+escape(b)+(c?"; expires="+c.toGMTString():"")+(d?"; path="+d:"")+(e?"; domain="+e:"")+(f?"; secure":"");document.cookie=a}
function try_load_now(a){this.load_func=a.load_func;this.timer=null;this.loaded=!1;this.counter=0;this.max_count=20;var b=this;this.start=function(){if(window.body_loaded==!0&&b.loaded==!1){clearTimeout(b.timer);try{b.load_func(),b.loaded=!0,clearTimeout(b.timer)}catch(a){b.run()}}else b.run()};this.run=function(){b.loaded=!1;b.timer=setTimeout(function(){b.start()},200);b.counter++;if(b.counter>b.max_count)b.loaded=!0};this.start()}
var new_start_function=function(){site_profil||start_init_map();var a=window.location.href,b=a.indexOf("/krok/");b!=-1&&a.indexOf("/dodano/")&&(b+=6,a=a.substring(b),set_tab(a));if(window.big_img)window.langV=new langSel,new big_img({loading_img:"img/bi/loading.gif",close_img:"img/bi/close.png",next_img:"img/bi/right.png",prev_img:"img/bi/left.png"});window.site_loaded=!0},tl_arr=[],url=window.location.href,site_start=!1,site_profil=!1,geocoder=null;
$(document).ready(function(){url.indexOf("/profil")!=-1&&(site_profil=!0);jQuery("#map").length>0&&jQuery("#map").mapyEholiday({lat:52,lng:19,zoom:6,zoom2:12,icon1:{title:"ikona1",zindex:1,img:"/img/srodek_of.png",size:[20,34],point1:[0,0],point2:[10,34]},icon2:{title:"ikona2",zindex:3,img:"/img/punkt_of.png",size:[36,26],point1:[0,0],point2:[18,13]},lang:{plus:""},change:null,parse_data:parse_page_data_latlng,update_data:update_page_data_latlng});jQuery("#text_srch").length>0&&jQuery("#text_srch").autocomplete({minLength:0,
source:function(a,b){geocoder==null&&(geocoder=new google.maps.Geocoder);var e=jQuery("#c_miejscowosc").val();geocoder.geocode({address:a.term+(e!=void 0&&e!=""?", "+e:"")+", Polska"},function(a,c){c==google.maps.GeocoderStatus.OK&&b(jQuery.map(a,function(a){var b=a.formatted_address,b=b.replace(RegExp(" ?[0-9]*-[0-9]+","g"),"").replace(RegExp(",? ?Polska","ig"),"");return{label:b,value:b,latLng:a.geometry.location}}))})},select:function(a,b){set_photo_loc3(b.item)}});var a="#ts, #ts_max",b="city";
jQuery("#ts2").length>0&&(a="#ts2",b="gal");if(jQuery(a).length>0)jQuery(a).autocomplete({minLength:3,source:function(a,d){var e=a.term;jQuery.ajax({url:"sindex.php?a=get_sel_"+b+"_data",cache:!1,data:{fraza:e},success:function(a){var b=RegExp("("+e+")","gi"),a=a.split("\n");d(jQuery.map(a,function(a){var a=a.split(";"),c=a[0].replace(b,"<strong>$1</strong>")+(a[1]>1?" ["+a[1]+" zdj\u0119\u0107]":"");return{label:a[0],value:a[0],desc:c,count:a[1]}}))}})},select:function(){}}),jQuery(a).data("autocomplete")._renderItem=
function(a,b){return $("<li></li>").data("item.autocomplete",b).append("<a>"+b.desc+"</a>").appendTo(a)};window.new_start_function();site_start=!0});

