var lightgallery=function(){function N(){if(l.showOverlay){var a=O();s(o,{width:a[0],height:a[1]});o.style.display!=w&&(s(o,{display:w}),x(o,{opacity:l.overlayOpacity},300))}}function W(){x(o,{opacity:0},300,function(){o.style.display=y;C=0})}function G(a,d){var b,c,i,m;i=2*l.minPadding;var e=t.width,f=t.height,g=O(),h=g[2],g=g[3];b=h-i;var k=g-i-u;if(0==a||d&&!a)if(e>b||f>k){i=b;var o=b*f/e;o>k&&(o=k,i=k*e/f);i=j.width=i;m=(j.height=o)+u}else i=j.width=e,m=(j.height=f)+u;else if(1==a)i=j.width=e, m=(j.height=f)+u;else if(1>a||1b||m>k+u)c=n.fitScreen,fsClass="LG_fitScreen";else if(j.width!=e||j.height!=f)c=n.fullSize,fsClass="LG_zoomNormal";v.$disabled=!1;j.getAttribute("width")==e?b?(v.id=fsClass,v.setAttribute("title",c)):(v.id="LG_zoom_disabled",v.$disabled=!0):(v.id="LG_zoomNormal",v.setAttribute("title",n.fullSize));i=Math.max(i,P);c=X();var p=(g>m?(g-m)/2:l.minPadding)+c[1],h=(h>i?(h-i)/2:l.minPadding)+c[0];c=i/3;e=m-u-10; animCallback=function(){N();Y()};s(D,{width:c,height:e});s(E,{width:c,height:e});l.animate&&!q?l.resizeSync?x(r,{width:i,left:h,height:m,top:p},l.duration,animCallback):x(r,{width:i,left:h},l.duration/2,function(){x(r,{height:m,top:p},l.duration/2,animCallback)}):(s(r,{top:p,left:h,width:i,height:m}),animCallback())}function Y(){innerCont.style.display=w;s(j,{opacity:0});x(j,{opacity:1},l.fadeImage?400:0,function(){H=0})}function Z(){l.enableZoom||(Q=R="");var a=g(k,{id:"LG_container"},F,g(k,{id:"LG_innerCont"}, g(k,{id:"LG_panel"},Q,R,v,I,g(k,{id:"LG_closeBtn",title:n.close}),g(k,{style:"clear:both"})),j,J,E,D)),d=function(a){a.cancelBubble=!0;a.stopPropagation&&a.stopPropagation();var c=a.target||a.srcElement;if("click"==a.type)a={LG_closeBtn:e.close,LG_zoomNormal:e.zoomNormal,LG_fitScreen:e.zoomNormal,LG_zoomIn:e.zoomIn,LG_zoomOut:e.zoomOut,LG_nextLink:e.next,LG_prevLink:e.prev},c.id in a&&a[c.id].call(e);else if("LG_nextLink"==c.id||"LG_prevLink"==c.id)x(c,{opacity:"mouseout"==a.type?0:1})};A(a,"click", d);A(a,"mouseover",d);A(a,"mouseout",d);return a}function $(a){if(C){var a=a||f.event,a=a.keyCode?a.keyCode:a.which?a.which:a.charCode,d={110:e.next,98:e.prev,102:e.zoomNormal,43:e.zoomIn,45:e.zoomOut,27:e.close};d[a]&&d[a]()}}function S(a,d){for(var b in d)a[b]=d[b]}function s(a,d){for(var b in d)setElemStyle(a,b,d[b])}function O(){var a,d,b,c;d=h.documentElement;c=h.body;b="CSS1Compat"===document.compatMode?d:c;f.innerHeight&&f.scrollMaxY?(a=c.scrollWidth,d=f.innerHeight+f.scrollMaxY):c.scrollHeight> c.offsetHeight?(a=c.scrollWidth,d=c.scrollHeight):d&&d.scrollHeight>d.offsetHeight?(a=d.scrollWidth,d=d.scrollHeight):(a=c.offsetWidth,d=c.offsetHeight);c=b.clientHeight;b=b.clientWidth;return[aa||a>p[z].length-1||l.animate&&H)){e.open();var d=p[z],b=D.style,c=E.style;innerCont.style.display=y;F.style.display=w;H=1;t.src=d[a].href;J.innerHTML=d[a].title;I.innerHTML=n.image+" "+(a+1)+" "+n.of+ " "+d.length;q=a;qj?1:(e-h)/b;for(f in d)setElemStyle(a,f,(g[f]+(d[f]-g[f])*(-Math.cos(pos*Math.PI)/2+0.5)).toFixed(3));e>j&&(k=!1,c&&c())}};for(f in d)"opacity"==f&&U?(o=e.filter.match(/opacity\=(\d+)/))&& (n=parseFloat(o[1])/100):n=parseFloat(e[f]),g[f]=n;V(p)};return e}();