// PhotoSwipe - http://www.photoswipe.com/
// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
// Licensed under the MIT license
// version: 1.0.19
(function(){if(!Function.prototype.bind)Function.prototype.bind=function(a){var b=[].slice,c=b.call(arguments,1),d=this,e=function(){},f=function(){return d.apply(this instanceof e?this:a||{},c.concat(b.call(arguments)))};e.prototype=d.prototype;f.prototype=new e;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),chrome:/Chrome/i.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),isCSSTransformSupported:!1,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,c=a in b;c||(b.setAttribute(a,"return;"),c=typeof b[a]=="function");return c}},setElementData:function(a,b,c){if(this.isNothing(a.UtilData))a.UtilData={};a.UtilData[b]=c},getElementData:function(a,b,c){typeof c==="undefined"&&(c=null);if(this.isNothing(a.UtilData))return c;if(this.isNothing(a.UtilData[b]))return c;return a.UtilData[b]},
removeElementData:function(a,b){delete a.UtilData[b]},coalesce:function(){var a;for(a=0;a<arguments.length;a++)if(!this.isNothing(arguments[a]))return arguments[a];return null},registerNamespace:function(){var a=arguments,b=null,c,d;for(c=0;c<a.length;++c){var e=a[c].split(".");d=e[0];eval("if (typeof "+d+' == "undefined"){'+d+" = {};} obj = "+d+";");for(d=1;d<e.length;++d)b[e[d]]=b[e[d]]||{},b=b[e[d]]}},extend:function(a,b,c){this.isNothing(c)&&(c=!0);if(a&&b&&this.isObject(b))for(var d in b)c?a[d]=
b[d]:typeof a[d]=="undefined"&&(a[d]=b[d])},swapArrayElements:function(a,b,c){var d=a[b];a[b]=a[c];a[c]=d},isObject:function(a){return typeof a=="object"},isNothing:function(a){if(typeof a==="undefined"||a===null)return!0;return!1},isFunction:function(a){return typeof a=="function"},isArray:function(a){return a&&Code.PhotoSwipe.Util.isFunction(a.pop)},isNumber:function(a){return typeof a=="number"},isString:function(a){return typeof a=="string"},trim:function(a){return a.replace(/^\s\s*/,"").replace(/\s\s*$/,
"")}};var f=document.createElement("div");if(Code.PhotoSwipe.Util.browser.webkit&&!Code.PhotoSwipe.Util.browser.chrome)Code.PhotoSwipe.Util.browser.is3dSupported=!Code.PhotoSwipe.Util.isNothing(f.style.WebkitPerspective);Code.PhotoSwipe.Util.browser.isCSSTransformSupported=!Code.PhotoSwipe.Util.isNothing(f.style.WebkitTransform)||!Code.PhotoSwipe.Util.isNothing(f.style.MozTransform)||!Code.PhotoSwipe.Util.isNothing(f.style.msTransform)||!Code.PhotoSwipe.Util.isNothing(f.style.transformProperty);Code.PhotoSwipe.Util.browser.touchSupported=
Code.PhotoSwipe.Util.browser.isEventSupported("touchstart");Code.PhotoSwipe.Util.browser.gestureSupported=Code.PhotoSwipe.Util.browser.isEventSupported("gesturestart")})(window);
(function(f,a){a.extend(a,{DOM:{resetTranslate:function(b){a.browser.webkit?a.browser.is3dSupported?a.DOM.setStyle(b,{webkitTransform:"translate3d(0px, 0px, 0px)"}):a.DOM.setStyle(b,{webkitTransform:"translate(0px, 0px)"}):a.DOM.setStyle(b,{webkitTransform:"translate(0px, 0px)",MozTransform:"translate(0px, 0px)",transform:"translate(0px, 0px)"})},createElement:function(a,c,d){var a=document.createElement(a),e;for(e in c)c.hasOwnProperty(e)&&a.setAttribute(e,c[e]);a.innerHTML=d||"";return a},appendChild:function(a,
c){c.appendChild(a)},appendText:function(b,c){var d=document.createTextNode(b);a.DOM.appendChild(d,c)},appendToBody:function(a){this.appendChild(a,document.body)},removeChild:function(a,c){c.removeChild(a)},removeChildren:function(a){if(a.hasChildNodes())for(;a.childNodes.length>=1;)a.removeChild(a.childNodes[a.childNodes.length-1])},hasAttribute:function(a,c){return a.getAttribute(c)},getAttribute:function(a,c){if(!this.hasAttribute(a,c))return"";return a.getAttribute(c)},setAttribute:function(a,
c,d){a.setAttribute(c,d)},removeAttribute:function(a,c){this.hasAttribute(a,c)&&a.removeAttribute(c)},addClass:function(b,c){var d=a.DOM.getAttribute(b,"class");RegExp("(?:^|\\s+)"+c+"(?:\\s+|$)").test(d)||(d!==""&&(d+=" "),d+=c,a.DOM.setAttribute(b,"class",d))},removeClass:function(b,c){var d=a.DOM.getAttribute(b,"class"),d=a.trim(d).split(" "),e="",f;for(f=0;f<d.length;f++)d[f]!==c&&(e!==""&&(e+=" "),e+=d[f]);e===""?a.DOM.removeAttribute(b,"class"):a.DOM.setAttribute(b,"class",e)},hasClass:function(b,
c){return RegExp("(?:^|\\s+)"+c+"(?:\\s+|$)").test(a.DOM.getAttribute(b,"class"))},setStyle:function(b,c,d){if(a.isObject(c))for(var e in c)c.hasOwnProperty(e)&&(b.style[e]=c[e]);else b.style[c]=d},getStyle:function(a,c){return f.getComputedStyle(a,"").getPropertyValue(c)},hide:function(b){a.setElementData(b,"oldDisplayValue",a.DOM.getStyle(b,"display"));a.DOM.setStyle(b,"display","none")},show:function(b){if(a.DOM.getStyle(b,"display")=="none"){var c=a.getElementData(b,"oldDisplayValue","block");
c==="none"&&(c="block");a.DOM.setStyle(b,"display",c)}},width:function(b,c){if(!a.isNothing(c))a.isNumber(c)&&(c+="px"),b.style.width=c;return this._getDimension(b,"width")},outerWidth:function(b){var c=a.DOM.width(b);c+=parseInt(a.DOM.getStyle(b,"padding-left"),10)+parseInt(a.DOM.getStyle(b,"padding-right"),10);c+=parseInt(a.DOM.getStyle(b,"margin-left"),10)+parseInt(a.DOM.getStyle(b,"margin-right"),10);c+=parseInt(a.DOM.getStyle(b,"border-left-width"),10)+parseInt(a.DOM.getStyle(b,"border-right-width"),
10);return c},height:function(b,c){if(!a.isNothing(c))a.isNumber(c)&&(c+="px"),b.style.height=c;return this._getDimension(b,"height")},_getDimension:function(a,c){var d=f.parseInt(f.getComputedStyle(a,"").getPropertyValue(c));if(isNaN(d)){var e={display:a.style.display,left:a.style.left};a.style.display="block";a.style.left="-1000000px";d=f.parseInt(f.getComputedStyle(a,"").getPropertyValue(c));a.style.display=e.display;a.style.left=e.left}return d},outerHeight:function(b){var c=a.DOM.height(b);c+=
parseInt(a.DOM.getStyle(b,"padding-top"),10)+parseInt(a.DOM.getStyle(b,"padding-bottom"),10);c+=parseInt(a.DOM.getStyle(b,"margin-top"),10)+parseInt(a.DOM.getStyle(b,"margin-bottom"),10);c+=parseInt(a.DOM.getStyle(b,"border-top-width"),10)+parseInt(a.DOM.getStyle(b,"border-bottom-width"),10);return c},documentWidth:function(){return a.DOM.width(document.documentElement)},documentHeight:function(){return a.DOM.height(document.documentElement)},documentOuterWidth:function(){return a.DOM.width(document.documentElement)},
documentOuterHeight:function(){return a.DOM.outerHeight(document.documentElement)},bodyWidth:function(){return a.DOM.width(document.body)},bodyHeight:function(){return a.DOM.height(document.body)},bodyOuterWidth:function(){return a.DOM.outerWidth(document.body)},bodyOuterHeight:function(){return a.DOM.outerHeight(document.body)},windowWidth:function(){return f.innerWidth},windowHeight:function(){return f.innerHeight},windowScrollLeft:function(){return f.pageXOffset},windowScrollTop:function(){return f.pageYOffset}}})})(window,
Code.PhotoSwipe.Util);
(function(f,a){a.extend(a,{Events:{add:function(a,c,d){this._checkHandlersProperty(a);typeof a.__eventHandlers[c]==="undefined"&&(a.__eventHandlers[c]=[]);a.__eventHandlers[c].push(d);this._isBrowserObject(a)&&a.addEventListener(c,d,!1)},remove:function(b,c,d){this._checkHandlersProperty(b);if(b.__eventHandlers[c]instanceof Array){var e,f=b.__eventHandlers[c];if(a.isNothing(d)){if(this._isBrowserObject(b))for(e=0;e<f.length;e++)b.removeEventListener(c,f[e],!1);b.__eventHandlers[c]=[]}else{e=0;for(var g=
f.length;e<g;e++)if(f[e]===d){f.splice(e,1);break}this._isBrowserObject(b)&&b.removeEventListener(c,d,!1)}}},fire:function(a,c){var d,e,h=Array.prototype.slice.call(arguments).splice(2);if(this._isBrowserObject(a)){if(typeof c!=="string")throw"type must be a string for DOM elements";e=this._NATIVE_EVENTS[c];d=document.createEvent(e?"HTMLEvents":"UIEvents");d[e?"initEvent":"initUIEvent"](c,!0,!0,f,1);if(h.length<1){a.dispatchEvent(d);return}}this._checkHandlersProperty(a);d=typeof c=="string"?{type:c}:
c;if(!d.target)d.target=a;if(!d.type)throw Error("Event object missing 'type' property.");if(a.__eventHandlers[d.type]instanceof Array){e=a.__eventHandlers[d.type];h.unshift(d);d=0;for(var g=e.length;d<g;d++)e[d].apply(a,h)}},getMousePosition:function(a){var c={x:0,y:0};if(a.pageX)c.x=a.pageX;else if(a.clientX)c.x=a.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft);if(a.pageY)c.y=a.pageY;else if(a.clientY)c.y=a.clientY+(document.documentElement.scrollTop?
document.documentElement.scrollTop:document.body.scrollTop);return c},getTouchEvent:function(a){return a},domReady:function(a){document.addEventListener("DOMContentLoaded",a,!1)},_checkHandlersProperty:function(b){a.isNothing(b.__eventHandlers)&&a.extend(b,{__eventHandlers:{}})},_isBrowserObject:function(a){if(a===f||a===f.document)return!0;return this._isElement(a)||this._isNode(a)},_isElement:function(a){return typeof HTMLElement==="object"?a instanceof HTMLElement:typeof a==="object"&&a.nodeType===
1&&typeof a.nodeName==="string"},_isNode:function(a){return typeof Node==="object"?a instanceof Node:typeof a==="object"&&typeof a.nodeType==="number"&&typeof a.nodeName==="string"},_NATIVE_EVENTS:{click:1,dblclick:1,mouseup:1,mousedown:1,contextmenu:1,mousewheel:1,DOMMouseScroll:1,mouseover:1,mouseout:1,mousemove:1,selectstart:1,selectend:1,keydown:1,keypress:1,keyup:1,orientationchange:1,touchstart:1,touchmove:1,touchend:1,touchcancel:1,gesturestart:1,gesturechange:1,gestureend:1,focus:1,blur:1,
change:1,reset:1,select:1,submit:1,load:1,unload:1,beforeunload:1,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1}}})})(window,Code.PhotoSwipe.Util);
(function(f,a){a.extend(a,{Animation:{_applyTransitionDelay:50,_setTransition:function(b,c,d,e,h,g){var i=a.Animation._getTransitionPrefix(),c=a.coalesce(c,""),d=a.coalesce(d,""),j;a.isFunction(e)?(j=e,h=e=""):(j=g,e=a.coalesce(e,""),h=a.coalesce(h,""));g={};g[i+"Property"]=c;g[i+"Duration"]=d;g[i+"TimingFunction"]=e;g[i+"Delay"]=h;a.DOM.setStyle(b,g);a.isFunction(j)&&f.setTimeout(function(){j(b)},a.Animation._applyTransitionDelay)},_setTransitionEndEventHandler:function(b){a.setElementData(b,"transitionEndEvent",
function(b){var d=b.target;a.Events.remove(d,a.Animation._getTransitionEndEventLabel(),a.getElementData(d,"transitionEndEvent"));a.removeElementData(d,"transitionEndEvent");var e=a.getElementData(d,"transitionEndCallback");a.removeElementData(d,"transitionEndCallback");a.Animation._removeTransitions(d);a.isFunction(e)&&f.setTimeout(function(){e(b)},a.Animation._applyTransitionDelay)});a.Events.add(b,a.Animation._getTransitionEndEventLabel(),a.getElementData(b,"transitionEndEvent"))},_removeTransitions:function(b){var c=
a.Animation._getTransitionPrefix(),d={};d[c+"Property"]="";d[c+"Duration"]="";d[c+"TimingFunction"]="";d[c+"Delay"]="";a.DOM.setStyle(b,d)},_getTransitionEndEventLabel:function(){return document.documentElement.style.WebkitTransition!==void 0?"webkitTransitionEnd":"transitionend"},_getTransitionPrefix:function(){return document.documentElement.style.WebkitTransition!==void 0?"webkitTransition":document.documentElement.style.MozTransition!==void 0?"MozTransition":"transition"},stopFade:function(b){var c=
a.getElementData(b,"transitionEndEvent");a.isNothing(c)||(a.Events.remove(b,a.Animation._getTransitionEndEventLabel(),a.getElementData(b,"transitionEndEvent")),c=f.getComputedStyle(b,"").getPropertyValue("opacity"),a.Animation._removeTransitions(b),a.DOM.setStyle(b,"opacity",c))},fadeIn:function(b,c,d,e){c=a.coalesce(c,1);d=a.coalesce(d,500);a.setElementData(b,"transitionEndCallback",e);a.Animation._setTransition(b,"opacity",d+"ms",function(b){a.Animation._setTransitionEndEventHandler(b);a.DOM.setStyle(b,
"opacity",c)})},fadeOut:function(b,c,d){a.isNothing(c)&&(c=500);a.setElementData(b,"transitionEndCallback",d);a.Animation._setTransition(b,"opacity",c+"ms",function(b){a.Animation._setTransitionEndEventHandler(b);a.DOM.setStyle(b,"opacity",0)})},slideBy:function(b,c,d,e,f){a.isNothing(e)&&(e=500);a.setElementData(b,"transitionEndCallback",a.Animation._onSlideByEnd);a.setElementData(b,"slideByCallback",f);a.setElementData(b,"slideByXPos",c);a.setElementData(b,"slideByYPos",d);a.Animation._setTransition(b,
"all",e+"ms","ease-in",0,function(b){a.Animation._setTransitionEndEventHandler(b);var c=a.getElementData(b,"slideByXPos"),d=a.getElementData(b,"slideByYPos");a.removeElementData(b,"slideByXPos");a.removeElementData(b,"slideByYPos");a.browser.webkit?a.browser.is3dSupported?a.DOM.setStyle(b,{webkitTransform:"translate3d("+c+"px, "+d+"px, 0)"}):a.DOM.setStyle(b,{webkitTransform:"translate("+c+"px, "+d+"px)"}):a.DOM.setStyle(b,{webkitTransform:"translate("+c+"px, "+d+"px)",MozTransform:"translate("+c+
"px, "+d+"px)",transform:"translate("+c+"px, "+d+"px)"})})},_onSlideByEnd:function(b){var c=b.target,d=a.getElementData(c,"slideByCallback"),e=a.coalesce(c.style.webkitTransform,c.style.MozTransform,c.style.transform).match(/\((.*?)\)/)[1].split(", "),h=f.parseInt(e[0]),e=f.parseInt(e[1]),g=f.parseInt(a.DOM.getStyle(c,"left")),i=f.parseInt(a.DOM.getStyle(c,"top"));a.DOM.setStyle(c,{webkitTransform:"",MozTransform:"",transform:"",left:g+h+"px",top:i+e+"px"});a.removeElementData(c,"slideByCallback");
a.removeElementData(c,"slideByXPos");a.removeElementData(c,"slideByYPos");a.isFunction(d)&&d(b)}}})})(window,Code.PhotoSwipe.Util);
(function(f,a){Code.PhotoSwipe.ElementClass=SimpleClass.extend({el:null,settings:null,isHidden:null,fadeInHandler:null,fadeOutHandler:null,init:function(b){this.settings={opacity:1,fadeInSpeed:250,fadeOutSpeed:500};a.extend(this.settings,b);this.fadeInHandler=this.postFadeIn.bind(this);this.fadeOutHandler=this.postFadeOut.bind(this);this.isHidden=!0},resetPosition:function(){},show:function(){this.stopFade();a.DOM.setStyle(this.el,"opacity",this.settings.opacity);a.DOM.show(this.el);this.postShow()},
postShow:function(){this.isHidden=!1;this.addEventHandlers();a.Events.fire(this,Code.PhotoSwipe.ElementClass.EventTypes.onShow)},fadeIn:function(){a.DOM.setStyle(this.el,"opacity",0);this.fadeInFromCurrentOpacity()},fadeInFromCurrentOpacity:function(){this.stopFade();this.isHidden=!1;a.DOM.show(this.el);a.Animation.fadeIn(this.el,this.settings.opacity,this.settings.fadeInSpeed,this.fadeInHandler)},postFadeIn:function(){this.isHidden||(this.addEventHandlers(),a.Events.fire(this,Code.PhotoSwipe.ElementClass.EventTypes.onFadeIn))},
hide:function(){this.stopFade();a.DOM.hide(this.el);this.postHide()},postHide:function(){this.isHidden=!0;this.removeEventHandlers();a.Events.fire(this,Code.PhotoSwipe.ElementClass.EventTypes.onHide)},fadeOut:function(){this.stopFade();this.isHidden=!0;a.Animation.fadeOut(this.el,this.settings.fadeOutSpeed,this.fadeOutHandler)},postFadeOut:function(){this.isHidden&&(a.DOM.hide(this.el),this.removeEventHandlers(),a.Events.fire(this,Code.PhotoSwipe.ElementClass.EventTypes.onFadeOut))},stopFade:function(){a.Animation.stopFade(this.el)},
addEventHandlers:function(){},removeEventHandlers:function(){}});Code.PhotoSwipe.ElementClass.EventTypes={onShow:"PhotoSwipeElementClassOnShow",onHide:"PhotoSwipeElementClassOnHide",onClick:"PhotoSwipeElementClassOnClick",onFadeIn:"PhotoSwipeElementClassOnFadeIn",onFadeOut:"PhotoSwipeElementClassOnFadeOut"}})(window,Code.PhotoSwipe.Util);
(function(f,a){Code.PhotoSwipe.FullSizeImageClass=SimpleClass.extend({el:null,index:null,naturalWidth:null,naturalHeight:null,src:null,caption:null,metaData:null,scaleMethod:null,isLandscape:null,isLoading:null,hasLoaded:null,loadEventHandler:null,init:function(b,c,d,e,f){this.index=b;this.naturalHeight=this.naturalWidth=0;this.src=d;this.caption=e;this.metaData=a.coalesce(f,{});this.hasLoaded=this.isLoading=this.isLandscape=!1;this.scaleMethod=c;this.loadEventHandler=this.onLoad.bind(this)},load:function(){this.isLoading=
!0;this.el=new Image;a.DOM.addClass(this.el,"ps-full-size-image");this.el.onload=this.loadEventHandler;this.el.src=this.src},onLoad:function(){this.naturalWidth=a.coalesce(this.el.naturalWidth,this.el.width);this.naturalHeight=a.coalesce(this.el.naturalHeight,this.el.height);this.isLandscape=this.naturalWidth>this.naturalHeight;this.isLoading=!1;this.hasLoaded=!0;a.Events.fire(this,Code.PhotoSwipe.FullSizeImageClass.EventTypes.onLoad)}});Code.PhotoSwipe.FullSizeImageClass.EventTypes={onLoad:"PhotoSwipeFullSizeImageClassOnLoader"}})(window,
Code.PhotoSwipe.Util);
(function(f,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.bodyOuterWidth());var b=a.DOM.bodyOuterHeight();
if(a.DOM.windowHeight>b)b=a.DOM.windowHeight;a.DOM.height(this.el,b)}});Code.PhotoSwipe.DocumentOverlayClass.CssClasses={documentOverlay:"ps-document-overlay"}})(window,Code.PhotoSwipe.Util);
(function(f,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,mouseMoveHandler:null,mouseUpHandler:null,doubleClickTimeout:null,init:function(b){this.settings={swipeThreshold:500,swipeTimeThreshold:250,zIndex:1E3,doubleClickSpeed:300};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.mouseMoveHandler=this.onMouseMove.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.bodyOuterWidth());a.DOM.height(this.el,a.DOM.windowHeight())},addEventHandlers:function(){a.browser.touchSupported&&
(a.Events.add(this.el,"touchstart",this.touchStartHandler),a.Events.add(this.el,"touchmove",this.touchMoveHandler),a.Events.add(this.el,"touchend",this.touchEndHandler));a.browser.gestureSupported&&(a.Events.add(this.el,"gesturestart",this.gestureStartHandler),a.Events.add(this.el,"gesturechange",this.gestureChangeHandler),a.Events.add(this.el,"gestureend",this.gestureEndHandler));a.Events.add(this.el,"mousedown",this.mouseDownHandler);a.Events.add(this.el,"mouseup",this.mouseUpHandler)},removeEventHandlers:function(){a.browser.touchSupported&&
(a.Events.remove(this.el,"touchstart",this.touchStartHandler),a.Events.remove(this.el,"touchmove",this.touchMoveHandler),a.Events.remove(this.el,"touchend",this.touchEndHandler));a.browser.gestureSupported&&(a.Events.remove(this.el,"gesturestart",this.gestureStartHandler),a.Events.remove(this.el,"gesturechange",this.gestureChangeHandler),a.Events.remove(this.el,"gestureend",this.gestureEndHandler));a.Events.remove(this.el,"mousedown",this.mouseDownHandler);a.Events.remove(this.el,"mouseup",this.mouseUpHandler)},
getTouchPoint:function(a){return{x:a[0].pageX,y:a[0].pageY}},onGestureStart:function(b){b.preventDefault();b=a.Events.getTouchEvent(b);a.Events.fire(this,{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.Events.getTouchEvent(b);a.Events.fire(this,{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.Events.getTouchEvent(b);a.Events.fire(this,{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.Events.getTouchEvent(b).touches;b.length>1?this.isGesture=!0:(a.Events.fire(this,{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.Events.getTouchEvent(b).touches,a.Events.fire(this,{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.Events.getTouchEvent(b),b=this.getTouchPoint(!a.isNothing(b.changedTouches)?
b.changedTouches:b.touches),a.Events.fire(this,{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();a.Events.add(this.el,"mousemove",this.mouseMoveHandler);a.Events.fire(this,{type:Code.PhotoSwipe.ViewportClass.EventTypes.onTouch,target:this,action:Code.PhotoSwipe.ViewportClass.Actions.touchStart,point:a.Events.getMousePosition(b)});
this.touchStartTime=new Date;this.isGesture=!1;this.touchStartPoint=a.Events.getMousePosition(b)},onMouseMove:function(b){b.preventDefault();a.Events.fire(this,{type:Code.PhotoSwipe.ViewportClass.EventTypes.onTouch,target:this,action:Code.PhotoSwipe.ViewportClass.Actions.touchMove,point:a.Events.getMousePosition(b)})},onMouseUp:function(b){b.preventDefault();a.Events.remove(this.el,"mousemove",this.mouseMoveHandler);this.fireTouchEvent(this.touchStartPoint,a.Events.getMousePosition(b))},fireTouchEvent:function(b,
c){var d;d=c.x-b.x;if(Math.abs(d)>=this.settings.swipeThreshold){if(new Date-this.touchStartTime>this.settings.swipeTimeThreshold)return;d=d<0?Code.PhotoSwipe.ViewportClass.Actions.swipeLeft:Code.PhotoSwipe.ViewportClass.Actions.swipeRight}else if(a.isNothing(this.doubleClickTimeout)){var e=this;this.doubleClickTimeout=f.setTimeout(function(){e.doubleClickTimeout=null;a.Events.fire(e,{type:Code.PhotoSwipe.ViewportClass.EventTypes.onTouch,target:e,action:Code.PhotoSwipe.ViewportClass.Actions.click,
point:c})},this.settings.doubleClickSpeed);return}else f.clearTimeout(this.doubleClickTimeout),this.doubleClickTimeout=null,d=Code.PhotoSwipe.ViewportClass.Actions.doubleClick;a.isNothing(d)||a.Events.fire(this,{type:Code.PhotoSwipe.ViewportClass.EventTypes.onTouch,target:this,action:d,point:c})}});Code.PhotoSwipe.ViewportClass.CssClasses={viewport:"ps-viewport"};Code.PhotoSwipe.ViewportClass.Actions={click:"click",doubleClick:"doubleClick",swipeLeft:"swipeLeft",swipeRight:"swipeRight",touchStart:"touchStart",
touchMove:"touchMove",touchEnd:"touchEnd",gestureStart:"gestureStart",gestureChange:"gestureChange",gestureEnd:"gestureEnd"};Code.PhotoSwipe.ViewportClass.EventTypes={onTouch:"PhotoSwipeViewportClassOnTouch"}})(window,Code.PhotoSwipe.Util);
(function(f,a,b){Code.PhotoSwipe.SliderItemClass=SimpleClass.extend({el:null,imageContainerEl:null,imageEl:null,parentEl:null,fullSizeImage:null,fullSizeImageLoadEventHandler:null,savedImageWidth:null,savedImageHeight:null,init:function(b){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,
d,e){a.DOM.width(this.el,b);a.DOM.height(this.el,d);a.DOM.setStyle(this.el,"left",e+"px");a.DOM.width(this.imageContainerEl,b);a.DOM.height(this.imageContainerEl,d);this.resetImagePosition()},resetImagePosition:function(){if(!a.isNothing(this.fullSizeImage)){a.DOM.getAttribute(this.imageEl,"src");var b,d,e,f;f=a.DOM.width(this.el);var g=a.DOM.height(this.el);this.fullSizeImage.scaleMethod==="fitNoUpscale"?(d=this.fullSizeImage.naturalWidth,e=this.fullSizeImage.naturalHeight,d>f&&(b=f/d,d=Math.round(d*
b),e=Math.round(e*b)),e>g&&(b=g/e,e=Math.round(e*b),d=Math.round(d*b))):(b=this.fullSizeImage.isLandscape?f/this.fullSizeImage.naturalWidth:g/this.fullSizeImage.naturalHeight,d=Math.round(this.fullSizeImage.naturalWidth*b),e=Math.round(this.fullSizeImage.naturalHeight*b),this.fullSizeImage.scaleMethod==="zoom"?(b=1,e<g?b=g/e:d<f&&(b=f/d),b!==1&&(d=Math.round(d*b),e=Math.round(e*b))):this.fullSizeImage.scaleMethod==="fit"&&(b=1,d>f?b=f/d:e>g&&(b=g/e),b!==1&&(d=Math.round(d*b),e=Math.round(e*b))));
b=(g-e)/2+"px";f=(f-d)/2+"px";a.DOM.width(this.imageEl,d);a.DOM.height(this.imageEl,e);a.DOM.setStyle(this.imageEl,{top:b,left:f});a.DOM.show(this.imageEl);this.savedImageWidth=d;this.savedImageHeight=e}},setFullSizeImage:function(c){this.fullSizeImage=c;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(),a.Events.fire(this,Code.PhotoSwipe.SliderItemClass.EventTypes.onFullSizeImageDisplay)):(a.DOM.addClass(this.el,Code.PhotoSwipe.SliderItemClass.CssClasses.loading),this.hideImage(),this.fullSizeImage.isLoading||(a.Events.add(this.fullSizeImage,b.EventTypes.onLoad,this.fullSizeImageLoadEventHandler),this.fullSizeImage.load()))},onFullSizeImageLoad:function(c){a.Events.remove(c.target,
b.EventTypes.onLoad,this.fullSizeImageLoadEventHandler);a.isNothing(this.fullSizeImage)||c.target.index!==this.fullSizeImage.index?a.Events.fire(this,{type:Code.PhotoSwipe.SliderItemClass.EventTypes.onFullSizeImageLoadAnomaly,target:this,fullSizeImage:c.target}):this.setFullSizeImage(c.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:"PhotoSwipeSliderItemClassOnFullSizeImageDisplay",onFullSizeImageLoadAnomaly:"PhotoSwipeSliderItemClassOnFullSizeImageLoadAnomaly"}})(window,Code.PhotoSwipe.Util,Code.PhotoSwipe.FullSizeImageClass);
(function(f,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(c,d){this.settings={slideSpeed:250};
a.extend(this.settings,c);this._super(this.settings);this.parentEl=d;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,d);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]},addEventHandlers:function(){for(var c=0;c<this.items.length;c++)a.Events.add(this.items[c],b.EventTypes.onFullSizeImageLoadAnomaly,this.sliderFullSizeImageLoadAnomalyEventHandler)},removeEventHandlers:function(){for(var c=
0;c<this.items.length;c++)a.Events.remove(this.items[c],b.EventTypes.onFullSizeImageLoadAnomaly,this.sliderFullSizeImageLoadAnomalyEventHandler)},resetPosition:function(){a.DOM.show(this.currentItem.imageContainerEl);this.parentElWidth=a.DOM.width(this.parentEl);this.parentElHeight=a.DOM.height(this.parentEl);a.DOM.width(this.el,this.parentElWidth*3);a.DOM.height(this.el,this.parentElHeight);this.previousItem.resetPosition(this.parentElWidth,this.parentElHeight,0);this.currentItem.resetPosition(this.parentElWidth,
this.parentElHeight,this.parentElWidth);this.nextItem.resetPosition(this.parentElWidth,this.parentElHeight,this.parentElWidth*2);this.center()},center:function(){a.DOM.resetTranslate(this.el);a.DOM.setStyle(this.el,{left:this.parentElWidth*-1+"px"})},setCurrentFullSizeImage:function(a){this.currentItem.setFullSizeImage(a);this.dispatchDisplayCurrentFullSizeImage()},setPreviousAndNextFullSizeImages:function(a,b){this.nextItem.setFullSizeImage(b);this.previousItem.setFullSizeImage(a)},showNext:function(){this.lastShowAction=
Code.PhotoSwipe.SliderClass.ShowActionTypes.next;this.hasBounced=!1;a.isNothing(this.nextItem.fullSizeImage)?this.bounce():a.Animation.slideBy(this.el,this.parentElWidth*-1,0,this.settings.slideSpeed,this.showNextEndEventHandler)},showPrevious:function(){this.lastShowAction=Code.PhotoSwipe.SliderClass.ShowActionTypes.previous;this.hasBounced=!1;a.isNothing(this.previousItem.fullSizeImage)?this.bounce():a.Animation.slideBy(this.el,this.parentElWidth,0,this.settings.slideSpeed,this.showPreviousEndEventHandler)},
bounce:function(){a.DOM.show(this.currentItem.imageContainerEl);this.hasBounced=!0;a.browser.chrome?this.dispatchDisplayCurrentFullSizeImage():(this.bounceSlideBy=this.parentElWidth/2,a.Animation.slideBy(this.el,this.lastShowAction===Code.PhotoSwipe.SliderClass.ShowActionTypes.previous?this.bounceSlideBy:this.bounceSlideBy*-1,0,this.settings.slideSpeed,this.bounceStepOneEventHandler))},onBounceStepOne:function(){var b=this;f.setTimeout(function(){a.Animation.slideBy(b.el,b.lastShowAction===Code.PhotoSwipe.SliderClass.ShowActionTypes.previous?
b.bounceSlideBy*-1:b.bounceSlideBy,0,b.settings.slideSpeed,b.bounceStepTwoEventHandler)},25)},onBounceStepTwo:function(){this.dispatchDisplayCurrentFullSizeImage()},onShowNextEnd:function(){a.DOM.show(this.currentItem.imageContainerEl);a.swapArrayElements(this.items,1,2);this.currentItem=this.items[1];this.nextItem=this.items[2];var b=this.parentElWidth;a.DOM.setStyle(this.currentItem.el,"left",b+"px");a.DOM.setStyle(this.nextItem.el,"left",b*2+"px");this.center();this.dispatchDisplayCurrentFullSizeImage()},
onShowPreviousEnd:function(){a.DOM.show(this.currentItem.imageContainerEl);a.swapArrayElements(this.items,1,0);this.currentItem=this.items[1];this.previousItem=this.items[0];a.DOM.setStyle(this.currentItem.el,"left",this.parentElWidth+"px");a.DOM.setStyle(this.previousItem.el,"left","0px");this.center();this.dispatchDisplayCurrentFullSizeImage()},onSliderFullSizeImageLoadAnomaly:function(b){b=b.fullSizeImage;!a.isNothing(this.currentItem.fullSizeImage)&&this.currentItem.fullSizeImage.index===b.index?
(this.currentItem.setFullSizeImage(b),this.dispatchDisplayCurrentFullSizeImage()):!a.isNothing(this.nextItem.fullSizeImage)&&this.nextItem.fullSizeImage.index===b.index?this.nextItem.setFullSizeImage(b):a.isNothing(this.previousItem.fullSizeImage)||this.previousItem.fullSizeImage.index===b.index&&this.previousItem.setFullSizeImage(b)},dispatchDisplayCurrentFullSizeImage:function(){a.Events.fire(this,{type:Code.PhotoSwipe.SliderClass.EventTypes.onDisplayCurrentFullSizeImage,target:this,fullSizeImage:this.currentItem.fullSizeImage})}});
Code.PhotoSwipe.SliderClass.CssClasses={slider:"ps-slider"};Code.PhotoSwipe.SliderClass.ShowActionTypes={next:"next",previous:"previous"};Code.PhotoSwipe.SliderClass.EventTypes={onDisplayCurrentFullSizeImage:"PhotoSwipeSliderClassOnDisplayCurrentFullSizeImage"}})(window,Code.PhotoSwipe.Util,Code.PhotoSwipe.SliderItemClass);
(function(f,a){Code.PhotoSwipe.CaptionClass=Code.PhotoSwipe.ElementClass.extend({contentEl:null,touchMoveHandler:null,captionValue:null,init:function(b){this.settings={position:"top",zIndex:1E3};a.extend(this.settings,b);this._super(this.settings);this.captionValue="";this.touchMoveHandler=this.onTouchMove.bind(this);b=Code.PhotoSwipe.CaptionClass.CssClasses.caption;this.settings.position==="bottom"&&(b=b+" "+Code.PhotoSwipe.CaptionClass.CssClasses.bottom);this.el=a.DOM.createElement("div",{"class":b},
"");a.DOM.setStyle(this.el,{left:0,position:"absolute",overflow:"hidden",zIndex:this.settings.zIndex,opacity:0});a.DOM.hide(this.el);a.DOM.appendToBody(this.el);this.contentEl=a.DOM.createElement("div",{"class":Code.PhotoSwipe.CaptionClass.CssClasses.content},"");a.DOM.appendChild(this.contentEl,this.el)},addEventHandlers:function(){a.browser.touchSupported&&a.Events.add(this.el,"touchmove",this.touchMoveHandler)},removeEventHandlers:function(){a.browser.touchSupported&&a.Events.remove(this.el,"touchmove",
this.touchMoveHandler)},onTouchMove:function(a){a.preventDefault()},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.bodyOuterWidth())},setCaptionValue:function(b){a.DOM.removeChildren(this.contentEl);b=a.coalesce(b,"\u00a0");a.isObject(b)?a.DOM.appendChild(b,this.contentEl):(b===""&&(b="\u00a0"),a.DOM.appendText(b,this.contentEl));
this.captionValue=b==="\u00a0"?"":b}});Code.PhotoSwipe.CaptionClass.CssClasses={caption:"ps-caption",bottom:"ps-caption-bottom",content:"ps-caption-content"}})(window,Code.PhotoSwipe.Util);
(function(f,a){Code.PhotoSwipe.ToolbarClass=Code.PhotoSwipe.ElementClass.extend({closeEl:null,previousEl:null,nextEl:null,playEl:null,clickHandler:null,touchStartHandler:null,touchMoveHandler:null,touched:null,isNextActive:null,isPreviousActive:null,init:function(b){this.settings={position:"bottom",hideClose:!1,zIndex:1E3};a.extend(this.settings,b);this._super(this.settings);this.isPreviousActive=this.isNextActive=!0;this.touched=!1;this.clickHandler=this.onClick.bind(this);if(a.browser.touchSupported)this.touchMoveHandler=
this.onTouchMove.bind(this),this.touchStartHandler=this.onTouchStart.bind(this);b=Code.PhotoSwipe.ToolbarClass.CssClasses.caption;this.settings.position==="top"&&(b=b+" "+Code.PhotoSwipe.ToolbarClass.CssClasses.top);this.el=a.DOM.createElement("div",{"class":b},"");a.DOM.setStyle(this.el,{left:0,position:"absolute",overflow:"hidden",zIndex:this.settings.zIndex,display:"table",opacity:0});a.DOM.hide(this.el);a.DOM.appendToBody(this.el);this.closeEl=a.DOM.createElement("div",{"class":Code.PhotoSwipe.ToolbarClass.CssClasses.close},
'<div class="'+Code.PhotoSwipe.ToolbarClass.CssClasses.content+'"></div>');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},'<div class="'+Code.PhotoSwipe.ToolbarClass.CssClasses.content+'"></div>');a.DOM.appendChild(this.playEl,this.el);this.previousEl=a.DOM.createElement("div",{"class":Code.PhotoSwipe.ToolbarClass.CssClasses.previous},'<div class="'+Code.PhotoSwipe.ToolbarClass.CssClasses.content+
'"></div>');a.DOM.appendChild(this.previousEl,this.el);this.nextEl=a.DOM.createElement("div",{"class":Code.PhotoSwipe.ToolbarClass.CssClasses.next},'<div class="'+Code.PhotoSwipe.ToolbarClass.CssClasses.content+'"></div>');a.DOM.appendChild(this.nextEl,this.el)},postFadeIn:function(){this.isHidden||(a.DOM.setStyle(this.el,{display:"table"}),this._super(this.settings))},addEventHandlers:function(){a.browser.touchSupported&&(a.browser.isBlackberry||a.Events.add(this.el,"touchstart",this.touchStartHandler),
a.Events.add(this.el,"touchmove",this.touchMoveHandler));a.Events.add(this.el,"click",this.clickHandler)},removeEventHandlers:function(){a.browser.touchSupported&&(a.browser.isBlackberry||a.Events.remove(this.el,"touchstart",this.touchStartHandler),a.Events.remove(this.el,"touchmove",this.touchMoveHandler));a.Events.remove(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 c;switch(b.target.parentNode){case this.previousEl:if(this.isPreviousActive)c=Code.PhotoSwipe.ToolbarClass.Actions.previous;break;case this.nextEl:if(this.isNextActive)c=Code.PhotoSwipe.ToolbarClass.Actions.next;break;case this.playEl:c=Code.PhotoSwipe.ToolbarClass.Actions.play;break;case this.closeEl:c=Code.PhotoSwipe.ToolbarClass.Actions.close}a.isNothing(c)||a.Events.fire(this,{type:Code.PhotoSwipe.ToolbarClass.EventTypes.onClick,target:this,action:c})},
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.bodyOuterWidth())},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:"PhotoSwipeToolbarClassOnClick"}})(window,Code.PhotoSwipe.Util);
(function(f,a,b,c){Code.PhotoSwipe.CaptionToolbarClass=SimpleClass.extend({toolbar:null,caption:null,isHidden:null,hasAddedEventHandlers:null,toolbarClickEventHandler:null,init:function(d){this.settings={opacity:0.8,fadeInSpeed:250,fadeOutSpeed:500,autoHideDelay:5E3,flipPosition:!1,showEmptyCaptions:!0,hideClose:!1,zIndex:1E3};a.extend(this.settings,d);this.isHidden=!0;this.hasAddedEventHandlers=!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 c({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()},addEventHandlers:function(){if(!this.hasAddedEventHandlers)a.Events.add(this.toolbar,
c.EventTypes.onClick,this.toolbarClickEventHandler),this.hasAddedEventHandlers=!0},removeEventHandlers:function(){a.Events.remove(this.toolbar,c.EventTypes.onClick,this.toolbarClickEventHandler);this.hasAddedEventHandlers=!1},fadeIn:function(){this.stopAutoHideTimeout();this.stopFade();this.isHidden?(this.isHidden=!1,this.fadeInCaption(),this.toolbar.fadeIn(),f.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.addEventHandlers();this.resetAutoHideTimeout();a.Events.fire(this,{type:Code.PhotoSwipe.CaptionToolbarClass.EventTypes.onShow,target:this})},fadeOut:function(){this.stopAutoHideTimeout();this.stopFade();this.isHidden=
!0;this.caption.fadeOut();this.toolbar.fadeOut();f.setTimeout(this.onFadeOut.bind(this),this.settings.fadeOutSpeed)},onFadeOut:function(){a.Events.fire(this,{type:Code.PhotoSwipe.CaptionToolbarClass.EventTypes.onHide,target:this})},stopFade:function(){this.caption.stopFade();this.toolbar.stopFade()},hide:function(){this.stopAutoHideTimeout();this.stopFade();this.isHidden=!0;this.removeEventHandlers();this.caption.hide();this.toolbar.hide();a.Events.fire(this,{type:Code.PhotoSwipe.CaptionToolbarClass.EventTypes.onHide,
target:this})},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=f.setTimeout(this.fadeOut.bind(this),this.settings.autoHideDelay)},stopAutoHideTimeout:function(){a.isNothing(this.autoHideTimeout)||f.clearTimeout(this.autoHideTimeout)},onToolbarClick:function(b){a.Events.fire(this,
{type:Code.PhotoSwipe.ToolbarClass.EventTypes.onClick,target:this,action:b.action})},setNextState:function(a){this.toolbar.setNextState(a)},setPreviousState:function(a){this.toolbar.setPreviousState(a)}});Code.PhotoSwipe.CaptionToolbarClass.EventTypes={onShow:"PhotoSwipeCaptionToolbarClassOnShow",onHide:"PhotoSwipeCaptionToolbarClassOnHide"}})(window,Code.PhotoSwipe.Util,Code.PhotoSwipe.CaptionClass,Code.PhotoSwipe.ToolbarClass);
(function(f,a){Code.PhotoSwipe.ZoomPanRotateClass=Code.PhotoSwipe.ElementClass.extend({containerEl:null,imageEl:null,parentEl:null,transformSettings:null,panStartingPoint:null,init:function(b,c,d){this.settings={maxZoom:5,minZoom:0.5,adjustPanToZoom:!0};a.extend(this.settings,b);this._super(b);this.parentEl=c;this.imageEl=d.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",zIndex:1});a.DOM.width(this.el,a.DOM.bodyOuterWidth());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);a.browser.isiOS&&(a.DOM.resetTranslate(this.containerEl),a.DOM.resetTranslate(this.imageEl))},setStartingTranslateFromCurrentTranform:function(){var b=a.coalesce(this.containerEl.style.webkitTransform,this.containerEl.style.MozTransform,this.containerEl.style.transform);if(!a.isNothing(b)&&(b=b.match(/translate\((.*?)\)/),!a.isNothing(b)))b=b[1].split(", "),this.transformSettings.startingTranslateX=f.parseInt(b[0],10),this.transformSettings.startingTranslateY=
f.parseInt(b[1],10)},getScale:function(a){a*=this.transformSettings.startingScale;if(this.settings.minZoom!==0&&a<this.settings.minZoom)a=this.settings.minZoom;else if(this.settings.maxZoom!==0&&a>this.settings.maxZoom)a=this.settings.maxZoom;return a},setStartingScaleAndRotation:function(a,c){this.transformSettings.startingScale=this.getScale(a);this.transformSettings.startingRotation=(this.transformSettings.startingRotation+c)%360},zoomRotate:function(a,c){this.transformSettings.scale=this.getScale(a);
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()},zoomAndPanToPoint:function(b,c){this.panStart({x:a.DOM.bodyWidth()/2,y:a.DOM.windowHeight()/2});var d=c.x-this.panStartingPoint.x,e=c.y-this.panStartingPoint.y,e=e/this.transformSettings.scale?e/this.transformSettings.scale:e;this.transformSettings.translateX=(this.transformSettings.startingTranslateX+(this.settings.adjustPanToZoom?d/this.transformSettings.scale:d))*-1;this.transformSettings.translateY=(this.transformSettings.startingTranslateY+
e)*-1;this.setStartingScaleAndRotation(b,0);this.transformSettings.scale=this.transformSettings.startingScale;this.transformSettings.rotation=0;this.applyTransform()},applyTransform:function(){var b="scale("+this.transformSettings.scale+") rotate("+this.transformSettings.rotation%360+"deg) translate("+f.parseInt(this.transformSettings.translateX,10)+"px, "+f.parseInt(this.transformSettings.translateY,10)+"px)";a.DOM.setStyle(this.containerEl,{webkitTransform:b,MozTransform:b,msTransform:b,transform:b})},
removeFromDOM:function(){a.DOM.removeChild(this.el,this.parentEl)}});Code.PhotoSwipe.ZoomPanRotateClass.CssClasses={documentOverlay:"ps-zoom-pan-rotate"}})(window,Code.PhotoSwipe.Util);
(function(f,a,b,c,d,e,h,g,i,j,k){g=SimpleClass.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,captionAndToolbarShowEventHandler:null,captionAndToolbarHideEventHandler:null,orientationEventName:null,init:function(){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(f.jQuery)&&!a.isNothing(f.jQuery.mobile),jQueryMobileDialogHash:"&ui-state=dialog",allowUserZoom:!0,allowRotationOnUserZoom:!0,maxUserZoom:5,minUserZoom:0.5,adjustUserPanToZoom:!0,doubleClickSpeed:300,doubleClickZoom:2.5,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 f;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);this.captionAndToolbarShowEventHandler=this.onCaptionAndToolbarShow.bind(this);
this.captionAndToolbarHideEventHandler=this.onCaptionAndToolbarHide.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<b.length;c++){var e=b[c];this.fullSizeImages.push(new d(c,this.settings.imageScaleMethod,this.settings.getImageSource(e),this.settings.getImageCaption(e),this.settings.getImageMetaData(e)))}},
show:function(c){if(!this.isBusy&&!this.isActive){if(!a.isNumber(c))throw"startingIndex must be a number";if(a.isNothing(this.fullSizeImages))throw"need to set images before showing the gallery";this.backButtonClicked=!1;this.isBusy=this.isActive=!0;this.lastShowPrevTrigger=Code.PhotoSwipe.ShowPrevTriggers.show;a.DOM.addClass(document.body,Code.PhotoSwipe.CssClasses.activeBody);c=f.parseInt(c);if(c<0||c>=this.fullSizeImages.length)c=0;this.currentIndex=c;a.isNothing(this.documentOverlay)?this.build():
this.resetPosition();a.Events.add(this.viewport,b.EventTypes.onFadeIn,this.viewportFadeInEventHandler);a.Events.fire(this,{type:Code.PhotoSwipe.EventTypes.onBeforeShow,target:this});this.viewport.fadeIn()}},build:function(){this.documentOverlay=new c({fadeInSpeed:this.settings.fadeInSpeed,fadeOutSpeed:this.settings.fadeOutSpeed,zIndex:this.settings.zIndex});this.viewport=new e({fadeInSpeed:this.settings.fadeInSpeed,fadeOutSpeed:this.settings.fadeOutSpeed,swipeThreshold:this.settings.swipeThreshold,
swipeTimeThreshold:this.settings.swipeTimeThreshold,zIndex:this.settings.zIndex+1,doubleClickSpeed:this.settings.doubleClickSpeed});this.slider=new h({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()},addEventHandler:function(b,c){a.Events.add(this,b,c)},addEventHandlers:function(){this.orientationEventName=a.browser.isAndroid?"resize":"onorientationchange"in f?"orientationchange":"resize";a.Events.add(f,this.orientationEventName,this.windowOrientationChangeEventHandler);a.Events.add(f,"scroll",this.windowScrollEventHandler);if(this.isBackEventSupported&&
this.settings.backButtonHideEnabled)this.settings.jQueryMobile?f.location.hash=this.settings.jQueryMobileDialogHash:(this.currentHistoryHashValue="PhotoSwipe"+(new Date).getTime().toString(),f.location.hash=this.currentHistoryHashValue),a.Events.add(f,"hashchange",this.windowHashChangeHandler);a.Events.add(document,"keydown",this.keyDownEventHandler);a.Events.add(this.viewport,e.EventTypes.onTouch,this.viewportTouchEventHandler);a.Events.add(this.slider,h.EventTypes.onDisplayCurrentFullSizeImage,
this.sliderDisplayCurrentFullSizeImageEventHandler);a.Events.add(this.captionAndToolbar,i.EventTypes.onClick,this.toolbarClickEventHandler);a.Events.add(this.captionAndToolbar,j.EventTypes.onShow,this.captionAndToolbarShowEventHandler);a.Events.add(this.captionAndToolbar,j.EventTypes.onHide,this.captionAndToolbarHideEventHandler)},removeEventHandlers:function(){a.Events.remove(f,this.orientationEventName,this.windowOrientationChangeEventHandler);a.Events.remove(f,"scroll",this.windowScrollEventHandler);
this.isBackEventSupported&&this.settings.backButtonHideEnabled&&a.Events.remove(f,"hashchange",this.windowHashChangeHandler);a.Events.remove(document,"keydown",this.keyDownEventHandler);a.Events.remove(this.viewport,e.EventTypes.onTouch,this.viewportTouchEventHandler);a.Events.remove(this.slider,h.EventTypes.onDisplayCurrentFullSizeImage,this.sliderDisplayCurrentFullSizeImageEventHandler);a.Events.remove(this.captionAndToolbar,i.EventTypes.onClick,this.toolbarClickEventHandler);a.Events.remove(this.captionAndToolbar,
j.EventTypes.onShow,this.captionAndToolbarShowEventHandler);a.Events.remove(this.captionAndToolbar,j.EventTypes.onHide,this.captionAndToolbarHideEventHandler)},onViewportFadeIn:function(){a.Events.remove(this.viewport,b.EventTypes.onFadeIn,this.viewportFadeInEventHandler);this.documentOverlay.show();this.slider.fadeIn();this.addEventHandlers();this.slider.setCurrentFullSizeImage(this.fullSizeImages[this.currentIndex]);this.isBusy=!1;a.Events.fire(this,{type:Code.PhotoSwipe.EventTypes.onShow,target:this})},
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(f.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();a.Events.fire(this,{type:Code.PhotoSwipe.EventTypes.onResetPosition,target:this})},
canUserZoom:function(){if(!a.browser.isCSSTransformSupported)return!1;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 e.Actions.gestureStart:this.createZoomPanRotate();break;case e.Actions.gestureChange:this.isZoomActive()&&this.zoomPanRotate.zoomRotate(b.scale,
this.settings.allowRotationOnUserZoom?b.rotation:0);break;case e.Actions.gestureEnd:this.isZoomActive()&&this.zoomPanRotate.setStartingScaleAndRotation(b.scale,this.settings.allowRotationOnUserZoom?b.rotation:0);break;case e.Actions.touchStart:this.stopSlideshow();this.isZoomActive()&&this.zoomPanRotate.panStart(b.point);break;case e.Actions.touchMove:this.isZoomActive()&&this.zoomPanRotate.pan(b.point);break;case e.Actions.click:this.stopSlideshow();this.settings.hideToolbar?this.hide():this.toggleCaptionAndToolbar();
a.Events.fire(this,{type:Code.PhotoSwipe.EventTypes.onViewportClick,target:this});break;case e.Actions.doubleClick:if(this.isZoomActive()){var c=this;f.setTimeout(function(){c.removeZoomPanRotate()})}else{b.point.x-=a.DOM.windowScrollLeft();b.point.y-=a.DOM.windowScrollTop();var d=f.parseInt(a.DOM.getStyle(this.slider.currentItem.imageEl,"top"),10),g=f.parseInt(a.DOM.getStyle(this.slider.currentItem.imageEl,"left"),10),h=g+a.DOM.width(this.slider.currentItem.imageEl),i=d+a.DOM.height(this.slider.currentItem.imageEl);
if(b.point.x<g)b.point.x=g;else if(b.point.x>h)b.point.x=h;if(b.point.y<d)b.point.y=d;else if(b.point.y>i)b.point.y=i;this.createZoomPanRotate();this.zoomPanRotate.zoomAndPanToPoint(this.settings.doubleClickZoom,b.point)}break;case e.Actions.swipeLeft:this.stopSlideshow();this.lastShowPrevTrigger=Code.PhotoSwipe.ShowPrevTriggers.swipe;this.showNext();break;case e.Actions.swipeRight:this.stopSlideshow(),this.lastShowPrevTrigger=Code.PhotoSwipe.ShowPrevTriggers.swipe,this.showPrevious()}},onViewportFadeOut:function(){a.Events.remove(this.viewport,
b.EventTypes.onFadeOut,this.viewportFadeOutEventHandler);this.isActive=this.isBusy=!1;a.Events.fire(this,{type:Code.PhotoSwipe.EventTypes.onHide,target:this});this.goBackInHistory()},hide:function(){if(!this.isBusy&&!this.settings.preventHide&&this.isActive)this.isBusy=!0,this.removeZoomPanRotate(),this.removeEventHandlers(),this.documentOverlay.hide(),this.captionAndToolbar.hide(),this.slider.hide(),a.DOM.removeClass(document.body,Code.PhotoSwipe.CssClasses.activeBody),a.Events.add(this.viewport,
b.EventTypes.onFadeOut,this.viewportFadeOutEventHandler),a.Events.fire(this,{type:Code.PhotoSwipe.EventTypes.onBeforeHide,target:this}),this.viewport.fadeOut()},hideImmediately:function(){if(this.isActive)a.Events.fire(this,{type:Code.PhotoSwipe.EventTypes.onBeforeHide,target:this}),this.removeZoomPanRotate(),this.removeEventHandlers(),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,a.Events.fire(this,{type:Code.PhotoSwipe.EventTypes.onHide,target:this}),this.goBackInHistory()},goBackInHistory:function(){this.isBackEventSupported&&this.settings.backButtonHideEnabled&&(this.backButtonClicked||f.history.back())},showNext:function(){if(!this.isBusy)this.isBusy=!0,this.cleanUpZoomPanRotateForNextPrevious(),this.setCaptionAndToolbarOnShowPreviousNext(),this.slider.showNext(),a.Events.fire(this,{type:Code.PhotoSwipe.EventTypes.onShowNext,target:this})},
showPrevious:function(){if(!this.isBusy)this.isBusy=!0,this.cleanUpZoomPanRotateForNextPrevious(),this.setCaptionAndToolbarOnShowPreviousNext(),this.wasUserZoomActive&&a.DOM.hide(this.slider.currentItem.imageEl),this.slider.showPrevious(),a.Events.fire(this,{type:Code.PhotoSwipe.EventTypes.onShowPrevious,target:this})},cleanUpZoomPanRotateForNextPrevious:function(){a.isNothing(this.zoomPanRotate)||(this.settings.loop?a.DOM.hide(this.slider.currentItem.imageEl):this.currentIndex>0&&this.currentIndex<
this.fullSizeImages.length-2&&a.DOM.hide(this.slider.currentItem.imageEl));this.removeZoomPanRotate()},setCaptionAndToolbarOnShowPreviousNext:function(){if(!this.settings.captionAndToolbarHide){var a=!1;switch(this.lastShowPrevTrigger){case Code.PhotoSwipe.ShowPrevTriggers.toolbar:a=!0;break;case Code.PhotoSwipe.ShowPrevTriggers.slideshow:a=!1;break;default:a=!this.settings.captionAndToolbarHideOnSwipe}a?this.captionAndToolbar.resetAutoHideTimeout():this.fadeOutCaptionAndToolbar()}},onSliderDisplayCurrentFullSizeImage:function(b){this.currentIndex=
b.fullSizeImage.index;if(!this.settings.captionAndToolbarHide){this.settings.loop?(this.captionAndToolbar.setNextState(!1),this.captionAndToolbar.setPreviousState(!1)):(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);b=!1;switch(this.lastShowPrevTrigger){case Code.PhotoSwipe.ShowPrevTriggers.toolbar:b=
!0;break;case Code.PhotoSwipe.ShowPrevTriggers.show:b=!0;break;case Code.PhotoSwipe.ShowPrevTriggers.slideshow:b=!1;break;default:b=!this.settings.captionAndToolbarHideOnSwipe}b&&(a.Events.fire(this,{type:Code.PhotoSwipe.EventTypes.onBeforeCaptionAndToolbarShow,target:this}),this.captionAndToolbar.fadeIn());a.Events.fire(this,{type:Code.PhotoSwipe.EventTypes.onDisplayImage,target:this,image:this.fullSizeImages[this.currentIndex]})}this.lastShowPrevTrigger="";this.setSliderPreviousAndNextFullSizeImages();
this.isSlideshowActive&&this.fireSlideshowTimeout();this.isBusy=!1},toggleCaptionAndToolbar:function(){this.settings.captionAndToolbarHide?this.captionAndToolbar.hide():this.captionAndToolbar.isHidden?(a.Events.fire(this,{type:Code.PhotoSwipe.EventTypes.onBeforeCaptionAndToolbarShow,target:this}),this.captionAndToolbar.fadeIn()):(a.Events.fire(this,{type:Code.PhotoSwipe.EventTypes.onBeforeCaptionAndToolbarHide,target:this}),this.captionAndToolbar.fadeOut())},fadeOutCaptionAndToolbar:function(){!this.settings.captionAndToolbarHide&&
!this.captionAndToolbar.isHidden&&(a.Events.fire(this,{type:Code.PhotoSwipe.EventTypes.onBeforeCaptionAndToolbarHide,target:this}),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)||f.clearTimeout(this.slideshowTimeout),this.removeZoomPanRotate(),this.isSlideshowActive=!0,this.fadeOutCaptionAndToolbar(),this.fireSlideshowTimeout(),a.Events.fire(this,{type:Code.PhotoSwipe.EventTypes.onSlideshowStart,target:this})},stopSlideshow:function(){a.isNothing(this.slideshowTimeout)||f.clearTimeout(this.slideshowTimeout);this.isSlideshowActive=!1;a.Events.fire(this,{type:Code.PhotoSwipe.EventTypes.onSlideshowStop,
target:this})},fireSlideshowTimeout:function(){var a=!1;this.settings.loop?this.fullSizeImages.length>1&&(a=!0):this.currentIndex<this.fullSizeImages.length-1&&(a=!0);if(a)this.lastShowPrevTrigger=Code.PhotoSwipe.ShowPrevTriggers.slideshow,this.slideshowTimeout=f.setTimeout(this.showNext.bind(this),this.settings.slideshowDelay)},createZoomPanRotate:function(){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);this.fadeOutCaptionAndToolbar()}},removeZoomPanRotate:function(){if(!a.isNothing(this.zoomPanRotate))this.zoomPanRotate.removeFromDOM(),this.zoomPanRotate=null},onCaptionAndToolbarShow:function(){a.Events.fire(this,{type:Code.PhotoSwipe.EventTypes.onCaptionAndToolbarShow,target:this})},onCaptionAndToolbarHide:function(){a.Events.fire(this,{type:Code.PhotoSwipe.EventTypes.onCaptionAndToolbarHide,target:this})}});
Code.PhotoSwipe.CssClasses={activeBody:"ps-active"};Code.PhotoSwipe.ShowPrevTriggers={show:"show",toolbar:"toobar",swipe:"swipe",keyboard:"keyboard",slideshow:"slideshow"};Code.PhotoSwipe.EventTypes={onBeforeShow:"PhotoSwipeOnBeforeShow",onShow:"PhotoSwipeOnShow",onBeforeHide:"PhotoSwipeOnBeforeHide",onHide:"PhotoSwipeOnHide",onShowNext:"PhotoSwipeOnShowNext",onShowPrevious:"PhotoSwipeOnShowPrevious",onDisplayImage:"PhotoSwipeOnDisplayImage",onResetPosition:"PhotoSwipeOnResetPosition",onSlideshowStart:"PhotoSwipeOnSlideshowStart",
onSlideshowStop:"PhotoSwipeOnSlideshowStop",onBeforeCaptionAndToolbarShow:"PhotoSwipeOnBeforeCaptionAndToolbarShow",onCaptionAndToolbarShow:"PhotoSwipeOnCaptionAndToolbarShow",onBeforeCaptionAndToolbarHide:"PhotoSwipeOnBeforeCaptionAndToolbarHide",onCaptionAndToolbarHide:"PhotoSwipeOnCaptionAndToolbarHide",onViewportClick:"PhotoSwipeOnViewportClick"};Code.PhotoSwipe.GetImageSource=function(a){return a.href};Code.PhotoSwipe.GetImageCaption=function(b){if(b.nodeName==="IMG")return a.DOM.getAttribute(b,
"alt");var c,d;for(c=0;c<b.childNodes.length;c++)if(d=b.childNodes[c],b.childNodes[c].nodeName==="IMG")return a.DOM.getAttribute(d,"alt")};Code.PhotoSwipe.GetImageMetaData=function(){return{}};Code.PhotoSwipe.Current=new g;Code.photoSwipe=function(b,c,d){var e=!0;if(!a.isNothing(b)){if(a.isNothing(c))c=document.documentElement,e=!1;a.isString(c)&&(c=document.documentElement.querySelector(c));if(a.isNothing(c))throw"Unable to find container element";a.isString(b)&&(b=c.querySelectorAll(b));if(!a.isNothing(b)){var f=
function(a){a.preventDefault();g(a.currentTarget)},g=function(a){var c;for(c=0;c<b.length;c++)if(b[c]===a)break;Code.PhotoSwipe.Current.show(c)};Code.PhotoSwipe.Current.setOptions(d);Code.PhotoSwipe.Current.setImages(b);if(e)c.addEventListener("click",function(c){if(c.target!==c.currentTarget){c.preventDefault();var d=function(b,c,e){if(a.isNothing(b)||a.isNothing(c)||a.isNothing(e))return null;if(b.nodeName===c)return b;if(b===e)return null;return d(b.parentNode,c,e)},c=d(c.target,b[0].nodeName,
c.currentTarget);a.isNothing(c)||g(c)}},!1);else for(c=0;c<b.length;c++)b[c].addEventListener("click",f,!1);return b}}};if(!a.isNothing(f.jQuery))f.jQuery.fn.photoSwipe=function(a){var b=this;Code.PhotoSwipe.Current.setOptions(a);Code.PhotoSwipe.Current.setImages(b);$(b).die("click.photoswipe");$(b).live("click.photoswipe",function(a){a.preventDefault();a=$(b).index($(a.currentTarget));Code.PhotoSwipe.Current.show(a)})}})(window,Code.PhotoSwipe.Util,Code.PhotoSwipe.ElementClass,Code.PhotoSwipe.DocumentOverlayClass,
Code.PhotoSwipe.FullSizeImageClass,Code.PhotoSwipe.ViewportClass,Code.PhotoSwipe.SliderClass,Code.PhotoSwipe.CaptionClass,Code.PhotoSwipe.ToolbarClass,Code.PhotoSwipe.CaptionToolbarClass,Code.PhotoSwipe.ZoomPanRotateClass);
