Duis aute irure dolor reprehenderit
(function(){var a,b,c;a=jQuery;c=(function(){function d(){this.fileLoadingImage=TemplateP+"/img/lb-loading.gif";this.fileCloseImage=TemplateP+"/img/lb-close.png";this.resizeDuration=700;this.fadeDuration=500;this.labelImage="Image";this.labelOf="of"}return d})();b=(function(){function d(e){this.options=e;this.album=[];this.currentImageIndex=void 0;this.init()}d.prototype.init=function(){this.enable();return this.build()};d.prototype.enable=function(){var e=this;return a("body").on("click","a[rel^=prettyPhoto], area[rel^=prettyPhoto]",function(f){e.start(a(f.currentTarget));return false})};d.prototype.build=function(){var e,f=this;a(" ",{id:"lightboxOverlay"}).after(a(" ",{id:"lightbox"}).append(a(" ",{"class":"lb-outerContainer"}).append(a(" ",{"class":"lb-container"}).append(a(" ",{"class":"lb-image"}),a(" ",{"class":"lb-nav"}).append(a(" ",{"class":"lb-prev"}),a(" ",{"class":"lb-next"})),a(" ",{"class":"lb-loader"}).append(a(" ",{"class":"lb-cancel"}).append(a(" ",{src:this.options.fileLoadingImage}))))),a(" ",{"class":"lb-dataContainer"}).append(a(" ",{"class":"lb-data"}).append(a(" ",{"class":"lb-details"}).append(a(" ",{"class":"lb-caption"}),a(" ",{"class":"lb-number"})),a(" ",{"class":"lb-closeContainer"}).append(a(" ",{"class":"lb-close"}).append(a(" ",{src:this.options.fileCloseImage}))))))).appendTo(a("body"));a(" lightboxOverlay").hide().on("click",function(g){f.end();return false});e=a(" lightbox");e.hide().on("click",function(g){if(a(g.target).attr("id")==="lightbox"){f.end()}return false});e.find(".lb-outerContainer").on("click",function(g){if(a(g.target).attr("id")==="lightbox"){f.end()}return false});e.find(".lb-prev").on("click",function(g){f.changeImage(f.currentImageIndex-1);return false});e.find(".lb-next").on("click",function(g){f.changeImage(f.currentImageIndex+1);return false});e.find(".lb-loader, .lb-close").on("click",function(g){f.end();return false})};d.prototype.start=function(j){var o,e,m,h,n,f,k,l,g;a(window).on("resize",this.sizeOverlay);a("select, object, embed").css({visibility:"hidden"});a(" lightboxOverlay").width(a(document).width()).height(a(document).height()).fadeIn(this.options.fadeDuration);this.album=[];n=0;if(j.attr("rel")==="prettyPhoto"){this.album.push({link:j.attr("href"),title:j.attr("title")})}else{g=a(j.prop("tagName")+`[rel="`+j.attr("rel")+`"]`);for(h=0,l=g.length;h 0){e.find(".lb-prev").show()}if(this.currentImageIndex 1){e.find(".lb-number").html(this.options.labelImage+" "+(this.currentImageIndex+1)+" "+this.options.labelOf+" "+this.album.length).fadeIn("fast")}else{e.find(".lb-number").hide()}e.find(".lb-outerContainer").removeClass("animating");e.find(".lb-dataContainer").fadeIn(this.resizeDuration,function(){return f.sizeOverlay()})};d.prototype.preloadNeighboringImages=function(){var f,e;if(this.album.length>this.currentImageIndex+1){f=new Image;f.src=this.album[this.currentImageIndex+1].link}if(this.currentImageIndex>0){e=new Image;e.src=this.album[this.currentImageIndex-1].link}};d.prototype.enableKeyboardNav=function(){a(document).on("keyup.keyboard",a.proxy(this.keyboardAction,this))};d.prototype.disableKeyboardNav=function(){a(document).off(".keyboard")};d.prototype.keyboardAction=function(h){var j,i,f,g,e;j=27;i=37;f=39;e=h.keyCode;g=String.fromCharCode(e).toLowerCase();if(e===j||g.match(/x|o|c/)){this.end()}else{if(g==="p"||e===i){if(this.currentImageIndex!==0){this.changeImage(this.currentImageIndex-1)}}else{if(g==="n"||e===f){if(this.currentImageIndex!==this.album.length-1){this.changeImage(this.currentImageIndex+1)}}}}};d.prototype.end=function(){this.disableKeyboardNav();a(window).off("resize",this.sizeOverlay);a(" lightbox").fadeOut(this.options.fadeDuration);a(" lightboxOverlay").fadeOut(this.options.fadeDuration);return a("select, object, embed").