(function(g){g.fn.stretchToParent=function(){return g(this).each(function(){function n(){var s=g(this);var u=s.parent().width();var o=s.parent().height();var w=s.width();var r=s.height();if(w>u||r>o){var t=w/r;var v=u;var q=u/t;if(q>o){q=o;v=o*t}s.width(v).height(q)}if(s.width()<u){s.css("padding-left",(u-s.width())/2)}if(s.height()<o){s.css("padding-top",(o-s.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 t=g(this);var u=q.slideExpr?g(q.slideExpr,this):t.children();var o=u.get();if(o.length<2){d("terminating; too few slides: "+o.length);return}var s=i(t,u,o,q);if(s===false){return}if(s.timeout||s.continuous){this.cycleTimeout=setTimeout(function(){c(o,s,0,!s.rev)},s.continuous?10:s.timeout+(s.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(C,y,r,E){var n=g.extend({},g.fn.cycle.defaults,E||{},g.metadata?C.metadata():g.meta?C.data():{});if(n.autostop){n.countdown=n.autostopCount||r.length}var F=C[0];C.data("cycle.opts",n);n.$cont=C;n.stopCount=F.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(y)}if(C.css("position")=="static"){C.css("position","relative")}if(n.width){C.width(n.width)}if(n.height&&n.height!="auto"){C.height(n.height)}if(n.startingSlide){n.startingSlide=parseInt(n.startingSlide)}if(n.random){n.randomMap=[];for(var t=0;t<r.length;t++){n.randomMap.push(t)}n.randomMap.sort(function(G,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 v=n.startingSlide;y.css({position:"absolute",top:0,left:0}).hide().each(function(w){var G=v?w>=v?r.length-(w-v):v-w:r.length-w;g(this).css("z-index",G)});g(r[v]).css("opacity",1).show();if(!g.support.opacity&&n.cleartype){r[v].style.removeAttribute("filter")}if(n.fit=="auto"){y.stretchToParent()}else{if(n.fit&&n.width){y.width(n.width)}if(n.fit&&n.height&&n.height!="auto"){y.height(n.height)}}var s=n.containerResize&&!C.innerHeight();if(s){var z=0,q=0;for(var t=0;t<r.length;t++){var o=g(r[t]),x=o[0],B=o.outerWidth(),u=o.outerHeight();if(!B){B=x.offsetWidth}if(!u){u=x.offsetHeight}z=B>z?B:z;q=u>q?u:q}if(z>0&&q>0){C.css({width:z+"px",height:q+"px"})}}if(n.pause){C.hover(function(){this.cyclePause++},function(){this.cyclePause--})}a(n);if(!n.multiFx){var D=g.fn.cycle.transitions[n.fx];if(g.isFunction(D)){D(C,y,n)}else{if(n.fx!="custom"&&!n.multiFx){d("unknown transition: "+n.fx,"; slideshow terminating");return false}}}y.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||{};y.not(":eq("+v+")").css(n.cssBefore);if(n.cssFirst){g(y[v]).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=v;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 A=y[v];if(n.before.length){n.before[0].apply(A,[A,A,n,true])}if(n.after.length>1){n.after[1].apply(A,[A,A,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(u){var q=g.fn.cycle.transitions;if(u.fx.indexOf(",")>0){u.multiFx=true;u.fxs=u.fx.replace(/\s*/g,"").split(",");for(var s=0;s<u.fxs.length;s++){var t=u.fxs[s];var o=q[t];if(!o||!q.hasOwnProperty(t)||!g.isFunction(o)){d("discarding unknowtn transition: ",t);u.fxs.splice(s,1);s--}}if(!u.fxs.length){d("No valid transitions named; slideshow terminating.");return false}}else{if(u.fx=="all"){u.multiFx=true;u.fxs=[];for(p in q){var o=q[p];if(q.hasOwnProperty(p)&&g.isFunction(o)){u.fxs.push(p)}}}}if(u.multiFx&&u.randomizeEffects){var r=Math.floor(Math.random()*20)+30;for(var s=0;s<r;s++){var n=Math.floor(Math.random()*u.fxs.length);u.fxs.push(u.fxs.splice(n,1)[0])}d("randomized fx sequence: ",u.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(v,n,u,w){if(u&&n.busy){g(v).stop(true,true);n.busy=false}if(n.busy){return}var s=n.$cont[0],y=v[n.currSlide],x=v[n.nextSlide];if(s.cycleStop!=n.stopCount||s.cycleTimeout===0&&!u){return}if(!u&&!s.cyclePause&&((n.autostop&&(--n.countdown<=0))||(n.nowrap&&!n.random&&n.nextSlide<n.currSlide))){if(n.end){n.end(n)}return}if(u||!s.cyclePause){var t=n.fx;y.cycleH=y.cycleH||y.offsetHeight;y.cycleW=y.cycleW||y.offsetWidth;x.cycleH=x.cycleH||x.offsetHeight;x.cycleW=x.cycleW||x.offsetWidth;if(n.multiFx){if(n.lastFx==undefined||++n.lastFx>=n.fxs.length){n.lastFx=0}t=n.fxs[n.lastFx];n.currFx=t}if(n.oneTimeFx){t=n.oneTimeFx;n.oneTimeFx=null}g.fn.cycle.resetState(n,t);if(n.before.length){g.each(n.before,function(z,A){if(s.cycleStop!=n.stopCount){return}A.apply(x,[y,x,n,w])})}var q=function(){g.each(n.after,function(z,A){if(s.cycleStop!=n.stopCount){return}A.apply(x,[y,x,n,w])})};if(n.nextSlide!=n.currSlide){n.busy=1;if(n.fxFn){n.fxFn(y,x,n,q,w)}else{if(g.isFunction(g.fn.cycle[n.fx])){g.fn.cycle[n.fx](y,x,n,q)}else{g.fn.cycle.custom(y,x,n,q,u&&n.fastOnEvent)}}}n.lastSlide=n.currSlide;if(n.random){n.currSlide=n.nextSlide;if(++n.randomIndex==v.length){n.randomIndex=0}n.nextSlide=n.randomMap[n.randomIndex]}else{var r=(n.nextSlide+1)==v.length;n.nextSlide=r?0:n.nextSlide+1;n.currSlide=r?v.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(y,x,n,w)}else{if(n.continuous&&s.cyclePause){o=10}}if(o>0){s.cycleTimeout=setTimeout(function(){c(v,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(s,q,r,o){if(r.timeoutFn){var n=r.timeoutFn(s,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,s){var n=o.elements;var r=o.$cont[0],q=r.cycleTimeout;if(q){clearTimeout(q);r.cycleTimeout=0}if(o.random&&s<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+s;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(s>0,o.nextSlide,n[o.nextSlide])}c(n,o,1,s>=0);return false}function b(o,q){var n=g(q.pager);g.each(o,function(r,s){g.fn.cycle.createPagerAnchor(r,s,n,o,q)});g.fn.cycle.updateActivePagerLink(q.pager,q.startingSlide)}g.fn.cycle.createPagerAnchor=function(r,s,o,q,t){var n=(g.isFunction(t.pagerAnchorBuilder))?t.pagerAnchorBuilder(r,s):'<a href="#">'+(r+1)+"</a>";if(!n){return}var u=g(n);if(u.parents("body").length==0){u.appendTo(o)}u.bind(t.pagerEvent,function(){t.nextSlide=r;var w=t.$cont[0],v=w.cycleTimeout;if(v){clearTimeout(v);w.cycleTimeout=0}if(g.isFunction(t.pagerClick)){t.pagerClick(t.nextSlide,q[t.nextSlide])}c(q,t,1,t.currSlide<r);return false});if(t.pauseOnPagerHover){u.hover(function(){t.$cont[0].cyclePause++},function(){t.$cont[0].cyclePause--})}};g.fn.cycle.hopsFromLast=function(r,q){var o,n=r.lastSlide,s=r.currSlide;if(q){o=s>n?s-n:r.slideCount-n}else{o=s<n?n-s:n+r.slideCount-s}return o};function e(q){function o(r){var r=parseInt(r).toString(16);return r.length<2?"0"+r:r}function n(t){for(;t&&t.nodeName.toLowerCase()!="html";t=t.parentNode){var r=g.css(t,"background-color");if(r.indexOf("rgb")>=0){var s=r.match(/\d+/g);return"#"+o(s[0])+o(s[1])+o(s[2])}if(r&&r!="transparent"){return r}}return"#ffffff"}q.each(function(){g(this).css("background-color",n(this))})}g.fn.cycle.commonReset=function(t,r,s,o,q,n){g(s.elements).not(t).hide();s.cssBefore.opacity=1;s.cssBefore.display="block";if(o!==false&&r.cycleW>0){s.cssBefore.width=r.cycleW}if(q!==false&&r.cycleH>0){s.cssBefore.height=r.cycleH}s.cssAfter=s.cssAfter||{};s.cssAfter.display="none";g(t).css("zIndex",s.slideCount+(n===true?1:0));g(r).css("zIndex",s.slideCount+(n===true?0:1))};g.fn.cycle.custom=function(z,t,n,q,o){var y=g(z),u=g(t);var r=n.speedIn,x=n.speedOut,s=n.easeIn,w=n.easeOut;u.css(n.cssBefore);if(o){if(typeof o=="number"){r=x=o}else{r=x=1}s=w=null}var v=function(){u.animate(n.animIn,r,s,q)};y.animate(n.animOut,x,w,function(){if(n.cssAfter){y.css(n.cssAfter)}if(!n.sync){v()}});if(n.sync){v()}};g.fn.cycle.transitions={fade:function(o,q,n){q.not(":eq("+n.currSlide+")").css("opacity",0);n.before.push(function(t,r,s){g.fn.cycle.commonReset(t,r,s);s.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);jQuery(function(a){a("#choose_city").bind("change",function(){if(a(this).val()!="0"){window.location="/miasta/"+a(this).val()+"/restauracje/galeria"}else{window.location="/restauracje/galeria"}})});