(function(a){if(typeof a.log==="undefined")if(!a.browser.safari&&typeof window.console!=="undefined"&&typeof window.console.log==="function"){a.log=function(){for(var b=[],a=0;a<arguments.length;a++)b.push(arguments[a]);window.console.log.apply(window.console,b)};a.console={log:a.log,debug:window.console.debug||a.log,warn:window.console.warn||a.log,error:window.console.error||a.log,trace:window.console.trace||a.log};$log=a.log;$debug=a.console.debug;$warn=a.console.warn;$error=a.console.error;$trace=a.console.trace}else{a.log=function(){};a.console={log:a.log,debug:a.log,warn:a.log,error:alert,trace:a.log};$log=a.log;$debug=a.console.debug;$warn=a.console.warn;$error=a.console.error;$trace=a.console.trace}a.params_to_json=a.params_to_json||function(a){a=String(a);a=a.substring(a.indexOf("?")+1);a=a.replace(/\+/g,"%20");if(a.substring(0,1)==="{"&&a.substring(a.length-1)==="}")return eval(decodeURIComponent(a));a=a.split(/\&|\&amp\;/);for(var h={},g=0,i=a.length;g<i;++g){var b=a[g]||null;if(b===null)continue;b=b.split("=");if(b===null)continue;var c=b[0]||null;if(c===null)continue;if(typeof b[1]==="undefined")continue;var d=b[1];c=decodeURIComponent(c);d=decodeURIComponent(d);try{d=eval(d)}catch(j){}var f=c.split(".");if(f.length===1)h[c]=d;else{var e="";for(ii in f){c=f[ii];e+="."+c;eval("json"+e+" = json"+e+" || {}")}eval("json"+e+" = value")}}return h};var b=function(a){return $type(a)!=="array"?[a]:a};Array.prototype.remove=function(a,c){var b=this.slice((c||a)+1||this.length);this.length=a<0?this.length+a:a;return this.push.apply(this,b)};Array.prototype.get=function(a,b){if(a==="first")a=0;else if(a==="last")a=this.length-1;else if(!a&&a!==0)a=this.index;b!==false&&this.setIndex(a);return this[a]||undefined};Array.prototype.each=function(b){for(var a=0;a<this.length;++a)if(b(a,this[a],this)===false)break;return this};Array.prototype.setIndex=function(a){if(a<this.length&&a>=0)this.index=a;else this.index=null;return this};Array.prototype.current=function(a){return this.get(a,true)};Array.prototype.isEmpty=function(){return this.length===0};Array.prototype.isSingle=function(){return this.length===1};Array.prototype.isMany=function(){return this.length!==0};Array.prototype.isLast=function(a){a=typeof a==="undefined"?this.index:a;return!this.isEmpty()&&a===this.length-1};Array.prototype.isFirst=function(a){a=typeof a==="undefined"?this.index:a;return!this.isEmpty()&&a===0};Array.prototype.clear=function(){this.length=0};Array.prototype.next=function(a){return this.get(this.index+1,a)};Array.prototype.prev=function(a){return this.get(this.index-1,a)};Array.prototype.reset=function(){this.index=null;return this};Array.prototype.set=function(a,b){if(a<this.length&&a>=0)this[a]=b;else{$error("index above array length");return false}return this};Array.prototype.loop=function(){return!this.index&&this.index!==0?this.current(0):this.next()};Array.prototype.add=function(){this.push.apply(this,arguments);return this};Array.prototype.insert=function(a,b){if(typeof a!=="number")a=this.length;a=a<=this.length?a:this.length;var c=this.slice(a);this.length=a;this.push(b);this.push.apply(this,c);return this};a.LightboxClass=function(){this.construct()};a.fn.lightbox=function(c){a.Lightbox=a.Lightbox||new a.LightboxClass;if(a.Lightbox.ie6&&!a.Lightbox.ie6_support)return this;c=a.extend({start:false,events:true},c);var b=a(this);if(c.events){b.unbind("click").click(function(){var d=a(this),c=b.index(d);return!a.Lightbox.init(c,b)?false:!a.Lightbox.start()?false:false});b.addClass("lightbox-enabled")}if(c.start){var d=a(this);if(!a.Lightbox.init(0,b))return this;if(!a.Lightbox.start())return this}return this};a.extend(a.LightboxClass.prototype,{images:[],constructed:false,compressed:null,src:null,baseurl:null,files:{compressed:{js:{lightbox:"js/jquery.lightbox.min.js",colorBlend:"js/jquery.color.min.js"},css:{lightbox:"css/jquery.lightbox.css"}},uncompressed:{js:{lightbox:"js/jquery.lightbox.js",colorBlend:"js/jquery.color.js"},css:{lightbox:"css/jquery.lightbox.css"}},images:{prev:"images/prev.gif",next:"images/next.gif",blank:"images/blank.gif",loading:"images/loading.gif"}},text:{image:"Foto",of:"z",close:"Zamknij X",closeInfo:"",download:"",help:{close:"Zamknij",interact:""},about:{text:"",title:"",link:""}},keys:{close:"c",prev:"p",next:"n"},handlers:{show:null},opacity:.9,padding:null,speed:400,rel:"lightbox",auto_relify:true,auto_scroll:"follow",auto_resize:true,ie6:null,ie6_support:true,ie6_upgrade:true,colorBlend:null,download_link:true,show_helper_text:true,show_linkback:true,show_info:"auto",show_extended_info:"auto",options:["show_helper_text","auto_scroll","auto_resize","download_link","show_info","show_extended_info","ie6_support","ie6_upgrade","colorBlend","baseurl","files","text","show_linkback","keys","opacity","padding","speed","rel","auto_relify"],construct:function(b){var g=typeof this.constructed==="undefined"||this.constructed===false;this.constructed=true;var f=g;b=b||{};var e=function(a,c){if(typeof a==="object")for(var b in a)a[b]=e(a[b],c);else if(typeof c==="array")for(var b=0,d=a.length;b<d;++b)a[b]=e(a[b],c);else a=c+a;return a};if(g&&typeof b.files==="undefined"){this.compressed=null;var d=a("script[src*="+this.files.compressed.js.lightbox+"]:first");if(d.length!==0){a.extend(true,this.files,this.files.compressed);this.compressed=true}else{d=a("script[src*="+this.files.uncompressed.js.lightbox+"]:first");if(d.length!==0){a.extend(true,this.files,this.files.uncompressed);this.compressed=false}}if(this.compressed===null){a.console.error("Lightbox was not able to find it's javascript script tag necessary for auto-inclusion.");f=false}else{this.src=d.attr("src");this.baseurl=this.src.substring(0,this.src.indexOf(this.files.js.lightbox));this.files=e(this.files,this.baseurl);b=a.extend(b,a.params_to_json(this.src))}this.images.image={src:"",title:"Untitled",description:"",name:"",color:null,width:null,height:null,id:null,image:true};this.images.prepare=function(c){var b=a.extend({},this.image);if(c.tagName){c=a(c);if(c.attr("src")||c.attr("href")){b.src=c.attr("src")||c.attr("href");b.title=c.attr("title")||c.attr("alt")||b.title;b.name=c.attr("name")||"";b.color=c.css("backgroundColor");var d=b.title.indexOf(": ");if(d>0){b.description=b.title.substring(d+2)||b.description;b.title=b.title.substring(0,d)||b.title}}else b=null}else if(c.src)b=a.extend(this.image,c);else b=null;if(b)b.id=b.id||b.src+b.title+b.description;return b};this.images.create=function(c){var b=this;if(c.each){c.each(function(c,a){b.create(a)});return}var d=b.prepare(c);if(!d)a.console.error("We dont know what we have:",c,d);else b.push(d);return b}}else if(typeof b.files==="object")b.files=e(b.files,this.baseurl);else f=false;for(var h in this.options){var c=this.options[h];if(typeof b[c]==="object"&&typeof this[c]==="object")this[c]=a.extend(true,this[c],b[c]);else if(typeof b[c]!=="undefined")this[c]=b[c]}delete h;if(g&&navigator.userAgent.indexOf("MSIE 6")>=0)this.ie6=true;else this.ie6=false;(f||typeof b.download_link!=="undefined"||typeof b.colorBlend!=="undefined"||typeof b.files==="object"||typeof b.text==="object"||typeof b.show_linkback!=="undefined"||typeof b.scroll_with!=="undefined")&&a(function(){a.Lightbox.domReady()});return true},domReady:function(){var f=document.getElementsByTagName(a.browser.safari?"head":"body")[0],e=this.files.css,d=this.files.js;if(this.ie6&&this.ie6_upgrade)d.ie6="http://www.savethedevelopers.org/say.no.to.ie.6.js";if(this.colorBlend===true&&typeof a.colorBlend==="undefined")this.colorBlend=true;else{this.colorBlend=typeof a.colorBlend!=="undefined";delete d.colorBlend}for(stylesheet in e){var b=document.createElement("link");b.type="text/css";b.rel="stylesheet";b.media="screen";b.href=e[stylesheet];b.id="lightbox-stylesheet-"+stylesheet.replace(/[^a-zA-Z0-9]/g,"");a("#"+b.id).remove();f.appendChild(b)}for(script in d){var c=document.createElement("script");c.type="text/javascript";c.src=d[script];c.id="lightbox-script-"+script.replace(/[^a-zA-Z0-9]/g,"");a("#"+c.id).remove();f.appendChild(c)}delete d;delete e;delete f;a("#lightbox,#lightbox-overlay").remove();a("body").append('<div id="lightbox-overlay"><div id="lightbox-overlay-text">'+(this.show_linkback?'<p><span id="lightbox-overlay-text-about"><a href="#" title="'+this.text.about.title+'">'+this.text.about.text+"</a></span></p><p>&nbsp;</p>":"")+(this.show_helper_text?'<p><span id="lightbox-overlay-text-close">'+this.text.help.close+'</span><br/>&nbsp;<span id="lightbox-overlay-text-interact">'+this.text.help.interact+"</span></p>":"")+'</div></div><div id="lightbox"><div id="lightbox-imageBox"><div id="lightbox-imageContainer"><img id="lightbox-image" /><div id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="'+this.files.images.loading+'" /></a></div></div></div><div id="lightbox-infoBox"><div id="lightbox-infoContainer"><div id="lightbox-infoHeader"><span id="lightbox-caption">'+(this.download_link?'<a href="#" title="'+this.text.download+'" id="lightbox-caption-title"></a>':'<span id="lightbox-caption-title"></span>')+'<span id="lightbox-caption-seperator"></span><span id="lightbox-caption-description"></span></span></div><div id="lightbox-infoFooter"><span id="lightbox-currentNumber"></span><span id="lightbox-close"><a href="#" id="lightbox-close-button" title="'+this.text.closeInfo+'">'+this.text.close+'</a></span></div><div id="lightbox-infoContainer-clear"></div></div></div></div>');this.resizeBoxes();this.repositionBoxes();a("#lightbox,#lightbox-overlay,#lightbox-overlay-text-interact").hide();this.ie6&&this.ie6_support&&a("#lightbox-overlay").css({position:"absolute",top:"0px",left:"0px"});a.each(this.files.images,function(){var a=new Image;a.onload=function(){a.onload=null;a=null};a.src=this});a(window).unbind("resize").resize(function(){a.Lightbox.resizeBoxes("resized")});this.scroll==="follow"&&a(window).scroll(function(){a.Lightbox.repositionBoxes()});a("#lightbox-nav-btnPrev").unbind().hover(function(){a(this).css({background:"url("+a.Lightbox.files.images.prev+") left 45% no-repeat"})},function(){a(this).css({background:"transparent url("+a.Lightbox.files.images.blank+") no-repeat"})}).click(function(){a.Lightbox.images.prev();a.Lightbox.showImage();return false});a("#lightbox-nav-btnNext").unbind().hover(function(){a(this).css({background:"url("+a.Lightbox.files.images.next+") right 45% no-repeat"})},function(){a(this).css({background:"transparent url("+a.Lightbox.files.images.blank+") no-repeat"})}).click(function(){a.Lightbox.images.next();a.Lightbox.showImage();return false});this.show_linkback&&a("#lightbox-overlay-text-about a").click(function(){window.open(a.Lightbox.text.about.link);return false});a("#lightbox-overlay-text-close").unbind().hover(function(){a("#lightbox-overlay-text-interact").fadeIn()},function(){a("#lightbox-overlay-text-interact").fadeOut()});a("#lightbox-caption-title").click(function(){window.open(a(this).attr("href"));return false});a("#lightbox-overlay, #lightbox, #lightbox-loading-link, #lightbox-btnClose").unbind().click(function(){a.Lightbox.finish();return false});this.auto_relify&&this.relify();return true},relify:function(){var b={},c=0,d=this.rel;a.each(a("[rel*="+d+"]"),function(g,f){var e=a(f).attr("rel");if(e===d)e=c;if(typeof b[e]==="undefined"){b[e]=[];c++}b[e].push(f)});a.each(b,function(c,b){a(b).lightbox()});return true},init:function(b,c){if(typeof c==="undefined"){c=b;b=0}this.images.clear();this.images.create(c);if(this.images.isEmpty()){a.console.warn("WARNING","Lightbox started, but no images: ",b,c);return false}if(!this.images.current(b)){a.console.warn("WARNING","Could not find current image: ",b,this.images);return false}return true},start:function(){this.visible=true;this.scroll==="disable"&&a(document.body).css("overflow","hidden");a("embed, object, select").css("visibility","hidden");this.resizeBoxes("general");this.repositionBoxes({speed:0});a("#lightbox-infoFooter").hide();a("#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-infoBox").hide();a("#lightbox-overlay").css("opacity",this.opacity).fadeIn(400,function(){a("#lightbox").fadeIn(300);if(!a.Lightbox.showImage()){a.Lightbox.finish();return false}});return true},finish:function(){a("#lightbox").hide();a("#lightbox-overlay").fadeOut(function(){a("#lightbox-overlay").hide()});a("embed, object, select").css({visibility:"visible"});this.images.reset();this.scroll==="disable"&&a(document.body).css("overflow","visible");this.visible=false},resizeBoxes:function(k){if(k!=="transition"){var j=a(this.ie6?document.body:document);a("#lightbox-overlay").css({width:j.width(),height:j.height()});delete j}switch(k){case"general":return true;break;case"resized":if(this.auto_resize===false){this.repositionBoxes({nHeight:d,speed:this.speed});return true}}var i=this.images.current();if(!i||!i.width||!this.visible)return false;var c=i.width,b=i.height,q=a(window).width(),n=a(window).height();if(this.auto_resize!==false){var g=Math.floor(q*(4/5)),f=Math.floor(n*(4/5)),e;while(c>g||b>f){if(c>g){e=g/c;c=g;b=Math.floor(b*e)}if(b>f){e=f/b;b=f;c=Math.floor(c*e)}}}var o=a("#lightbox-imageBox").width(),l=a("#lightbox-imageBox").height(),h=c+this.padding*2,d=b+this.padding*2,p=o-h,m=l-d;a("#lightbox-nav-btnPrev,#lightbox-nav-btnNext").css("height",d);a("#lightbox-infoBox").css("width",h);if(k==="transition")if(p===0&&m===0){this.pause(this.speed/3);this.showImage(null,3)}else{a("#lightbox-image").width(c).height(b);a("#lightbox-imageBox").animate({width:h,height:d},this.speed,function(){a.Lightbox.showImage(null,3)})}else{a("#lightbox-image").animate({width:c,height:b},this.speed);a("#lightbox-imageBox").animate({width:h,height:d},this.speed)}this.repositionBoxes({nHeight:d,speed:this.speed});return true},repositioning:false,reposition_failsafe:false,repositionBoxes:function(b){if(this.repositioning){this.reposition_failsafe=true;return null}this.repositioning=true;b=a.extend({},b);b.callback=b.callback||null;b.speed=b.speed||"slow";var c=this.getPageScroll(),e=b.nHeight||parseInt(a("#lightbox").height(),10),g=c.yScroll+(a(window).height()-e)/2.5,f=c.xScroll,d={left:f,top:g};if(b.speed)a("#lightbox").animate(d,"slow",function(){if(a.Lightbox.reposition_failsafe){a.Lightbox.repositioning=a.Lightbox.reposition_failsafe=false;a.Lightbox.repositionBoxes(b)}else{a.Lightbox.repositioning=false;b.callback&&b.callback()}});else{a("#lightbox").css(d);if(this.reposition_failsafe){this.repositioning=this.reposition_failsafe=false;this.repositionBoxes(b)}else this.repositioning=false}return true},visible:false,showImage:function(b,d){d=d||1;b=this.images.current(b)||this.images.get("first",true);if(!b)return;switch(d){case 1:this.KeyboardNav_Disable();a("#lightbox-loading").show();a("#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-infoBox").hide();a("#lightbox-imageBox").unbind();if(b.width&&b.height)this.showImage(null,2);else{var c=new Image;c.onload=function(){b.width=c.width;b.height=c.height;a.Lightbox.showImage(null,2);c.onload=null;c=null};c.src=b.src}break;case 2:a("#lightbox-image").attr("src",b.src);if(typeof this.padding==="undefined"||this.padding===null||isNaN(this.padding))this.padding=parseInt(a("#lightbox-imageContainer").css("padding-left"),10)||parseInt(a("#lightbox-imageContainer").css("padding"),10)||0;if(this.colorBlend){a("#lightbox-overlay").animate({backgroundColor:b.color},this.speed*2);a("#lightbox-imageBox").css("borderColor",b.color)}this.resizeBoxes("transition");break;case 3:a("#lightbox-loading").hide();a("#lightbox-image").fadeIn(this.speed*1.5,function(){a.Lightbox.showImage(null,4)});this.preloadNeighbours();this.handlers.show!==null&&this.handlers.show(b);break;case 4:var e=a("#lightbox-caption-title").html(b.title||"Untitled");this.download_link&&e.attr("href",this.download_link?b.src:"");delete e;a("#lightbox-caption-seperator").html(b.description?": ":"");a("#lightbox-caption-description").html(b.description||"&nbsp;");if(this.images.length>1)a("#lightbox-currentNumber").html(this.text.image+"&nbsp;"+(this.images.index+1)+"&nbsp;"+this.text.of+"&nbsp;"+this.images.length);else a("#lightbox-currentNumber").html("&nbsp;");a("#lightbox-imageBox").unbind("mouseover").mouseover(function(){a("#lightbox-infoBox:not(:visible)").stop().slideDown("fast")});a("#lightbox-infoBox").unbind("mouseover").mouseover(function(){a("#lightbox-infoFooter:not(:visible)").stop().slideDown("fast")});if(this.show_extended_info===true){a("#lightbox-imageBox").trigger("mouseover");a("#lightbox-infoBox").trigger("mouseover")}else this.show_info===true&&a("#lightbox-imageBox").trigger("mouseover");a("#lightbox-nav-btnPrev, #lightbox-nav-btnNext").css({background:"transparent url("+this.files.images.blank+") no-repeat"});!this.images.isFirst()&&a("#lightbox-nav-btnPrev").show();!this.images.isLast()&&a("#lightbox-nav-btnNext").show();a("#lightbox-nav").show();this.KeyboardNav_Enable();break;default:a.console.error("Don't know what to do: ",b,d);return this.showImage(b,1)}return true},preloadNeighbours:function(){if(this.images.isSingle()||this.images.isEmpty())return true;var b=this.images.current(),c=this.images.index;if(!b)return b;var a,e=this.images.prev();if(e){a=new Image;a.src=e.src}this.images.setIndex(c);var d=this.images.next();if(d){a=new Image;a.src=d.src}this.images.setIndex(c)},KeyboardNav_Enable:function(){a(document).keydown(function(b){a.Lightbox.KeyboardNav_Action(b)})},KeyboardNav_Disable:function(){a(document).unbind("keydown")},KeyboardNav_Action:function(b){b=b||window.event;var c=b.keyCode,e=b.DOM_VK_ESCAPE||27,d=String.fromCharCode(c).toLowerCase();return d===this.keys.close||c===e?a.Lightbox.finish():d===this.keys.prev||c===37?a.Lightbox.showImage(a.Lightbox.images.prev()):d===this.keys.next||c===39?a.Lightbox.showImage(a.Lightbox.images.next()):true},getPageScroll:function(){var a,b;if(self.pageYOffset){b=self.pageYOffset;a=self.pageXOffset}else if(document.documentElement&&document.documentElement.scrollTop){b=document.documentElement.scrollTop;a=document.documentElement.scrollLeft}else if(document.body){b=document.body.scrollTop;a=document.body.scrollLeft}var c={xScroll:a,yScroll:b};return c},pause:function(c){var b=new Date,a=null;do a=new Date;while(a-b<c)}});if(typeof a.Lightbox==="undefined")a.Lightbox=new a.LightboxClass})(jQuery)
