/* MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License - {@link http://opensource.org/licenses/mit-license.php} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} MIT License {@link http://creativecommons.org/licenses/MIT/} @example Visit {@link http://balupton.com/projects/jquery-lightbox} for more information. */ (function(b){if("object"!==typeof window.console||"undefined"===typeof window.console.emulated)"object"!==typeof window.console||!("function"===typeof window.console.log||"object"===typeof window.console.log)?(window.console={},window.console.log=window.console.debug=window.console.warn=window.console.trace=function(){},window.console.error=function(){for(var a="An error has occured. More information will be available in the console log.",b=0;ba?this.length+a:a;return this.push.apply(this,d)};Array.prototype.get=function(a,b){"first"===a?a=0:"last"===a?a=this.length- 1:"prev"===a?a=this.index-1:"next"===a?a=this.index+1:!a&&0!==a&&(a=this.index);b&&this.setIndex(a);return this.exists(a)?this[a]:void 0};Array.prototype.each=function(a){for(var b=0;b');this.resizeBoxes();this.repositionBoxes();b("#lightbox,#lightbox-overlay,#lightbox-overlay-text-interact").hide();this.ie6&&this.ie6_support&&b("#lightbox-overlay").css({position:"absolute",top:"0px",left:"0px"});b.each(this.files.images,function(){var a=new Image;a.onload=function(){a=a.onload=null};a.src=this});b(window).unbind("resize").resize(function(){b.Lightbox.resizeBoxes("resized")}); "follow"===this.scroll&&b(window).scroll(function(){b.Lightbox.repositionBoxes()});b("#lightbox-nav-btnPrev").unbind().preventDefault().hover(function(){b(this).css({background:"url("+b.Lightbox.files.images.prev+") left 45% no-repeat"})},function(){b(this).css({background:"transparent url("+b.Lightbox.files.images.blank+") no-repeat"})}).lastclick(function(){b.Lightbox.showImage("prev");return!1});b("#lightbox-nav-btnNext").unbind().preventDefault().hover(function(){b(this).css({background:"url("+ b.Lightbox.files.images.next+") right 45% no-repeat"})},function(){b(this).css({background:"transparent url("+b.Lightbox.files.images.blank+") no-repeat"})}).lastclick(function(){b.Lightbox.showImage("next");return!1});this.show_linkback&&b("#lightbox-overlay-text-about a").preventDefault().lastclick(function(){window.open(b.Lightbox.text.about.link);return!1});b("#lightbox-overlay-text-close").unbind().hover(function(){b("#lightbox-overlay-text-interact").fadeIn()},function(){b("#lightbox-overlay-text-interact").fadeOut()}); this.download_link&&b("#lightbox-caption-title").preventDefault().lastclick(function(){window.open(b(this).prop("href"));return!1});b("#lightbox-overlay, #lightbox, #lightbox-loading-link, #lightbox-btnClose").unbind().preventDefault().lastclick(function(){b.Lightbox.finish();return!1});this.auto_relify&&this.relify();return!0},relify:function(){var a={},c=0,d=this.rel;b.each(b("[rel*="+d+"]"),function(e,f){var g=b(f).prop("rel");g===d&&(g=c);"undefined"===typeof a[g]&&(a[g]=[],c++);a[g].push(f)}); b.each(a,function(a,c){b(c).lightbox()});return!0},init:function(a,b){"undefined"===typeof b&&(b=a,a=0);this.images.clear();this.images.create(b);return this.images.isEmpty()?(window.console.warn("WARNING","Lightbox started, but no images: ",a,b),!1):!this.images.current(a)?(window.console.warn("WARNING","Could not find current image: ",a,this.images),!1):!0},start:function(){this.visible=!0;"disable"===this.scroll&&b(document.body).css("overflow","hidden");b("embed, object, select").css("visibility", "hidden");this.resizeBoxes("general");this.repositionBoxes({speed:0});b("#lightbox-infoFooter").hide();b("#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-infoBox").hide();b("#lightbox-overlay").css("opacity",this.opacity).fadeIn(400,function(){b("#lightbox").fadeIn(300);if(!b.Lightbox.showImage())return b.Lightbox.finish(),!1});return!0},finish:function(){b("#lightbox").hide();b("#lightbox-overlay").fadeOut(function(){b("#lightbox-overlay").hide()});b("embed, object, select").css({visibility:"visible"}); this.images.reset();"disable"===this.scroll&&b(document.body).css("overflow","visible");this.visible=!1},resizeBoxes:function(a){if("transition"!==a){var c=b(this.ie6?document.body:document);b("#lightbox-overlay").css({width:c.width(),height:c.height()});delete c}switch(a){case "general":return!0;case "resized":if(!1===this.auto_resize)return this.repositionBoxes({nHeight:e,speed:this.speed}),!0}var d=this.images.current();if(!d||!d.width||!this.visible)return!1;var c=d.width,d=d.height,e=b(window).width(), f=b(window).height();if(!1!==this.auto_resize)for(var e=Math.floor(0.8*e),f=Math.floor(0.8*f),g;c>e||d>f;)c>e&&(g=e/c,c=e,d=Math.floor(d*g)),d>f&&(g=f/d,d=f,c=Math.floor(c*g));var h=b("#lightbox-imageBox").width();g=b("#lightbox-imageBox").height();var f=c+2*this.padding,e=d+2*this.padding,h=h-f;g-=e;b("#lightbox-nav-btnPrev,#lightbox-nav-btnNext").css("height",e);b("#lightbox-infoBox").css("width",f);"transition"===a?0===h&&0===g?(this.pause(this.speed/3),this.showImage(null,3)):(b("#lightbox-image").width(c).height(d), b("#lightbox-imageBox").animate({width:f,height:e},this.speed,function(){b.Lightbox.showImage(null,3)})):(b("#lightbox-image").animate({width:c,height:d},this.speed),b("#lightbox-imageBox").animate({width:f,height:e},this.speed));this.repositionBoxes({nHeight:e,speed:this.speed});return!0},repositioning:!1,reposition_failsafe:!1,repositionBoxes:function(a){if(this.repositioning)return this.reposition_failsafe=!0,null;this.repositioning=!0;a=b.extend({},a);a.callback=a.callback||null;a.speed=a.speed|| "slow";var c=this.getPageScroll(),d=a.nHeight||parseInt(b("#lightbox").height(),10),d=c.yScroll+(b(window).height()-d)/2.5,c={left:c.xScroll,top:d};a.speed?b("#lightbox").animate(c,"slow",function(){b.Lightbox.reposition_failsafe?(b.Lightbox.repositioning=b.Lightbox.reposition_failsafe=!1,b.Lightbox.repositionBoxes(a)):(b.Lightbox.repositioning=!1,a.callback&&a.callback())}):(b("#lightbox").css(c),this.reposition_failsafe?(this.repositioning=this.reposition_failsafe=!1,this.repositionBoxes(a)):this.repositioning= !1);return!0},visible:!1,showImage:function(a,c){c=c||1;if(a=this.images.current(a)||this.images.get("first",!0)){switch(c){case 1:this.KeyboardNav_Disable();b("#lightbox-loading").show();b("#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-infoBox").hide();b("#lightbox-imageBox").unbind();if(a.width&&a.height)this.showImage(null,2);else{var d=new Image;d.onload=function(){a.width=d.width;a.height=d.height;b.Lightbox.showImage(null,2);d=d.onload=null};d.src=a.src}break; case 2:b("#lightbox-image").prop("src",a.src);if("undefined"===typeof this.padding||null===this.padding||isNaN(this.padding))this.padding=parseInt(b("#lightbox-imageContainer").css("padding-left"),10)||parseInt(b("#lightbox-imageContainer").css("padding"),10)||0;this.colorBlend&&(b("#lightbox-overlay").animate({backgroundColor:a.color},2*this.speed),b("#lightbox-imageBox").css("borderColor",a.color));this.resizeBoxes("transition");break;case 3:b("#lightbox-loading").hide();b("#lightbox-image").fadeIn(1.5* this.speed,function(){b.Lightbox.showImage(null,4)});this.preloadNeighbours();null!==this.handlers.show&&this.handlers.show(a);break;case 4:var e=b("#lightbox-caption-title").html(a.title||"Untitled");this.download_link&&e.prop("href",this.download_link?a.src:"");delete e;b("#lightbox-caption-seperator").html(a.description?": ":"");b("#lightbox-caption-description").html(a.description||" ");1