function UltraMarker(b,a){this.latlng=b;if(!a){a={}}this.zIndex=a.zIndex;this.preventClick=a.preventClick;this.htmlClass=a.htmlClass;this.height_=a.height||32;this.width_=a.width||32;this.image_=a.image;this.imageOver_=a.imageOver;this.clicked_=0;this.link_=a.link;this.alwaysOnTop=a.alwaysOnTop||false}UltraMarker.prototype=new GOverlay();UltraMarker.prototype.initialize=function(c){var b=this;var a=document.createElement(this.link_?"a":"div");if(this.link_){a.href=this.link_}if(this.preventClick){a.onclick=function(){return false}}a.className="transparent";if(this.htmlClass){a.className+=" "+this.htmlClass}a.style.position="absolute";a.style.paddingLeft="0px";a.style.cursor="pointer";a.style.display="block";a.style.backgroundImage='url("'+this.image_+'")';a.style.backgroundPosition="center center";a.style.backgroundRepeat="no-repeat";GEvent.addDomListener(a,"click",function(d){b.clicked_=1;GEvent.trigger(b,"click");if(!d){var d=window.event}d.cancelBubble=true;if(d.stopPropagation){d.stopPropagation()}if(d.preventDefault){d.preventDefault()}});GEvent.addDomListener(a,"mouseover",function(d){GEvent.trigger(b,"mouseover")});GEvent.addDomListener(a,"mouseout",function(d){GEvent.trigger(b,"mouseout")});c.getPane(G_MAP_MARKER_PANE).appendChild(a);this.map_=c;this.div_=a};UltraMarker.prototype.remove=function(){this.div_.parentNode.removeChild(this.div_)};UltraMarker.prototype.copy=function(){var a={};a.color=this.color_;a.height=this.height_;a.width=this.width_;a.image=this.image_;a.imageOver=this.image_;return new UltraMarker(this.latlng,a)};UltraMarker.prototype.redraw=function(a){if(!a){return}var b=this.map_.fromLatLngToDivPixel(this.latlng);this.div_.style.width=this.width_+"px";this.div_.style.left=(b.x-this.width_/2)+"px";this.div_.style.height=(this.height_)+"px";this.div_.style.top=(b.y-this.height_/2)+"px";this.div_.style.zIndex=""+this.getZIndex()};UltraMarker.prototype.getZIndex=function(a){if(this.zIndex){return this.zIndex}var b=GOverlay.getZIndex(this.getPoint().lat());return this.alwaysOnTop?b+9999:b};UltraMarker.prototype.getPoint=function(){return this.latlng};UltraMarker.prototype.setStyle=function(a){for(s in a){this.div_.style[s]=a[s]}};UltraMarker.prototype.setImage=function(a){this.div_.style.backgroundImage='url("'+a+'")'};UltraMarker.prototype.getLatLng=function(){return this.latlng};UltraMarker.prototype.getSize=function(){return new GSize(this.width_,this.height_)};UltraMarker.prototype.getIcon=function(){var a=this;return{iconSize:a.getSize(),iconAnchor:new GPoint(a.width_/2,a.height_/2)}};function PlaceMarker(c,b,a){UltraMarker.call(this,c,b);this.name=a;this.placeClass=b.placeClass}PlaceMarker.prototype=new UltraMarker();PlaceMarker.prototype.constructor=PlaceMarker;PlaceMarker.prototype.initialize=function(c){UltraMarker.prototype.initialize.call(this,c);var b=document.createElement("div");var a=document.createElement("div");b.appendChild(a);a.className="inner";b.className="placeLabel";b.style.position="absolute";b.style.display="block";a.innerHTML="<nobr>"+this.name+"</nobr>";c.getPane(G_MAP_MARKER_PANE).appendChild(b);this.placeLabel=b};PlaceMarker.prototype.getZIndex=function(a){return this.getPoint().lng()*100};PlaceMarker.prototype.redraw=function(a){if(!a){return}UltraMarker.prototype.redraw.call(this,a);this.placeLabel.style.top=""+(parseInt(this.div_.style.top)+18)+"px";this.placeLabel.style.left=""+(parseInt(this.div_.style.left)+25)+"px";this.div_.style.zIndex=""+parseInt(this.getZIndex());this.placeLabel.style.zIndex=""+(parseInt(this.div_.style.zIndex)-10)};PlaceMarker.prototype.remove=function(){this.div_.parentNode.removeChild(this.div_);this.placeLabel.parentNode.removeChild(this.placeLabel)};(function(a){a.fn.extend({find_pos:function(){if(!this.tagName&&this.length){obj=this[0]}else{return[0,0]}var b=curtop=0;if(obj.offsetParent){b=obj.offsetLeft;curtop=obj.offsetTop;while(obj=obj.offsetParent){b+=obj.offsetLeft;curtop+=obj.offsetTop}}return[b,curtop]}});a.MapTips=function(c){var b=this;var d=c;this.add_tooltip=function(e,f){e.tooltip=f;GEvent.addListener(e,"mouseover",b.show_tooltip);GEvent.addListener(e,"mouseout",b.hide_tooltip)};this.show_tooltip=function(k){var t=d.fromLatLngToContainerPixel(this.getLatLng());var i=null;i=document.getElementById("tipDiv");if(!i){i=document.createElement("div");i.className="maptip";i.id="tipDiv";document.body.appendChild(i)}i.style.display="block";i.innerHTML=this.tooltip;var l=a(d.getContainer()).find_pos();var n=l[0];var m=l[0]+a(d.getContainer()).width();var e=l[1];var j=this.getIcon().iconSize;l[0]+=t.x-j.width/2;l[1]+=t.y-j.height/2;var g=i.offsetHeight+5;var h=i.offsetWidth/2;var r=l[0]-h;var q=l[1]-g;var o=l[0]-h;var f=l[0]-h+i.offsetWidth;if(n>=o){r+=n-o+3}else{if(m<=f){r-=f-m+3}}if(e>=q){q+=g+j.height+10}i.style.top=""+q+"px";i.style.left=""+r+"px"};this.hide_tooltip=function(){var e=document.getElementById("tipDiv");if(e){e.style.display="none"}}}})(jQuery);function ClusterMarker(b,a){this.zIndex=a.zIndex;this._map=b;this._mapMarkers=[];this._iconBounds=[];this._clusterMarkers=[];this._eventListeners=[];if(typeof(a)==="undefined"){a={}}this.borderPadding=(a.borderPadding)?a.borderPadding:256;this.clusteringEnabled=(a.clusteringEnabled===false)?false:true;if(a.clusterMarkerClick){this.clusterMarkerClick=a.clusterMarkerClick}if(a.clusterMarkerMouseOver){this.clusterMarkerMouseOver=a.clusterMarkerMouseOver}if(a.clusterMarkerMouseOut){this.clusterMarkerMouseOut=a.clusterMarkerMouseOut}if(a.clusterMarkerIcon){this.clusterMarkerIcon=a.clusterMarkerIcon}else{this.clusterMarkerIcon=new GIcon();this.clusterMarkerIcon.image="http://maps.google.com/mapfiles/arrow.png";this.clusterMarkerIcon.iconSize=new GSize(39,34);this.clusterMarkerIcon.iconAnchor=new GPoint(9,31);this.clusterMarkerIcon.infoWindowAnchor=new GPoint(9,31);this.clusterMarkerIcon.shadow="http://www.google.com/intl/en_us/mapfiles/arrowshadow.png";this.clusterMarkerIcon.shadowSize=new GSize(39,34)}this.clusterMarkerTitle=(a.clusterMarkerTitle)?a.clusterMarkerTitle:"";if(a.fitMapMaxZoom){this.fitMapMaxZoom=a.fitMapMaxZoom}this.intersectPadding=(a.intersectPadding)?a.intersectPadding:0;if(a.markers){this.addMarkers(a.markers)}GEvent.bind(this._map,"moveend",this,this._moveEnd);GEvent.bind(this._map,"zoomend",this,this._zoomEnd);GEvent.bind(this._map,"maptypechanged",this,this._mapTypeChanged)}ClusterMarker.prototype.addMarkers=function(b){var a;if(!b[0]){var c=[];for(a in b){c.push(b[a])}b=c}for(a=b.length-1;a>=0;a--){b[a]._isVisible=false;b[a]._isActive=false;b[a]._makeVisible=false}this._mapMarkers=this._mapMarkers.concat(b)};ClusterMarker.prototype._clusterMarker=function(b){var j=this;function a(n,i,m){var l={icon:i,title:m};if(j.zIndex){l.zIndexProcess=function(){return j.zIndex}}return new GMarker(n,l)}var h=new GLatLngBounds(),d,e,g=[],k,f=this,c=this._mapMarkers;for(d=b.length-1;d>=0;d--){k=c[b[d]];k.index=b[d];h.extend(k.getLatLng());g.push(k)}e=a(h.getCenter(),this.clusterMarkerIcon,this.clusterMarkerTitle.replace(/%count/gi,b.length));e.clusterGroupBounds=h;this._eventListeners.push(GEvent.addListener(e,"click",function(){f.clusterMarkerClick({clusterMarker:e,clusteredMarkers:g})}));this._eventListeners.push(GEvent.addListener(e,"mouseover",function(){f.clusterMarkerMouseOver({clusterMarker:e,clusteredMarkers:g})}));this._eventListeners.push(GEvent.addListener(e,"mouseout",function(){f.clusterMarkerMouseOut({clusterMarker:e,clusteredMarkers:g})}));e._childIndexes=b;for(d=b.length-1;d>=0;d--){c[b[d]]._parentCluster=e}return e};ClusterMarker.prototype.clusterMarkerClick=function(a){this._map.setCenter(a.clusterMarker.getLatLng(),this._map.getBoundsZoomLevel(a.clusterMarker.clusterGroupBounds))};ClusterMarker.prototype._filterActiveMapMarkers=function(){var k=this.borderPadding,j=this._map.getZoom(),r=this._map.getCurrentMapType().getProjection(),o,c,m,h,n,d,b=this._map.getBounds(),f,q,e=[],l,a=this._mapMarkers,g=this._iconBounds;if(k){o=r.fromLatLngToPixel(b.getSouthWest(),j);c=new GPoint(o.x-k,o.y+k);m=r.fromPixelToLatLng(c,j);h=r.fromLatLngToPixel(b.getNorthEast(),j);n=new GPoint(h.x+k,h.y-k);d=r.fromPixelToLatLng(n,j);b.extend(m);b.extend(d)}this._activeMarkersChanged=false;if(typeof(g[j])==="undefined"){this._iconBounds[j]=[];this._activeMarkersChanged=true;for(f=a.length-1;f>=0;f--){q=a[f];q._isActive=b.containsLatLng(q.getLatLng())?true:false;q._makeVisible=q._isActive;if(q._isActive){e.push(f)}}}else{for(f=a.length-1;f>=0;f--){q=a[f];l=q._isActive;q._isActive=b.containsLatLng(q.getLatLng())?true:false;q._makeVisible=q._isActive;if(!this._activeMarkersChanged&&l!==q._isActive){this._activeMarkersChanged=true}if(q._isActive&&typeof(g[j][f])==="undefined"){e.push(f)}}}return e};ClusterMarker.prototype._filterIntersectingMapMarkers=function(){var e,d,b,a=this._map.getZoom(),f=this._mapMarkers,c=this._iconBounds;for(d=f.length-1;d>0;d--){if(f[d]._makeVisible){e=[];for(b=d-1;b>=0;b--){if(f[b]._makeVisible&&c[a][d].intersects(c[a][b])){e.push(b)}}if(e.length!==0){e.push(d);for(b=e.length-1;b>=0;b--){f[e[b]]._makeVisible=false}this._clusterMarkers.push(this._clusterMarker(e))}}}};ClusterMarker.prototype.getMarkers=function(){return this._mapMarkers||[]};ClusterMarker.prototype.fitMapToMarkers=function(){var f=this._mapMarkers,b=new GLatLngBounds(),g;for(g=f.length-1;g>=0;g--){b.extend(f[g].getLatLng())}var c=b.getSouthWest();var d=b.getNorthEast();var j=Math.abs(c.lat()-d.lat());var h=Math.abs(c.lng()-d.lng());var a=j/10;var k=h/10;c=new GLatLng(c.lat()-a,c.lng()+a);d=new GLatLng(d.lat()+a,d.lng()-a);b.extend(c);b.extend(d);var e=this._map.getBoundsZoomLevel(b);if(this.fitMapMaxZoom&&e>this.fitMapMaxZoom){e=this.fitMapMaxZoom}this._map.setCenter(b.getCenter(),e);this.refresh()};ClusterMarker.prototype._mapTypeChanged=function(){this.refresh(true)};ClusterMarker.prototype._moveEnd=function(){if(!this._cancelMoveEnd){this.refresh()}else{this._cancelMoveEnd=false}};ClusterMarker.prototype._preCacheIconBounds=function(c,h){var n=this._map.getCurrentMapType().getProjection(),g,o,e,a,j,l,f,k,d,m=this.intersectPadding,b=this._mapMarkers;for(g=c.length-1;g>=0;g--){o=b[c[g]];e=o.getIcon().iconSize;a=n.fromLatLngToPixel(o.getLatLng(),h);j=o.getIcon().iconAnchor;l=new GPoint(a.x-j.x-m,a.y-j.y+e.height+m);f=new GPoint(a.x-j.x+e.width+m,a.y-j.y-m);k=n.fromPixelToLatLng(l,h);d=n.fromPixelToLatLng(f,h);this._iconBounds[h][c[g]]=new GLatLngBounds(k,d)}};ClusterMarker.prototype.refresh=function(d){var c,b,e=this._map.getZoom(),a=this._filterActiveMapMarkers();if(this._activeMarkersChanged||d){this._removeClusterMarkers();if(this.clusteringEnabled&&e<this._map.getCurrentMapType().getMaximumResolution()){if(a.length>0){this._preCacheIconBounds(a,e)}this._filterIntersectingMapMarkers()}for(c=this._clusterMarkers.length-1;c>=0;c--){this._map.addOverlay(this._clusterMarkers[c])}for(c=this._mapMarkers.length-1;c>=0;c--){b=this._mapMarkers[c];if(!b._isVisible&&b._makeVisible){this._map.addOverlay(b);b._isVisible=true}if(b._isVisible&&!b._makeVisible){this._map.removeOverlay(b);b._isVisible=false}}}};ClusterMarker.prototype._removeClusterMarkers=function(){var d,b,g=this._map,a=this._eventListeners,f=this._clusterMarkers,c,e=this._mapMarkers;for(d=f.length-1;d>=0;d--){c=f[d]._childIndexes;for(b=c.length-1;b>=0;b--){delete e[c[b]]._parentCluster}g.removeOverlay(f[d])}for(d=a.length-1;d>=0;d--){GEvent.removeListener(a[d])}this._clusterMarkers=[];this._eventListeners=[]};ClusterMarker.prototype.removeMarkers=function(){var a,b=this._mapMarkers,c=this._map;for(a=b.length-1;a>=0;a--){if(b[a]._isVisible){c.removeOverlay(b[a])}delete b[a]._isVisible;delete b[a]._isActive;delete b[a]._makeVisible}this._removeClusterMarkers();this._mapMarkers=[];this._iconBounds=[]};ClusterMarker.prototype.triggerClick=function(h){var k=this._mapMarkers[h];if(k._isVisible){GEvent.trigger(k,"click")}else{if(k._isActive){var f=k._parentCluster._childIndexes,b=true,c,d,g=this._map.getZoom(),j,e=this._iconBounds,a=this._map.getCurrentMapType().getMaximumResolution();while(b&&g<a){b=false;g++;if(typeof(e[g])==="undefined"){e[g]=[];this._preCacheIconBounds(f,g)}else{c=[];for(d=f.length-1;d>=0;d--){if(typeof(e[g][f[d]])==="undefined"){c.push(f[d])}}if(c.length>=1){this._preCacheIconBounds(c,g)}}for(d=f.length-1;d>=0;d--){j=f[d];if(j!==h&&e[g][j].intersects(e[g][h])){b=true;break}}}this._map.setCenter(k.getLatLng(),g);this.triggerClick(h)}else{this._map.setCenter(k.getLatLng());this.triggerClick(h)}}};ClusterMarker.prototype._zoomEnd=function(){this._cancelMoveEnd=true;this.refresh(true)};(function(c){c.fitMapToMarkers=function(g,l){if(l.length==0){return}var r=new GLatLngBounds(),m;for(m=l.length-1;m>=0;m--){r.extend(l[m].getLatLng())}var j=r.getSouthWest();var k=r.getNorthEast();var o=Math.abs(j.lat()-k.lat());var n=Math.abs(j.lng()-k.lng());var f=o/10;var q=n/10;j=new GLatLng(j.lat()-f,j.lng()+f);k=new GLatLng(k.lat()+f,k.lng()-f);r.extend(j);r.extend(k);var h=g.getBoundsZoomLevel(r);if(h>15){h=15}g.setCenter(r.getCenter(),h)};c.fn.positionBy=function(l,k){l=c(l);if(l.length==0){return this}var n=null;var g=l.parents();var j=0;while(!n){var m=c(g[j]);if(m.css("position")=="relative"){n=m}j++}var f=l.offset();var h=n.offset();f.right=f.left+l.width();f.bottom=f.top+l.height();h.right=h.left+n.width();h.bottom=h.top+n.height();return c(this).each(function(){var i=c(this);c.each(["top","left","bottom","right"],function(q,o){if(k[o]!=null){k[o]=Math.abs(h[o]-f[o])+k[o]}});i.css(k)})};c.addTooltip=function(h,g,i){g.itemData=i;var k="";var f="";if(i.main_photo_url&&i.premium){f="content_with_photo";photoStyle="background-image: url("+i.main_photo_url+")";k+='<div class="photo" style="'+photoStyle+'"></div>'}k+='<div class="content '+f+'">';k+=i.name;if(i.average_rating){var l=Math.round((i.average_rating/5)*(10))*10;k+='<div class="ratings"><span class="label">ocena:</span> <div class="stars"><div class="inner" style="width: '+l+'%"></div></div><span class="number">'+c.roundNumber(i.average_rating,1)+"</span></div>"}if(BrowserDetect.browser=="Explorer"&&BrowserDetect.version==6){var j=""}else{var j="Aby otworzyć stronę lokalu w nowej karcie kliknij na gwiazdkę środkowym przyciskiem myszy."}k+='<div class="clear"></div><span class="dbclick_notice">'+j+"</span></div>";h.add_tooltip(g,k)};function d(){c("#map_loading").positionBy("#map_container",{right:0,top:0}).show();c("#tipDiv, #middleClickOverlay").hide()}function b(){c("#map_loading").hide();c("#tipDiv, #middleClickOverlay").hide()}function a(g,f){return Math.floor((f-g-1)*Math.random())+g}function e(h,i,f){if(f<i){var g=f;f=i;i=g}return h<=f&&h>=i}c.gmaps=c.gmaps||{};c.gmaps.filtering=c.gmaps.filtering||{};c.gmaps.consts={earth_radius_in_miles:3963.19,earth_radius_in_kms:6376.77271};c.gmaps.deg2rad=function(f){return f/180*Math.PI};c.gmaps.cut=function(g,f){if(g>f){return f}else{if(g<-f){return -f}else{return g}}};c.gmaps.removeMarkersOutsideBounds=function(l,k){var j=[];for(var g=0;g<l.length;g++){var f=l[g];var h=f.getLatLng();if(k.containsLatLng(h)){j.push(f)}}return j};c.gmaps.getParams=function(f){f=f||{};var g={};if(f.bounds){g=c.extend(g,{lat1:f.bounds.getSouthWest().lat(),lat2:f.bounds.getNorthEast().lat(),lng1:f.bounds.getSouthWest().lng(),lng2:f.bounds.getNorthEast().lng()})}return g};c.fn.gMap=function(f){f=f||{};f=c.extend({},{clusterer:true,startingLongitude:19.2,startingLatitude:52,startingZoom:10,url:"/map/map.json",resourceName:"item",distanceLimit:false,distance:0.02,intersectPadding:0,citiesViewZoom:10,disablePlaces:false,zoomOutOnMarkersOutsideBounds:false},f,c(this).metadata());var g;var h=true;if(f.citiesViewZoom>10){f.citiesViewZoom=10}return c(this).each(function(){var u=c(this);var q=new GLatLng(f.startingLatitude,f.startingLongitude);var v=G_DEFAULT_MAP_TYPES;for(var y=0;y<v.length;y++){v[y].getMaximumResolution=function(i){return 19};v[y].getMinimumResolution=function(i){return 5}}var w=null;var m=null;var E=new GMap2(this);if(f.smallMap){E.addControl(new GSmallMapControl())}else{E.addControl(new GLargeMapControl())}E.setCenter(q,f.startingZoom);E.enableDoubleClickZoom();E.disableScrollWheelZoom();g=new c.MapTips(E);var C=null;var o=false;GEvent.addListener(E,"moveend",function(){if(o){o=false;return}C=setTimeout(function(){u.trigger("gmap.reload")},100)});GEvent.addListener(E,"move",function(){clearTimeout(C)});GEvent.addListener(E,"movestart",function(){clearTimeout(C)});GEvent.addListener(E,"zoomend",function(){console.log(E.getZoom())});var A=[];var z;var x=new GIcon();x.image="/images/map-group.png";x.iconSize=new GSize(25,29);x.iconAnchor=new GPoint(12,14);var t=new GIcon(x);t.iconSize=new GSize(26,28);t.iconAnchor=new GPoint(13,14);t.image="/images/map-main-star.png";if(f.clusterer){function r(F){if(!F.clusterMarker.tooltip){var G='<span class="list">';var H=F.clusteredMarkers.length>4?4:F.clusteredMarkers.length;for(y=0;y<H;y++){var i=F.clusteredMarkers[y];G+=i.itemData.name+"<br/>"}if(F.clusteredMarkers.length>4){var I=(F.clusteredMarkers.length-4);G+="... i "+I+" "+c.pluralize(I,{one:"inny lokal",few:"inne lokale",many:"innych lokali"})+"<br/>"}G+='</span><span class="click_to_zoom">Kliknij żeby powiększyć</span>';F.clusterMarker.tooltip=G}if(!(F.clusterMarker.isInfoWindowOpen)&&!(F.clusterMarker.isHidden())){g.show_tooltip.call(F.clusterMarker,F.clusterMarker)}}function k(i){g.hide_tooltip.call(i.clusterMarker)}function l(i){z.defaultClickAction=function(){E.setCenter(i.clusterMarker.getLatLng(),E.getBoundsZoomLevel(i.clusterMarker.clusterGroupBounds));delete z.defaultClickAction};g.hide_tooltip.call(i.clusterMarker);z.defaultClickAction()}z=new ClusterMarker(E,{clusterMarkerMouseOver:r,clusterMarkerMouseOut:k,clusterMarkerClick:l,clusterMarkerTitle:"",intersectPadding:f.intersectPadding,clusterMarkerIcon:x,intersectPadding:2})}if(c(this).hasClass("disablePlaces")){f.disablePlaces=true}var D=[];var B=[];c.data(this,"map",E);c.data(this,"options",f);var n=null;var j=this;c(this).bind("gmap.loadItems",function(G,I){var i=this;var H=[];if(c(this).hasClass("filters")){H.push(c("#filters form").serialize())}if(f.distanceLimit){H.push("latitude1="+(f.startingLatitude-f.distance));H.push("latitude2="+(f.startingLatitude+f.distance));H.push("longitude1="+(f.startingLongitude-f.distance));H.push("longitude2="+(f.startingLongitude+f.distance))}if(c(this).hasClass("reloadable")){H.push(jQuery.param(c.gmaps.getParams({bounds:E.getBounds()})))}H.push("latitude="+E.getCenter().lat());H.push("longitude="+E.getCenter().lng());var F=E.getZoom();if(F<=8&&m=="voivodeships"&&!I&&!f.disablePlaces){}else{if(F<=8&&!f.disablePlaces){console.log("Województwa");m="voivodeships";if(n){n.abort()}n=c.ajax({url:"/map/voivodeships.json",dataType:"json",type:"GET",data:H.join("&"),beforeSend:function(){d()},complete:function(){b()},success:function(J,L){E.clearOverlays();if(f.clusterer){z.removeMarkers()}if(BrowserDetect.browser=="Explorer"&&BrowserDetect.version==6){var K="gif"}else{var K="png"}c.each(J,function(N,O){O=O.voivodeship;var M=new PlaceMarker(new GLatLng(O.latitude,O.longitude),{image:"/images/big-star."+K,link:"restauracje/wojewodztwo/"+O.slug,preventClick:true,width:40,height:40},O.name);GEvent.addListener(M,"click",function(){E.setZoom(9);E.setCenter(this.getLatLng())});E.addOverlay(M)})}})}else{if(F<=f.citiesViewZoom&&!f.disablePlaces){console.log("Miasta");m="cities";E.clearOverlays();if(n){n.abort()}n=c.ajax({url:"/map/cities.json",dataType:"json",data:H.join("&"),type:"GET",beforeSend:function(){d()},complete:function(){b()},success:function(J,L){if(BrowserDetect.browser=="Explorer"&&BrowserDetect.version==6){var K="gif"}else{var K="png"}c.each(J,function(N,Q){var P=Q.matches_count==1?"/images/map-star."+K:"/images/map-group."+K;var M=new UltraMarker(new GLatLng(Q.latitude,Q.longitude),{image:P,link:"/restauracje/"+Q.slug,preventClick:true,width:25,height:29});GEvent.addListener(M,"click",function(){E.setZoom(11);E.setCenter(this.getLatLng())});var O=Q.name+"<br/>znaleziono "+Q.matches_count+" "+c.pluralize(Q.matches_count,{one:"lokal",few:"lokale",many:"lokali"});g.add_tooltip(M,O);E.addOverlay(M)})}})}else{console.log("Punkty");m="restaurants";if(n){n.abort()}B=[];n=c.ajax({url:f.url,dataType:"json",data:H.join("&"),type:"POST",beforeSend:function(){d()},complete:function(){b()},success:function(P,K){bounds=E.getBounds();if(BrowserDetect.browser=="Explorer"&&BrowserDetect.version==6){var L="gif"}else{var L="png"}var N=[];var J=new Date().getTime();var R=null;if(f.mainStar){R=f.mainStar.item.id}var Q=0;for(Q=0;Q<P.length;Q++){var S=P[Q].item;if(S.latitude&&S.longitude&&S.id!=R){var O=new UltraMarker(new GLatLng(S.latitude,S.longitude),{image:"/images/map-star."+L,link:"/"+(S.to_param||S.id),width:18,height:21,alwaysOnTop:S.premium});c.addTooltip(g,O,S);GEvent.addListener(O,"click",function(){var T=this;window.location="/"+(T.itemData.to_param||T.itemData.id)});if(S.premium){N.push(O)}else{B.push(O)}}}B=B.slice(-700);if(f.clusterer){z.removeMarkers()}E.clearOverlays();if(f.clusterer){console.log("Aktualna ilość markerów: "+B.length);z.addMarkers(B);for(var Q=0;Q<N.length;Q++){E.addOverlay(N[Q])}}else{for(var Q=0;Q<B.length;Q++){E.addOverlay(B[Q])}for(var Q=0;Q<N.length;Q++){E.addOverlay(N[Q])}}if(f.clusterer){z.refresh();if(f.fitMap&&h&&(N.length!=0||B.length!=0)){o=true;h=false;c.fitMapToMarkers(E,N.concat(B))}}if(f.mainStar){var O=new GMarker(new GLatLng(f.mainStar.item.latitude,f.mainStar.item.longitude),{icon:t,zIndexProcess:function(){return GOverlay.getZIndex(f.mainStar.latitude)-99999}});c.addTooltip(g,O,f.mainStar.item);E.addOverlay(O)}var M=new Date().getTime();if(h&&f.zoomOutOnMarkersOutsideBounds&&B.length==0&&N.length==0&&!f.mainStar){h=false;E.zoomOut()}h=false}})}}}}).bind("gmap.setCenter",function(F,i){E.setCenter(i,15)}).bind("gmap.reload",function(){if(!c(this).hasClass("reloadable")){return false}c(this).trigger("gmap.loadItems")})})}})(jQuery);(function(a){a("#map_wrapper .search form").livequery("submit",function(){var b=a("input[type=text]",this).val();if(a("#city").hasClass("voivodeship")||a("#city").hasClass("city")){b=b+", "+a("h2 > span > a").html()}console.log(b);var c=new GClientGeocoder();c.getLatLng(b,function(d){if(!d){a.facebox("Adres nie został znaleziony")}else{a("#map").trigger("gmap.setCenter",[d])}});return false});a("#map").livequery(function(){a(this).gMap({url:"/map/map.json"});if(!a.getParamsFromHash().filters){a("#map").trigger("gmap.loadItems")}})})(jQuery);(function(e){jQuery.stripTags=function(f){return f.replace(/<\/?[^>]+>/gi,"")};var d=false;function c(f){e("div.info span.others").html("");var h=[];e("#filters div.wrapper").each(function(){var k=e("h3",this).html();if(k=="Inne:"){k="inne kuchnie:"}var i=[];e("input:checked",this).each(function(){var l=e(this).parent().find("label").html();if(l!="Bez znaczenia"){i.push(l)}});if(i.length>0){k=k.replace(/^./,k.charAt(0).toLowerCase());if(k.charAt(k.length-1)!=":"){k+=":"}var j='<span class="name">'+k+' </span><span class="value">'+i.join(", ")+"</span>";h.push(k+" "+i.join(", "));if(e("#city .info .voivodeship").length!=0){j=", "+j}e("div.info span.others").append(j)}});if(f){var g=e("#map_wrapper .info .voivodeship");if(g.length>0){h.unshift(e.stripTags(g.html()))}h.unshift(e.stripTags(e("#map_wrapper h2").html()));pageTracker._trackEvent("Filters","Reload",h.join(", ").replace(/\s+/," "))}}e(function(){c(false)});function b(f){f=e.extend({reloadMap:true,scrollTop:false},f);if(d){d.abort()}if(e("#city-search").attr("title")!=e("#city-search").val()){}e("#filters #sort_filter").val(e("#sort").val());e("#filters #sort_order").val(e("#sorting input[name=sort_order]:checked").val());d=e.ajax({url:location.href.replace(/#.*/,"").replace(/\?.*/,""),type:"GET",dataType:"html",data:e("#filters form").serialize(),success:function(h,g){e("#loading").hide();window.location.hash=e("#filters form").serialize()+"&filters=true";e("#restaurants_list").html(h);c(true);var i=e("#sorting_wrapper, #map_container, #map_wrapper .search");if(e("#restaurants_list").find(".found_nothing").length==0){i.show();if(f.reloadMap){e("#map").trigger("gmap.loadItems",[true])}}else{i.hide()}if(f.scrollTop){e(document).scrollTo(e("#search_results").offset().top-20)}},beforeSend:function(){e("#loading").show()},complete:function(){e("#loading").hide()}})}function a(){e("#page_filter").val(1);b({scrollTop:true})}e(function(){if(e.browser.msie){e("#filters input, #sorting input").livequery("click",a);e("#filters select, #sorting select").livequery("change",a)}else{e("#filters input, #filters select, #sorting input, #sorting select").livequery("change",a)}e(".filtered .pagination a").livequery("click",function(){e("#page_filter").val(e(this).metadata().page||1);b({reloadMap:false,scrollTop:true});return false});var f=e.getParamsFromHash();if(f.filters){e("#sort").val(f.sort);e("#page_filter").val(f.page);e("#city_id").val(f.city_id);e("#voivodeship_id").val(f.voivodeship_id);e("#kind_filter").val(f.kind);e("#city_filter").val(f.city);delete f.sort;delete f.page;delete f.city_id;delete f.kind;delete f.city;e.each(f,function(g,h){if(!e.isArray(h)){h=[h]}e.each(h,function(l,k){var j=e("select#"+g.replace(/\[\]/,"")+"_"+(l+1));if(j.length>0){j.val(k)}else{var m=e("#"+g.replace(/\[\]/,"")+"_"+this);if(m.attr("type")=="checkbox"){m.attr("checked","checked")}else{m.val(h)}}})});b()}})})(jQuery);(function(b){b("#add_new_list form").livequery("submit",function(){var d=b(this);var c=d.find("input.name").val();if(!c||c.replace(/( )+/,"")==""){return false}b.ajax({url:d.attr("action"),type:"POST",data:"list[name]="+c,dataType:"script",beforeSend:function(e){if(!b("body").hasClass("logged-in")){b.openLogin();e.abort();return}d.find("input[type=submit]").spin()},complete:function(){d.find("input[type=submit]").stopSpin();d[0].reset()},success:function(e){d[0].reset()}});return false});b.fn.checkList=function(c){c=c||{};c=b.extend({},{afterCreate:function(d){}},c);return b(this).each(function(){var d=b(this);b("ul li.add",this).bind("click",function(){if(!b("body").hasClass("logged-in")){b.openLogin()}else{b("#add_new_list").faceBox()}return false});b("ul li:not(.add)",this).bind("click",function(){var f=this;if(b.data(this,"lock")){return false}var i=b(".link",this);var e=b(this);var h=e.hasClass("checked")?"DELETE":"POST";var g=i.attr("href").replace(/^[^#]*#/,"");b.ajax({url:g,type:h,dataType:"script",beforeSend:function(j){if(b("body").hasClass("logged-in")){b.data(f,"lock",true);if(h=="DELETE"){e.removeClass("checked")}else{e.addClass("checked")}}else{b.openLogin();j.abort();return}},complete:function(){b.data(f,"lock",false)},success:function(){var k=b("#"+e.metadata().kind+"_list_count");if(k.length>0){var j=parseInt(k.html())}if(h=="DELETE"){pageTracker._trackEvent("Lists","Delete",g);e.removeClass("checked");if(k.length>0){k.html(j-1)}}else{pageTracker._trackEvent("Lists","Add",g);e.addClass("checked");if(k.length>0){k.html(j+1)}}}});return false});b(".container",this).bind("checkList.showList",function(){b(this).show().addClass("visible");d.addClass("visible").addClass("checklist_visible")}).bind("checkList.hideList",function(){b(this).hide().removeClass("visible");d.removeClass("visible").removeClass("checklist_visible")});d.hover(function(){},function(){var e=d.find(".container");var f=setTimeout(function(){e.trigger("checkList.hideList")},500);b.data(d[0],"timeout",f)});d.find(".container, .button").bind("mousemove",function(){var e=d.find(".container");if(e.is(":hidden")){e.trigger("checkList.showList")}var f=b.data(d[0],"timeout");if(f){clearTimeout(f)}})})};var a=1100;b(".checkList").livequery(function(){a-=1;b(this).checkList();b(this).parents("div.info").css("z-index",a)})})(jQuery);(function(c){var a=c.scrollTo=function(f,e,d){c(window).scrollTo(f,e,d)};a.defaults={axis:"y",duration:1};a.window=function(d){return c(window).scrollable()};c.fn.scrollable=function(){return this.map(function(){var g=this.parentWindow||this.defaultView,e=this.nodeName=="#document"?g.frameElement||g:this,f=e.contentDocument||(e.contentWindow||e).document,d=e.setInterval;return e.nodeName=="IFRAME"||d&&c.browser.safari?f.body:d?f.documentElement:this})};c.fn.scrollTo=function(f,e,d){if(typeof e=="object"){d=e;e=0}if(typeof d=="function"){d={onAfter:d}}d=c.extend({},a.defaults,d);e=e||d.speed||d.duration;d.queue=d.queue&&d.axis.length>1;if(d.queue){e/=2}d.offset=b(d.offset);d.over=b(d.over);return this.scrollable().each(function(){var m=this,k=c(m),l=f,j,h={},n=k.is("html,body");switch(typeof l){case"number":case"string":if(/^([+-]=)?\d+(px)?$/.test(l)){l=b(l);break}l=c(l,this);case"object":if(l.is||l.style){j=(l=c(l)).offset()}}c.each(d.axis.split(""),function(t,u){var v=u=="x"?"Left":"Top",x=v.toLowerCase(),r="scroll"+v,o=m[r],q=u=="x"?"Width":"Height",w=q.toLowerCase();if(j){h[r]=j[x]+(n?0:o-k.offset()[x]);if(d.margin){h[r]-=parseInt(l.css("margin"+v))||0;h[r]-=parseInt(l.css("border"+v+"Width"))||0}h[r]+=d.offset[x]||0;if(d.over[x]){h[r]+=l[w]()*d.over[x]}}else{h[r]=l[x]}if(/^\d+$/.test(h[r])){h[r]=h[r]<=0?0:Math.min(h[r],g(q))}if(!t&&d.queue){if(o!=h[r]){i(d.onAfterFirst)}delete h[r]}});i(d.onAfter);function i(o){k.animate(h,e,d.easing,o&&function(){o.call(this,f,d)})}function g(q){var o="scroll"+q,r=m.ownerDocument;return n?Math.max(r.documentElement[o],r.body[o]):m[o]}}).end()};function b(d){return typeof d=="object"?d:{top:d,left:d}}})(jQuery);(function(g){g.fn.stretchToParent=function(){return g(this).each(function(){function n(){var t=g(this);var v=t.parent().width();var o=t.parent().height();var x=t.width();var r=t.height();if(x>v||r>o){var u=x/r;var w=v;var q=v/u;if(q>o){q=o;w=o*u}t.width(w).height(q)}if(t.width()<v){t.css("padding-left",(v-t.width())/2)}if(t.height()<o){t.css("padding-top",(o-t.height())/2)}}if(this.complete){n.apply(this)}else{g(this).bind("load",n)}})};var j="2.54";if(g.support==undefined){g.support={opacity:!(g.browser.msie&&/MSIE 6.0/.test(navigator.userAgent))}}function d(){if(window.console&&window.console.log){window.console.log("[cycle] "+Array.prototype.join.call(arguments,""))}}g.fn.cycle=function(q,n){if(this.length==0&&q!="stop"){if(!g.isReady&&this.selector){d("DOM not ready, queuing slideshow");var r={s:this.selector,c:this.context};g(function(){g(r.s,r.c).cycle(q,n)});return}d("terminating; zero elements found by selector"+(g.isReady?"":" (DOM not ready)"));return this}return this.each(function(){q=k(this,q,n);if(q===false){return}if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=this.cyclePause=0;var u=g(this);var v=q.slideExpr?g(q.slideExpr,this):u.children();var o=v.get();if(o.length<2){d("terminating; too few slides: "+o.length);return}var t=i(u,v,o,q);if(t===false){return}if(t.timeout||t.continuous){this.cycleTimeout=setTimeout(function(){c(o,t,0,!t.rev)},t.continuous?10:t.timeout+(t.delay||0))}})};function k(n,r,o){if(n.cycleStop==undefined){n.cycleStop=0}if(r===undefined||r===null){r={}}if(r.constructor==String){switch(r){case"stop":n.cycleStop++;if(n.cycleTimeout){clearTimeout(n.cycleTimeout)}n.cycleTimeout=0;g(n).removeData("cycle.opts");return false;case"pause":n.cyclePause=1;return false;case"resume":n.cyclePause=0;if(o===true){r=g(n).data("cycle.opts");if(!r){d("options not found, can not resume");return}if(n.cycleTimeout){clearTimeout(n.cycleTimeout);n.cycleTimeout=0}c(r.elements,r,1,1)}return false;default:r={fx:r}}}else{if(r.constructor==Number){var q=r;r=g(n).data("cycle.opts");if(!r){d("options not found, can not advance slide");return false}if(q<0||q>=r.elements.length){d("invalid slide index: "+q);return false}r.nextSlide=q;if(n.cycleTimeout){clearTimeout(this.cycleTimeout);n.cycleTimeout=0}if(typeof o=="string"){r.oneTimeFx=o}c(r.elements,r,1,q>=r.currSlide);return false}}return r}function i(D,z,r,F){var n=g.extend({},g.fn.cycle.defaults,F||{},g.metadata?D.metadata():g.meta?D.data():{});if(n.autostop){n.countdown=n.autostopCount||r.length}var G=D[0];D.data("cycle.opts",n);n.$cont=D;n.stopCount=G.cycleStop;n.elements=r;n.before=n.before?[n.before]:[];n.after=n.after?[n.after]:[];n.after.unshift(function(){n.busy=0});if(!g.support.opacity&&n.cleartype){n.after.push(function(){this.style.removeAttribute("filter")})}if(n.continuous){n.after.push(function(){c(r,n,0,!n.rev)})}l(n);if(!g.support.opacity&&n.cleartype&&!n.cleartypeNoBg){e(z)}if(D.css("position")=="static"){D.css("position","relative")}if(n.width){D.width(n.width)}if(n.height&&n.height!="auto"){D.height(n.height)}if(n.startingSlide){n.startingSlide=parseInt(n.startingSlide)}if(n.random){n.randomMap=[];for(var u=0;u<r.length;u++){n.randomMap.push(u)}n.randomMap.sort(function(H,w){return Math.random()-0.5});n.randomIndex=0;n.startingSlide=n.randomMap[0]}else{if(n.startingSlide>=r.length){n.startingSlide=0}}n.currSlide=n.startingSlide=n.startingSlide||0;var x=n.startingSlide;z.css({position:"absolute",top:0,left:0}).hide().each(function(w){var H=x?w>=x?r.length-(w-x):x-w:r.length-w;g(this).css("z-index",H)});g(r[x]).css("opacity",1).show();if(!g.support.opacity&&n.cleartype){r[x].style.removeAttribute("filter")}if(n.fit=="auto"){z.stretchToParent()}else{if(n.fit&&n.width){z.width(n.width)}if(n.fit&&n.height&&n.height!="auto"){z.height(n.height)}}var t=n.containerResize&&!D.innerHeight();if(t){var A=0,q=0;for(var u=0;u<r.length;u++){var o=g(r[u]),y=o[0],C=o.outerWidth(),v=o.outerHeight();if(!C){C=y.offsetWidth}if(!v){v=y.offsetHeight}A=C>A?C:A;q=v>q?v:q}if(A>0&&q>0){D.css({width:A+"px",height:q+"px"})}}if(n.pause){D.hover(function(){this.cyclePause++},function(){this.cyclePause--})}a(n);if(!n.multiFx){var E=g.fn.cycle.transitions[n.fx];if(g.isFunction(E)){E(D,z,n)}else{if(n.fx!="custom"&&!n.multiFx){d("unknown transition: "+n.fx,"; slideshow terminating");return false}}}z.each(function(){var w=g(this);this.cycleH=(n.fit&&n.height)?n.height:w.height();this.cycleW=(n.fit&&n.width)?n.width:w.width()});n.cssBefore=n.cssBefore||{};n.animIn=n.animIn||{};n.animOut=n.animOut||{};z.not(":eq("+x+")").css(n.cssBefore);if(n.cssFirst){g(z[x]).css(n.cssFirst)}if(n.timeout){n.timeout=parseInt(n.timeout);if(n.speed.constructor==String){n.speed=g.fx.speeds[n.speed]||parseInt(n.speed)}if(!n.sync){n.speed=n.speed/2}while((n.timeout-n.speed)<250){n.timeout+=n.speed}}if(n.easing){n.easeIn=n.easeOut=n.easing}if(!n.speedIn){n.speedIn=n.speed}if(!n.speedOut){n.speedOut=n.speed}n.slideCount=r.length;n.currSlide=n.lastSlide=x;if(n.random){n.nextSlide=n.currSlide;if(++n.randomIndex==r.length){n.randomIndex=0}n.nextSlide=n.randomMap[n.randomIndex]}else{n.nextSlide=n.startingSlide>=(r.length-1)?0:n.startingSlide+1}var B=z[x];if(n.before.length){n.before[0].apply(B,[B,B,n,true])}if(n.after.length>1){n.after[1].apply(B,[B,B,n,true])}if(n.next){g(n.next).click(function(){return m(n,n.rev?-1:1)})}if(n.prev){g(n.prev).click(function(){return m(n,n.rev?1:-1)})}if(n.pager){b(r,n)}h(n,r);return n}function l(n){n.original={before:[],after:[]};n.original.cssBefore=g.extend({},n.cssBefore);n.original.cssAfter=g.extend({},n.cssAfter);n.original.animIn=g.extend({},n.animIn);n.original.animOut=g.extend({},n.animOut);g.each(n.before,function(){n.original.before.push(this)});g.each(n.after,function(){n.original.after.push(this)})}function a(v){var q=g.fn.cycle.transitions;if(v.fx.indexOf(",")>0){v.multiFx=true;v.fxs=v.fx.replace(/\s*/g,"").split(",");for(var t=0;t<v.fxs.length;t++){var u=v.fxs[t];var o=q[u];if(!o||!q.hasOwnProperty(u)||!g.isFunction(o)){d("discarding unknowtn transition: ",u);v.fxs.splice(t,1);t--}}if(!v.fxs.length){d("No valid transitions named; slideshow terminating.");return false}}else{if(v.fx=="all"){v.multiFx=true;v.fxs=[];for(p in q){var o=q[p];if(q.hasOwnProperty(p)&&g.isFunction(o)){v.fxs.push(p)}}}}if(v.multiFx&&v.randomizeEffects){var r=Math.floor(Math.random()*20)+30;for(var t=0;t<r;t++){var n=Math.floor(Math.random()*v.fxs.length);v.fxs.push(v.fxs.splice(n,1)[0])}d("randomized fx sequence: ",v.fxs)}}function h(o,n){o.addSlide=function(r,t){var q=g(r),u=q[0];if(!o.autostopCount){o.countdown++}n[t?"unshift":"push"](u);if(o.els){o.els[t?"unshift":"push"](u)}o.slideCount=n.length;q.css("position","absolute");q[t?"prependTo":"appendTo"](o.$cont);if(t){o.currSlide++;o.nextSlide++}if(!g.support.opacity&&o.cleartype&&!o.cleartypeNoBg){e(q)}if(o.fit=="auto"){$slides.stretchToParent()}else{if(o.fit&&o.width){q.width(o.width)}if(o.fit&&o.height&&o.height!="auto"){$slides.height(o.height)}}u.cycleH=(o.fit&&o.height)?o.height:q.height();u.cycleW=(o.fit&&o.width)?o.width:q.width();q.css(o.cssBefore);if(o.pager){g.fn.cycle.createPagerAnchor(n.length-1,u,g(o.pager),n,o)}if(g.isFunction(o.onAddSlide)){o.onAddSlide(q)}else{q.hide()}}}g.fn.cycle.resetState=function(o,n){var n=n||o.fx;o.before=[];o.after=[];o.cssBefore=g.extend({},o.original.cssBefore);o.cssAfter=g.extend({},o.original.cssAfter);o.animIn=g.extend({},o.original.animIn);o.animOut=g.extend({},o.original.animOut);o.fxFn=null;g.each(o.original.before,function(){o.before.push(this)});g.each(o.original.after,function(){o.after.push(this)});var q=g.fn.cycle.transitions[n];if(g.isFunction(q)){q(o.$cont,g(o.elements),o)}};function c(w,n,v,x){if(v&&n.busy){g(w).stop(true,true);n.busy=false}if(n.busy){return}var t=n.$cont[0],z=w[n.currSlide],y=w[n.nextSlide];if(t.cycleStop!=n.stopCount||t.cycleTimeout===0&&!v){return}if(!v&&!t.cyclePause&&((n.autostop&&(--n.countdown<=0))||(n.nowrap&&!n.random&&n.nextSlide<n.currSlide))){if(n.end){n.end(n)}return}if(v||!t.cyclePause){var u=n.fx;z.cycleH=z.cycleH||z.offsetHeight;z.cycleW=z.cycleW||z.offsetWidth;y.cycleH=y.cycleH||y.offsetHeight;y.cycleW=y.cycleW||y.offsetWidth;if(n.multiFx){if(n.lastFx==undefined||++n.lastFx>=n.fxs.length){n.lastFx=0}u=n.fxs[n.lastFx];n.currFx=u}if(n.oneTimeFx){u=n.oneTimeFx;n.oneTimeFx=null}g.fn.cycle.resetState(n,u);if(n.before.length){g.each(n.before,function(A,B){if(t.cycleStop!=n.stopCount){return}B.apply(y,[z,y,n,x])})}var q=function(){g.each(n.after,function(A,B){if(t.cycleStop!=n.stopCount){return}B.apply(y,[z,y,n,x])})};if(n.nextSlide!=n.currSlide){n.busy=1;if(n.fxFn){n.fxFn(z,y,n,q,x)}else{if(g.isFunction(g.fn.cycle[n.fx])){g.fn.cycle[n.fx](z,y,n,q)}else{g.fn.cycle.custom(z,y,n,q,v&&n.fastOnEvent)}}}n.lastSlide=n.currSlide;if(n.random){n.currSlide=n.nextSlide;if(++n.randomIndex==w.length){n.randomIndex=0}n.nextSlide=n.randomMap[n.randomIndex]}else{var r=(n.nextSlide+1)==w.length;n.nextSlide=r?0:n.nextSlide+1;n.currSlide=r?w.length-1:n.nextSlide-1}if(n.pager){g.fn.cycle.updateActivePagerLink(n.pager,n.currSlide)}}var o=0;if(n.timeout&&!n.continuous){o=f(z,y,n,x)}else{if(n.continuous&&t.cyclePause){o=10}}if(o>0){t.cycleTimeout=setTimeout(function(){c(w,n,0,!n.rev)},o)}}g.fn.cycle.updateActivePagerLink=function(n,o){g(n).find("a").removeClass("activeSlide").filter("a:eq("+o+")").addClass("activeSlide")};function f(u,q,r,o){if(r.timeoutFn){var n=r.timeoutFn(u,q,r,o);if(n!==false){return n}}return r.timeout}g.fn.cycle.next=function(n){m(n,n.rev?-1:1)};g.fn.cycle.prev=function(n){m(n,n.rev?1:-1)};function m(o,t){var n=o.elements;var r=o.$cont[0],q=r.cycleTimeout;if(q){clearTimeout(q);r.cycleTimeout=0}if(o.random&&t<0){o.randomIndex--;if(--o.randomIndex==-2){o.randomIndex=n.length-2}else{if(o.randomIndex==-1){o.randomIndex=n.length-1}}o.nextSlide=o.randomMap[o.randomIndex]}else{if(o.random){if(++o.randomIndex==n.length){o.randomIndex=0}o.nextSlide=o.randomMap[o.randomIndex]}else{o.nextSlide=o.currSlide+t;if(o.nextSlide<0){if(o.nowrap){return false}o.nextSlide=n.length-1}else{if(o.nextSlide>=n.length){if(o.nowrap){return false}o.nextSlide=0}}}}if(g.isFunction(o.prevNextClick)){o.prevNextClick(t>0,o.nextSlide,n[o.nextSlide])}c(n,o,1,t>=0);return false}function b(o,q){var n=g(q.pager);g.each(o,function(r,t){g.fn.cycle.createPagerAnchor(r,t,n,o,q)});g.fn.cycle.updateActivePagerLink(q.pager,q.startingSlide)}g.fn.cycle.createPagerAnchor=function(r,t,o,q,u){var n=(g.isFunction(u.pagerAnchorBuilder))?u.pagerAnchorBuilder(r,t):'<a href="#">'+(r+1)+"</a>";if(!n){return}var v=g(n);if(v.parents("body").length==0){v.appendTo(o)}v.bind(u.pagerEvent,function(){u.nextSlide=r;var x=u.$cont[0],w=x.cycleTimeout;if(w){clearTimeout(w);x.cycleTimeout=0}if(g.isFunction(u.pagerClick)){u.pagerClick(u.nextSlide,q[u.nextSlide])}c(q,u,1,u.currSlide<r);return false});if(u.pauseOnPagerHover){v.hover(function(){u.$cont[0].cyclePause++},function(){u.$cont[0].cyclePause--})}};g.fn.cycle.hopsFromLast=function(r,q){var o,n=r.lastSlide,t=r.currSlide;if(q){o=t>n?t-n:r.slideCount-n}else{o=t<n?n-t:n+r.slideCount-t}return o};function e(q){function o(r){var r=parseInt(r).toString(16);return r.length<2?"0"+r:r}function n(u){for(;u&&u.nodeName.toLowerCase()!="html";u=u.parentNode){var r=g.css(u,"background-color");if(r.indexOf("rgb")>=0){var t=r.match(/\d+/g);return"#"+o(t[0])+o(t[1])+o(t[2])}if(r&&r!="transparent"){return r}}return"#ffffff"}q.each(function(){g(this).css("background-color",n(this))})}g.fn.cycle.commonReset=function(u,r,t,o,q,n){g(t.elements).not(u).hide();t.cssBefore.opacity=1;t.cssBefore.display="block";if(o!==false&&r.cycleW>0){t.cssBefore.width=r.cycleW}if(q!==false&&r.cycleH>0){t.cssBefore.height=r.cycleH}t.cssAfter=t.cssAfter||{};t.cssAfter.display="none";g(u).css("zIndex",t.slideCount+(n===true?1:0));g(r).css("zIndex",t.slideCount+(n===true?0:1))};g.fn.cycle.custom=function(A,u,n,q,o){var z=g(A),v=g(u);var r=n.speedIn,y=n.speedOut,t=n.easeIn,x=n.easeOut;v.css(n.cssBefore);if(o){if(typeof o=="number"){r=y=o}else{r=y=1}t=x=null}var w=function(){v.animate(n.animIn,r,t,q)};z.animate(n.animOut,y,x,function(){if(n.cssAfter){z.css(n.cssAfter)}if(!n.sync){w()}});if(n.sync){w()}};g.fn.cycle.transitions={fade:function(o,q,n){q.not(":eq("+n.currSlide+")").css("opacity",0);n.before.push(function(u,r,t){g.fn.cycle.commonReset(u,r,t);t.cssBefore.opacity=0});n.animIn={opacity:1};n.animOut={opacity:0};n.cssBefore={top:0,left:0}}};g.fn.cycle.ver=function(){return j};g.fn.cycle.defaults={fx:"fade",timeout:4000,timeoutFn:null,continuous:0,speed:1000,speedIn:null,speedOut:null,next:null,prev:null,prevNextClick:null,pager:null,pagerClick:null,pagerEvent:"click",pagerAnchorBuilder:null,before:null,after:null,end:null,easing:null,easeIn:null,easeOut:null,shuffle:null,animIn:null,animOut:null,cssBefore:null,cssAfter:null,fxFn:null,height:"auto",startingSlide:0,sync:1,random:0,fit:0,containerResize:1,pause:0,pauseOnPagerHover:0,autostop:0,autostopCount:0,delay:0,slideExpr:null,cleartype:!g.support.opacity,nowrap:0,fastOnEvent:0,randomizeEffects:1,rev:0}})(jQuery);(function(a){function b(){var c=(a(this).parent().height()-a(this).height())/2;a(this).css("margin-top",c)}if(a(".slideshow").length>1){a(".slideshow .photo .inner > *").each(function(){var c=a(this);jQuery("<img>").attr("src",c.metadata().url)})}a(".slideshow").each(function(){var d=a(this);if(a("photo .inner > *",this).length==1){a(".photo .next, .slideshow .photo .prev",this).hide()}else{if(a(".photo .inner > *",this).length>1){var c=a(".slideshow_container").hasClass("change_url");a(".info .wrapper",this).each(b);a(".photo .inner",this).cycle({fx:"fade",next:a(".photo .next",this),prev:a(".photo .prev",this),timeout:6000,continous:true,before:function(f,e){var g=a(e).metadata();a(e).css("background-image","url("+g.src+")");if(c){var h=d.find(".info");setTimeout(function(){a("h3",h).html(g.name);a("span",h).html(g.address);d.find(".link").height(h.height()+d.find(".photo").height()+24).attr("href",g.url);h.find(".wrapper").each(b)},200)}}})}}})})(jQuery);