"use strict";function Lightbox(){var K=this,M=false,L=false,t=document.getElementsByTagName("body")[0],f='
',h=false,y=false,e=false,p={},j=[],d=false,b,E,a=[],J,x=false,m=false,u,I,A,w;K.opt={};K.box=false;K.wrapper=false;K.thumbnails=[];function z(){return window.innerHeight||document.documentElement.offsetHeight}function N(){return window.innerWidth||document.documentElement.offsetWidth}function k(Q,R,S,P){if(Q.addEventListener){Q.addEventListener(R,S,P||false)}else{if(Q.attachEvent){Q.attachEvent("on"+R,S)}}}function D(Q,P){if(!Q||!P){return}return(new RegExp("(^|\\s)"+P+"(\\s|$)").test(Q.className))}function o(Q,P){if(!Q||!P){return}Q.className=Q.className.replace(new RegExp("(?:^|\\s)"+P+"(?!\\S)"),"");return Q}function v(Q,P){if(!Q||!P){return}if(!D(Q,P)){Q.className+=" "+P}return Q}function O(P){return typeof P!=="undefined"}function F(R,P){if(!R||!O(R)){return false}var Q;if(R.getAttribute){Q=R.getAttribute(P)}else{if(R.getAttributeNode){Q=R.getAttributeNode(P).value}}if(O(Q)&&Q!==""){return Q}return false}function c(R,P){if(!R||!O(R)){return false}var Q;if(R.getAttribute){Q=R.getAttribute(P)}else{if(R.getAttributeNode){Q=R.getAttributeNode(P).value}}return typeof Q==="string"}function g(P){k(P,"click",function(){y=F(P,"data-jslghtbx-group")||false;e=P;s(P,false,false,false)},false)}function C(P){if(P.stopPropagation){P.stopPropagation()}else{P.returnValue=false}}function n(R){var P=[];for(var Q=0;Q=a.length?0:Q+=1},K.opt.loadingAnimation)}};J=setTimeout(P,500)}function i(){if(M){return}o(K.box,"jslghtbx-loading");if(!L&&typeof K.opt.loadingAnimation!=="string"&&K.opt.loadingAnimation){clearInterval(E);for(var P=0;P1){H();G()}p.img.onerror=function(){if(K.opt.onloaderror){K.opt.onloaderror(S)}};p.img.onload=function(){p.originalWidth=this.naturalWidth||this.width;p.originalHeight=this.naturalHeight||this.height;if(M||L){var W=new Image();W.setAttribute("src",U);p.originalWidth=W.width;p.originalHeight=W.height}var X=setInterval(function(){if(D(K.box,"jslghtbx-active")){v(K.wrapper,"jslghtbx-wrapper-active");if(typeof K.opt.animation==="number"){v(p.img,"jslghtbx-animate-transition")}if(P){P()}if(K.opt.animation){o(K.wrapper,"jslghtbx-animate")}i();clearTimeout(J);if(K.opt.preload){l()}if(K.opt.nextOnClick){v(p.img,"jslghtbx-next-on-click");k(p.img,"click",function(Y){C(Y);K.next()},false)}if(K.opt.onload){K.opt.onload(S)}clearInterval(X);K.resize()}},10)};p.img.setAttribute("src",U);B()}K.load=function(R){if(navigator.appVersion.indexOf("MSIE 8")>0){M=true}if(navigator.appVersion.indexOf("MSIE 9")>0){L=true}q(R);var P=document.getElementsByTagName("img");for(var Q=0;QQ){A=Q*h;w=Q}else{A=P;w=P/h}A=Math.floor(A*K.opt.maxImgSize);w=Math.floor(w*K.opt.maxImgSize);if(K.opt.dimensions&&w>p.originalHeight||K.opt.dimensions&&A>p.originalWidth){w=p.originalHeight;A=p.originalWidth}p.img.setAttribute("width",A);p.img.setAttribute("height",w);p.img.setAttribute("style","margin-top:"+((z()-w)/2)+"px");setTimeout(G,200);if(K.opt.onresize){K.opt.onresize()}};K.next=function(){if(!y){return}var P=r(e,y)+1;if(j[P]){e=j[P]}else{if(K.opt.carousel){e=j[0]}else{return}}if(typeof K.opt.animation==="number"){o(p.img,"jslghtbx-animating-next");setTimeout(function(){var Q=function(){setTimeout(function(){v(p.img,"jslghtbx-animating-next")},K.opt.animation/2)};s(e,false,Q,"next")},K.opt.animation/2)}else{s(e,false,false,"next")}};K.prev=function(){if(!y){return}var P=r(e,y)-1;if(j[P]){e=j[P]}else{if(K.opt.carousel){e=j[j.length-1]}else{return}}if(typeof K.opt.animation==="number"){o(p.img,"jslghtbx-animating-prev");setTimeout(function(){var Q=function(){setTimeout(function(){v(p.img,"jslghtbx-animating-next")},K.opt.animation/2)};s(e,false,Q,"prev")},K.opt.animation/2)}else{s(e,false,false,"prev")}};K.close=function(){y=false;e=false;p={};j=[];d=false;o(K.box,"jslghtbx-active");o(K.wrapper,"jslghtbx-wrapper-active");o(x,"jslghtbx-active");o(m,"jslghtbx-active");K.box.setAttribute("style","padding-top: 0px");i();if(M){K.box.setAttribute("style","display: none")}if(!K.opt||!O(K.opt.hideOverflow)||K.opt.hideOverflow){t.setAttribute("style","overflow: auto")}if(K.opt.onclose){K.opt.onclose()}}};