// PhotoSwipe - http://www.photoswipe.com/ // Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com) // Licensed under the MIT license // version: 1.0.11 (function(){if(!Function.prototype.bind)Function.prototype.bind=function(a){var b=[].slice,d=b.call(arguments,1),e=this,c=function(){},f=function(){return e.apply(this instanceof c?this:a||{},d.concat(b.call(arguments)))};c.prototype=e.prototype;f.prototype=new c;return f};if(typeof Code==="undefined")Code={},Code.PhotoSwipe={};Code.PhotoSwipe.Util={browser:{version:(navigator.userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],webkit:/webkit/i.test(navigator.userAgent),opera:/opera/i.test(navigator.userAgent), msie:/msie/i.test(navigator.userAgent)&&!/opera/.test(navigator.userAgent),mozilla:/mozilla/i.test(navigator.userAgent)&&!/(compatible|webkit)/.test(navigator.userAgent),mobileSafari:/mobile.*safari/i.test(navigator.userAgent),is3dSupported:!1,isAndroid:/android/i.test(navigator.userAgent),isBlackberry:/blackberry/i.test(navigator.userAgent),isiOS:/like Mac OS/i.test(navigator.userAgent),touchSupported:!1,gestureSupported:!1,_eventTagNames:{select:"input",change:"input",submit:"form",reset:"form", error:"img",load:"img",abort:"img"},isEventSupported:function(a){var b=document.createElement(this._eventTagNames[a]||"div"),a="on"+a,d=a in b;d||(b.setAttribute(a,"return;"),d=typeof b[a]=="function");return d}},setElementData:function(a,b,d){if(this.isNothing(a.UtilData))a.UtilData={};a.UtilData[b]=d},getElementData:function(a,b,d){typeof d==="undefined"&&(d=null);if(this.isNothing(a.UtilData))return d;if(this.isNothing(a.UtilData[b]))return d;return a.UtilData[b]},removeElementData:function(a, b){delete a.UtilData[b]},coalesce:function(){var a;for(a=0;a");a.attr(d);a.append(e);return a[0]},appendChild:function(a,d){$(d).append(a)},appendText:function(a,d){$(d).text(a)},appendToBody:function(a){$("body").append(a)}, removeChild:function(a){$(a).empty().remove()},removeChildren:function(a){$(a).empty()},hasAttribute:function(b,d){return a.isNothing($(b).attr(d))},getAttribute:function(a,d){return $(a).attr(d)},setAttribute:function(a,d,e){$(a).attr(d,e)},removeAttribute:function(a,d){$(a).removeAttr(d)},addClass:function(a,d){$(a).addClass(d)},removeClass:function(a,d){$(a).removeClass(d)},hasClass:function(a,d){$(a).hasClass(d)},setStyle:function(b,d,e){a.isObject(d)?$(b).css(d):$(b).css(d,e)},getStyle:function(a, d){return $(a).css(d)},hide:function(a){$(a).hide()},show:function(a){$(a).show()},width:function(b,d){a.isNothing(d)||$(b).width(d);return $(b).width()},outerWidth:function(a){return $(a).outerWidth()},height:function(b,d){a.isNothing(d)||$(b).height(d);return $(b).height()},outerHeight:function(a){return $(a).outerHeight()},documentWidth:function(){return $(document.documentElement).width()},documentHeight:function(){return $(document.documentElement).height()},bodyWidth:function(){return $(document.body).width()}, bodyHeight:function(){return $(document.body).height()},windowWidth:function(){if(!c.innerWidth)return $(c).width();return c.innerWidth},windowHeight:function(){if(!c.innerHeight)return $(c).height();return c.innerHeight},windowScrollLeft:function(){if(!c.pageXOffset)return $(c).scrollLeft();return c.pageXOffset},windowScrollTop:function(){if(!c.pageYOffset)return $(c).scrollTop();return c.pageYOffset},addEventListener:function(a,d,e){$(a).bind(d,e)},removeEventListener:function(a,d,e){$(a).unbind(d, e)},getMousePosition:function(a){return{x:a.pageX,y:a.pageY}},getTouchEvent:function(a){return a.originalEvent}}})})(window,Code.PhotoSwipe.Util); (function(c,a){a.extend(a,{Animation:{stopFade:function(a){$(a).stop(!0,!0)},fadeIn:function(b,d,e,c){d=a.coalesce(d,1);e=a.coalesce(e,500);$(b).fadeTo(e,d,c)},fadeOut:function(b,d,e){a.isNothing(d)&&(d=500);$(b).fadeTo(d,0,e)},slideBy:function(b,d,e,c,f){a.isNothing(c)&&(c=500);d=jQuery.fn.translation?{left:"+="+d+"px",top:"+="+e+"px",useTranslate3d:a.browser.is3dSupported}:{left:"+="+d+"px",top:"+="+e+"px"};$(b).animate(d,c,f)}}})})(window,Code.PhotoSwipe.Util); (function(){Code.PhotoSwipe.EventClass=SimpleClass.extend({_listeners:null,init:function(){this._listeners={}},addEventListener:function(c,a){typeof this._listeners[c]==="undefined"&&(this._listeners[c]=[]);this._listeners[c].push(a)},dispatchEvent:function(c){typeof c=="string"&&(c={type:c});if(!c.target)c.target=this;if(!c.type)throw Error("Event object missing 'type' property.");if(this._listeners[c.type]instanceof Array)for(var a=this._listeners[c.type],b=0,d=a.length;bthis.naturalHeight;this.isLoading=!1;this.hasLoaded=!0;this.dispatchEvent(Code.PhotoSwipe.FullSizeImageClass.EventTypes.onLoad)}});Code.PhotoSwipe.FullSizeImageClass.EventTypes= {onLoad:"onLoad"}})(window,Code.PhotoSwipe.Util); (function(c,a){Code.PhotoSwipe.DocumentOverlayClass=Code.PhotoSwipe.ElementClass.extend({init:function(b){this.settings={zIndex:1E3};a.extend(this.settings,b);this._super(b);this.el=a.DOM.createElement("div",{"class":Code.PhotoSwipe.DocumentOverlayClass.CssClasses.documentOverlay},"");a.DOM.setStyle(this.el,{left:0,position:"absolute",zIndex:this.settings.zIndex,top:0});a.DOM.hide(this.el);a.DOM.appendToBody(this.el)},resetPosition:function(){a.DOM.width(this.el,a.DOM.bodyWidth());a.DOM.height(this.el, a.DOM.bodyHeight())}});Code.PhotoSwipe.DocumentOverlayClass.CssClasses={documentOverlay:"ps-document-overlay"}})(window,Code.PhotoSwipe.Util); (function(c,a){Code.PhotoSwipe.ViewportClass=Code.PhotoSwipe.ElementClass.extend({touchStartPoint:null,touchStartTime:null,touchStartHandler:null,touchMoveHandler:null,touchEndHandler:null,gestureStartHandler:null,gestureChangeHandler:null,gestureEndHandler:null,isGesture:null,mouseDownHandler:null,mouseUpHandler:null,init:function(b){this.settings={swipeThreshold:500,swipeTimeThreshold:250,zIndex:1E3};a.extend(this.settings,b);this._super(this.settings);this.touchStartPoint={x:0,y:0};if(a.browser.touchSupported)this.touchStartHandler= this.onTouchStart.bind(this),this.touchMoveHandler=this.onTouchMove.bind(this),this.touchEndHandler=this.onTouchEnd.bind(this);if(a.browser.gestureSupported)this.gestureStartHandler=this.onGestureStart.bind(this),this.gestureChangeHandler=this.onGestureChange.bind(this),this.gestureEndHandler=this.onGestureEnd.bind(this);this.mouseDownHandler=this.onMouseDown.bind(this);this.mouseUpHandler=this.onMouseUp.bind(this);this.el=a.DOM.createElement("div",{"class":Code.PhotoSwipe.ViewportClass.CssClasses.viewport, "data-role":"dialog"},"");a.DOM.setStyle(this.el,{position:"absolute",left:0,zIndex:this.settings.zIndex,overflow:"hidden"});a.DOM.hide(this.el);a.DOM.appendToBody(this.el)},resetPosition:function(){a.DOM.setStyle(this.el,{top:a.DOM.windowScrollTop()+"px"});a.DOM.width(this.el,a.DOM.bodyWidth());a.DOM.height(this.el,a.DOM.windowHeight())},addEventListeners:function(){a.browser.touchSupported&&(a.DOM.addEventListener(this.el,"touchstart",this.touchStartHandler),a.DOM.addEventListener(this.el,"touchmove", this.touchMoveHandler),a.DOM.addEventListener(this.el,"touchend",this.touchEndHandler));a.browser.gestureSupported&&(a.DOM.addEventListener(this.el,"gesturestart",this.gestureStartHandler),a.DOM.addEventListener(this.el,"gesturechange",this.gestureChangeHandler),a.DOM.addEventListener(this.el,"gestureend",this.gestureEndHandler));a.DOM.addEventListener(this.el,"mousedown",this.mouseDownHandler);a.DOM.addEventListener(this.el,"mouseup",this.mouseUpHandler)},removeEventListeners:function(){a.browser.touchSupported&& (a.DOM.removeEventListener(this.el,"touchstart",this.touchStartHandler),a.DOM.removeEventListener(this.el,"touchmove",this.touchMoveHandler),a.DOM.removeEventListener(this.el,"touchend",this.touchEndHandler));a.browser.gestureSupported&&(a.DOM.removeEventListener(this.el,"gesturestart",this.gestureStartHandler),a.DOM.removeEventListener(this.el,"gesturechange",this.gestureChangeHandler),a.DOM.removeEventListener(this.el,"gestureend",this.gestureEndHandler));a.DOM.removeEventListener(this.el,"mousedown", this.mouseDownHandler);a.DOM.removeEventListener(this.el,"mouseup",this.mouseUpHandler)},getTouchPoint:function(a){return{x:a[0].pageX,y:a[0].pageY}},onGestureStart:function(b){b.preventDefault();b=a.DOM.getTouchEvent(b);this.dispatchEvent({type:Code.PhotoSwipe.ViewportClass.EventTypes.onTouch,target:this,action:Code.PhotoSwipe.ViewportClass.Actions.gestureStart,scale:b.scale,rotation:b.rotation})},onGestureChange:function(b){b.preventDefault();b=a.DOM.getTouchEvent(b);this.dispatchEvent({type:Code.PhotoSwipe.ViewportClass.EventTypes.onTouch, target:this,action:Code.PhotoSwipe.ViewportClass.Actions.gestureChange,scale:b.scale,rotation:b.rotation})},onGestureEnd:function(b){b.preventDefault();b=a.DOM.getTouchEvent(b);this.dispatchEvent({type:Code.PhotoSwipe.ViewportClass.EventTypes.onTouch,target:this,action:Code.PhotoSwipe.ViewportClass.Actions.gestureEnd,scale:b.scale,rotation:b.rotation})},onTouchStart:function(b){b.preventDefault();b=a.DOM.getTouchEvent(b).touches;b.length>1?this.isGesture=!0:(this.dispatchEvent({type:Code.PhotoSwipe.ViewportClass.EventTypes.onTouch, target:this,action:Code.PhotoSwipe.ViewportClass.Actions.touchStart,point:this.getTouchPoint(b)}),this.touchStartTime=new Date,this.isGesture=!1,this.touchStartPoint=this.getTouchPoint(b))},onTouchMove:function(b){b.preventDefault();if(!this.isGesture)b=a.DOM.getTouchEvent(b).touches,this.dispatchEvent({type:Code.PhotoSwipe.ViewportClass.EventTypes.onTouch,target:this,action:Code.PhotoSwipe.ViewportClass.Actions.touchMove,point:this.getTouchPoint(b)})},onTouchEnd:function(b){b.preventDefault();this.isGesture|| (b=a.DOM.getTouchEvent(b),b=this.getTouchPoint(!a.isNothing(b.changedTouches)?b.changedTouches:b.touches),this.dispatchEvent({type:Code.PhotoSwipe.ViewportClass.EventTypes.onTouch,target:this,action:Code.PhotoSwipe.ViewportClass.Actions.touchEnd,point:b}),this.fireTouchEvent(this.touchStartPoint,b))},onMouseDown:function(b){b.preventDefault();this.touchStartTime=new Date;this.isGesture=!1;this.touchStartPoint=a.DOM.getMousePosition(b)},onMouseUp:function(b){b.preventDefault();this.fireTouchEvent(this.touchStartPoint, a.DOM.getMousePosition(b))},fireTouchEvent:function(b,d){var e;new Date-this.touchStartTime>this.settings.swipeTimeThreshold||(e=d.x-b.x,e=Math.abs(e)>=this.settings.swipeThreshold?e<0?Code.PhotoSwipe.ViewportClass.Actions.swipeLeft:Code.PhotoSwipe.ViewportClass.Actions.swipeRight:Code.PhotoSwipe.ViewportClass.Actions.click,a.isNothing(e)||this.dispatchEvent({type:Code.PhotoSwipe.ViewportClass.EventTypes.onTouch,target:this,action:e}))}});Code.PhotoSwipe.ViewportClass.CssClasses={viewport:"ps-viewport"}; Code.PhotoSwipe.ViewportClass.Actions={click:"click",swipeLeft:"swipeLeft",swipeRight:"swipeRight",touchStart:"touchStart",touchMove:"touchMove",touchEnd:"touchEnd",gestureStart:"gestureStart",gestureChange:"gestureChange",gestureEnd:"gestureEnd"};Code.PhotoSwipe.ViewportClass.EventTypes={onTouch:"onTouch"}})(window,Code.PhotoSwipe.Util); (function(c,a,b){Code.PhotoSwipe.SliderItemClass=Code.PhotoSwipe.EventClass.extend({el:null,imageContainerEl:null,imageEl:null,parentEl:null,fullSizeImage:null,fullSizeImageLoadEventHandler:null,savedImageWidth:null,savedImageHeight:null,init:function(b){this._super();this.parentEl=b;this.fullSizeImageLoadEventHandler=this.onFullSizeImageLoad.bind(this);this.el=a.DOM.createElement("div",{"class":Code.PhotoSwipe.SliderItemClass.CssClasses.item+" "+Code.PhotoSwipe.SliderItemClass.CssClasses.loading}, "");a.DOM.setStyle(this.el,{position:"absolute",overflow:"hidden",top:0});a.DOM.resetTranslate(this.el);a.DOM.appendChild(this.el,this.parentEl);this.imageContainerEl=a.DOM.createElement("div");a.DOM.setStyle(this.imageContainerEl,{position:"absolute",overflow:"hidden",top:0,left:0});a.DOM.appendChild(this.imageContainerEl,this.el);this.imageEl=new Image;a.DOM.setStyle(this.imageEl,{display:"block",position:"absolute",margin:0,padding:0});a.DOM.hide(this.imageEl);a.DOM.appendChild(this.imageEl,this.imageContainerEl)}, resetPosition:function(b,e,c){a.DOM.width(this.el,b);a.DOM.height(this.el,e);a.DOM.setStyle(this.el,"left",c+"px");a.DOM.width(this.imageContainerEl,b);a.DOM.height(this.imageContainerEl,e);this.resetImagePosition()},resetImagePosition:function(){if(!a.isNothing(this.fullSizeImage)){a.DOM.getAttribute(this.imageEl,"src");var b,e,c,f;f=a.DOM.width(this.el);var h=a.DOM.height(this.el);b=this.fullSizeImage.isLandscape?f/this.fullSizeImage.naturalWidth:h/this.fullSizeImage.naturalHeight;e=Math.round(this.fullSizeImage.naturalWidth* b); c = Math.round(this.fullSizeImage.naturalHeight * b); this.fullSizeImage.scaleMethod === "zoom" ? (b = 1, c < h ? b = h / c : e < f && (b = f / e), b !== 1 && (e = Math.round(e * b), c = Math.round(c * b))) : this.fullSizeImage.scaleMethod === "fit" && (b = 1, e > f ? b = f / e : c > h && (b = h / c), b !== 1 && (e = Math.round(e * b), c = Math.round(c * b))); b = (h - this.fullSizeImage.naturalHeight) / 2 + "px"; f = (f - this.fullSizeImage.naturalWidth) / 2 + "px"; a.DOM.width(this.imageEl, this.fullSizeImage.naturalWidth); a.DOM.height(this.imageEl, this.fullSizeImage.naturalHeight); a.DOM.setStyle(this.imageEl, { top: b, left: f }); a.DOM.show(this.imageEl); this.savedImageWidth = this.fullSizeImage.naturalWidth; this.savedImageHeight = this.fullSizeImage.naturalHeight } }, setFullSizeImage: function (d) { this.fullSizeImage = d;a.DOM.removeClass(this.el,Code.PhotoSwipe.SliderItemClass.CssClasses.loading);a.DOM.removeClass(this.el,Code.PhotoSwipe.SliderItemClass.CssClasses.imageError);a.isNothing(this.fullSizeImage)?(this.fullSizeImage=null,a.DOM.addClass(this.el,Code.PhotoSwipe.SliderItemClass.CssClasses.imageError),this.hideImage()):this.fullSizeImage.hasLoaded?(a.DOM.setAttribute(this.imageEl,"src",this.fullSizeImage.src),this.resetImagePosition(),this.dispatchEvent(Code.PhotoSwipe.SliderItemClass.EventTypes.onFullSizeImageDisplay)): (a.DOM.addClass(this.el,Code.PhotoSwipe.SliderItemClass.CssClasses.loading),this.hideImage(),this.fullSizeImage.isLoading||(this.fullSizeImage.addEventListener(b.EventTypes.onLoad,this.fullSizeImageLoadEventHandler),this.fullSizeImage.load()))},onFullSizeImageLoad:function(d){d.target.removeEventListener(b.EventTypes.onLoad,this.fullSizeImageLoadEventHandler);a.isNothing(this.fullSizeImage)||d.target.index!==this.fullSizeImage.index?this.dispatchEvent({type:Code.PhotoSwipe.SliderItemClass.EventTypes.onFullSizeImageLoadAnomaly, target:this,fullSizeImage:d.target}):this.setFullSizeImage(d.target)},hideImage:function(){a.DOM.removeAttribute(this.imageEl,"src");a.DOM.hide(this.imageEl)}});Code.PhotoSwipe.SliderItemClass.CssClasses={item:"ps-slider-item",loading:"ps-slider-item-loading",imageError:"ps-slider-item-image-error"};Code.PhotoSwipe.SliderItemClass.EventTypes={onFullSizeImageDisplay:"onFullSizeImageDisplay",onFullSizeImageLoadAnomaly:"onFullSizeImageLoadAnomaly"}})(window,Code.PhotoSwipe.Util,Code.PhotoSwipe.FullSizeImageClass); (function(c,a,b){Code.PhotoSwipe.SliderClass=Code.PhotoSwipe.ElementClass.extend({parentEl:null,parentElWidth:null,parentElHeight:null,items:null,scaleEl:null,lastScaleValue:null,previousItem:null,currentItem:null,nextItem:null,hasBounced:null,lastShowAction:null,bounceSlideBy:null,showNextEndEventHandler:null,showPreviousEndEventHandler:null,bounceStepOneEventHandler:null,bounceStepTwoEventHandler:null,sliderFullSizeImageLoadAnomalyEventHandler:null,init:function(d,c){this.settings={slideSpeed:250}; a.extend(this.settings,d);this._super(this.settings);this.parentEl=c;this.hasBounced=!1;this.showNextEndEventHandler=this.onShowNextEnd.bind(this);this.showPreviousEndEventHandler=this.onShowPreviousEnd.bind(this);this.bounceStepOneEventHandler=this.onBounceStepOne.bind(this);this.bounceStepTwoEventHandler=this.onBounceStepTwo.bind(this);this.sliderFullSizeImageLoadAnomalyEventHandler=this.onSliderFullSizeImageLoadAnomaly.bind(this);this.el=a.DOM.createElement("div",{"class":Code.PhotoSwipe.SliderClass.CssClasses.slider}, "");a.DOM.setStyle(this.el,{position:"absolute",top:0});a.DOM.hide(this.el);a.DOM.appendChild(this.el,c);this.items=[];this.items.push(new b(this.el));this.items.push(new b(this.el));this.items.push(new b(this.el));this.previousItem=this.items[0];this.currentItem=this.items[1];this.nextItem=this.items[2]},addEventListeners:function(){for(var a=0;a');this.settings.hideClose&&a.DOM.hide(this.closeEl);a.DOM.appendChild(this.closeEl,this.el);this.playEl=a.DOM.createElement("div",{"class":Code.PhotoSwipe.ToolbarClass.CssClasses.play},'
');a.DOM.appendChild(this.playEl,this.el);this.previousEl=a.DOM.createElement("div",{"class":Code.PhotoSwipe.ToolbarClass.CssClasses.previous},'
');a.DOM.appendChild(this.previousEl,this.el);this.nextEl=a.DOM.createElement("div",{"class":Code.PhotoSwipe.ToolbarClass.CssClasses.next},'
');a.DOM.appendChild(this.nextEl,this.el)},postFadeIn:function(){this.isHidden||(a.DOM.setStyle(this.el,{display:"table"}),this._super(this.settings))},addEventListeners:function(){a.browser.touchSupported&&(a.browser.isBlackberry||a.DOM.addEventListener(this.el,"touchstart",this.touchStartHandler), a.DOM.addEventListener(this.el,"touchmove",this.touchMoveHandler));a.DOM.addEventListener(this.el,"click",this.clickHandler)},removeEventListeners:function(){a.browser.touchSupported&&(a.browser.isBlackberry||a.DOM.removeEventListener(this.el,"touchstart",this.touchStartHandler),a.DOM.removeEventListener(this.el,"touchmove",this.touchMoveHandler));a.DOM.removeEventListener(this.el,"click",this.clickHandler)},onTouchStart:function(a){a.preventDefault();this.touched=!0;this.handleClick(a)},onTouchMove:function(a){a.preventDefault()}, onClick:function(a){this.touched||this.handleClick(a)},handleClick:function(b){var d;switch(b.target.parentNode){case this.previousEl:if(this.isPreviousActive)d=Code.PhotoSwipe.ToolbarClass.Actions.previous;break;case this.nextEl:if(this.isNextActive)d=Code.PhotoSwipe.ToolbarClass.Actions.next;break;case this.playEl:d=Code.PhotoSwipe.ToolbarClass.Actions.play;break;case this.closeEl:d=Code.PhotoSwipe.ToolbarClass.Actions.close}a.isNothing(d)||this.dispatchEvent({type:Code.PhotoSwipe.ToolbarClass.EventTypes.onClick, target:this,action:d})},resetPosition:function(){var b;b=this.settings.position==="bottom"?a.DOM.windowHeight()-a.DOM.outerHeight(this.el)+a.DOM.windowScrollTop():a.DOM.windowScrollTop();a.DOM.setStyle(this.el,"top",b+"px");a.DOM.width(this.el,a.DOM.bodyWidth())},setNextState:function(b){b?(a.DOM.addClass(this.nextEl,Code.PhotoSwipe.ToolbarClass.CssClasses.nextDisabled),this.isNextActive=!1):(a.DOM.removeClass(this.nextEl,Code.PhotoSwipe.ToolbarClass.CssClasses.nextDisabled),this.isNextActive=!0)}, setPreviousState:function(b){b?(a.DOM.addClass(this.previousEl,Code.PhotoSwipe.ToolbarClass.CssClasses.previousDisabled),this.isPreviousActive=!1):(a.DOM.removeClass(this.previousEl,Code.PhotoSwipe.ToolbarClass.CssClasses.previousDisabled),this.isPreviousActive=!0)}});Code.PhotoSwipe.ToolbarClass.CssClasses={caption:"ps-toolbar",top:"ps-toolbar-top",close:"ps-toolbar-close",previous:"ps-toolbar-previous",previousDisabled:"ps-toolbar-previous-disabled",next:"ps-toolbar-next",nextDisabled:"ps-toolbar-next-disabled", play:"ps-toolbar-play",content:"ps-toolbar-content"};Code.PhotoSwipe.ToolbarClass.Actions={close:"close",previous:"previous",next:"next",play:"play"};Code.PhotoSwipe.ToolbarClass.EventTypes={onClick:"onClick"}})(window,Code.PhotoSwipe.Util); (function(c,a,b,d){Code.PhotoSwipe.CaptionToolbarClass=Code.PhotoSwipe.EventClass.extend({toolbar:null,caption:null,isHidden:null,hasAddedEventListeners:null,toolbarClickEventHandler:null,init:function(c){this._super();this.settings={opacity:0.8,fadeInSpeed:250,fadeOutSpeed:500,autoHideDelay:5E3,flipPosition:!1,showEmptyCaptions:!0,hideClose:!1,zIndex:1E3};a.extend(this.settings,c);this.isHidden=!0;this.hasAddedEventListeners=!1;this.toolbarClickEventHandler=this.onToolbarClick.bind(this);this.caption= new b({fadeInSpeed:this.settings.fadeInSpeed,fadeOutSpeed:this.settings.fadeOutSpeed,opacity:this.settings.opacity,position:this.settings.flipPosition?"bottom":"top",zIndex:this.settings.zIndex});this.toolbar=new d({fadeInSpeed:this.settings.fadeInSpeed,fadeOutSpeed:this.settings.fadeOutSpeed,opacity:this.settings.opacity,position:this.settings.flipPosition?"top":"bottom",hideClose:this.settings.hideClose,zIndex:this.settings.zIndex+1})},resetPosition:function(){this.caption.resetPosition();this.toolbar.resetPosition()}, addEventListeners:function(){if(!this.hasAddedEventListeners)this.toolbar.addEventListener(d.EventTypes.onClick,this.toolbarClickEventHandler),this.hasAddedEventListeners=!0},removeEventListeners:function(){this.toolbar.removeEventListener(d.EventTypes.onClick,this.toolbarClickEventHandler);this.hasAddedEventListeners=!1},fadeIn:function(){this.stopAutoHideTimeout();this.stopFade();this.isHidden?(this.isHidden=!1,this.fadeInCaption(),this.toolbar.fadeIn(),c.setTimeout(this.onFadeIn.bind(this),this.settings.fadeInSpeed)): (this.caption.isHidden&&this.fadeInCaption(),this.resetAutoHideTimeout())},showCaption:function(){this.caption.captionValue===""?this.settings.showEmptyCaptions&&this.caption.show():this.caption.show()},fadeInCaption:function(){this.caption.captionValue===""?this.settings.showEmptyCaptions&&this.caption.fadeIn():this.caption.fadeIn()},onFadeIn:function(){this.addEventListeners();this.resetAutoHideTimeout()},fadeOut:function(){this.stopAutoHideTimeout();this.stopFade();this.isHidden=!0;this.caption.fadeOut(); this.toolbar.fadeOut();c.setTimeout(this.onFadeOut.bind(this),this.settings.fadeOutSpeed)},onFadeOut:function(){},stopFade:function(){this.caption.stopFade();this.toolbar.stopFade()},hide:function(){this.stopAutoHideTimeout();this.stopFade();this.isHidden=!0;this.removeEventListeners();this.caption.hide();this.toolbar.hide()},setCaptionValue:function(a){this.caption.setCaptionValue(a);this.caption.captionValue===""&&!this.settings.showEmptyCaptions&&this.caption.fadeOut()},resetAutoHideTimeout:function(){if(!this.isHidden&& (this.stopAutoHideTimeout(),this.settings.autoHideDelay>0))this.autoHideTimeout=c.setTimeout(this.fadeOut.bind(this),this.settings.autoHideDelay)},stopAutoHideTimeout:function(){a.isNothing(this.autoHideTimeout)||c.clearTimeout(this.autoHideTimeout)},onToolbarClick:function(a){this.dispatchEvent({type:Code.PhotoSwipe.ToolbarClass.EventTypes.onClick,target:this,action:a.action})},setNextState:function(a){this.toolbar.setNextState(a)},setPreviousState:function(a){this.toolbar.setPreviousState(a)}})})(window, Code.PhotoSwipe.Util,Code.PhotoSwipe.CaptionClass,Code.PhotoSwipe.ToolbarClass); (function(c,a){Code.PhotoSwipe.ZoomPanRotateClass=Code.PhotoSwipe.ElementClass.extend({containerEl:null,imageEl:null,parentEl:null,transformSettings:null,panStartingPoint:null,init:function(b,d,c){this.settings={maxZoom:5,minZoom:0.5,adjustPanToZoom:!0};a.extend(this.settings,b);this._super(b);this.parentEl=d;this.imageEl=c.cloneNode(!1);this.transformSettings={startingScale:1,scale:1,startingRotation:0,rotation:0,startingTranslateX:0,startingTranslateY:0,translateX:0,translateY:0};this.el=a.DOM.createElement("div", {"class":Code.PhotoSwipe.ZoomPanRotateClass.CssClasses.documentOverlay},"");a.DOM.setStyle(this.el,{left:0,top:0,position:"absolute"});a.DOM.width(this.el,a.DOM.bodyWidth());a.DOM.height(this.el,a.DOM.windowHeight());this.containerEl=a.DOM.createElement("div");a.DOM.setStyle(this.containerEl,{left:0,top:0,position:"absolute"});a.DOM.width(this.containerEl,a.DOM.bodyWidth());a.DOM.height(this.containerEl,a.DOM.windowHeight());a.DOM.appendChild(this.imageEl,this.containerEl);a.DOM.appendChild(this.containerEl, this.el);a.DOM.appendChild(this.el,this.parentEl)},setStartingTranslateFromCurrentTranform:function(){var b=this.containerEl.style.webkitTransform.match(/translate\((.*?)\)/);if(!a.isNothing(b))b=b[1].split(", "),this.transformSettings.startingTranslateX=c.parseInt(b[0]),this.transformSettings.startingTranslateY=c.parseInt(b[1])},setStartingScaleAndRotation:function(a,d){var c=this.transformSettings.startingScale*a;if(this.settings.minZoom!==0&&cthis.settings.maxZoom)c=this.settings.maxZoom;this.transformSettings.startingScale=c;this.transformSettings.startingRotation=(this.transformSettings.startingRotation+d)%360},zoomRotate:function(a,c){var e=this.transformSettings.startingScale*a;if(this.settings.minZoom!==0&&ethis.settings.maxZoom)e=this.settings.maxZoom;this.transformSettings.scale=e;this.transformSettings.rotation=this.transformSettings.startingRotation+ c;this.applyTransform()},panStart:function(a){this.setStartingTranslateFromCurrentTranform();this.panStartingPoint={x:a.x,y:a.y}},pan:function(a){var c=a.x-this.panStartingPoint.x,a=a.y-this.panStartingPoint.y,a=a/this.transformSettings.scale?a/this.transformSettings.scale:a;this.transformSettings.translateX=this.transformSettings.startingTranslateX+(this.settings.adjustPanToZoom?c/this.transformSettings.scale:c);this.transformSettings.translateY=this.transformSettings.startingTranslateY+a;this.applyTransform()}, applyTransform:function(){this.containerEl.style.webkitTransform="scale("+this.transformSettings.scale+") rotate("+this.transformSettings.rotation%360+"deg) translate("+this.transformSettings.translateX+"px, "+this.transformSettings.translateY+"px)"},removeFromDOM:function(){a.DOM.removeChild(this.el,this.parentEl)}});Code.PhotoSwipe.ZoomPanRotateClass.CssClasses={documentOverlay:"ps-zoom-pan-rotate"}})(window,Code.PhotoSwipe.Util); (function(c,a,b,d,e,g,f,h,i,j,k){h=Code.PhotoSwipe.EventClass.extend({fullSizeImages:null,documentOverlay:null,viewport:null,slider:null,captionAndToolbar:null,zoomPanRotate:null,settings:null,currentIndex:null,isBusy:null,isActive:null,currentHistoryHashValue:null,isBackEventSupported:null,slideshowTimeout:null,isSlideshowActive:null,lastShowPrevTrigger:null,backButtonClicked:null,viewportFadeInEventHandler:null,windowOrientationChangeEventHandler:null,windowScrollEventHandler:null,windowHashChangeHandler:null, keyDownEventHandler:null,viewportTouchEventHandler:null,viewportFadeOutEventHandler:null,sliderDisplayCurrentFullSizeImageEventHandler:null,toolbarClickEventHandler:null,orientationEventName:null,init:function(){this._super();this.currentIndex=0;this.backButtonClicked=this.isSlideshowActive=this.isActive=this.isBusy=!1;this.settings={getImageSource:Code.PhotoSwipe.GetImageSource,getImageCaption:Code.PhotoSwipe.GetImageCaption,getImageMetaData:Code.PhotoSwipe.GetImageMetaData,fadeInSpeed:250,fadeOutSpeed:500, slideSpeed:250,swipeThreshold:50,swipeTimeThreshold:250,loop:!0,slideshowDelay:3E3,imageScaleMethod:"fit",preventHide:!1,zIndex:1E3,backButtonHideEnabled:!0,jQueryMobile:!a.isNothing(c.jQuery)&&!a.isNothing(c.jQuery.mobile),jQueryMobileDialogHash:"&ui-state=dialog",allowUserZoom:!0,allowRotationOnUserZoom:!0,maxUserZoom:5,minUserZoom:0.5,adjustUserPanToZoom:!0,captionAndToolbarHide:!1,captionAndToolbarHideOnSwipe:!0,captionAndToolbarFlipPosition:!1,captionAndToolbarAutoHideDelay:5E3,captionAndToolbarOpacity:0.8, captionAndToolbarShowEmptyCaptions:!0};if(a.browser.isAndroid&&navigator.userAgent.indexOf("2.1"))this.isBackEventSupported=!0;if(!this.isBackEventSupported)this.isBackEventSupported="onhashchange"in c;if(this.settings.preventHide)this.settings.backButtonHideEnabled=!1;this.viewportFadeInEventHandler=this.onViewportFadeIn.bind(this);this.windowOrientationChangeEventHandler=this.onWindowOrientationChange.bind(this);this.windowScrollEventHandler=this.onWindowScroll.bind(this);this.windowHashChangeHandler= this.onWindowHashChange.bind(this);this.keyDownEventHandler=this.onKeyDown.bind(this);this.viewportTouchEventHandler=this.onViewportTouch.bind(this);this.viewportFadeOutEventHandler=this.onViewportFadeOut.bind(this);this.sliderDisplayCurrentFullSizeImageEventHandler=this.onSliderDisplayCurrentFullSizeImage.bind(this);this.toolbarClickEventHandler=this.onToolbarClick.bind(this)},setOptions:function(b){a.extend(this.settings,b);if(this.settings.preventHide)this.settings.backButtonHideEnabled=!1},setImages:function(b){if(!a.isArray)throw"thumbEls is not an array"; this.currentIndex=0;this.fullSizeImages=[];for(var c=0;c=this.fullSizeImages.length)d=0;this.currentIndex=d;a.isNothing(this.documentOverlay)?this.build():this.resetPosition();this.viewport.addEventListener(b.EventTypes.onFadeIn,this.viewportFadeInEventHandler);this.dispatchEvent(Code.PhotoSwipe.EventTypes.onBeforeShow);this.viewport.fadeIn()}},build:function(){this.documentOverlay=new d({fadeInSpeed:this.settings.fadeInSpeed, fadeOutSpeed:this.settings.fadeOutSpeed,zIndex:this.settings.zIndex});this.viewport=new g({fadeInSpeed:this.settings.fadeInSpeed,fadeOutSpeed:this.settings.fadeOutSpeed,swipeThreshold:this.settings.swipeThreshold,swipeTimeThreshold:this.settings.swipeTimeThreshold,zIndex:this.settings.zIndex+1});this.slider=new f({fadeInSpeed:this.settings.fadeInSpeed,fadeOutSpeed:this.settings.fadeOutSpeed,slideSpeed:this.settings.slideSpeed},this.viewport.el);this.captionAndToolbar=new j({opacity:this.settings.captionAndToolbarOpacity, fadeInSpeed:this.settings.fadeInSpeed,fadeOutSpeed:this.settings.fadeOutSpeed,autoHideDelay:this.settings.captionAndToolbarAutoHideDelay,flipPosition:this.settings.captionAndToolbarFlipPosition,showEmptyCaptions:this.settings.captionAndToolbarShowEmptyCaptions,hideClose:this.settings.preventHide,zIndex:this.settings.zIndex+3});this.resetPosition()},addEventListeners:function(){this.orientationEventName=a.browser.isAndroid?"resize":"onorientationchange"in c?"orientationchange":"resize";a.DOM.addEventListener(c, this.orientationEventName,this.windowOrientationChangeEventHandler);a.DOM.addEventListener(c,"scroll",this.windowScrollEventHandler);if(this.isBackEventSupported&&this.settings.backButtonHideEnabled)this.settings.jQueryMobile?c.location.hash=this.settings.jQueryMobileDialogHash:(this.currentHistoryHashValue="PhotoSwipe"+(new Date).getTime().toString(),c.location.hash=this.currentHistoryHashValue),a.DOM.addEventListener(c,"hashchange",this.windowHashChangeHandler);a.DOM.addEventListener(document,"keydown", this.keyDownEventHandler);this.viewport.addEventListener(g.EventTypes.onTouch,this.viewportTouchEventHandler);this.slider.addEventListener(f.EventTypes.onDisplayCurrentFullSizeImage,this.sliderDisplayCurrentFullSizeImageEventHandler);this.captionAndToolbar.addEventListener(i.EventTypes.onClick,this.toolbarClickEventHandler)},removeEventListeners:function(){a.DOM.removeEventListener(c,this.orientationEventName,this.windowOrientationChangeEventHandler);a.DOM.removeEventListener(c,"scroll",this.windowScrollEventHandler); this.isBackEventSupported&&this.settings.backButtonHideEnabled&&a.DOM.removeEventListener(c,"hashchange",this.windowHashChangeHandler);a.DOM.removeEventListener(document,"keydown",this.keyDownEventHandler);this.viewport.removeEventListener(g.EventTypes.onTouch,this.viewportTouchEventHandler);this.slider.removeEventListener(f.EventTypes.onDisplayCurrentFullSizeImage,this.sliderDisplayCurrentFullSizeImageEventHandler);this.captionAndToolbar.removeEventListener(i.EventTypes.onClick,this.toolbarClickEventHandler)}, onViewportFadeIn:function(){this.viewport.removeEventListener(b.EventTypes.onFadeIn,this.viewportFadeInEventHandler);this.documentOverlay.show();this.slider.fadeIn();this.addEventListeners();this.slider.setCurrentFullSizeImage(this.fullSizeImages[this.currentIndex]);this.isBusy=!1;this.dispatchEvent(Code.PhotoSwipe.EventTypes.onShow)},setSliderPreviousAndNextFullSizeImages:function(){var a,b=null,c=null;this.fullSizeImages.length>1&&(a=this.fullSizeImages.length-1,this.currentIndex===a?(this.settings.loop&& (c=this.fullSizeImages[0]),b=this.fullSizeImages[this.currentIndex-1]):this.currentIndex===0?(c=this.fullSizeImages[this.currentIndex+1],this.settings.loop&&(b=this.fullSizeImages[a])):(c=this.fullSizeImages[this.currentIndex+1],b=this.fullSizeImages[this.currentIndex-1]));this.slider.setPreviousAndNextFullSizeImages(b,c)},onKeyDown:function(a){this.stopSlideshow();a.keyCode===37?(a.preventDefault(),this.lastShowPrevTrigger=Code.PhotoSwipe.ShowPrevTriggers.keyboard,this.showPrevious()):a.keyCode=== 39?(a.preventDefault(),this.lastShowPrevTrigger=Code.PhotoSwipe.ShowPrevTriggers.keyboard,this.showNext()):a.keyCode===38||a.keyCode===40?a.preventDefault():a.keyCode===27?(a.preventDefault(),this.hide()):a.keyCode===32&&(this.settings.hideToolbar?this.hide():this.toggleCaptionAndToolbar(),a.preventDefault())},onWindowOrientationChange:function(){this.resetPosition()},onWindowScroll:function(){this.resetPosition()},onWindowHashChange:function(){if(c.location.hash!=="#"+(this.settings.jQueryMobile? this.settings.jQueryMobileDialogHash:this.currentHistoryHashValue))this.backButtonClicked=!0,this.hide()},resetPosition:function(){this.removeZoomPanRotate();this.viewport.resetPosition();this.slider.resetPosition();this.documentOverlay.resetPosition();this.captionAndToolbar.resetPosition();this.dispatchEvent(Code.PhotoSwipe.EventTypes.onResetPosition)},canUserZoom:function(){if(!this.settings.allowUserZoom)return!1;if(this.isBusy)return!1;if(a.isNothing(this.slider.currentItem.fullSizeImage))return!1; if(!this.slider.currentItem.fullSizeImage.hasLoaded)return!1;return!0},isZoomActive:function(){return!a.isNothing(this.zoomPanRotate)},onViewportTouch:function(b){switch(b.action){case g.Actions.gestureStart:if(this.canUserZoom()){this.stopSlideshow();if(!this.isZoomActive())this.zoomPanRotate=new k({maxZoom:this.settings.maxUserZoom,minZoom:this.settings.minUserZoom,adjustPanToZoom:this.settings.adjustUserPanToZoom},this.viewport.el,this.slider.currentItem.imageEl),a.DOM.resetTranslate(this.zoomPanRotate.containerEl), a.DOM.resetTranslate(this.zoomPanRotate.imageEl);this.fadeOutCaptionAndToolbar()}break;case g.Actions.gestureChange:this.isZoomActive()&&this.zoomPanRotate.zoomRotate(b.scale,this.settings.allowRotationOnUserZoom?b.rotation:0);break;case g.Actions.gestureEnd:this.isZoomActive()&&this.zoomPanRotate.setStartingScaleAndRotation(b.scale,this.settings.allowRotationOnUserZoom?b.rotation:0);break;case g.Actions.touchStart:this.stopSlideshow();this.isZoomActive()&&this.zoomPanRotate.panStart(b.point);break; case g.Actions.touchMove:this.isZoomActive()&&this.zoomPanRotate.pan(b.point);break;case g.Actions.click:this.stopSlideshow();this.settings.hideToolbar?this.hide():this.toggleCaptionAndToolbar();this.dispatchEvent(Code.PhotoSwipe.EventTypes.onViewportClick);break;case g.Actions.swipeLeft:this.stopSlideshow();this.lastShowPrevTrigger=Code.PhotoSwipe.ShowPrevTriggers.swipe;this.showNext();break;case g.Actions.swipeRight:this.stopSlideshow(),this.lastShowPrevTrigger=Code.PhotoSwipe.ShowPrevTriggers.swipe, this.showPrevious()}},onViewportFadeOut:function(){this.viewport.removeEventListener(b.EventTypes.onFadeOut,this.viewportFadeOutEventHandler);this.isActive=this.isBusy=!1;this.dispatchEvent(Code.PhotoSwipe.EventTypes.onHide);this.goBackInHistory()},hide:function(){if(!this.isBusy&&!this.settings.preventHide&&this.isActive)this.isBusy=!0,this.removeZoomPanRotate(),this.removeEventListeners(),this.documentOverlay.hide(),this.captionAndToolbar.hide(),this.slider.hide(),a.DOM.removeClass(document.body, Code.PhotoSwipe.CssClasses.activeBody),this.viewport.addEventListener(b.EventTypes.onFadeOut,this.viewportFadeOutEventHandler),this.dispatchEvent(Code.PhotoSwipe.EventTypes.onBeforeHide),this.viewport.fadeOut()},hideImmediately:function(){if(this.isActive)this.dispatchEvent(Code.PhotoSwipe.EventTypes.onBeforeHide),this.removeZoomPanRotate(),this.removeEventListeners(),this.documentOverlay.hide(),this.captionAndToolbar.hide(),this.slider.hide(),this.viewport.hide(),a.DOM.removeClass(document.body, Code.PhotoSwipe.CssClasses.activeBody),this.isActive=this.isBusy=!1,this.dispatchEvent(Code.PhotoSwipe.EventTypes.onHide),this.goBackInHistory()},goBackInHistory:function(){this.isBackEventSupported&&this.settings.backButtonHideEnabled&&(this.backButtonClicked||c.history.back())},showNext:function(){if(!this.isBusy)this.isBusy=!0,this.cleanUpZoomPanRotateForNextPrevious(),this.setCaptionAndToolbarOnShowPreviousNext(),this.slider.showNext(),this.dispatchEvent(Code.PhotoSwipe.EventTypes.onShowNext)}, showPrevious:function(){if(!this.isBusy)this.isBusy=!0,this.cleanUpZoomPanRotateForNextPrevious(),this.setCaptionAndToolbarOnShowPreviousNext(),this.wasUserZoomActive&&a.DOM.hide(this.slider.currentItem.imageEl),this.slider.showPrevious(),this.dispatchEvent(Code.PhotoSwipe.EventTypes.onShowPrevious)},cleanUpZoomPanRotateForNextPrevious:function(){a.isNothing(this.zoomPanRotate)||(this.settings.loop?a.DOM.hide(this.slider.currentItem.imageEl):this.currentIndex>0&&this.currentIndex=this.fullSizeImages.length-1?this.captionAndToolbar.setNextState(!0):this.captionAndToolbar.setNextState(!1),this.currentIndex<1?this.captionAndToolbar.setPreviousState(!0):this.captionAndToolbar.setPreviousState(!1));this.captionAndToolbar.setCaptionValue(this.fullSizeImages[this.currentIndex].caption);a=!1;switch(this.lastShowPrevTrigger){case Code.PhotoSwipe.ShowPrevTriggers.toolbar:a= !0;break;case Code.PhotoSwipe.ShowPrevTriggers.show:a=!0;break;case Code.PhotoSwipe.ShowPrevTriggers.slideshow:a=!1;break;default:a=!this.settings.captionAndToolbarHideOnSwipe}a&&(this.dispatchEvent(Code.PhotoSwipe.EventTypes.onBeforeCaptionAndToolbarShow),this.captionAndToolbar.fadeIn());this.dispatchEvent(Code.PhotoSwipe.EventTypes.onDisplayImage)}this.lastShowPrevTrigger="";this.setSliderPreviousAndNextFullSizeImages();this.isSlideshowActive&&this.fireSlideshowTimeout();this.isBusy=!1},toggleCaptionAndToolbar:function(){this.settings.captionAndToolbarHide? this.captionAndToolbar.hide():this.captionAndToolbar.isHidden?(this.dispatchEvent(Code.PhotoSwipe.EventTypes.onBeforeCaptionAndToolbarShow),this.captionAndToolbar.fadeIn()):(this.dispatchEvent(Code.PhotoSwipe.EventTypes.onBeforeCaptionAndToolbarHide),this.captionAndToolbar.fadeOut())},fadeOutCaptionAndToolbar:function(){!this.settings.captionAndToolbarHide&&!this.captionAndToolbar.isHidden&&(this.dispatchEvent(Code.PhotoSwipe.EventTypes.onBeforeCaptionAndToolbarHide),this.captionAndToolbar.fadeOut())}, onToolbarClick:function(a){this.stopSlideshow();switch(a.action){case i.Actions.previous:this.lastShowPrevTrigger=Code.PhotoSwipe.ShowPrevTriggers.toolbar;this.showPrevious();break;case i.Actions.next:this.lastShowPrevTrigger=Code.PhotoSwipe.ShowPrevTriggers.toolbar;this.showNext();break;case i.Actions.play:this.startSlideshow();break;default:this.hide()}},startSlideshow:function(){if(!this.isBusy)a.isNothing(this.slideshowTimeout)||c.clearTimeout(this.slideshowTimeout),this.removeZoomPanRotate(), this.isSlideshowActive=!0,this.fadeOutCaptionAndToolbar(),this.fireSlideshowTimeout(),this.dispatchEvent(Code.PhotoSwipe.EventTypes.onSlideshowStart)},stopSlideshow:function(){a.isNothing(this.slideshowTimeout)||c.clearTimeout(this.slideshowTimeout);this.isSlideshowActive=!1;this.dispatchEvent(Code.PhotoSwipe.EventTypes.onSlideshowStop)},fireSlideshowTimeout:function(){var a=!1;this.settings.loop?this.fullSizeImages.length>1&&(a=!0):this.currentIndex