// photoswipe - http://www.photoswipe.com/ // copyright (c) 2012 by code computerlove (http://www.codecomputerlove.com) // licensed under the mit license // version: 3.0.5 (function(e){if(!function.prototype.bind)function.prototype.bind=function(d){var a=[].slice,b=a.call(arguments,1),c=this,g=function(){},f=function(){return c.apply(this instanceof g?this:d||{},b.concat(a.call(arguments)))};g.prototype=c.prototype;f.prototype=new g;return f};if(typeof e.code==="undefined")e.code={};e.code.util={registernamespace:function(){var d=arguments,a=null,b,c,g,f,i;b=0;for(f=d.length;bd.dom.windowheight()}};d.browser._detect()})(window,window.code.util); (function(e,d,a){a.extend(a,{events:{add:function(a,c,g){d(a).bind(c,g)},remove:function(a,c,g){d(a).unbind(c,g)},fire:function(a,c){var g,f=array.prototype.slice.call(arguments).splice(2);g=typeof c==="string"?{type:c}:c;d(a).trigger(d.event(g.type,g),f)},getmouseposition:function(a){return{x:a.pagex,y:a.pagey}},gettouchevent:function(a){return a.originalevent},getwheeldelta:function(b){var c=0;a.isnothing(b.wheeldelta)?a.isnothing(b.detail)||(c=-b.detail/3):c=b.wheeldelta/120;return c},domready:function(a){d(document).ready(a)}}})})(window, window.jquery,window.code.util); (function(e,d,a){a.extend(a,{dom:{setdata:function(b,c,g){if(a.islikearray(b)){var f,d;f=0;for(d=b.length;f");a.attr(c);a.append(g);return a[0]},appendchild:function(a,c){d(c).append(a)},insertbefore:function(a,c){d(a).insertbefore(c)},appendtext:function(a,c){d(c).text(a)},appendtobody:function(a){d("body").append(a)},removechild:function(a){d(a).empty().remove()},removechildren:function(a){d(a).empty()}, hasattribute:function(b,c){return!a.isnothing(d(b).attr(c))},getattribute:function(b,c,g){b=d(b).attr(c);a.isnothing(b)&&!a.isnothing(g)&&(b=g);return b},setattribute:function(b,c,g){if(a.islikearray(b)){var f,d;f=0;for(d=b.length;f=1&&d.dom.setstyle(a,"opacity",0);d.browser.iscsstransformsupported?this._applytransition(a,"opacity",f,b,c,g):d.isnothing(e.jquery)||e.jquery(a).fadeto(b,f,c)},fadeto:function(a,b,c,g,f){this.fadein(a, c,g,f,b)},fadeout:function(a,b,c,g){if(b<=0&&(d.dom.setstyle(a,"opacity",0),!d.isnothing(c))){c(a);return}d.browser.iscsstransformsupported?this._applytransition(a,"opacity",0,b,c,g):e.jquery(a).fadeto(b,0,c)},slideby:function(a,b,c,g,f,i){var j={},b=d.coalesce(b,0),c=d.coalesce(c,0),i=d.coalesce(i,"ease-out");j[this._transitionprefix+"property"]="all";j[this._transitionprefix+"delay"]="0";g===0?(j[this._transitionprefix+"duration"]="",j[this._transitionprefix+"timingfunction"]=""):(j[this._transitionprefix+ "duration"]=g+"ms",j[this._transitionprefix+"timingfunction"]=d.coalesce(i,"ease-out"),d.events.add(a,this._transitionendlabel,this._gettransitionendhandler()));j[this._transformlabel]=d.browser.is3dsupported?"translate3d("+b+"px, "+c+"px, 0px)":"translate("+b+"px, "+c+"px)";if(!d.isnothing(f))a.cclallcallback=f;d.dom.setstyle(a,j);g===0&&e.settimeout(function(){this._leavetransforms(a)}.bind(this),this._applytransitiondelay)},resettranslate:function(a){var b={};b[this._transformlabel]=b[this._transformlabel]= d.browser.is3dsupported?"translate3d(0px, 0px, 0px)":"translate(0px, 0px)";d.dom.setstyle(a,b)},_applytransition:function(a,b,c,g,f,i){var j={},i=d.coalesce(i,"ease-in");j[this._transitionprefix+"property"]=b;j[this._transitionprefix+"duration"]=g+"ms";j[this._transitionprefix+"timingfunction"]=i;j[this._transitionprefix+"delay"]="0";d.events.add(a,this._transitionendlabel,this._gettransitionendhandler());d.dom.setstyle(a,j);d.isnothing(f)||(a["ccl"+b+"callback"]=f);e.settimeout(function(){d.dom.setstyle(a, b,c)},this._applytransitiondelay)},_ontransitionend:function(a){d.events.remove(a.currenttarget,this._transitionendlabel,this._gettransitionendhandler());this._leavetransforms(a.currenttarget)},_leavetransforms:function(a){var b=a.style[this._transitionprefix+"property"],c=b!==""?"ccl"+b+"callback":"cclallcallback",g,b=d.coalesce(a.style.webkittransform,a.style.moztransform,a.style.transform),f,i=e.parseint(d.dom.getstyle(a,"left"),0),j=e.parseint(d.dom.getstyle(a,"top"),0),h,l,k={};b!==""&&(b=d.browser.is3dsupported? b.match(/translate3d\((.*?)\)/):b.match(/translate\((.*?)\)/),d.isnothing(b)||(f=b[1].split(", "),h=e.parseint(f[0],0),l=e.parseint(f[1],0)));k[this._transitionprefix+"property"]="";k[this._transitionprefix+"duration"]="";k[this._transitionprefix+"timingfunction"]="";k[this._transitionprefix+"delay"]="";d.dom.setstyle(a,k);e.settimeout(function(){if(!d.isnothing(f))k={},k[this._transformlabel]="",k.left=i+h+"px",k.top=j+l+"px",d.dom.setstyle(a,k);d.isnothing(a[c])||(g=a[c],delete a[c],g(a))}.bind(this), this._applytransitiondelay)}}})})(window,window.code.util); (function(e,d,a){a.registernamespace("code.util.touchelement");a.touchelement.eventtypes={ontouch:"codeutiltouchelementontouch"};a.touchelement.actiontypes={touchstart:"touchstart",touchmove:"touchmove",touchend:"touchend",touchmoveend:"touchmoveend",tap:"tap",doubletap:"doubletap",swipeleft:"swipeleft",swiperight:"swiperight",swipeup:"swipeup",swipedown:"swipedown",gesturestart:"gesturestart",gesturechange:"gesturechange",gestureend:"gestureend"}})(window,window.klass,window.code.util); (function(e,d,a){a.registernamespace("code.util.touchelement");a.touchelement.touchelementclass=d({el:null,capturesettings:null,touchstartpoint:null,touchendpoint:null,touchstarttime:null,doubletaptimeout:null,touchstarthandler:null,touchmovehandler:null,touchendhandler:null,mousedownhandler:null,mousemovehandler:null,mouseuphandler:null,mouseouthandler:null,gesturestarthandler:null,gesturechangehandler:null,gestureendhandler:null,swipethreshold:null,swipetimethreshold:null,doubletapspeed:null,dispose:function(){var b; this.removeeventhandlers();for(b in this)a.objecthasproperty(this,b)&&(this[b]=null)},initialize:function(b,c){this.el=b;this.capturesettings={swipe:!1,move:!1,gesture:!1,doubletap:!1,preventdefaulttouchevents:!0};a.extend(this.capturesettings,c);this.swipethreshold=50;this.doubletapspeed=this.swipetimethreshold=250;this.touchstartpoint={x:0,y:0};this.touchendpoint={x:0,y:0}},addeventhandlers:function(){if(a.isnothing(this.touchstarthandler))this.touchstarthandler=this.ontouchstart.bind(this),this.touchmovehandler= this.ontouchmove.bind(this),this.touchendhandler=this.ontouchend.bind(this),this.mousedownhandler=this.onmousedown.bind(this),this.mousemovehandler=this.onmousemove.bind(this),this.mouseuphandler=this.onmouseup.bind(this),this.mouseouthandler=this.onmouseout.bind(this),this.gesturestarthandler=this.ongesturestart.bind(this),this.gesturechangehandler=this.ongesturechange.bind(this),this.gestureendhandler=this.ongestureend.bind(this);a.events.add(this.el,"touchstart",this.touchstarthandler);this.capturesettings.move&& a.events.add(this.el,"touchmove",this.touchmovehandler);a.events.add(this.el,"touchend",this.touchendhandler);a.events.add(this.el,"mousedown",this.mousedownhandler);a.browser.isgesturesupported&&this.capturesettings.gesture&&(a.events.add(this.el,"gesturestart",this.gesturestarthandler),a.events.add(this.el,"gesturechange",this.gesturechangehandler),a.events.add(this.el,"gestureend",this.gestureendhandler))},removeeventhandlers:function(){a.events.remove(this.el,"touchstart",this.touchstarthandler); this.capturesettings.move&&a.events.remove(this.el,"touchmove",this.touchmovehandler);a.events.remove(this.el,"touchend",this.touchendhandler);a.events.remove(this.el,"mousedown",this.mousedownhandler);a.browser.isgesturesupported&&this.capturesettings.gesture&&(a.events.remove(this.el,"gesturestart",this.gesturestarthandler),a.events.remove(this.el,"gesturechange",this.gesturechangehandler),a.events.remove(this.el,"gestureend",this.gestureendhandler))},gettouchpoint:function(a){return{x:a[0].pagex, y:a[0].pagey}},firetouchevent:function(b){var c=0,g=0,f=0,d,c=this.touchendpoint.x-this.touchstartpoint.x,g=this.touchendpoint.y-this.touchstartpoint.y,f=math.sqrt(c*c+g*g);if(this.capturesettings.swipe&&(d=new date,d-=this.touchstarttime,d<=this.swipetimethreshold)){if(e.math.abs(c)>=this.swipethreshold){a.events.fire(this,{type:a.touchelement.eventtypes.ontouch,target:this,point:this.touchendpoint,action:c<0?a.touchelement.actiontypes.swipeleft:a.touchelement.actiontypes.swiperight,targetel:b.target, currenttargetel:b.currenttarget});return}if(e.math.abs(g)>=this.swipethreshold){a.events.fire(this,{type:a.touchelement.eventtypes.ontouch,target:this,point:this.touchendpoint,action:g<0?a.touchelement.actiontypes.swipeup:a.touchelement.actiontypes.swipedown,targetel:b.target,currenttargetel:b.currenttarget});return}}f>1?a.events.fire(this,{type:a.touchelement.eventtypes.ontouch,target:this,action:a.touchelement.actiontypes.touchmoveend,point:this.touchendpoint,targetel:b.target,currenttargetel:b.currenttarget}): this.capturesettings.doubletap?a.isnothing(this.doubletaptimeout)?this.doubletaptimeout=e.settimeout(function(){this.doubletaptimeout=null;a.events.fire(this,{type:a.touchelement.eventtypes.ontouch,target:this,point:this.touchendpoint,action:a.touchelement.actiontypes.tap,targetel:b.target,currenttargetel:b.currenttarget})}.bind(this),this.doubletapspeed):(e.cleartimeout(this.doubletaptimeout),this.doubletaptimeout=null,a.events.fire(this,{type:a.touchelement.eventtypes.ontouch,target:this,point:this.touchendpoint, action:a.touchelement.actiontypes.doubletap,targetel:b.target,currenttargetel:b.currenttarget})):a.events.fire(this,{type:a.touchelement.eventtypes.ontouch,target:this,point:this.touchendpoint,action:a.touchelement.actiontypes.tap,targetel:b.target,currenttargetel:b.currenttarget})},ontouchstart:function(b){this.capturesettings.preventdefaulttouchevents&&b.preventdefault();a.events.remove(this.el,"mousedown",this.mousedownhandler);var c=a.events.gettouchevent(b).touches;c.length>1&&this.capturesettings.gesture? this.isgesture=!0:(this.touchstarttime=new date,this.isgesture=!1,this.touchstartpoint=this.gettouchpoint(c),a.events.fire(this,{type:a.touchelement.eventtypes.ontouch,target:this,action:a.touchelement.actiontypes.touchstart,point:this.touchstartpoint,targetel:b.target,currenttargetel:b.currenttarget}))},ontouchmove:function(b){this.capturesettings.preventdefaulttouchevents&&b.preventdefault();if(!this.isgesture||!this.capturesettings.gesture){var c=a.events.gettouchevent(b).touches;a.events.fire(this, {type:a.touchelement.eventtypes.ontouch,target:this,action:a.touchelement.actiontypes.touchmove,point:this.gettouchpoint(c),targetel:b.target,currenttargetel:b.currenttarget})}},ontouchend:function(b){if(!this.isgesture||!this.capturesettings.gesture){this.capturesettings.preventdefaulttouchevents&&b.preventdefault();var c=a.events.gettouchevent(b);this.touchendpoint=this.gettouchpoint(!a.isnothing(c.changedtouches)?c.changedtouches:c.touches);a.events.fire(this,{type:a.touchelement.eventtypes.ontouch, target:this,action:a.touchelement.actiontypes.touchend,point:this.touchendpoint,targetel:b.target,currenttargetel:b.currenttarget});this.firetouchevent(b)}},onmousedown:function(b){b.preventdefault();a.events.remove(this.el,"touchstart",this.mousedownhandler);a.events.remove(this.el,"touchmove",this.touchmovehandler);a.events.remove(this.el,"touchend",this.touchendhandler);this.capturesettings.move&&a.events.add(this.el,"mousemove",this.mousemovehandler);a.events.add(this.el,"mouseup",this.mouseuphandler); a.events.add(this.el,"mouseout",this.mouseouthandler);this.touchstarttime=new date;this.isgesture=!1;this.touchstartpoint=a.events.getmouseposition(b);a.events.fire(this,{type:a.touchelement.eventtypes.ontouch,target:this,action:a.touchelement.actiontypes.touchstart,point:this.touchstartpoint,targetel:b.target,currenttargetel:b.currenttarget})},onmousemove:function(b){b.preventdefault();a.events.fire(this,{type:a.touchelement.eventtypes.ontouch,target:this,action:a.touchelement.actiontypes.touchmove, point:a.events.getmouseposition(b),targetel:b.target,currenttargetel:b.currenttarget})},onmouseup:function(b){b.preventdefault();this.capturesettings.move&&a.events.remove(this.el,"mousemove",this.mousemovehandler);a.events.remove(this.el,"mouseup",this.mouseuphandler);a.events.remove(this.el,"mouseout",this.mouseouthandler);this.touchendpoint=a.events.getmouseposition(b);a.events.fire(this,{type:a.touchelement.eventtypes.ontouch,target:this,action:a.touchelement.actiontypes.touchend,point:this.touchendpoint, targetel:b.target,currenttargetel:b.currenttarget});this.firetouchevent(b)},onmouseout:function(b){var c=b.relatedtarget;if(!(this.el===c||a.dom.ischildof(c,this.el)))b.preventdefault(),this.capturesettings.move&&a.events.remove(this.el,"mousemove",this.mousemovehandler),a.events.remove(this.el,"mouseup",this.mouseuphandler),a.events.remove(this.el,"mouseout",this.mouseouthandler),this.touchendpoint=a.events.getmouseposition(b),a.events.fire(this,{type:a.touchelement.eventtypes.ontouch,target:this, action:a.touchelement.actiontypes.touchend,point:this.touchendpoint,targetel:b.target,currenttargetel:b.currenttarget}),this.firetouchevent(b)},ongesturestart:function(b){b.preventdefault();var c=a.events.gettouchevent(b);a.events.fire(this,{type:a.touchelement.eventtypes.ontouch,target:this,action:a.touchelement.actiontypes.gesturestart,scale:c.scale,rotation:c.rotation,targetel:b.target,currenttargetel:b.currenttarget})},ongesturechange:function(b){b.preventdefault();var c=a.events.gettouchevent(b); a.events.fire(this,{type:a.touchelement.eventtypes.ontouch,target:this,action:a.touchelement.actiontypes.gesturechange,scale:c.scale,rotation:c.rotation,targetel:b.target,currenttargetel:b.currenttarget})},ongestureend:function(b){b.preventdefault();var c=a.events.gettouchevent(b);a.events.fire(this,{type:a.touchelement.eventtypes.ontouch,target:this,action:a.touchelement.actiontypes.gestureend,scale:c.scale,rotation:c.rotation,targetel:b.target,currenttargetel:b.currenttarget})}})})(window,window.klass, window.code.util);(function(e,d,a){a.registernamespace("code.photoswipe.image");e.code.photoswipe.image.eventtypes={onload:"onload",onerror:"onerror"}})(window,window.klass,window.code.util); (function(e,d,a){a.registernamespace("code.photoswipe.image");var b=e.code.photoswipe;b.image.imageclass=d({refobj:null,imageel:null,src:null,caption:null,metadata:null,imageloadhandler:null,imageerrorhandler:null,dispose:function(){var c;this.shrinkimage();for(c in this)a.objecthasproperty(this,c)&&(this[c]=null)},initialize:function(a,b,f,d){this.refobj=a;this.src=this.originalsrc=b;this.caption=f;this.metadata=d;this.imageel=new e.image;this.imageloadhandler=this.onimageload.bind(this);this.imageerrorhandler= this.onimageerror.bind(this)},load:function(){this.imageel.originalsrc=a.coalesce(this.imageel.originalsrc,"");this.imageel.originalsrc===this.src?this.imageel.iserror?a.events.fire(this,{type:b.image.eventtypes.onerror,target:this}):a.events.fire(this,{type:b.image.eventtypes.onload,target:this}):(this.imageel.iserror=!1,this.imageel.isloading=!0,this.imageel.naturalwidth=null,this.imageel.naturalheight=null,this.imageel.islandscape=!1,this.imageel.onload=this.imageloadhandler,this.imageel.onerror= this.imageerrorhandler,this.imageel.onabort=this.imageerrorhandler,this.imageel.originalsrc=this.src,this.imageel.src=this.src)},shrinkimage:function(){if(!a.isnothing(this.imageel)&&this.imageel.src.indexof(this.src)>-1)this.imageel.src="data:image/gif;base64,r0lgodlhaqabaad/acwaaaaaaqabaaacads=",a.isnothing(this.imageel.parentnode)||a.dom.removechild(this.imageel,this.imageel.parentnode)},onimageload:function(){this.imageel.onload=null;this.imageel.naturalwidth=a.coalesce(this.imageel.naturalwidth, this.imageel.width);this.imageel.naturalheight=a.coalesce(this.imageel.naturalheight,this.imageel.height);this.imageel.islandscape=this.imageel.naturalwidth>this.imageel.naturalheight;this.imageel.isloading=!1;a.events.fire(this,{type:b.image.eventtypes.onload,target:this})},onimageerror:function(){this.imageel.onload=null;this.imageel.onerror=null;this.imageel.onabort=null;this.imageel.isloading=!1;this.imageel.iserror=!0;a.events.fire(this,{type:b.image.eventtypes.onerror,target:this})}})})(window, window.klass,window.code.util); (function(e,d,a){a.registernamespace("code.photoswipe.cache");e=e.code.photoswipe;e.cache.mode={normal:"normal",aggressive:"aggressive"};e.cache.functions={getimagesource:function(a){return a.href},getimagecaption:function(b){if(b.nodename==="img")return a.dom.getattribute(b,"alt");var c,g,f;c=0;for(g=b.childnodes.length;cb&& (b=a.dom.windowheight())}else c=a.dom.width(this.settings.target),b=a.dom.height(this.settings.target),f="0px";a.dom.setstyle(this.el,{width:c,height:b,top:f})},fadein:function(c,b){this.resetposition();a.dom.setstyle(this.el,"opacity",0);a.dom.show(this.el);a.animation.fadein(this.el,c,b)}})})(window,window.klass,window.code.util); (function(e,d,a){a.registernamespace("code.photoswipe.carousel");e=e.code.photoswipe;e.carousel.eventtypes={onslidebyend:"photoswipecarouselonslidebyend",onslideshowstart:"photoswipecarouselonslideshowstart",onslideshowstop:"photoswipecarouselonslideshowstop"};e.carousel.cssclasses={carousel:"ps-carousel",content:"ps-carousel-content",item:"ps-carousel-item",itemloading:"ps-carousel-item-loading",itemerror:"ps-carousel-item-error"};e.carousel.slidebyaction={previous:"previous",current:"current",next:"next"}})(window, window.klass,window.code.util); (function(e,d,a){a.registernamespace("code.photoswipe.carousel");var b=e.code.photoswipe;b.carousel.carouselclass=d({el:null,contentel:null,settings:null,cache:null,slidebyendhandler:null,currentcacheindex:null,issliding:null,isslideshowactive:null,lastslidebyaction:null,touchstartpoint:null,touchstartposition:null,imageloadhandler:null,imageerrorhandler:null,slideshowtimeout:null,dispose:function(){var c,g,f;g=0;for(f=this.cache.images.length;g0&&a.dom.setstyle(j,{marginright:this.settings.margin+"px"}),a.dom.appendchild(j,this.contentel);this.settings.target===e?a.dom.appendtobody(this.el):a.dom.appendchild(this.el,this.settings.target)}, resetposition:function(){var c,g,f,d,j,h;this.settings.target===e?(c=a.dom.windowwidth(),g=a.dom.windowheight(),f=a.dom.windowscrolltop()+"px"):(c=a.dom.width(this.settings.target),g=a.dom.height(this.settings.target),f="0px");d=this.settings.margin>0?c+this.settings.margin:c;j=a.dom.find("."+b.carousel.cssclasses.item,this.contentel);d*=j.length;a.dom.setstyle(this.el,{top:f,width:c,height:g});a.dom.setstyle(this.contentel,{width:d,height:g});f=0;for(d=j.length;fe&&(b=e/f,f=math.round(f*b),d=math.round(d*b)),d>h&&(b=h/d,d=math.round(d*b),f=math.round(f*b))):(b=c.islandscape?e/c.naturalwidth:h/c.naturalheight,f=math.round(c.naturalwidth* b),d=math.round(c.naturalheight*b),this.settings.imagescalemethod==="zoom"?(b=1,de?b=e/f:d>h&&(b=h/d),b!==1&&(f=math.round(f*b),d=math.round(d*b))));a.dom.setstyle(c,{position:"absolute",width:f,height:d,top:math.round((h-d)/2)+"px",left:math.round((e-f)/2)+"px",display:"block"})}},setcontentleftposition:function(){var c,b,d;c=this.settings.target===e?a.dom.windowwidth():a.dom.width(this.settings.target); b=this.getitemels();d=0;this.settings.loop?d=(c+this.settings.margin)*-1:this.currentcacheindex===this.cache.images.length-1?d=(b.length-1)*(c+this.settings.margin)*-1:this.currentcacheindex>0&&(d=(c+this.settings.margin)*-1);a.dom.setstyle(this.contentel,{left:d+"px"})},show:function(c){this.currentcacheindex=c;this.resetposition();this.setimages(!1);a.dom.show(this.el);a.animation.resettranslate(this.contentel);var c=this.getitemels(),d,f;d=0;for(f=c.length;dthis.cache.images.length-1&&(b=0),e<0&&(e=this.cache.images.length-1),b=this.cache.getimages([e,this.currentcacheindex,b]),a||this.addcacheimagetoitemel(b[1],d[1]),this.addcacheimagetoitemel(b[2],d[2]),this.addcacheimagetoitemel(b[0], d[0])):d.length===1?a||(b=this.cache.getimages([this.currentcacheindex]),this.addcacheimagetoitemel(b[0],d[0])):d.length===2?this.currentcacheindex===0?(b=this.cache.getimages([this.currentcacheindex,this.currentcacheindex+1]),a||this.addcacheimagetoitemel(b[0],d[0]),this.addcacheimagetoitemel(b[1],d[1])):(b=this.cache.getimages([this.currentcacheindex-1,this.currentcacheindex]),a||this.addcacheimagetoitemel(b[1],d[1]),this.addcacheimagetoitemel(b[0],d[0])):this.currentcacheindex===0?(b=this.cache.getimages([this.currentcacheindex, this.currentcacheindex+1,this.currentcacheindex+2]),a||this.addcacheimagetoitemel(b[0],d[0]),this.addcacheimagetoitemel(b[1],d[1]),this.addcacheimagetoitemel(b[2],d[2])):(this.currentcacheindex===this.cache.images.length-1?(b=this.cache.getimages([this.currentcacheindex-2,this.currentcacheindex-1,this.currentcacheindex]),a||this.addcacheimagetoitemel(b[2],d[2]),this.addcacheimagetoitemel(b[1],d[1])):(b=this.cache.getimages([this.currentcacheindex-1,this.currentcacheindex,this.currentcacheindex+1]), a||this.addcacheimagetoitemel(b[1],d[1]),this.addcacheimagetoitemel(b[2],d[2])),this.addcacheimagetoitemel(b[0],d[0]))},addcacheimagetoitemel:function(c,d){a.dom.removeclass(d,b.carousel.cssclasses.itemerror);a.dom.addclass(d,b.carousel.cssclasses.itemloading);a.dom.removechildren(d);a.dom.setstyle(c.imageel,{display:"none"});a.dom.appendchild(c.imageel,d);a.animation.resettranslate(c.imageel);a.events.add(c,b.image.eventtypes.onload,this.imageloadhandler);a.events.add(c,b.image.eventtypes.onerror, this.imageerrorhandler);c.load()},slidecarousel:function(c,d,f){if(!this.issliding){var i,j;i=this.settings.target===e?a.dom.windowwidth()+this.settings.margin:a.dom.width(this.settings.target)+this.settings.margin;f=a.coalesce(f,this.settings.slidespeed);if(!(e.math.abs(j)<1)){switch(d){case a.touchelement.actiontypes.swipeleft:c=i*-1;break;case a.touchelement.actiontypes.swiperight:c=i;break;default:j=c.x-this.touchstartpoint.x,c=e.math.abs(j)>i/2?j>0?i:i*-1:0}this.lastslidebyaction=c<0?b.carousel.slidebyaction.next: c>0?b.carousel.slidebyaction.previous:b.carousel.slidebyaction.current;if(!this.settings.loop&&(this.lastslidebyaction===b.carousel.slidebyaction.previous&&this.currentcacheindex===0||this.lastslidebyaction===b.carousel.slidebyaction.next&&this.currentcacheindex===this.cache.images.length-1))c=0,this.lastslidebyaction=b.carousel.slidebyaction.current;this.issliding=!0;this.doslidecarousel(c,f)}}},movecarousel:function(a){this.issliding||this.settings.enabledrag&&this.domovecarousel(a.x-this.touchstartpoint.x)}, getitemels:function(){return a.dom.find("."+b.carousel.cssclasses.item,this.contentel)},previous:function(){this.stopslideshow();this.slidecarousel({x:0,y:0},a.touchelement.actiontypes.swiperight,this.settings.nextpreviousslidespeed)},next:function(){this.stopslideshow();this.slidecarousel({x:0,y:0},a.touchelement.actiontypes.swipeleft,this.settings.nextpreviousslidespeed)},slideshownext:function(){this.slidecarousel({x:0,y:0},a.touchelement.actiontypes.swipeleft)},startslideshow:function(){this.stopslideshow(); this.isslideshowactive=!0;this.slideshowtimeout=e.settimeout(this.slideshownext.bind(this),this.settings.slideshowdelay);a.events.fire(this,{type:b.carousel.eventtypes.onslideshowstart,target:this})},stopslideshow:function(){if(!a.isnothing(this.slideshowtimeout))e.cleartimeout(this.slideshowtimeout),this.slideshowtimeout=null,this.isslideshowactive=!1,a.events.fire(this,{type:b.carousel.eventtypes.onslideshowstop,target:this})},onslidebyend:function(){if(!a.isnothing(this.issliding)){var c=this.getitemels(); this.issliding=!1;this.lastslidebyaction===b.carousel.slidebyaction.next?this.currentcacheindex+=1:this.lastslidebyaction===b.carousel.slidebyaction.previous&&(this.currentcacheindex-=1);if(this.settings.loop)if(this.lastslidebyaction===b.carousel.slidebyaction.next?a.dom.appendchild(c[0],this.contentel):this.lastslidebyaction===b.carousel.slidebyaction.previous&&a.dom.insertbefore(c[c.length-1],c[0],this.contentel),this.currentcacheindex<0)this.currentcacheindex=this.cache.images.length-1;else{if(this.currentcacheindex=== this.cache.images.length)this.currentcacheindex=0}else this.cache.images.length>3&&(this.currentcacheindex>1&&this.currentcacheindex
'}})(window,window.klass,window.code.util); (function(e,d,a){a.registernamespace("code.photoswipe.toolbar");var b=e.code.photoswipe;b.toolbar.toolbarclass=d({toolbarel:null,closeel:null,playel:null,previousel:null,nextel:null,captionel:null,captioncontentel:null,currentcaption:null,settings:null,cache:null,timeout:null,isvisible:null,fadeouthandler:null,touchstarthandler:null,touchmovehandler:null,clickhandler:null,dispose:function(){var b;this.cleartimeout();this.removeeventhandlers();a.animation.stop(this.toolbarel);a.animation.stop(this.captionel); a.dom.removechild(this.toolbarel,this.toolbarel.parentnode);a.dom.removechild(this.captionel,this.captionel.parentnode);for(b in this)a.objecthasproperty(this,b)&&(this[b]=null)},initialize:function(c,d){var f;this.settings=d;this.cache=c;this.isvisible=!1;this.fadeouthandler=this.onfadeout.bind(this);this.touchstarthandler=this.ontouchstart.bind(this);this.touchmovehandler=this.ontouchmove.bind(this);this.clickhandler=this.onclick.bind(this);f=b.toolbar.cssclasses.toolbar;this.settings.captionandtoolbarflipposition&& (f=f+" "+b.toolbar.cssclasses.toolbartop);this.toolbarel=a.dom.createelement("div",{"class":f},this.settings.gettoolbar());a.dom.setstyle(this.toolbarel,{left:0,position:"absolute",overflow:"hidden",zindex:this.settings.zindex});this.settings.target===e?a.dom.appendtobody(this.toolbarel):a.dom.appendchild(this.toolbarel,this.settings.target);a.dom.hide(this.toolbarel);this.closeel=a.dom.find("."+b.toolbar.cssclasses.close,this.toolbarel)[0];this.settings.preventhide&&!a.isnothing(this.closeel)&&a.dom.hide(this.closeel); this.playel=a.dom.find("."+b.toolbar.cssclasses.play,this.toolbarel)[0];this.settings.preventslideshow&&!a.isnothing(this.playel)&&a.dom.hide(this.playel);this.nextel=a.dom.find("."+b.toolbar.cssclasses.next,this.toolbarel)[0];this.previousel=a.dom.find("."+b.toolbar.cssclasses.previous,this.toolbarel)[0];f=b.toolbar.cssclasses.caption;this.settings.captionandtoolbarflipposition&&(f=f+" "+b.toolbar.cssclasses.captionbottom);this.captionel=a.dom.createelement("div",{"class":f},"");a.dom.setstyle(this.captionel, {left:0,position:"absolute",overflow:"hidden",zindex:this.settings.zindex});this.settings.target===e?a.dom.appendtobody(this.captionel):a.dom.appendchild(this.captionel,this.settings.target);a.dom.hide(this.captionel);this.captioncontentel=a.dom.createelement("div",{"class":b.toolbar.cssclasses.captioncontent},"");a.dom.appendchild(this.captioncontentel,this.captionel);this.addeventhandlers()},resetposition:function(){var b,d,f;this.settings.target===e?(this.settings.captionandtoolbarflipposition? (d=a.dom.windowscrolltop(),f=a.dom.windowscrolltop()+a.dom.windowheight()-a.dom.height(this.captionel)):(d=a.dom.windowscrolltop()+a.dom.windowheight()-a.dom.height(this.toolbarel),f=a.dom.windowscrolltop()),b=a.dom.windowwidth()):(this.settings.captionandtoolbarflipposition?(d="0",f=a.dom.height(this.settings.target)-a.dom.height(this.captionel)):(d=a.dom.height(this.settings.target)-a.dom.height(this.toolbarel),f=0),b=a.dom.width(this.settings.target));a.dom.setstyle(this.toolbarel,{top:d+"px", width:b});a.dom.setstyle(this.captionel,{top:f+"px",width:b})},togglevisibility:function(a){this.isvisible?this.fadeout():this.show(a)},show:function(c){a.animation.stop(this.toolbarel);a.animation.stop(this.captionel);this.resetposition();this.settoolbarstatus(c);a.events.fire(this,{type:b.toolbar.eventtypes.onbeforeshow,target:this});this.showtoolbar();this.setcaption(c);this.showcaption();this.isvisible=!0;this.settimeout();a.events.fire(this,{type:b.toolbar.eventtypes.onshow,target:this})},settimeout:function(){if(this.settings.captionandtoolbarautohidedelay> 0)this.cleartimeout(),this.timeout=e.settimeout(this.fadeout.bind(this),this.settings.captionandtoolbarautohidedelay)},cleartimeout:function(){if(!a.isnothing(this.timeout))e.cleartimeout(this.timeout),this.timeout=null},fadeout:function(){this.cleartimeout();a.events.fire(this,{type:b.toolbar.eventtypes.onbeforehide,target:this});a.animation.fadeout(this.toolbarel,this.settings.fadeoutspeed);a.animation.fadeout(this.captionel,this.settings.fadeoutspeed,this.fadeouthandler);this.isvisible=!1},addeventhandlers:function(){a.browser.istouchsupported&& (a.browser.blackberry||a.events.add(this.toolbarel,"touchstart",this.touchstarthandler),a.events.add(this.toolbarel,"touchmove",this.touchmovehandler),a.events.add(this.captionel,"touchmove",this.touchmovehandler));a.events.add(this.toolbarel,"click",this.clickhandler)},removeeventhandlers:function(){a.browser.istouchsupported&&(a.browser.blackberry||a.events.remove(this.toolbarel,"touchstart",this.touchstarthandler),a.events.remove(this.toolbarel,"touchmove",this.touchmovehandler),a.events.remove(this.captionel, "touchmove",this.touchmovehandler));a.events.remove(this.toolbarel,"click",this.clickhandler)},handletap:function(c){this.cleartimeout();var d;if(c.target===this.nextel||a.dom.ischildof(c.target,this.nextel))d=b.toolbar.toolbaraction.next;else if(c.target===this.previousel||a.dom.ischildof(c.target,this.previousel))d=b.toolbar.toolbaraction.previous;else if(c.target===this.closeel||a.dom.ischildof(c.target,this.closeel))d=b.toolbar.toolbaraction.close;else if(c.target===this.playel||a.dom.ischildof(c.target, this.playel))d=b.toolbar.toolbaraction.play;this.settimeout();if(a.isnothing(d))d=b.toolbar.toolbaraction.none;a.events.fire(this,{type:b.toolbar.eventtypes.ontap,target:this,action:d,taptarget:c.target})},setcaption:function(b){a.dom.removechildren(this.captioncontentel);this.currentcaption=a.coalesce(this.cache.images[b].caption,"\u00a0");if(a.isobject(this.currentcaption))a.dom.appendchild(this.currentcaption,this.captioncontentel);else{if(this.currentcaption==="")this.currentcaption="\u00a0"; a.dom.appendtext(this.currentcaption,this.captioncontentel)}this.currentcaption=this.currentcaption==="\u00a0"?"":this.currentcaption;this.resetposition()},showtoolbar:function(){a.dom.setstyle(this.toolbarel,{opacity:this.settings.captionandtoolbaropacity});a.dom.show(this.toolbarel)},showcaption:function(){(this.currentcaption===""||this.captioncontentel.childnodes.length<1)&&!this.settings.captionandtoolbarshowemptycaptions?a.dom.hide(this.captionel):(a.dom.setstyle(this.captionel,{opacity:this.settings.captionandtoolbaropacity}), a.dom.show(this.captionel))},settoolbarstatus:function(c){this.settings.loop||(a.dom.removeclass(this.previousel,b.toolbar.cssclasses.previousdisabled),a.dom.removeclass(this.nextel,b.toolbar.cssclasses.nextdisabled),c>0&&cthis.settings.maxuserzoom)a=this.settings.maxuserzoom;return a},setstartingscaleandrotation:function(a,b){this.transformsettings.startingscale=this.getscale(a);this.transformsettings.startingrotation=(this.transformsettings.startingrotation+b)%360},zoomrotate:function(a,b){this.transformsettings.scale=this.getscale(a);this.transformsettings.rotation=this.transformsettings.startingrotation+b;this.applytransform()},panstart:function(a){this.setstartingtranslatefromcurrenttransform();this.panstartingpoint= {x:a.x,y:a.y}},pan:function(a){var b=(a.y-this.panstartingpoint.y)/this.transformsettings.scale;this.transformsettings.translatex=this.transformsettings.startingtranslatex+(a.x-this.panstartingpoint.x)/this.transformsettings.scale;this.transformsettings.translatey=this.transformsettings.startingtranslatey+b;this.applytransform()},zoomandpantopoint:function(b,d){if(this.settings.target===e){this.panstart({x:a.dom.windowwidth()/2,y:a.dom.windowheight()/2});var f=(d.y-this.panstartingpoint.y)/this.transformsettings.scale; this.transformsettings.translatex=(this.transformsettings.startingtranslatex+(d.x-this.panstartingpoint.x)/this.transformsettings.scale)*-1;this.transformsettings.translatey=(this.transformsettings.startingtranslatey+f)*-1}this.setstartingscaleandrotation(b,0);this.transformsettings.scale=this.transformsettings.startingscale;this.transformsettings.rotation=0;this.applytransform()},applytransform:function(){var c=this.transformsettings.rotation%360,d=e.parseint(this.transformsettings.translatex,10), f=e.parseint(this.transformsettings.translatey,10),i="scale("+this.transformsettings.scale+") rotate("+c+"deg) translate("+d+"px, "+f+"px)";a.dom.setstyle(this.transformel,{webkittransform:i,moztransform:i,mstransform:i,transform:i});a.events.fire(this,{target:this,type:b.zoompanrotate.eventtypes.ontransform,scale:this.transformsettings.scale,rotation:this.transformsettings.rotation,rotationdegs:c,translatex:d,translatey:f})}})})(window,window.klass,window.code.util); (function(e,d){d.registernamespace("code.photoswipe");var a=e.code.photoswipe;a.cssclasses={buildingbody:"ps-building",activebody:"ps-active"};a.eventtypes={onbeforeshow:"photoswipeonbeforeshow",onshow:"photoswipeonshow",onbeforehide:"photoswipeonbeforehide",onhide:"photoswipeonhide",ondisplayimage:"photoswipeondisplayimage",onresetposition:"photoswipeonresetposition",onslideshowstart:"photoswipeonslideshowstart",onslideshowstop:"photoswipeonslideshowstop",ontouch:"photoswipeontouch",onbeforecaptionandtoolbarshow:"photoswipeonbeforecaptionandtoolbarshow", oncaptionandtoolbarshow:"photoswipeoncaptionandtoolbarshow",onbeforecaptionandtoolbarhide:"photoswipeonbeforecaptionandtoolbarhide",oncaptionandtoolbarhide:"photoswipeoncaptionandtoolbarhide",ontoolbartap:"photoswipeontoolbartap",onbeforezoompanrotateshow:"photoswipeonbeforezoompanrotateshow",onzoompanrotateshow:"photoswipeonzoompanrotateshow",onbeforezoompanrotatehide:"photoswipeonbeforezoompanrotatehide",onzoompanrotatehide:"photoswipeonzoompanrotatehide",onzoompanrotatetransform:"photoswipeonzoompanrotatetransform"}; a.instances=[];a.activeinstances=[];a.setactivateinstance=function(b){if(d.arrayindexof(b.settings.target,a.activeinstances,"target")>-1)throw"code.photoswipe.activateinstance: unable to active instance as another instance is already active for this target";a.activeinstances.push({target:b.settings.target,instance:b})};a.unsetactivateinstance=function(b){b=d.arrayindexof(b,a.activeinstances,"instance");a.activeinstances.splice(b,1)};a.attach=function(b,c,e){var f,i;f=a.createinstance(b,c,e);c=0;for(e= b.length;c=2.1)this.isbackeventsupported=!0;if(!this.isbackeventsupported)this.isbackeventsupported=a.objecthasproperty(e,"onhashchange");this.settings={fadeinspeed:250,fadeoutspeed:250,preventhide:!1,preventslideshow:!1,zindex:1e3,backbuttonhideenabled:!0,enablekeyboard:!0,enablemousewheel:!0, mousewheelspeed:350,autostartslideshow:!1,jquerymobile:!a.isnothing(e.jquery)&&!a.isnothing(e.jquery.mobile),jquerymobiledialoghash:"&ui-state=dialog",enableuiwebviewrepositiontimeout:!1,uiwebviewresetpositiondelay:500,target:e,preventdefaulttouchevents:!0,loop:!0,slidespeed:250,nextpreviousslidespeed:0,enabledrag:!0,swipethreshold:50,swipetimethreshold:250,slidetimingfunction:"ease-out",slideshowdelay:3e3,doubletapspeed:250,margin:20,imagescalemethod:"fit",captionandtoolbarhide:!1,captionandtoolbarflipposition:!1, captionandtoolbarautohidedelay:5e3,captionandtoolbaropacity:0.8,captionandtoolbarshowemptycaptions:!0,gettoolbar:h.toolbar.gettoolbar,allowuserzoom:!0,allowrotationonuserzoom:!1,maxuserzoom:5,minuserzoom:0.5,doubletapzoomlevel:2.5,getimagesource:h.cache.functions.getimagesource,getimagecaption:h.cache.functions.getimagecaption,getimagemetadata:h.cache.functions.getimagemetadata,cachemode:h.cache.mode.normal};a.extend(this.settings,d);this.settings.target!==e&&(d=a.dom.getstyle(this.settings.target, "position"),(d!=="relative"||d!=="absolute")&&a.dom.setstyle(this.settings.target,"position","relative"));if(this.settings.target!==e)this.isbackeventsupported=!1,this.settings.backbuttonhideenabled=!1;else if(this.settings.preventhide)this.settings.backbuttonhideenabled=!1;this.cache=new b.cacheclass(c,this.settings)},show:function(b){var c,d;this.backbuttonclicked=this._isresettingposition=!1;if(a.isnumber(b))this.currentindex=b;else{this.currentindex=-1;c=0;for(d=this.originalimages.length;cthis.originalimages.length-1)throw"code.photoswipe.photoswipeclass.show: starting index out of range";this.isalreadygettingpage=this.getwindowdimensions();h.setactivateinstance(this);this.windowdimensions=this.getwindowdimensions();this.settings.target===e?a.dom.addclass(e.document.body,h.cssclasses.buildingbody):a.dom.addclass(this.settings.target,h.cssclasses.buildingbody);this.createcomponents();a.events.fire(this,{type:h.eventtypes.onbeforeshow, target:this});this.documentoverlay.fadein(this.settings.fadeinspeed,this.ondocumentoverlayfadein.bind(this))},getwindowdimensions:function(){return{width:a.dom.windowwidth(),height:a.dom.windowheight()}},createcomponents:function(){this.documentoverlay=new c.documentoverlayclass(this.settings);this.carousel=new g.carouselclass(this.cache,this.settings);this.uilayer=new i.uilayerclass(this.settings);if(!this.settings.captionandtoolbarhide)this.toolbar=new f.toolbarclass(this.cache,this.settings)}, resetposition:function(){if(!this._isresettingposition){var b=this.getwindowdimensions();if(a.isnothing(this.windowdimensions)||!(b.width===this.windowdimensions.width&&b.height===this.windowdimensions.height))this._isresettingposition=!0,this.windowdimensions=b,this.destroyzoompanrotate(),this.documentoverlay.resetposition(),this.carousel.resetposition(),a.isnothing(this.toolbar)||this.toolbar.resetposition(),this.uilayer.resetposition(),this._isresettingposition=!1,a.events.fire(this,{type:h.eventtypes.onresetposition, target:this})}},addeventhandler:function(b,c){a.events.add(this,b,c)},addeventhandlers:function(){if(a.isnothing(this.windoworientationchangehandler))this.windoworientationchangehandler=this.onwindoworientationchange.bind(this),this.windowscrollhandler=this.onwindowscroll.bind(this),this.keydownhandler=this.onkeydown.bind(this),this.windowhashchangehandler=this.onwindowhashchange.bind(this),this.uilayertouchhandler=this.onuilayertouch.bind(this),this.carouselslidebyendhandler=this.oncarouselslidebyend.bind(this), this.carouselslideshowstarthandler=this.oncarouselslideshowstart.bind(this),this.carouselslideshowstophandler=this.oncarouselslideshowstop.bind(this),this.toolbartaphandler=this.ontoolbartap.bind(this),this.toolbarbeforeshowhandler=this.ontoolbarbeforeshow.bind(this),this.toolbarshowhandler=this.ontoolbarshow.bind(this),this.toolbarbeforehidehandler=this.ontoolbarbeforehide.bind(this),this.toolbarhidehandler=this.ontoolbarhide.bind(this),this.mousewheelhandler=this.onmousewheel.bind(this),this.zoompanrotatetransformhandler= this.onzoompanrotatetransform.bind(this);a.browser.android?this.orientationeventname="resize":a.browser.ios&&!a.browser.safari?a.events.add(e.document.body,"orientationchange",this.windoworientationchangehandler):this.orientationeventname=!a.isnothing(e.onorientationchange)?"orientationchange":"resize";a.isnothing(this.orientationeventname)||a.events.add(e,this.orientationeventname,this.windoworientationchangehandler);this.settings.target===e&&a.events.add(e,"scroll",this.windowscrollhandler);this.settings.enablekeyboard&& a.events.add(e.document,"keydown",this.keydownhandler);if(this.isbackeventsupported&&this.settings.backbuttonhideenabled)this.windowhashchangehandler=this.onwindowhashchange.bind(this),this.settings.jquerymobile?e.location.hash=this.settings.jquerymobiledialoghash:(this.currenthistoryhashvalue="photoswipe"+(new date).gettime().tostring(),e.location.hash=this.currenthistoryhashvalue),a.events.add(e,"hashchange",this.windowhashchangehandler);this.settings.enablemousewheel&&a.events.add(e,"mousewheel", this.mousewheelhandler);a.events.add(this.uilayer,a.touchelement.eventtypes.ontouch,this.uilayertouchhandler);a.events.add(this.carousel,g.eventtypes.onslidebyend,this.carouselslidebyendhandler);a.events.add(this.carousel,g.eventtypes.onslideshowstart,this.carouselslideshowstarthandler);a.events.add(this.carousel,g.eventtypes.onslideshowstop,this.carouselslideshowstophandler);a.isnothing(this.toolbar)||(a.events.add(this.toolbar,f.eventtypes.ontap,this.toolbartaphandler),a.events.add(this.toolbar, f.eventtypes.onbeforeshow,this.toolbarbeforeshowhandler),a.events.add(this.toolbar,f.eventtypes.onshow,this.toolbarshowhandler),a.events.add(this.toolbar,f.eventtypes.onbeforehide,this.toolbarbeforehidehandler),a.events.add(this.toolbar,f.eventtypes.onhide,this.toolbarhidehandler))},removeeventhandlers:function(){a.browser.ios&&!a.browser.safari&&a.events.remove(e.document.body,"orientationchange",this.windoworientationchangehandler);a.isnothing(this.orientationeventname)||a.events.remove(e,this.orientationeventname, this.windoworientationchangehandler);a.events.remove(e,"scroll",this.windowscrollhandler);this.settings.enablekeyboard&&a.events.remove(e.document,"keydown",this.keydownhandler);this.isbackeventsupported&&this.settings.backbuttonhideenabled&&a.events.remove(e,"hashchange",this.windowhashchangehandler);this.settings.enablemousewheel&&a.events.remove(e,"mousewheel",this.mousewheelhandler);a.isnothing(this.uilayer)||a.events.remove(this.uilayer,a.touchelement.eventtypes.ontouch,this.uilayertouchhandler); a.isnothing(this.toolbar)||(a.events.remove(this.carousel,g.eventtypes.onslidebyend,this.carouselslidebyendhandler),a.events.remove(this.carousel,g.eventtypes.onslideshowstart,this.carouselslideshowstarthandler),a.events.remove(this.carousel,g.eventtypes.onslideshowstop,this.carouselslideshowstophandler));a.isnothing(this.toolbar)||(a.events.remove(this.toolbar,f.eventtypes.ontap,this.toolbartaphandler),a.events.remove(this.toolbar,f.eventtypes.onbeforeshow,this.toolbarbeforeshowhandler),a.events.remove(this.toolbar, f.eventtypes.onshow,this.toolbarshowhandler),a.events.remove(this.toolbar,f.eventtypes.onbeforehide,this.toolbarbeforehidehandler),a.events.remove(this.toolbar,f.eventtypes.onhide,this.toolbarhidehandler))},hide:function(){if(!this.settings.preventhide){if(a.isnothing(this.documentoverlay))throw"code.photoswipe.photoswipeclass.hide: photoswipe instance is already hidden";if(a.isnothing(this.hiding)){this.clearuiwebviewresetpositiontimeout();this.destroyzoompanrotate();this.removeeventhandlers();a.events.fire(this, {type:h.eventtypes.onbeforehide,target:this});this.uilayer.dispose();this.uilayer=null;if(!a.isnothing(this.toolbar))this.toolbar.dispose(),this.toolbar=null;this.carousel.dispose();this.carousel=null;a.dom.removeclass(e.document.body,h.cssclasses.activebody);this.documentoverlay.dispose();this.documentoverlay=null;this._isresettingposition=!1;h.unsetactivateinstance(this);a.events.fire(this,{type:h.eventtypes.onhide,target:this});this.gobackinhistory()}}},gobackinhistory:function(){this.isbackeventsupported&& this.settings.backbuttonhideenabled&&(this.backbuttonclicked||e.history.back())},play:function(){!this.iszoomactive()&&!this.settings.preventslideshow&&!a.isnothing(this.carousel)&&(!a.isnothing(this.toolbar)&&this.toolbar.isvisible&&this.toolbar.fadeout(),this.carousel.startslideshow())},stop:function(){this.iszoomactive()||a.isnothing(this.carousel)||this.carousel.stopslideshow()},previous:function(){this.iszoomactive()||a.isnothing(this.carousel)||this.carousel.previous()},next:function(){this.iszoomactive()|| a.isnothing(this.carousel)||this.carousel.next()},toggletoolbar:function(){this.iszoomactive()||a.isnothing(this.toolbar)||this.toolbar.togglevisibility(this.currentindex)},fadeouttoolbarifvisible:function(){!a.isnothing(this.toolbar)&&this.toolbar.isvisible&&this.settings.captionandtoolbarautohidedelay>0&&this.toolbar.fadeout()},createzoompanrotate:function(){this.stop();if(this.canuserzoom()&&!this.iszoomactive())a.events.fire(this,h.eventtypes.onbeforezoompanrotateshow),this.zoompanrotate=new j.zoompanrotateclass(this.settings, this.cache.images[this.currentindex],this.uilayer),this.uilayer.capturesettings.preventdefaulttouchevents=!0,a.events.add(this.zoompanrotate,h.zoompanrotate.eventtypes.ontransform,this.zoompanrotatetransformhandler),a.events.fire(this,h.eventtypes.onzoompanrotateshow),!a.isnothing(this.toolbar)&&this.toolbar.isvisible&&this.toolbar.fadeout()},destroyzoompanrotate:function(){if(!a.isnothing(this.zoompanrotate))a.events.fire(this,h.eventtypes.onbeforezoompanrotatehide),a.events.remove(this.zoompanrotate, h.zoompanrotate.eventtypes.ontransform,this.zoompanrotatetransformhandler),this.zoompanrotate.dispose(),this.zoompanrotate=null,this.uilayer.capturesettings.preventdefaulttouchevents=this.settings.preventdefaulttouchevents,a.events.fire(this,h.eventtypes.onzoompanrotatehide)},canuserzoom:function(){var b;if(a.browser.msie){if(b=document.createelement("div"),a.isnothing(b.style.mstransform))return!1}else if(!a.browser.iscsstransformsupported)return!1;if(!this.settings.allowuserzoom)return!1;if(this.carousel.issliding)return!1; b=this.cache.images[this.currentindex];if(a.isnothing(b))return!1;if(b.isloading)return!1;return!0},iszoomactive:function(){return!a.isnothing(this.zoompanrotate)},getcurrentimage:function(){return this.cache.images[this.currentindex]},ondocumentoverlayfadein:function(){e.settimeout(function(){var b=this.settings.target===e?e.document.body:this.settings.target;a.dom.removeclass(b,h.cssclasses.buildingbody);a.dom.addclass(b,h.cssclasses.activebody);this.addeventhandlers();this.carousel.show(this.currentindex); this.uilayer.show();this.settings.autostartslideshow?this.play():a.isnothing(this.toolbar)||this.toolbar.show(this.currentindex);a.events.fire(this,{type:h.eventtypes.onshow,target:this});this.setuiwebviewresetpositiontimeout()}.bind(this),250)},setuiwebviewresetpositiontimeout:function(){if(this.settings.enableuiwebviewrepositiontimeout&&a.browser.ios&&!a.browser.safari)a.isnothing(this._uiwebviewresetpositiontimeout)||e.cleartimeout(this._uiwebviewresetpositiontimeout),this._uiwebviewresetpositiontimeout= e.settimeout(function(){this.resetposition();this.setuiwebviewresetpositiontimeout()}.bind(this),this.settings.uiwebviewresetpositiondelay)},clearuiwebviewresetpositiontimeout:function(){a.isnothing(this._uiwebviewresetpositiontimeout)||e.cleartimeout(this._uiwebviewresetpositiontimeout)},onwindowscroll:function(){this.resetposition()},onwindoworientationchange:function(){this.resetposition()},onwindowhashchange:function(){if(e.location.hash!=="#"+(this.settings.jquerymobile?this.settings.jquerymobiledialoghash: this.currenthistoryhashvalue))this.backbuttonclicked=!0,this.hide()},onkeydown:function(a){a.keycode===37?(a.preventdefault(),this.previous()):a.keycode===39?(a.preventdefault(),this.next()):a.keycode===38||a.keycode===40?a.preventdefault():a.keycode===27?(a.preventdefault(),this.hide()):a.keycode===32?(this.settings.hidetoolbar?this.hide():this.toggletoolbar(),a.preventdefault()):a.keycode===13&&(a.preventdefault(),this.play())},onuilayertouch:function(b){if(this.iszoomactive())switch(b.action){case a.touchelement.actiontypes.gesturechange:this.zoompanrotate.zoomrotate(b.scale, this.settings.allowrotationonuserzoom?b.rotation:0);break;case a.touchelement.actiontypes.gestureend:this.zoompanrotate.setstartingscaleandrotation(b.scale,this.settings.allowrotationonuserzoom?b.rotation:0);break;case a.touchelement.actiontypes.touchstart:this.zoompanrotate.panstart(b.point);break;case a.touchelement.actiontypes.touchmove:this.zoompanrotate.pan(b.point);break;case a.touchelement.actiontypes.doubletap:this.destroyzoompanrotate();this.toggletoolbar();break;case a.touchelement.actiontypes.swipeleft:this.destroyzoompanrotate(); this.next();this.toggletoolbar();break;case a.touchelement.actiontypes.swiperight:this.destroyzoompanrotate(),this.previous(),this.toggletoolbar()}else switch(b.action){case a.touchelement.actiontypes.touchmove:case a.touchelement.actiontypes.swipeleft:case a.touchelement.actiontypes.swiperight:this.fadeouttoolbarifvisible();this.carousel.ontouch(b.action,b.point);break;case a.touchelement.actiontypes.touchstart:case a.touchelement.actiontypes.touchmoveend:this.carousel.ontouch(b.action,b.point); break;case a.touchelement.actiontypes.tap:this.toggletoolbar();break;case a.touchelement.actiontypes.doubletap:this.settings.target===e&&(b.point.x-=a.dom.windowscrollleft(),b.point.y-=a.dom.windowscrolltop());var c=this.cache.images[this.currentindex].imageel,d=e.parseint(a.dom.getstyle(c,"top"),10),f=e.parseint(a.dom.getstyle(c,"left"),10),g=f+a.dom.width(c),c=d+a.dom.height(c);if(b.point.xg)b.point.x=g;if(b.point.yc)b.point.y=c; this.createzoompanrotate();this.iszoomactive()&&this.zoompanrotate.zoomandpantopoint(this.settings.doubletapzoomlevel,b.point);break;case a.touchelement.actiontypes.gesturestart:this.createzoompanrotate()}a.events.fire(this,{type:h.eventtypes.ontouch,target:this,point:b.point,action:b.action})},oncarouselslidebyend:function(b){this.currentindex=b.cacheindex;a.isnothing(this.toolbar)||(this.toolbar.setcaption(this.currentindex),this.toolbar.settoolbarstatus(this.currentindex));a.events.fire(this,{type:h.eventtypes.ondisplayimage, target:this,action:b.action,index:b.cacheindex})},ontoolbartap:function(b){switch(b.action){case f.toolbaraction.next:this.next();break;case f.toolbaraction.previous:this.previous();break;case f.toolbaraction.close:this.hide();break;case f.toolbaraction.play:this.play()}a.events.fire(this,{type:h.eventtypes.ontoolbartap,target:this,toolbaraction:b.action,taptarget:b.taptarget})},onmousewheel:function(b){var c=a.events.getwheeldelta(b);if(!(b.timestamp-(this.mousewheelstarttime||0)0&&this.previous()},oncarouselslideshowstart:function(){a.events.fire(this,{type:h.eventtypes.onslideshowstart,target:this})},oncarouselslideshowstop:function(){a.events.fire(this,{type:h.eventtypes.onslideshowstop,target:this})},ontoolbarbeforeshow:function(){a.events.fire(this,{type:h.eventtypes.onbeforecaptionandtoolbarshow,target:this})},ontoolbarshow:function(){a.events.fire(this,{type:h.eventtypes.oncaptionandtoolbarshow, target:this})},ontoolbarbeforehide:function(){a.events.fire(this,{type:h.eventtypes.onbeforecaptionandtoolbarhide,target:this})},ontoolbarhide:function(){a.events.fire(this,{type:h.eventtypes.oncaptionandtoolbarhide,target:this})},onzoompanrotatetransform:function(b){a.events.fire(this,{target:this,type:h.eventtypes.onzoompanrotatetransform,scale:b.scale,rotation:b.rotation,rotationdegs:b.rotationdegs,translatex:b.translatex,translatey:b.translatey})}})})(window,window.klass,window.code.util,window.code.photoswipe.cache, window.code.photoswipe.documentoverlay,window.code.photoswipe.carousel,window.code.photoswipe.toolbar,window.code.photoswipe.uilayer,window.code.photoswipe.zoompanrotate);