/* Embeddable (837) jquery.lightbox.js */ /* (c) 2008 Benjamin Arthur Lupton {@link http://www.balupton.com} @license GNU Affero General Public License - {@link http://www.gnu.org/licenses/agpl.html} @example Visit {@link http://jquery.com/plugins/project/jquerylightbox_bal} for more information. */ (function(b){"undefined"===typeof b.log&&(b.browser.safari||"undefined"===typeof window.console||"function"!==typeof window.console.log?(b.log=function(){},b.console={log:b.log,debug:b.log,warn:b.log,error:alert,trace:b.log}):(b.log=function(){for(var a=[],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().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"})}).click(function(){b.Lightbox.showImage(b.Lightbox.images.prev());return!1});b("#lightbox-nav-btnNext").unbind().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"})}).click(function(){b.Lightbox.showImage(b.Lightbox.images.next());return!1});this.show_linkback&&b("#lightbox-overlay-text-about a").click(function(){window.open(b.Lightbox.text.about.link);return!1});b("#lightbox-overlay-text-close").unbind().hover(function(){b("#lightbox-overlay-text-interact").show()},function(){b("#lightbox-overlay-text-interact").hide()});b("#lightbox-overlay, #lightbox, #lightbox-loading-link, #lightbox-btnClose").unbind().click(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(f,e){var g=b(e).attr("rel");g===d&&(g=c);"undefined"===typeof a[g]&&(a[g]=[],c++);a[g].push(e)});b.each(a,function(a,c){b(c).lightbox()});return!0},init:function(a,c){"undefined"===typeof c&&(c=a,a=0);this.images.clear();return this.images.add(c)?this.images.empty()?(b.console.warn("WARNING","Lightbox started, but no images: ",a,c),!1):this.images.active(a)?!0:!1:!1},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).show(1,function(){b("#lightbox").show(1);if(!b.Lightbox.showImage(b.Lightbox.images.active()))return b.Lightbox.finish(),!1});return!0}, finish:function(){b("#lightbox").hide();b("#lightbox-overlay").hide();b("embed, object, select").css({visibility:"visible"});this.images.active(!1);"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:f, speed:this.speed}),!0}var d=this.images.active();if(!d||!d.width||!this.visible)return!1;var c=d.width,d=d.height,f=b(window).width(),e=b(window).height();if(!1!==this.auto_resize)for(var f=Math.floor(0.8*f),e=Math.floor(0.8*e),g;c>f||d>e;)c>f&&(g=f/c,c=f,d=Math.floor(d*g)),d>e&&(g=e/d,d=e,c=Math.floor(c*g));var h=b("#lightbox-imageBox").width();g=b("#lightbox-imageBox").height();var e=c+2*this.padding,f=d+2*this.padding,h=h-e;g-=f;b("#lightbox-nav-btnPrev,#lightbox-nav-btnNext").css("height",f); b("#lightbox-infoBox").css("width",e);"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:e,height:f},this.speed,function(){b.Lightbox.showImage(null,3)})):(b("#lightbox-image").animate({width:c,height:d},this.speed),b("#lightbox-imageBox").animate({width:e,height:f},this.speed));this.repositionBoxes({nHeight:f,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;a.speed=a.speed||"fast";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};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){a=this.images.get(a);if(!a)return a;c=c||1;var d=1