window.MagicZoom=function(){function w(a){var b,c;for(b="",c=0;c<a.length;c++)b+=String.fromCharCode(14^a.charCodeAt(c));return b}function x(a){var b=[],c=null;return a&&(c=d(a))&&(b=m.filter(function(a){return a.placeholder===c})),b.length?b[0]:null}function y(a){var b=d(window).jGetSize(),c=d(window).jGetScroll();return a=a||0,{left:a,right:b.width-a,top:a,bottom:b.height-a,x:c.x,y:c.y}}function z(a){return a.pointerType&&("touch"===a.pointerType||a.pointerType===a.MSPOINTER_TYPE_TOUCH)||/touch/i.test(a.type)}function A(a){return a.pointerType?("touch"===a.pointerType||a.MSPOINTER_TYPE_TOUCH===a.pointerType)&&a.isPrimary:1===a.changedTouches.length&&(!a.targetTouches.length||a.targetTouches[0].identifier==a.changedTouches[0].identifier)}function B(a){return Object.assign({},a,{type:a.type,pageX:a.pageX,pageY:a.pageY,screenX:a.screenX,screenY:a.screenY,clientX:a.clientX,clientY:a.clientY})}function C(){var a=b.$A(arguments),c=a.shift(),d=l[c];if(d)for(var e=0;e<d.length;e++)d[e].apply(null,a)}function D(){var c,d,a=arguments[0],e=[];try{do d=a.tagName,/^[A-Za-z]*$/.test(d)&&((c=a.getAttribute("id"))&&/^[A-Za-z][-A-Za-z0-9_]*/.test(c)&&(d+="#"+c),e.push(d)),a=a.parentNode;while(a&&a!==document.documentElement);e=e.reverse(),b.addCSS(e.join(" ")+"> .mz-figure > img",{width:"100% !important;",transition:"none",transform:"none"},"mz-runtime-css",!0)}catch(a){}}function E(){var a=null,b=null,c=function(){window.scrollTo(document.body.scrollLeft,document.body.scrollTop),window.dispatchEvent(new Event("resize"))};return b=setInterval(function(){var b=90==window.orientation||window.orientation==-90,d=window.innerHeight,e=.85*(b?screen.availWidth:screen.availHeight);null!=a&&0!=a||!(b&&d<e||!b&&d<e)?null!=a&&1!=a||!(b&&d>e||!b&&d>e)||(a=!1,c()):(a=!0,c())},250)}function F(){b.addCSS(".magic-hidden-wrapper, .magic-temporary-img",{display:"block !important","min-height":"0 !important","min-width":"0 !important","max-height":"none !important","max-width":"none !important",width:"10px !important",height:"10px !important",position:"absolute !important",top:"-10000px !important",left:"0 !important",overflow:"hidden !important","-webkit-transform":"none !important",transform:"none !important","-webkit-transition":"none !important",transition:"none !important"},"magiczoom-reset-css"),b.addCSS(".magic-temporary-img img",{display:"inline-block !important",border:"0 !important",padding:"0 !important","min-height":"0 !important","min-width":"0 !important","max-height":"none !important","max-width":"none !important","-webkit-transform":"none !important",transform:"none !important","-webkit-transition":"none !important",transition:"none !important"},"magiczoom-reset-css"),b.browser.androidBrowser&&b.addCSS(".mobile-magic .mz-expand .mz-expand-bg",{display:"none !important"},"magiczoom-reset-css"),!b.browser.androidBrowser||"chrome"===b.browser.uaName&&44!=b.browser.uaVersion||b.addCSS(".mobile-magic .mz-zoom-window.mz-magnifier, .mobile-magic .mz-zoom-window.mz-magnifier:before",{"border-radius":"0 !important"},"magiczoom-reset-css")}var a,b;a=b=function(){function j(a){var b=a.charAt(0).toUpperCase()+a.slice(1);return a in i||"Webkit"+b in i||"Moz"+b in i||"ms"+b in i||"O"+b in i}function p(a){var c,d;return d=(!b.browser.webkit||"filter"!=a)&&a in i,!d&&(c=b.browser.cssDomPrefix+a.charAt(0).toUpperCase()+a.slice(1),c in i)?c:a}var a={version:"v3.3-b5",UUID:0,storage:{},$uuid:function(a){return a.$J_UUID||(a.$J_UUID=++b.UUID)},getStorage:function(a){return b.storage[a]||(b.storage[a]={})},$F:function(){},$false:function(){return!1},$true:function(){return!0},stylesId:"mjs-"+Math.floor(Math.random()*(new Date).getTime()),defined:function(a){return void 0!=a},ifndef:function(a,b){return void 0!=a?a:b},exists:function(a){return!!a},jTypeOf:function(a){if(!b.defined(a))return!1;if(a.$J_TYPE)return a.$J_TYPE;if(a.nodeType){if(1==a.nodeType)return"element";if(3==a.nodeType)return"textnode"}if(a.length&&a.item)return"collection";if(a.length&&a.callee)return"arguments";if((a instanceof window.Object||a instanceof window.Function)&&a.constructor===b.Class)return"class";if(a instanceof window.Array)return"array";if(a instanceof window.Function)return"function";if(a instanceof window.String)return"string";if(b.browser.trident){if(b.defined(a.cancelBubble))return"event"}else if(a===window.event||a.constructor==window.Event||a.constructor==window.MouseEvent||a.constructor==window.UIEvent||a.constructor==window.KeyboardEvent||a.constructor==window.KeyEvent)return"event";return a instanceof window.Date?"date":a instanceof window.RegExp?"regexp":a===window?"window":a===document?"document":typeof a},extend:function(a,c){if(a instanceof window.Array||(a=[a]),!c)return a[0];for(var d=0,e=a.length;d<e;d++)if(b.defined(a))for(var f in c)if(Object.prototype.hasOwnProperty.call(c,f))try{a[d][f]=c[f]}catch(a){}return a[0]},implement:function(a,c){a instanceof window.Array||(a=[a]);for(var d=0,e=a.length;d<e;d++)if(b.defined(a[d])&&a[d].prototype)for(var f in c||{})a[d].prototype[f]||(a[d].prototype[f]=c[f]);return a[0]},nativize:function(a,c){if(!b.defined(a))return a;for(var d in c||{})a[d]||(a[d]=c[d]);return a},$try:function(){for(var a=0,b=arguments.length;a<b;a++)try{return arguments[a]()}catch(a){}return null},$A:function(a){if(!b.defined(a))return b.$([]);if(a.toArray)return b.$(a.toArray());if(a.item){for(var c=a.length||0,d=new Array(c);c--;)d[c]=a[c];return b.$(d)}return b.$(Array.prototype.slice.call(a))},now:function(){return(new Date).getTime()},detach:function(a){var c;switch(b.jTypeOf(a)){case"object":c={};for(var d in a)c[d]=b.detach(a[d]);break;case"array":c=[];for(var e=0,f=a.length;e<f;e++)c[e]=b.detach(a[e]);break;default:return a}return b.$(c)},$:function(a){var c=!0;if(!b.defined(a))return null;if(a.$J_EXT)return a;switch(b.jTypeOf(a)){case"array":return a=b.nativize(a,b.extend(b.Array,{$J_EXT:b.$F})),a.jEach=a.forEach,a;case"string":var d=document.getElementById(a);return b.defined(d)?b.$(d):null;case"window":case"document":b.$uuid(a),a=b.extend(a,b.Doc);break;case"element":b.$uuid(a),a=b.extend(a,b.Element);break;case"event":a=b.extend(a,b.Event);break;case"textnode":case"function":case"array":case"date":default:c=!1}return c?b.extend(a,{$J_EXT:b.$F}):a},$new:function(a,c,d){return b.$(b.doc.createElement(a)).setProps(c||{}).jSetCss(d||{})},addCSS:function(a,c,d){var e,f,g,h=[],i=-1;if(d||(d=b.stylesId),e=b.$(d)||b.$new("style",{id:d,type:"text/css"}).jAppendTo(document.head||document.body,"top"),f=e.sheet||e.styleSheet,"string"!=b.jTypeOf(c)){for(var g in c)h.push(g+":"+c[g]);c=h.join(";")}return i=f.insertRule?f.insertRule(a+" {"+c+"}",f.cssRules.length):f.addRule(a,c)},removeCSS:function(a,c){var d,e;d=b.$(a),"element"===b.jTypeOf(d)&&(e=d.sheet||d.styleSheet,e.deleteRule?e.deleteRule(c):e.removeRule&&e.removeRule(c))},generateUUID:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"==a?b:3&b|8;return c.toString(16)}).toUpperCase()},getAbsoluteURL:function(){var a;return function(b){return a||(a=document.createElement("a")),a.setAttribute("href",b),("!!"+a.href).replace("!!","")}}(),getHashCode:function(a){for(var b=0,c=a.length,d=0;d<c;++d)b=31*b+a.charCodeAt(d),b%=4294967296;return b}},b=a;a.$;window.magicJS||(window.magicJS=a,window.$mjs=a.$),b.Array={$J_TYPE:"array",indexOf:function(a,b){for(var d=(this.length,this.length),e=b<0?Math.max(0,d+b):b||0;e<d;e++)if(this[e]===a)return e;return-1},contains:function(a,b){return this.indexOf(a,b)!=-1},forEach:function(a,b){for(var c=0,d=this.length;c<d;c++)c in this&&a.call(b,this[c],c,this)},filter:function(a,b){for(var c=[],d=0,e=this.length;d<e;d++)if(d in this){var f=this[d];a.call(b,this[d],d,this)&&c.push(f)}return c},map:function(a,b){for(var c=[],d=0,e=this.length;d<e;d++)d in this&&(c[d]=a.call(b,this[d],d,this));return c}},b.implement(String,{$J_TYPE:"string",jTrim:function(){return this.replace(/^\s+|\s+$/g,"")},eq:function(a,b){return b?this.toString()===a.toString():this.toLowerCase().toString()===a.toLowerCase().toString()},jCamelize:function(){return this.replace(/-\D/g,function(a){return a.charAt(1).toUpperCase()})},dashize:function(){return this.replace(/[A-Z]/g,function(a){return"-"+a.charAt(0).toLowerCase()})},jToInt:function(a){return parseInt(this,a||10)},toFloat:function(){return parseFloat(this)},jToBool:function(){return!this.replace(/true/i,"").jTrim()},has:function(a,b){return b=b||"",(b+this+b).indexOf(b+a+b)>-1}}),a.implement(Function,{$J_TYPE:"function",jBind:function(){var a=b.$A(arguments),c=this,d=a.shift();return function(){return c.apply(d||null,a.concat(b.$A(arguments)))}},jBindAsEvent:function(){var a=b.$A(arguments),c=this,d=a.shift();return function(e){return c.apply(d||null,b.$([e||(b.browser.ieMode?window.event:null)]).concat(a))}},jDelay:function(){var a=b.$A(arguments),c=this,d=a.shift();return window.setTimeout(function(){return c.apply(c,a)},d||0)},jDefer:function(){var a=b.$A(arguments),c=this;return function(){return c.jDelay.apply(c,a)}},interval:function(){var a=b.$A(arguments),c=this,d=a.shift();return window.setInterval(function(){return c.apply(c,a)},d||0)}});var d={},e=navigator.userAgent.toLowerCase(),f=e.match(/(webkit|gecko|trident|presto)\/(\d+\.?\d*)/i),g=e.match(/(edge|opr)\/(\d+\.?\d*)/i)||e.match(/(crios|chrome|safari|firefox|opera|opr)\/(\d+\.?\d*)/i),h=e.match(/version\/(\d+\.?\d*)/i),i=document.documentElement.style;b.browser={features:{xpath:!!document.evaluate,air:!!window.runtime,query:!!document.querySelector,fullScreen:!!(document.fullscreenEnabled||document.msFullscreenEnabled||document.exitFullscreen||document.cancelFullScreen||document.webkitexitFullscreen||document.webkitCancelFullScreen||document.mozCancelFullScreen||document.oCancelFullScreen||document.msCancelFullScreen),xhr2:!!window.ProgressEvent&&!!window.FormData&&window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,transition:j("transition"),transform:j("transform"),perspective:j("perspective"),animation:j("animation"),requestAnimationFrame:!1,multibackground:!1,cssFilters:!1,canvas:!1,svg:function(){return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1")}()},touchScreen:function(){return"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}(),mobile:!!e.match(/(android|bb\d+|meego).+|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/),engine:f&&f[1]?f[1].toLowerCase():window.opera?"presto":window.ActiveXObject?"trident":void 0!==document.getBoxObjectFor||null!=window.mozInnerScreenY?"gecko":null===window.WebKitPoint&&navigator.taintEnabled?"unknown":"webkit",version:f&&f[2]?parseFloat(f[2]):0,uaName:g&&g[1]?g[1].toLowerCase():"",uaVersion:g&&g[2]?parseFloat(g[2]):0,cssPrefix:"",cssDomPrefix:"",domPrefix:"",ieMode:0,platform:e.match(/ip(?:ad|od|hone)/)?"ios":(e.match(/(?:webos|android)/)||navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase(),backCompat:document.compatMode&&"backcompat"==document.compatMode.toLowerCase(),scrollbarsWidth:0,getDoc:function(){return document.compatMode&&"backcompat"==document.compatMode.toLowerCase()?document.body:document.documentElement},requestAnimationFrame:window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||void 0,cancelAnimationFrame:window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||window.webkitCancelRequestAnimationFrame||void 0,ready:!1,onready:function(){if(!b.browser.ready){var a,c;b.browser.ready=!0,b.body=b.$(document.body),b.win=b.$(window);try{var e=b.$new("div").jSetCss({width:100,height:100,overflow:"scroll",position:"absolute",top:-9999}).jAppendTo(document.body);b.browser.scrollbarsWidth=e.offsetWidth-e.clientWidth,e.jRemove()}catch(a){}try{a=b.$new("div"),c=a.style,c.cssText="background:url(https://),url(https://),red url(https://)",b.browser.features.multibackground=/(url\s*\(.*?){3}/.test(c.background),c=null,a=null}catch(a){}b.browser.cssTransformProp||(b.browser.cssTransformProp=b.normalizeCSS("transform").dashize());try{a=b.$new("div"),a.style.cssText=b.normalizeCSS("filter").dashize()+":blur(2px);",b.browser.features.cssFilters=!!a.style.length&&(!b.browser.ieMode||b.browser.ieMode>9),a=null}catch(a){}b.browser.features.cssFilters||b.$(document.documentElement).jAddClass("no-cssfilters-magic");try{b.browser.features.canvas=function(){var a=b.$new("canvas");return!(!a.getContext||!a.getContext("2d"))}()}catch(a){}void 0===window.TransitionEvent&&void 0!==window.WebKitTransitionEvent&&(d.transitionend="webkitTransitionEnd"),b.Doc.jCallEvent.call(b.$(document),"domready")}}},function(){var c,d,e,a=[];switch(b.browser.engine){case"trident":b.browser.version||(b.browser.version=window.XMLHttpRequest?3:2);break;case"gecko":b.browser.version=g&&g[2]?parseFloat(g[2]):0}if(b.browser[b.browser.engine]=!0,g&&"crios"===g[1]&&(b.browser.uaName="chrome"),window.chrome&&(b.browser.chrome=!0),g&&"opr"===g[1]&&(b.browser.uaName="opera",b.browser.opera=!0),"safari"===b.browser.uaName&&h&&h[1]&&(b.browser.uaVersion=parseFloat(h[1])),"android"==b.browser.platform&&b.browser.webkit&&h&&h[1]&&(b.browser.androidBrowser=!0),c={gecko:["-moz-","Moz","moz"],webkit:["-webkit-","Webkit","webkit"],trident:["-ms-","ms","ms"],presto:["-o-","O","o"]}[b.browser.engine]||["","",""],b.browser.cssPrefix=c[0],b.browser.cssDomPrefix=c[1],b.browser.domPrefix=c[2],b.browser.ieMode=b.browser.trident?document.documentMode?document.documentMode:function(){var a=0;if(b.browser.backCompat)return 5;switch(b.browser.version){case 2:a=6;break;case 3:a=7}return a}():void 0,a.push(b.browser.platform+"-magic"),b.browser.mobile&&a.push("mobile-magic"),b.browser.androidBrowser&&a.push("android-browser-magic"),b.browser.ieMode)for(b.browser.uaName="ie",b.browser.uaVersion=b.browser.ieMode,a.push("ie"+b.browser.ieMode+"-magic"),d=11;d>b.browser.ieMode;d--)a.push("lt-ie"+d+"-magic");b.browser.webkit&&b.browser.version<536&&(b.browser.features.fullScreen=!1),b.browser.requestAnimationFrame&&b.browser.requestAnimationFrame.call(window,function(){b.browser.features.requestAnimationFrame=!0}),b.browser.features.svg?a.push("svg-magic"):a.push("no-svg-magic"),e=(document.documentElement.className||"").match(/\S+/g)||[],document.documentElement.className=b.$(e).concat(a).join(" ");try{document.documentElement.setAttribute("data-magic-ua",b.browser.uaName),document.documentElement.setAttribute("data-magic-ua-ver",b.browser.uaVersion)}catch(a){}b.browser.ieMode&&b.browser.ieMode<9&&(document.createElement("figure"),document.createElement("figcaption"))}(),function(){b.browser.fullScreen={capable:b.browser.features.fullScreen,enabled:function(){return!!(document.fullscreenElement||document[b.browser.domPrefix+"FullscreenElement"]||document.fullScreen||document.webkitIsFullScreen||document[b.browser.domPrefix+"FullScreen"])},request:function(a,c){c||(c={}),this.capable?(b.$(document).jAddEvent(this.changeEventName,this.onchange=function(a){this.enabled()?c.onEnter&&c.onEnter():(b.$(document).jRemoveEvent(this.changeEventName,this.onchange),c.onExit&&c.onExit())}.jBindAsEvent(this)),b.$(document).jAddEvent(this.errorEventName,this.onerror=function(a){c.fallback&&c.fallback(),b.$(document).jRemoveEvent(this.errorEventName,this.onerror)}.jBindAsEvent(this)),(a[b.browser.domPrefix+"RequestFullscreen"]||a[b.browser.domPrefix+"RequestFullScreen"]||a.requestFullscreen||function(){}).call(a)):c.fallback&&c.fallback()},cancel:(document.exitFullscreen||document.cancelFullScreen||document[b.browser.domPrefix+"ExitFullscreen"]||document[b.browser.domPrefix+"CancelFullScreen"]||function(){}).jBind(document),changeEventName:document.msExitFullscreen?"MSFullscreenChange":(document.exitFullscreen?"":b.browser.domPrefix)+"fullscreenchange",errorEventName:document.msExitFullscreen?"MSFullscreenError":(document.exitFullscreen?"":b.browser.domPrefix)+"fullscreenerror",prefix:b.browser.domPrefix,activeElement:null}}();var k=/\S+/g,l=/^(border(Top|Bottom|Left|Right)Width)|((padding|margin)(Top|Bottom|Left|Right))$/,m={float:"undefined"==typeof i.styleFloat?"cssFloat":"styleFloat"},n={fontWeight:!0,lineHeight:!0,opacity:!0,zIndex:!0,zoom:!0},o=window.getComputedStyle?function(a,b){var c=window.getComputedStyle(a,null);return c?c.getPropertyValue(b)||c[b]:null}:function(a,b){var c=a.currentStyle,d=null;return d=c?c[b]:null,null==d&&a.style&&a.style[b]&&(d=a.style[b]),d};return b.normalizeCSS=p,b.Element={jHasClass:function(a){return!(a||"").has(" ")&&(this.className||"").has(a," ")},jAddClass:function(a){for(var c=(this.className||"").match(k)||[],d=(a||"").match(k)||[],e=d.length,f=0;f<e;f++)b.$(c).contains(d[f])||c.push(d[f]);return this.className=c.join(" "),this},jRemoveClass:function(a){for(var g,c=(this.className||"").match(k)||[],d=(a||"").match(k)||[],e=d.length,f=0;f<e;f++)(g=b.$(c).indexOf(d[f]))>-1&&c.splice(g,1);return this.className=a?c.join(" "):"",this},jToggleClass:function(a){return this.jHasClass(a)?this.jRemoveClass(a):this.jAddClass(a)},jGetCss:function(a){var c=a.jCamelize(),d=null;if(a=m[c]||(m[c]=p(c)),d=o(this,a),"auto"===d&&(d=null),null!==d){if("opacity"==a)return b.defined(d)?parseFloat(d):1;l.test(a)&&(d=parseInt(d,10)?d:"0px")}return d},jSetCssProp:function(a,c){var d=a.jCamelize();try{if("opacity"==a)return this.jSetOpacity(c),this;a=m[d]||(m[d]=p(d)),this.style[a]=c+("number"!=b.jTypeOf(c)||n[d]?"":"px")}catch(a){}return this},jSetCss:function(a){for(var b in a)this.jSetCssProp(b,a[b]);return this},jGetStyles:function(){var a={};return b.$A(arguments).jEach(function(b){a[b]=this.jGetCss(b)},this),a},jSetOpacity:function(a,c){return c=c||!1,this.style.opacity=a,a=parseInt(100*parseFloat(a)),c&&(0===a?"hidden"!=this.style.visibility&&(this.style.visibility="hidden"):"visible"!=this.style.visibility&&(this.style.visibility="visible")),b.browser.ieMode&&b.browser.ieMode<9&&(isNaN(a)?(this.style.filter=this.style.filter.replace(/progid:DXImageTransform.Microsoft.Alpha\(Opacity=\d*\)/i,"").jTrim(),""===this.style.filter&&this.style.removeAttribute("filter")):~this.style.filter.indexOf("Alpha")?this.style.filter=this.style.filter.replace(/Opacity=\d*/i,"Opacity="+a):this.style.filter+=" progid:DXImageTransform.Microsoft.Alpha(Opacity="+a+")"),this},setProps:function(a){for(var b in a)"class"===b?this.jAddClass(""+a[b]):this.setAttribute(b,""+a[b]);return this},jGetTransitionDuration:function(){var a=0,b=0;return a=this.jGetCss("transition-duration"),b=this.jGetCss("transition-delay"),a=a.indexOf("ms")>-1?parseFloat(a):a.indexOf("s")>-1?1e3*parseFloat(a):0,b=b.indexOf("ms")>-1?parseFloat(b):b.indexOf("s")>-1?1e3*parseFloat(b):0,a+b},hide:function(){return this.jSetCss({display:"none",visibility:"hidden"})},show:function(){return this.jSetCss({display:"",visibility:"visible"})},jGetSize:function(){return{width:this.offsetWidth,height:this.offsetHeight}},getInnerSize:function(a){var b=this.jGetSize();return b.width-=parseFloat(this.jGetCss("border-left-width")||0)+parseFloat(this.jGetCss("border-right-width")||0),b.height-=parseFloat(this.jGetCss("border-top-width")||0)+parseFloat(this.jGetCss("border-bottom-width")||0),a||(b.width-=parseFloat(this.jGetCss("padding-left")||0)+parseFloat(this.jGetCss("padding-right")||0),b.height-=parseFloat(this.jGetCss("padding-top")||0)+parseFloat(this.jGetCss("padding-bottom")||0)),b},jGetScroll:function(){return{top:this.scrollTop,left:this.scrollLeft}},jGetFullScroll:function(){var a=this,b={top:0,left:0};do b.left+=a.scrollLeft||0,b.top+=a.scrollTop||0,a=a.parentNode;while(a);return b},jGetPosition:function(){var a=this,c=0,d=0;if(b.defined(document.documentElement.getBoundingClientRect)){var e=this.getBoundingClientRect(),f=b.$(document).jGetScroll(),g=b.browser.getDoc();return{top:e.top+f.y-g.clientTop,left:e.left+f.x-g.clientLeft}}do c+=a.offsetLeft||0,d+=a.offsetTop||0,a=a.offsetParent;while(a&&!/^(?:body|html)$/i.test(a.tagName));return{top:d,left:c}},jGetRect:function(){var a=this.jGetPosition(),b=this.jGetSize();return{top:a.top,bottom:a.top+b.height,left:a.left,right:a.left+b.width}},changeContent:function(a){try{this.innerHTML=a}catch(b){this.innerText=a}return this},jRemove:function(){return this.parentNode?this.parentNode.removeChild(this):this},kill:function(){return b.$A(this.childNodes).jEach(function(a){3!=a.nodeType&&8!=a.nodeType&&b.$(a).kill()}),this.jRemove(),this.jClearEvents(),this.$J_UUID&&(b.storage[this.$J_UUID]=null,delete b.storage[this.$J_UUID]),null},append:function(a,b){b=b||"bottom";var c=this.firstChild;return"top"==b&&c?this.insertBefore(a,c):this.appendChild(a),this},jAppendTo:function(a,c){b.$(a).append(this,c);return this},enclose:function(a){return this.append(a.parentNode.replaceChild(this,a)),this},hasChild:function(a){return"element"===b.jTypeOf("string"==b.jTypeOf(a)?a=document.getElementById(a):a)&&(this!=a&&(this.contains&&!b.browser.webkit419?this.contains(a):this.compareDocumentPosition?!!(16&this.compareDocumentPosition(a)):b.$A(this.byTag(a.tagName)).contains(a)))}},b.Element.jGetStyle=b.Element.jGetCss,b.Element.jSetStyle=b.Element.jSetCss,window.Element||(window.Element=b.$F,b.browser.engine.webkit&&window.document.createElement("iframe"),window.Element.prototype=b.browser.engine.webkit?window["[[DOMElement.prototype]]"]:{}),b.implement(window.Element,{$J_TYPE:"element"}),b.Doc={jGetSize:function(){return b.browser.touchScreen||b.browser.presto925||b.browser.webkit419?{width:window.innerWidth,height:window.innerHeight}:{width:b.browser.getDoc().clientWidth,height:b.browser.getDoc().clientHeight}},jGetScroll:function(){return{x:window.pageXOffset||b.browser.getDoc().scrollLeft,y:window.pageYOffset||b.browser.getDoc().scrollTop}},jGetFullSize:function(){var a=this.jGetSize();return{width:Math.max(b.browser.getDoc().scrollWidth,a.width),height:Math.max(b.browser.getDoc().scrollHeight,a.height)}}},b.extend(document,{$J_TYPE:"document"}),b.extend(window,{$J_TYPE:"window"}),b.extend([b.Element,b.Doc],{jFetch:function(a,c){var d=b.getStorage(this.$J_UUID),e=d[a];return void 0!==c&&void 0===e&&(e=d[a]=c),b.defined(e)?e:null},jStore:function(a,c){var d=b.getStorage(this.$J_UUID);return d[a]=c,this},jDel:function(a){var c=b.getStorage(this.$J_UUID);return delete c[a],this}}),window.HTMLElement&&window.HTMLElement.prototype&&window.HTMLElement.prototype.getElementsByClassName||b.extend([b.Element,b.Doc],{getElementsByClassName:function(a){return b.$A(this.getElementsByTagName("*")).filter(function(b){try{return 1==b.nodeType&&b.className.has(a," ")}catch(a){}})}}),b.extend([b.Element,b.Doc],{byClass:function(){return this.getElementsByClassName(arguments[0])},byTag:function(){return this.getElementsByTagName(arguments[0])}}),b.browser.fullScreen.capable&&!document.requestFullScreen&&(b.Element.requestFullScreen=function(){b.browser.fullScreen.request(this)}),b.Event={$J_TYPE:"event",isQueueStopped:b.$false,stop:function(){return this.stopDistribution().stopDefaults()},stopDistribution:function(){return this.stopPropagation?this.stopPropagation():this.cancelBubble=!0,this},stopDefaults:function(){return this.preventDefault?this.preventDefault():this.returnValue=!1,this},stopQueue:function(){return this.isQueueStopped=b.$true,this},getClientXY:function(){var a;return a=/touch/i.test(this.type)?this.changedTouches[0]:this,b.defined(a)?{x:a.clientX,y:a.clientY}:{x:0,y:0}},jGetPageXY:function(){var a;return a=/touch/i.test(this.type)?this.changedTouches[0]:this,b.defined(a)?{x:a.pageX||a.clientX+b.browser.getDoc().scrollLeft,y:a.pageY||a.clientY+b.browser.getDoc().scrollTop}:{x:0,y:0}},getTarget:function(){for(var a=this.target||this.srcElement;a&&3==a.nodeType;)a=a.parentNode;return a},getRelated:function(){var a=null;switch(this.type){case"mouseover":case"pointerover":case"MSPointerOver":a=this.relatedTarget||this.fromElement;break;case"mouseout":case"pointerout":case"MSPointerOut":a=this.relatedTarget||this.toElement;break;default:return a}try{for(;a&&3==a.nodeType;)a=a.parentNode}catch(b){a=null}return a},getButton:function(){return this.which||void 0===this.button?this.which:1&this.button?1:2&this.button?3:4&this.button?2:0},isTouchEvent:function(){return this.pointerType&&("touch"===this.pointerType||this.pointerType===this.MSPOINTER_TYPE_TOUCH)||/touch/i.test(this.type)},isPrimaryTouch:function(){return this.pointerType?("touch"===this.pointerType||this.MSPOINTER_TYPE_TOUCH===this.pointerType)&&this.isPrimary:1===this.changedTouches.length&&(!this.targetTouches.length||this.targetTouches[0].identifier==this.changedTouches[0].identifier)}},b._event_add_="addEventListener",b._event_del_="removeEventListener",b._event_prefix_="",document.addEventListener||(b._event_add_="attachEvent",b._event_del_="detachEvent",b._event_prefix_="on"),b.Event.Custom={type:"",x:null,y:null,timeStamp:null,button:null,target:null,relatedTarget:null,$J_TYPE:"event.custom",isQueueStopped:b.$false,events:b.$([]),pushToEvents:function(a){var b=a;this.events.push(b)},stop:function(){return this.stopDistribution().stopDefaults()},stopDistribution:function(){return this.events.jEach(function(a){try{a.stopDistribution()}catch(a){}}),this},stopDefaults:function(){return this.events.jEach(function(a){try{a.stopDefaults()}catch(a){}}),this},stopQueue:function(){return this.isQueueStopped=b.$true,this},getClientXY:function(){return{x:this.clientX,y:this.clientY}},jGetPageXY:function(){return{x:this.x,y:this.y}},getTarget:function(){return this.target},getRelated:function(){return this.relatedTarget},getButton:function(){return this.button},getOriginalTarget:function(){return this.events.length>0?this.events[0].getTarget():void 0}},b.extend([b.Element,b.Doc],{jAddEvent:function(a,c,e,f){var g,h,i,j,k;return"string"==b.jTypeOf(a)&&(k=a.split(" "),k.length>1&&(a=k)),"array"==b.jTypeOf(a)?(b.$(a).jEach(this.jAddEvent.jBindAsEvent(this,c,e,f)),this):a&&c&&"string"==b.jTypeOf(a)&&"function"==b.jTypeOf(c)?"domready"==a&&b.browser.ready?(c.call(this),this):(a=d[a]||a,e=parseInt(e||50),c.$J_EUID||(c.$J_EUID=Math.floor(Math.random()*b.now())),g=b.Doc.jFetch.call(this,"_EVENTS_",{}),h=g[a],h||(g[a]=h=b.$([]),i=this,b.Event.Custom[a]?b.Event.Custom[a].handler.add.call(this,f):(h.handle=function(c){c=b.extend(c||window.e,{$J_TYPE:"event"}),b.Doc.jCallEvent.call(i,a,b.$(c))},this[b._event_add_](b._event_prefix_+a,h.handle,!1))),j={type:a,fn:c,priority:e,euid:c.$J_EUID},h.push(j),h.sort(function(a,b){return a.priority-b.priority}),this):this},jRemoveEvent:function(a){var e,f,g,h,i,j,c=b.Doc.jFetch.call(this,"_EVENTS_",{});if(i=arguments.length>1?arguments[1]:-100,"string"==b.jTypeOf(a)&&(j=a.split(" "),j.length>1&&(a=j)),"array"==b.jTypeOf(a))return b.$(a).jEach(this.jRemoveEvent.jBindAsEvent(this,i)),this;if(a=d[a]||a,!a||"string"!=b.jTypeOf(a)||!c||!c[a])return this;for(e=c[a]||[],g=0;g<e.length;g++)f=e[g],(-100==i||i&&i.$J_EUID===f.euid)&&(h=e.splice(g--,1));return 0===e.length&&(b.Event.Custom[a]?b.Event.Custom[a].handler.jRemove.call(this):this[b._event_del_](b._event_prefix_+a,e.handle,!1),delete c[a]),this},jCallEvent:function(a,c){var f,h,e=b.Doc.jFetch.call(this,"_EVENTS_",{});if(a=d[a]||a,!a||"string"!=b.jTypeOf(a)||!e||!e[a])return this;try{c=b.extend(c||{},{type:a})}catch(a){}for(void 0===c.timeStamp&&(c.timeStamp=b.now()),f=e[a]||[],h=0;h<f.length&&(!c.isQueueStopped||!c.isQueueStopped());h++)f[h].fn.call(this,c)},jRaiseEvent:function(a,c){var g,e="domready"!=a,f=this;return a=d[a]||a,e?(f===document&&document.createEvent&&!f.dispatchEvent&&(f=document.documentElement),document.createEvent?(g=document.createEvent(a),g.initEvent(c,!0,!0)):(g=document.createEventObject(),g.eventType=a),document.createEvent?f.dispatchEvent(g):f.fireEvent("on"+c,g),g):(b.Doc.jCallEvent.call(this,a),this)},jClearEvents:function(){var a=b.Doc.jFetch.call(this,"_EVENTS_");if(!a)return this;for(var c in a)b.Doc.jRemoveEvent.call(this,c);return b.Doc.jDel.call(this,"_EVENTS_"),this}}),function(a){return"complete"===document.readyState?a.browser.onready.jDelay(1):void(a.browser.webkit&&a.browser.version<420?!function(){a.$(["loaded","complete"]).contains(document.readyState)?a.browser.onready():arguments.callee.jDelay(50)}():a.browser.trident&&a.browser.ieMode<9&&window==top?!function(){a.$try(function(){return a.browser.getDoc().doScroll("left"),!0})?a.browser.onready():arguments.callee.jDelay(50)}():(a.Doc.jAddEvent.call(a.$(document),"DOMContentLoaded",a.browser.onready),a.Doc.jAddEvent.call(a.$(window),"load",a.browser.onready)))}(a),b.Class=function(){var a=null,c=b.$A(arguments);"class"==b.jTypeOf(c[0])&&(a=c.shift());var d=function(){for(var a in this)this[a]=b.detach(this[a]);if(this.constructor.$parent){this.$parent={};var c=this.constructor.$parent;for(var d in c){var e=c[d];switch(b.jTypeOf(e)){case"function":this.$parent[d]=b.Class.wrap(this,e);break;case"object":this.$parent[d]=b.detach(e);break;case"array":this.$parent[d]=b.detach(e)}}}var f=this.init?this.init.apply(this,arguments):this;return delete this.caller,f};if(d.prototype.init||(d.prototype.init=b.$F),a){var e=function(){};e.prototype=a.prototype,d.prototype=new e,d.$parent={};for(var f in a.prototype)d.$parent[f]=a.prototype[f]}else d.$parent=null;return d.constructor=b.Class,d.prototype.constructor=d,b.extend(d.prototype,c[0]),b.extend(d,{$J_TYPE:"class"}),d},a.Class.wrap=function(a,b){return function(){var d=(this.caller,b.apply(a,arguments));return d}},function(a){var c=(a.$,5),d=300;a.Event.Custom.btnclick=new a.Class(a.extend(a.Event.Custom,{type:"btnclick",init:function(a,b){var c=b.jGetPageXY();this.x=c.x,this.y=c.y,this.clientX=b.clientX,this.clientY=b.clientY,this.timeStamp=b.timeStamp,this.button=b.getButton(),this.target=a,this.pushToEvents(b)}})),a.Event.Custom.btnclick.handler={options:{threshold:d,button:1},add:function(b){this.jStore("event:btnclick:options",a.extend(a.detach(a.Event.Custom.btnclick.handler.options),b||{})),this.jAddEvent("mousedown",a.Event.Custom.btnclick.handler.handle,1),this.jAddEvent("mouseup",a.Event.Custom.btnclick.handler.handle,1),this.jAddEvent("click",a.Event.Custom.btnclick.handler.onclick,1),a.browser.trident&&a.browser.ieMode<9&&this.jAddEvent("dblclick",a.Event.Custom.btnclick.handler.handle,1)},jRemove:function(){this.jRemoveEvent("mousedown",a.Event.Custom.btnclick.handler.handle),this.jRemoveEvent("mouseup",a.Event.Custom.btnclick.handler.handle),this.jRemoveEvent("click",a.Event.Custom.btnclick.handler.onclick),a.browser.trident&&a.browser.ieMode<9&&this.jRemoveEvent("dblclick",a.Event.Custom.btnclick.handler.handle)},onclick:function(a){a.stopDefaults()},handle:function(b){var d,e,f;if(e=this.jFetch("event:btnclick:options"),"dblclick"==b.type||b.getButton()==e.button){if(this.jFetch("event:btnclick:ignore"))return void this.jDel("event:btnclick:ignore");if("mousedown"==b.type)d=new a.Event.Custom.btnclick(this,b),this.jStore("event:btnclick:btnclickEvent",d);else if("mouseup"==b.type){if(d=this.jFetch("event:btnclick:btnclickEvent"),!d)return;f=b.jGetPageXY(),this.jDel("event:btnclick:btnclickEvent"),d.pushToEvents(b),b.timeStamp-d.timeStamp<=e.threshold&&Math.sqrt(Math.pow(f.x-d.x,2)+Math.pow(f.y-d.y,2))<=c&&this.jCallEvent("btnclick",d),document.jCallEvent("mouseup",b)}else"dblclick"==b.type&&(d=new a.Event.Custom.btnclick(this,b),this.jCallEvent("btnclick",d))}}}}(a),function(a){var b=a.$;a.Event.Custom.mousedrag=new a.Class(a.extend(a.Event.Custom,{type:"mousedrag",state:"dragstart",dragged:!1,init:function(a,b,c){var d=b.jGetPageXY();this.x=d.x,this.y=d.y,this.clientX=b.clientX,this.clientY=b.clientY,this.timeStamp=b.timeStamp,this.button=b.getButton(),this.target=a,this.pushToEvents(b),this.state=c}})),a.Event.Custom.mousedrag.handler={add:function(){var b=a.Event.Custom.mousedrag.handler.handleMouseMove.jBindAsEvent(this),c=a.Event.Custom.mousedrag.handler.handleMouseUp.jBindAsEvent(this);this.jAddEvent("mousedown",a.Event.Custom.mousedrag.handler.handleMouseDown,1),this.jAddEvent("mouseup",a.Event.Custom.mousedrag.handler.handleMouseUp,1),document.jAddEvent("mousemove",b,1),document.jAddEvent("mouseup",c,1),this.jStore("event:mousedrag:listeners:document:move",b),this.jStore("event:mousedrag:listeners:document:end",c)},jRemove:function(){this.jRemoveEvent("mousedown",a.Event.Custom.mousedrag.handler.handleMouseDown),this.jRemoveEvent("mouseup",a.Event.Custom.mousedrag.handler.handleMouseUp),b(document).jRemoveEvent("mousemove",this.jFetch("event:mousedrag:listeners:document:move")||a.$F),b(document).jRemoveEvent("mouseup",this.jFetch("event:mousedrag:listeners:document:end")||a.$F),this.jDel("event:mousedrag:listeners:document:move"),this.jDel("event:mousedrag:listeners:document:end")},handleMouseDown:function(b){var c;1==b.getButton()&&(c=new a.Event.Custom.mousedrag(this,b,"dragstart"),this.jStore("event:mousedrag:dragstart",c))},handleMouseUp:function(b){var c;c=this.jFetch("event:mousedrag:dragstart"),c&&(b.stopDefaults(),c=new a.Event.Custom.mousedrag(this,b,"dragend"),this.jDel("event:mousedrag:dragstart"),this.jCallEvent("mousedrag",c))},handleMouseMove:function(b){var c;c=this.jFetch("event:mousedrag:dragstart"),c&&(b.stopDefaults(),c.dragged||(c.dragged=!0,this.jCallEvent("mousedrag",c)),c=new a.Event.Custom.mousedrag(this,b,"dragmove"),this.jCallEvent("mousedrag",c))}}}(a),function(a){a.$;a.Event.Custom.dblbtnclick=new a.Class(a.extend(a.Event.Custom,{type:"dblbtnclick",timedout:!1,tm:null,init:function(a,b){var c=b.jGetPageXY();this.x=c.x,this.y=c.y,this.clientX=b.clientX,this.clientY=b.clientY,this.timeStamp=b.timeStamp,this.button=b.getButton(),this.target=a,this.pushToEvents(b)}})),a.Event.Custom.dblbtnclick.handler={options:{threshold:200},add:function(b){this.jStore("event:dblbtnclick:options",a.extend(a.detach(a.Event.Custom.dblbtnclick.handler.options),b||{})),this.jAddEvent("btnclick",a.Event.Custom.dblbtnclick.handler.handle,1)},jRemove:function(){this.jRemoveEvent("btnclick",a.Event.Custom.dblbtnclick.handler.handle)},handle:function(b){var c,d;c=this.jFetch("event:dblbtnclick:event"),d=this.jFetch("event:dblbtnclick:options"),c?(clearTimeout(c.tm),this.jDel("event:dblbtnclick:event"),c.timedout||(c.pushToEvents(b),b.stopQueue().stop(),this.jCallEvent("dblbtnclick",c))):(c=new a.Event.Custom.dblbtnclick(this,b),c.tm=setTimeout(function(){c.timedout=!0,b.isQueueStopped=a.$false,this.jCallEvent("btnclick",b),this.jDel("event:dblbtnclick:event")}.jBind(this),d.threshold+10),this.jStore("event:dblbtnclick:event",c),b.stopQueue())}}}(a),function(a){function c(a){return a.pointerType?("touch"===a.pointerType||a.MSPOINTER_TYPE_TOUCH===a.pointerType)&&a.isPrimary:1===a.changedTouches.length&&(!a.targetTouches.length||a.targetTouches[0].identifier==a.changedTouches[0].identifier)}function d(a){return a.pointerType?"touch"===a.pointerType||a.MSPOINTER_TYPE_TOUCH===a.pointerType?a.pointerId:null:a.changedTouches[0].identifier}function e(a){return a.pointerType?"touch"===a.pointerType||a.MSPOINTER_TYPE_TOUCH===a.pointerType?a:null:a.changedTouches[0]}a.$;a.Event.Custom.tap=new a.Class(a.extend(a.Event.Custom,{type:"tap",id:null,init:function(a,b){var c=e(b);this.id=c.pointerId||c.identifier,this.x=c.pageX,this.y=c.pageY,this.pageX=c.pageX,this.pageY=c.pageY,this.clientX=c.clientX,this.clientY=c.clientY,this.timeStamp=b.timeStamp,this.button=0,this.target=a,this.pushToEvents(b)}}));var f=10,g=200;a.Event.Custom.tap.handler={add:function(b){this.jAddEvent(["touchstart",window.navigator.pointerEnabled?"pointerdown":"MSPointerDown"],a.Event.Custom.tap.handler.onTouchStart,1),this.jAddEvent(["touchend",window.navigator.pointerEnabled?"pointerup":"MSPointerUp"],a.Event.Custom.tap.handler.onTouchEnd,1),this.jAddEvent("click",a.Event.Custom.tap.handler.onClick,1)},jRemove:function(){this.jRemoveEvent(["touchstart",window.navigator.pointerEnabled?"pointerdown":"MSPointerDown"],a.Event.Custom.tap.handler.onTouchStart),this.jRemoveEvent(["touchend",window.navigator.pointerEnabled?"pointerup":"MSPointerUp"],a.Event.Custom.tap.handler.onTouchEnd),this.jRemoveEvent("click",a.Event.Custom.tap.handler.onClick)},onClick:function(a){a.stopDefaults()},onTouchStart:function(b){return c(b)?(this.jStore("event:tap:event",new a.Event.Custom.tap(this,b)),void this.jStore("event:btnclick:ignore",!0)):void this.jDel("event:tap:event")},onTouchEnd:function(b){var i=(a.now(),this.jFetch("event:tap:event"));this.jFetch("event:tap:options");i&&c(b)&&(this.jDel("event:tap:event"),i.id==d(b)&&b.timeStamp-i.timeStamp<=g&&Math.sqrt(Math.pow(e(b).pageX-i.x,2)+Math.pow(e(b).pageY-i.y,2))<=f&&(this.jDel("event:btnclick:btnclickEvent"),b.stop(),i.pushToEvents(b),this.jCallEvent("tap",i)))}}}(a),b.Event.Custom.dbltap=new b.Class(b.extend(b.Event.Custom,{type:"dbltap",timedout:!1,tm:null,init:function(a,b){this.x=b.x,this.y=b.y,this.clientX=b.clientX,this.clientY=b.clientY,this.timeStamp=b.timeStamp,this.button=0,this.target=a,this.pushToEvents(b)}})),b.Event.Custom.dbltap.handler={options:{threshold:300},add:function(a){this.jStore("event:dbltap:options",b.extend(b.detach(b.Event.Custom.dbltap.handler.options),a||{})),this.jAddEvent("tap",b.Event.Custom.dbltap.handler.handle,1)},jRemove:function(){this.jRemoveEvent("tap",b.Event.Custom.dbltap.handler.handle)},handle:function(a){var c,d;c=this.jFetch("event:dbltap:event"),d=this.jFetch("event:dbltap:options"),c?(clearTimeout(c.tm),this.jDel("event:dbltap:event"),c.timedout||(c.pushToEvents(a),a.stopQueue().stop(),this.jCallEvent("dbltap",c))):(c=new b.Event.Custom.dbltap(this,a),c.tm=setTimeout(function(){c.timedout=!0,a.isQueueStopped=b.$false,this.jCallEvent("tap",a)}.jBind(this),d.threshold+10),this.jStore("event:dbltap:event",c),a.stopQueue())}},function(a){function c(a){return a.pointerType?("touch"===a.pointerType||a.MSPOINTER_TYPE_TOUCH===a.pointerType)&&a.isPrimary:1===a.changedTouches.length&&(!a.targetTouches.length||a.targetTouches[0].identifier==a.changedTouches[0].identifier)}function d(a){return a.pointerType?"touch"===a.pointerType||a.MSPOINTER_TYPE_TOUCH===a.pointerType?a.pointerId:null:a.changedTouches[0].identifier}function e(a){return a.pointerType?"touch"===a.pointerType||a.MSPOINTER_TYPE_TOUCH===a.pointerType?a:null:a.changedTouches[0]}var b=a.$,f=10;a.Event.Custom.touchdrag=new a.Class(a.extend(a.Event.Custom,{type:"touchdrag",state:"dragstart",id:null,dragged:!1,init:function(a,b,c){var d=e(b);this.id=d.pointerId||d.identifier,this.clientX=d.clientX,this.clientY=d.clientY,this.pageX=d.pageX,this.pageY=d.pageY,this.x=d.pageX,this.y=d.pageY,this.timeStamp=b.timeStamp,this.button=0,this.target=a,this.pushToEvents(b),this.state=c}})),a.Event.Custom.touchdrag.handler={add:function(){var c=a.Event.Custom.touchdrag.handler.onTouchMove.jBind(this),d=a.Event.Custom.touchdrag.handler.onTouchEnd.jBind(this);this.jAddEvent(["touchstart",window.navigator.pointerEnabled?"pointerdown":"MSPointerDown"],a.Event.Custom.touchdrag.handler.onTouchStart,1),this.jAddEvent(["touchend",window.navigator.pointerEnabled?"pointerup":"MSPointerUp"],a.Event.Custom.touchdrag.handler.onTouchEnd,1),this.jAddEvent(["touchmove",window.navigator.pointerEnabled?"pointermove":"MSPointerMove"],a.Event.Custom.touchdrag.handler.onTouchMove,1),this.jStore("event:touchdrag:listeners:document:move",c),this.jStore("event:touchdrag:listeners:document:end",d),b(document).jAddEvent(window.navigator.pointerEnabled?"pointermove":"MSPointerMove",c,1),b(document).jAddEvent(window.navigator.pointerEnabled?"pointerup":"MSPointerUp",d,1)},jRemove:function(){this.jRemoveEvent(["touchstart",window.navigator.pointerEnabled?"pointerdown":"MSPointerDown"],a.Event.Custom.touchdrag.handler.onTouchStart),this.jRemoveEvent(["touchend",window.navigator.pointerEnabled?"pointerup":"MSPointerUp"],a.Event.Custom.touchdrag.handler.onTouchEnd),this.jRemoveEvent(["touchmove",window.navigator.pointerEnabled?"pointermove":"MSPointerMove"],a.Event.Custom.touchdrag.handler.onTouchMove),b(document).jRemoveEvent(window.navigator.pointerEnabled?"pointermove":"MSPointerMove",this.jFetch("event:touchdrag:listeners:document:move")||a.$F,1),b(document).jRemoveEvent(window.navigator.pointerEnabled?"pointerup":"MSPointerUp",this.jFetch("event:touchdrag:listeners:document:end")||a.$F,1),this.jDel("event:touchdrag:listeners:document:move"),this.jDel("event:touchdrag:listeners:document:end")},onTouchStart:function(b){var d;c(b)&&(d=new a.Event.Custom.touchdrag(this,b,"dragstart"),this.jStore("event:touchdrag:dragstart",d))},onTouchEnd:function(b){var c;c=this.jFetch("event:touchdrag:dragstart"),c&&c.dragged&&c.id==d(b)&&(c=new a.Event.Custom.touchdrag(this,b,"dragend"),this.jDel("event:touchdrag:dragstart"),this.jCallEvent("touchdrag",c))},onTouchMove:function(b){var g;if(g=this.jFetch("event:touchdrag:dragstart"),g&&c(b)){if(g.id!=d(b))return void this.jDel("event:touchdrag:dragstart");!g.dragged&&Math.sqrt(Math.pow(e(b).pageX-g.x,2)+Math.pow(e(b).pageY-g.y,2))>f&&(g.dragged=!0,this.jCallEvent("touchdrag",g)),g.dragged&&(g=new a.Event.Custom.touchdrag(this,b,"dragmove"),this.jCallEvent("touchdrag",g))}}}}(a),b.Event.Custom.touchpinch=new b.Class(b.extend(b.Event.Custom,{type:"touchpinch",scale:1,previousScale:1,curScale:1,state:"pinchstart",init:function(a,b){this.timeStamp=b.timeStamp,this.button=0,this.target=a,this.x=b.touches[0].clientX+(b.touches[1].clientX-b.touches[0].clientX)/2,this.y=b.touches[0].clientY+(b.touches[1].clientY-b.touches[0].clientY)/2,this._initialDistance=Math.sqrt(Math.pow(b.touches[0].clientX-b.touches[1].clientX,2)+Math.pow(b.touches[0].clientY-b.touches[1].clientY,2)),this.pushToEvents(b)},update:function(a){var b;this.state="pinchupdate",a.changedTouches[0].identifier==this.events[0].touches[0].identifier&&a.changedTouches[1].identifier==this.events[0].touches[1].identifier&&(b=Math.sqrt(Math.pow(a.changedTouches[0].clientX-a.changedTouches[1].clientX,2)+Math.pow(a.changedTouches[0].clientY-a.changedTouches[1].clientY,2)),this.previousScale=this.scale,this.scale=b/this._initialDistance,this.curScale=this.scale/this.previousScale,this.x=a.changedTouches[0].clientX+(a.changedTouches[1].clientX-a.changedTouches[0].clientX)/2,this.y=a.changedTouches[0].clientY+(a.changedTouches[1].clientY-a.changedTouches[0].clientY)/2,this.pushToEvents(a))}})),b.Event.Custom.touchpinch.handler={add:function(){this.jAddEvent("touchstart",b.Event.Custom.touchpinch.handler.handleTouchStart,1),this.jAddEvent("touchend",b.Event.Custom.touchpinch.handler.handleTouchEnd,1),this.jAddEvent("touchmove",b.Event.Custom.touchpinch.handler.handleTouchMove,1)},jRemove:function(){this.jRemoveEvent("touchstart",b.Event.Custom.touchpinch.handler.handleTouchStart),this.jRemoveEvent("touchend",b.Event.Custom.touchpinch.handler.handleTouchEnd),this.jRemoveEvent("touchmove",b.Event.Custom.touchpinch.handler.handleTouchMove)},handleTouchStart:function(a){var c;2==a.touches.length&&(a.stopDefaults(),c=new b.Event.Custom.touchpinch(this,a),this.jStore("event:touchpinch:event",c))},handleTouchEnd:function(a){var b;b=this.jFetch("event:touchpinch:event"),b&&(a.stopDefaults(),this.jDel("event:touchpinch:event"))},handleTouchMove:function(a){var b;b=this.jFetch("event:touchpinch:event"),b&&(a.stopDefaults(),b.update(a),this.jCallEvent("touchpinch",b))}},function(a){function e(){c=null}function f(b,c){return b>50||1===c&&!("win"==a.browser.platform&&b<1)||0===b%12||0==b%4.000244140625}a.$;a.Event.Custom.mousescroll=new a.Class(a.extend(a.Event.Custom,{type:"mousescroll",init:function(a,b,c,d,e,f,g){var h=b.jGetPageXY();this.x=h.x,this.y=h.y,this.timeStamp=b.timeStamp,this.target=a,this.delta=c||0,this.deltaX=d||0,this.deltaY=e||0,this.deltaZ=f||0,this.deltaFactor=g||0,this.deltaMode=b.deltaMode||0,this.isMouse=!1,this.pushToEvents(b)}}));var c,d;a.Event.Custom.mousescroll.handler={eventType:"onwheel"in document||a.browser.ieMode>8?"wheel":"mousewheel",add:function(){this.jAddEvent(a.Event.Custom.mousescroll.handler.eventType,a.Event.Custom.mousescroll.handler.handle,1)},jRemove:function(){this.jRemoveEvent(a.Event.Custom.mousescroll.handler.eventType,a.Event.Custom.mousescroll.handler.handle,1)},handle:function(b){var k,l,g=0,h=0,i=0,j=0;b.detail&&(i=b.detail*-1),void 0!==b.wheelDelta&&(i=b.wheelDelta),void 0!==b.wheelDeltaY&&(i=b.wheelDeltaY),void 0!==b.wheelDeltaX&&(h=b.wheelDeltaX*-1),b.deltaY&&(i=-1*b.deltaY),b.deltaX&&(h=b.deltaX),0===i&&0===h||(g=0===i?h:i,j=Math.max(Math.abs(i),Math.abs(h)),(!c||j<c)&&(c=j),k=g>0?"floor":"ceil",g=Math[k](g/c),h=Math[k](h/c),i=Math[k](i/c),d&&clearTimeout(d),d=setTimeout(e,200),l=new a.Event.Custom.mousescroll(this,b,g,h,i,0,c),l.isMouse=f(c,b.deltaMode||0),this.jCallEvent("mousescroll",l))}}}(a),b.win=b.$(window),b.doc=b.$(document),a}(),function(b){if(!b)throw"MagicJS not found";var c=b.$,d=window.URL||window.webkitURL||null;a.ImageLoader=new b.Class({img:null,ready:!1,options:{onprogress:b.$F,onload:b.$F,onabort:b.$F,onerror:b.$F,oncomplete:b.$F,onxhrerror:b.$F,xhr:!1,progressiveLoad:!0},size:null,_timer:null,loadedBytes:0,_handlers:{onprogress:function(a){a.target&&(200===a.target.status||304===a.target.status)&&a.lengthComputable&&(this.options.onprogress.jBind(null,(a.loaded-(this.options.progressiveLoad?this.loadedBytes:0))/a.total).jDelay(1),this.loadedBytes=a.loaded)},onload:function(a){a&&c(a).stop(),this._unbind(),this.ready||(this.ready=!0,this._cleanup(),!this.options.xhr&&this.options.onprogress.jBind(null,1).jDelay(1),this.options.onload.jBind(null,this).jDelay(1),this.options.oncomplete.jBind(null,this).jDelay(1))},onabort:function(a){a&&c(a).stop(),this._unbind(),this.ready=!1,this._cleanup(),this.options.onabort.jBind(null,this).jDelay(1),this.options.oncomplete.jBind(null,this).jDelay(1)},onerror:function(a){a&&c(a).stop(),this._unbind(),this.ready=!1,this._cleanup(),this.options.onerror.jBind(null,this).jDelay(1),this.options.oncomplete.jBind(null,this).jDelay(1)}},_bind:function(){c(["load","abort","error"]).jEach(function(a){this.img.jAddEvent(a,this._handlers["on"+a].jBindAsEvent(this).jDefer(1))},this)},_unbind:function(){if(this._timer){try{clearTimeout(this._timer)}catch(a){}this._timer=null}c(["load","abort","error"]).jEach(function(a){this.img.jRemoveEvent(a)},this)},_cleanup:function(){if(this.jGetSize(),this.img.jFetch("new")){var a=this.img.parentNode;this.img.jRemove().jDel("new").jSetCss({position:"static",top:"auto"}),a.kill()}},loadBlob:function(a){var f,e=new XMLHttpRequest;c(["abort","progress"]).jEach(function(a){e["on"+a]=c(function(b){this._handlers["on"+a].call(this,b)}).jBind(this)},this),e.onerror=c(function(){this.options.onxhrerror.jBind(null,this).jDelay(1),this.options.xhr=!1,this._bind(),this.img.src=a}).jBind(this),e.onload=c(function(){return 200!==e.status&&304!==e.status?void this._handlers.onerror.call(this):(f=e.response,this._bind(),void(!d||b.browser.trident||"ios"===b.browser.platform&&b.browser.version<537?this.img.src=a:this.img.setAttribute("src",d.createObjectURL(f))))}).jBind(this),e.open("GET",a),e.responseType="blob",e.send()},init:function(a,d){if(this.options=b.extend(this.options,d),this.img=c(a)||b.$new("img",{},{"max-width":"none","max-height":"none"}).jAppendTo(b.$new("div").jAddClass("magic-temporary-img").jSetCss({position:"absolute",top:-1e4,width:10,height:10,overflow:"hidden"}).jAppendTo(document.body)).jStore("new",!0),b.browser.features.xhr2&&this.options.xhr&&"string"==b.jTypeOf(a))return void this.loadBlob(a);var e=function(){this.isReady()?this._handlers.onload.call(this):this._handlers.onerror.call(this),e=null}.jBind(this);this._bind(),"string"==b.jTypeOf(a)?this.img.src=a:(b.browser.trident&&5==b.browser.version&&b.browser.ieMode<9&&(this.img.onreadystatechange=function(){/loaded|complete/.test(this.img.readyState)&&(this.img.onreadystatechange=null,e&&e())}.jBind(this)),this.img.src=a.getAttribute("src")),this.img&&this.img.complete&&e&&(this._timer=e.jDelay(100))},destroy:function(){return this._unbind(),this._cleanup(),this.ready=!1,this},isReady:function(){var a=this.img;return a.naturalWidth?a.naturalWidth>0:a.readyState?"complete"==a.readyState:a.width>0},jGetSize:function(){return this.size||(this.size={width:this.img.naturalWidth||this.img.width,height:this.img.naturalHeight||this.img.height})}})}(a),function(a){if(!a)throw"MagicJS not found";if(!a.FX){var b=a.$;a.FX=new a.Class({init:function(b,c){var d;this.el=a.$(b),this.options=a.extend(this.options,c),this.timer=!1,this.easeFn=this.cubicBezierAtTime,d=a.FX.Transition[this.options.transition]||this.options.transition,"function"===a.jTypeOf(d)?this.easeFn=d:this.cubicBezier=this.parseCubicBezier(d)||this.parseCubicBezier("ease"),"string"==a.jTypeOf(this.options.cycles)&&(this.options.cycles="infinite"===this.options.cycles?1/0:parseInt(this.options.cycles)||1)},options:{fps:60,duration:600,transition:"ease",cycles:1,direction:"normal",onStart:a.$F,onComplete:a.$F,onBeforeRender:a.$F,onAfterRender:a.$F,forceAnimation:!1,roundCss:!1},styles:null,cubicBezier:null,easeFn:null,setTransition:function(b){this.options.transition=b,b=a.FX.Transition[this.options.transition]||this.options.transition,"function"===a.jTypeOf(b)?this.easeFn=b:(this.easeFn=this.cubicBezierAtTime,this.cubicBezier=this.parseCubicBezier(b)||this.parseCubicBezier("ease"))},start:function(b){var d,c=/\%$/;this.styles=b||{},this.cycle=0,this.state=0,this.curFrame=0,this.pStyles={},this.alternate="alternate"===this.options.direction||"alternate-reverse"===this.options.direction,this.continuous="continuous"===this.options.direction||"continuous-reverse"===this.options.direction;for(d in this.styles)c.test(this.styles[d][0])&&(this.pStyles[d]=!0),"reverse"!==this.options.direction&&"alternate-reverse"!==this.options.direction&&"continuous-reverse"!==this.options.direction||this.styles[d].reverse();return this.startTime=a.now(),this.finishTime=this.startTime+this.options.duration,this.options.onStart.call(),0===this.options.duration?(this.render(1),this.options.onComplete.call()):(this.loopBind=this.loop.jBind(this),!this.options.forceAnimation&&a.browser.features.requestAnimationFrame?this.timer=a.browser.requestAnimationFrame.call(window,this.loopBind):this.timer=this.loopBind.interval(Math.round(1e3/this.options.fps))),this},stopAnimation:function(){this.timer&&(!this.options.forceAnimation&&a.browser.features.requestAnimationFrame&&a.browser.cancelAnimationFrame?a.browser.cancelAnimationFrame.call(window,this.timer):clearInterval(this.timer),this.timer=!1)},stop:function(b){return b=!!a.defined(b)&&b,this.stopAnimation(),b&&(this.render(1),this.options.onComplete.jDelay(10)),this},calc:function(a,b,c){return a=parseFloat(a),b=parseFloat(b),(b-a)*c+a},loop:function(){var b=a.now(),c=(b-this.startTime)/this.options.duration,d=Math.floor(c);if(b>=this.finishTime&&d>=this.options.cycles)return this.stopAnimation(),this.render(1),this.options.onComplete.jDelay(10),this;if(this.alternate&&this.cycle<d)for(var e in this.styles)this.styles[e].reverse();this.cycle=d,!this.options.forceAnimation&&a.browser.features.requestAnimationFrame&&(this.timer=a.browser.requestAnimationFrame.call(window,this.loopBind)),this.render((this.continuous?d:0)+this.easeFn(c%1))},render:function(a){var b={};for(var d in this.styles)"opacity"===d?b[d]=Math.round(100*this.calc(this.styles[d][0],this.styles[d][1],a))/100:(b[d]=this.calc(this.styles[d][0],this.styles[d][1],a),this.pStyles[d]&&(b[d]+="%"));this.options.onBeforeRender(b,this.el),this.set(b),this.options.onAfterRender(b,this.el)},set:function(a){return this.el.jSetCss(a)},parseCubicBezier:function(c){var d,e=null;if("string"!==a.jTypeOf(c))return null;switch(c){case"linear":e=b([0,0,1,1]);break;case"ease":e=b([.25,.1,.25,1]);break;case"ease-in":e=b([.42,0,1,1]);break;case"ease-out":e=b([0,0,.58,1]);break;case"ease-in-out":e=b([.42,0,.58,1]);break;case"easeInSine":e=b([.47,0,.745,.715]);break;case"easeOutSine":e=b([.39,.575,.565,1]);break;case"easeInOutSine":e=b([.445,.05,.55,.95]);break;case"easeInQuad":e=b([.55,.085,.68,.53]);break;case"easeOutQuad":e=b([.25,.46,.45,.94]);break;case"easeInOutQuad":e=b([.455,.03,.515,.955]);break;case"easeInCubic":e=b([.55,.055,.675,.19]);break;case"easeOutCubic":e=b([.215,.61,.355,1]);break;case"easeInOutCubic":e=b([.645,.045,.355,1]);break;case"easeInQuart":e=b([.895,.03,.685,.22]);break;case"easeOutQuart":e=b([.165,.84,.44,1]);break;case"easeInOutQuart":e=b([.77,0,.175,1]);break;case"easeInQuint":e=b([.755,.05,.855,.06]);break;case"easeOutQuint":e=b([.23,1,.32,1]);break;case"easeInOutQuint":e=b([.86,0,.07,1]);break;case"easeInExpo":e=b([.95,.05,.795,.035]);break;case"easeOutExpo":e=b([.19,1,.22,1]);break;case"easeInOutExpo":e=b([1,0,0,1]);break;case"easeInCirc":e=b([.6,.04,.98,.335]);break;case"easeOutCirc":e=b([.075,.82,.165,1]);break;case"easeInOutCirc":e=b([.785,.135,.15,.86]);break;case"easeInBack":e=b([.6,-.28,.735,.045]);break;case"easeOutBack":e=b([.175,.885,.32,1.275]);break;case"easeInOutBack":e=b([.68,-.55,.265,1.55]);break;default:if(c=c.replace(/\s/g,""),c.match(/^cubic-bezier\((?:-?[0-9\.]{0,}[0-9]{1,},){3}(?:-?[0-9\.]{0,}[0-9]{1,})\)$/))for(e=c.replace(/^cubic-bezier\s*\(|\)$/g,"").split(","),d=e.length-1;d>=0;d--)e[d]=parseFloat(e[d])}return b(e)},cubicBezierAtTime:function(a){function i(a){return((b*a+c)*a+d)*a}function j(a){return((e*a+f)*a+g)*a}function k(a){return(3*b*a+2*c)*a+d}function l(a){return 1/(200*a)}function m(a,b){return j(n(a,b))}function n(a,b){function j(a){return a>=0?a:0-a}var c,d,e,f,g,h;for(e=a,h=0;h<8;h++){if(f=i(e)-a,j(f)<b)return e;if(g=k(e),j(g)<1e-6)break;e-=f/g}if(c=0,d=1,e=a,e<c)return c;if(e>d)return d;for(;c<d;){if(f=i(e),j(f-a)<b)return e;a>f?c=e:d=e,e=.5*(d-c)+c}return e}var b=0,c=0,d=0,e=0,f=0,g=0,h=this.options.duration;return d=3*this.cubicBezier[0],c=3*(this.cubicBezier[2]-this.cubicBezier[0])-d,b=1-d-c,g=3*this.cubicBezier[1],f=3*(this.cubicBezier[3]-this.cubicBezier[1])-g,e=1-g-f,m(a,l(h))}}),a.FX.Transition={linear:"linear",sineIn:"easeInSine",sineOut:"easeOutSine",expoIn:"easeInExpo",expoOut:"easeOutExpo",quadIn:"easeInQuad",quadOut:"easeOutQuad",cubicIn:"easeInCubic",cubicOut:"easeOutCubic",backIn:"easeInBack",backOut:"easeOutBack",elasticIn:function(a,b){return b=b||[],Math.pow(2,10*--a)*Math.cos(20*a*Math.PI*(b[0]||1)/3)},elasticOut:function(b,c){return 1-a.FX.Transition.elasticIn(1-b,c)},bounceIn:function(a){for(var b=0,c=1;1;b+=c,c/=2)if(a>=(7-4*b)/11)return c*c-Math.pow((11-6*b-11*a)/4,2)},bounceOut:function(b){return 1-a.FX.Transition.bounceIn(1-b)},none:function(a){return 0}}}}(a),function(a){if(!a)throw"MagicJS not found";if(!a.PFX){a.$;a.PFX=new a.Class(a.FX,{init:function(b,c){this.el_arr=b,this.options=a.extend(this.options,c),this.timer=!1,this.$parent.init()},start:function(a){var c,d,b=/\%$/,e=a.length;for(this.styles_arr=a,this.pStyles_arr=new Array(e),d=0;d<e;d++){this.pStyles_arr[d]={};for(c in a[d])b.test(a[d][c][0])&&(this.pStyles_arr[d][c]=!0),"reverse"!==this.options.direction&&"alternate-reverse"!==this.options.direction&&"continuous-reverse"!==this.options.direction||this.styles_arr[d][c].reverse()}return this.$parent.start({}),this},render:function(b){for(var c=0;c<this.el_arr.length;c++)this.el=a.$(this.el_arr[c]),this.styles=this.styles_arr[c],this.pStyles=this.pStyles_arr[c],this.$parent.render(b)}})}}(a),function(a){if(!a)throw"MagicJS not found";if(!a.Tooltip){a.$;a.Tooltip=function(b,c){var d=this.tooltip=a.$new("div",null,{position:"absolute","z-index":999}).jAddClass("MagicToolboxTooltip");a.$(b).jAddEvent("mouseover",function(){d.jAppendTo(document.body)}),a.$(b).jAddEvent("mouseout",function(){d.jRemove()}),a.$(b).jAddEvent("mousemove",function(b){function i(a,b,c){return c<(a-b)/2?c:c>(a+b)/2?c-b:(a-b)/2}var c=20,e=a.$(b).jGetPageXY(),f=d.jGetSize(),g=a.$(window).jGetSize(),h=a.$(window).jGetScroll();d.jSetCss({left:h.x+i(g.width,f.width+2*c,e.x-h.x)+c,top:h.y+i(g.height,f.height+2*c,e.y-h.y)+c})}),this.text(c)},a.Tooltip.prototype.text=function(a){this.tooltip.firstChild&&this.tooltip.removeChild(this.tooltip.firstChild),this.tooltip.append(document.createTextNode(a))}}}(a),function(b){if(!b)throw"MagicJS not found";if(!b.MessageBox){b.$;b.Message=function(a,c,d,e){this.hideTimer=null,this.messageBox=b.$new("span",null,{position:"absolute","z-index":999,visibility:"hidden",opacity:.8}).jAddClass(e||"").jAppendTo(d||document.body),this.setMessage(a),this.show(c)},b.Message.prototype.show=function(a){this.messageBox.show(),this.hideTimer=this.hide.jBind(this).jDelay(b.ifndef(a,5e3))},b.Message.prototype.hide=function(c){clearTimeout(this.hideTimer),this.hideTimer=null,this.messageBox&&!this.hideFX&&(this.hideFX=new a.FX(this.messageBox,{duration:b.ifndef(c,500),onComplete:function(){this.messageBox.kill(),delete this.messageBox,this.hideFX=null}.jBind(this)}).start({opacity:[this.messageBox.jGetCss("opacity"),0]}))},b.Message.prototype.setMessage=function(a){this.messageBox.firstChild&&this.tooltip.removeChild(this.messageBox.firstChild),this.messageBox.append(document.createTextNode(a))}}}(a),function(a){if(!a)throw"MagicJS not found";if(!a.Options){var b=a.$,c=null,d={boolean:1,array:2,number:3,function:4,string:100},e={boolean:function(d,e,f){if("boolean"!=a.jTypeOf(e)){if(f||"string"!=a.jTypeOf(e))return!1;if(!/^(true|false)$/.test(e))return!1;e=e.jToBool()}return!(d.hasOwnProperty("enum")&&!b(d.enum).contains(e))&&(c=e,!0)},string:function(d,e,f){return"string"===a.jTypeOf(e)&&(!(d.hasOwnProperty("enum")&&!b(d.enum).contains(e))&&(c=""+e,!0))},number:function(d,e,f){var h=/%$/,i="string"==a.jTypeOf(e)&&h.test(e);return(!f||0!=typeof e)&&(e=parseFloat(e),!isNaN(e)&&(isNaN(d.minimum)&&(d.minimum=Number.NEGATIVE_INFINITY),isNaN(d.maximum)&&(d.maximum=Number.POSITIVE_INFINITY),!(d.hasOwnProperty("enum")&&!b(d.enum).contains(e))&&(!(d.minimum>e||e>d.maximum)&&(c=i?e+"%":e,!0))))},array:function(b,d,e){if("string"===a.jTypeOf(d))try{d=window.JSON.parse(d)}catch(a){return!1}return"array"===a.jTypeOf(d)&&(c=d,!0)},function:function(b,d,e){return"function"===a.jTypeOf(d)&&(c=d,!0)}},f=function(b,c,d){var f;if(f=b.hasOwnProperty("oneOf")?b.oneOf:[b],"array"!=a.jTypeOf(f))return!1;for(var g=0,h=f.length-1;g<=h;g++)if(e[f[g].type](f[g],c,d))return!0;return!1},g=function(a){var b,c,f,g;if(a.hasOwnProperty("oneOf"))for(f=a.oneOf.length,b=0;b<f;b++)for(c=b+1;c<f;c++)d[a.oneOf[b].type]>d[a.oneOf[c].type]&&(g=a.oneOf[b],a.oneOf[b]=a.oneOf[c],a.oneOf[c]=g);return a},h=function(b){var c;if(c=b.hasOwnProperty("oneOf")?b.oneOf:[b],"array"!=a.jTypeOf(c))return!1;for(var g=c.length-1;g>=0;g--){if(!c[g].type||!d.hasOwnProperty(c[g].type))return!1;if(a.defined(c[g].enum)){if("array"!==a.jTypeOf(c[g].enum))return!1;for(var h=c[g].enum.length-1;h>=0;h--)if(!e[c[g].type]({type:c[g].type},c[g].enum[h],!0))return!1}}return!(b.hasOwnProperty("default")&&!f(b,b.default,!0))},i=function(a){this.schema={},this.options={},this.parseSchema(a)};a.extend(i.prototype,{parseSchema:function(a){var b,c;for(b in a)if(a.hasOwnProperty(b)&&(c=(b+"").jTrim().jCamelize(),!this.schema.hasOwnProperty(c))){if(this.schema[c]=g(a[b]),!h(this.schema[c]))throw"Incorrect definition of the '"+b+"' parameter in "+a;this.options[c]=void 0}},set:function(b,d){b=(b+"").jTrim().jCamelize(),"string"==a.jTypeOf(d)&&(d=d.jTrim()),this.schema.hasOwnProperty(b)&&(c=d,f(this.schema[b],d)&&(this.options[b]=c),c=null)},get:function(b){if(b=(b+"").jTrim().jCamelize(),this.schema.hasOwnProperty(b))return a.defined(this.options[b])?this.options[b]:this.schema[b].default},fromJSON:function(a){for(var b in a)this.set(b,a[b])},getJSON:function(){var b=a.extend({},this.options);for(var c in b)void 0===b[c]&&void 0!==this.schema[c].default&&(b[c]=this.schema[c].default);return b},fromString:function(a){b(a.split(";")).jEach(b(function(a){a=a.split(":"),this.set(a.shift().jTrim(),a.join(":"))}).jBind(this))},exists:function(a){return a=(a+"").jTrim().jCamelize(),this.schema.hasOwnProperty(a)},isset:function(b){return b=(b+"").jTrim().jCamelize(),this.exists(b)&&a.defined(this.options[b])},jRemove:function(a){a=(a+"").jTrim().jCamelize(),this.exists(a)&&(delete this.options[a],delete this.schema[a])}}),a.Options=i}}(a),function(a){if(!a)throw"MagicJS not found";var b=a.$;if(!a.SVGImage){var c="http://www.w3.org/2000/svg",d="http://www.w3.org/1999/xlink",e=function(a){this.filters={},this.originalImage=b(a),this.canvas=b(document.createElementNS(c,"svg")),this.canvas.setAttribute("width",this.originalImage.naturalWidth||this.originalImage.width),this.canvas.setAttribute("height",this.originalImage.naturalHeight||this.originalImage.height),this.image=b(document.createElementNS(c,"image")),this.image.setAttributeNS(d,"href",this.originalImage.getAttribute("src")),this.image.setAttribute("width","100%"),this.image.setAttribute("height","100%"),this.image.jAppendTo(this.canvas)};e.prototype.getNode=function(){return this.canvas},e.prototype.blur=function(a){if(!(Math.round(a)<1))return this.filters.blur?this.filters.blur.firstChild.setAttribute("stdDeviation",a):(this.filters.blur=b(document.createElementNS(c,"filter")),this.filters.blur.setAttribute("id","filterBlur"),this.filters.blur.appendChild(b(document.createElementNS(c,"feGaussianBlur")).setProps({in:"SourceGraphic",stdDeviation:a})),this.filters.blur.jAppendTo(this.canvas),this.image.setAttribute("filter","url(#filterBlur)")),this},a.SVGImage=e}}(a);var c=function(a){var b=a.$,c=function(b,c){this.settings={cssPrefix:"magic",orientation:"horizontal",position:"bottom",size:{units:"px",width:"auto",height:"auto"},sides:["height","width"]},this.parent=b,this.root=null,this.wrapper=null,this.context=null,this.buttons={},this.items=[],this.selectedItem=null,this.scrollFX=null,this.resizeCallback=null,this.settings=a.extend(this.settings,c),this.rootCSS=this.settings.cssPrefix+"-thumbs",this.itemCSS=this.settings.cssPrefix+"-thumb",this.setupContent()};return c.prototype={setupContent:function(){this.root=a.$new("div").jAddClass(this.rootCSS).jAddClass(this.rootCSS+"-"+this.settings.orientation).jSetCss({visibility:"hidden"}),this.wrapper=a.$new("div").jAddClass(this.rootCSS+"-wrapper").jAppendTo(this.root),this.root.jAppendTo(this.parent),b(["prev","next"]).jEach(function(c){this.buttons[c]=a.$new("button").jAddClass(this.rootCSS+"-button").jAddClass(this.rootCSS+"-button-"+c).jAppendTo(this.root).jAddEvent("btnclick tap",function(a,c){b(a).events[0].stop().stopQueue(),b(a).stopDistribution(),this.scroll(c)}.jBindAsEvent(this,c))}.jBind(this)),this.buttons.prev.jAddClass(this.rootCSS+"-button-disabled"),this.context=a.$new("ul").jAddEvent("btnclick tap",function(a){a.stop()})},addItem:function(b){var c=a.$new("li").jAddClass(this.itemCSS).append(b).jAppendTo(this.context);return new a.ImageLoader(b,{oncomplete:this.reflow.jBind(this)}),this.items.push(c),c},selectItem:function(a){var c=this.selectedItem||this.context.byClass(this.itemCSS+"-selected")[0];c&&b(c).jRemoveClass(this.itemCSS+"-selected"),this.selectedItem=b(a),this.selectedItem&&(this.selectedItem.jAddClass(this.itemCSS+"-selected"),this.scroll(this.selectedItem))},run:function(){if(this.wrapper!==this.context.parentNode)return b(this.context).jAppendTo(this.wrapper),this.initDrag(),b(window).jAddEvent("resize",this.resizeCallback=this.reflow.jBind(this)),void this.run.jBind(this).jDelay(1);var a=this.parent.jGetSize();a.height>0&&a.height>a.width?this.setOrientation("vertical"):this.setOrientation("horizontal"),this.reflow(),this.root.jSetCss({visibility:""})},stop:function(){this.resizeCallback&&b(window).jRemoveEvent("resize",this.resizeCallback),this.root.kill()},scroll:function(b,c){var k,l,m,q,d={x:0,y:0},e="vertical"==this.settings.orientation?"top":"left",f="vertical"==this.settings.orientation?"height":"width",g="vertical"==this.settings.orientation?"y":"x",h=this.context.parentNode.jGetSize()[f],i=this.context.parentNode.jGetPosition(),j=this.context.jGetSize()[f],r=[];
if(this.scrollFX?this.scrollFX.stop():this.context.jSetCss("transition",a.browser.cssTransformProp+String.fromCharCode(32)+"0s"),void 0===c&&(c=600),k=this.context.jGetPosition(),"string"==a.jTypeOf(b))d[g]="next"==b?Math.max(k[e]-i[e]-h,h-j):Math.min(k[e]-i[e]+h,0);else{if("element"!=a.jTypeOf(b))return;l=b.jGetSize(),m=b.jGetPosition(),d[g]=Math.min(0,Math.max(h-j,k[e]+h/2-m[e]-l[f]/2))}a.browser.gecko&&"android"==a.browser.platform||a.browser.ieMode&&a.browser.ieMode<10?("string"==a.jTypeOf(b)&&d[g]==k[e]-i[e]&&(k[e]+=0===k[e]-i[e]?30:-30),d["margin-"+e]=[j<=h?0:k[e]-i[e],d[g]],delete d.x,delete d.y,this.selectorsMoveFX||(this.selectorsMoveFX=new a.PFX([this.context],{duration:500})),r.push(d),this.selectorsMoveFX.start(r),q=d["margin-"+e][1]):(this.context.jSetCss({transition:a.browser.cssTransformProp+String.fromCharCode(32)+c+"ms ease",transform:"translate3d("+d.x+"px, "+d.y+"px, 0)"}),q=d[g]),q>=0?this.buttons.prev.jAddClass(this.rootCSS+"-button-disabled"):this.buttons.prev.jRemoveClass(this.rootCSS+"-button-disabled"),q<=h-j?this.buttons.next.jAddClass(this.rootCSS+"-button-disabled"):this.buttons.next.jRemoveClass(this.rootCSS+"-button-disabled"),q=null},initDrag:function(){var c,e,f,g,h,i,j,k,l,m,n,o,q,r,p={x:0,y:0},s=300,t=function(a){var b,c=0;for(b=1.5;b<=90;b+=1.5)c+=a*Math.cos(b/Math.PI/2);return f<0&&(c*=-1),c};g=b(function(b){if(p={x:0,y:0},q="vertical"==this.settings.orientation?"top":"left",r="vertical"==this.settings.orientation?"height":"width",c="vertical"==this.settings.orientation?"y":"x",n=this.context.parentNode.jGetSize()[r],m=this.context.jGetSize()[r],e=n-m,!(e>=0))if("dragstart"==b.state)void 0===o&&(o=0),this.context.jSetCssProp("transition",a.browser.cssTransformProp+String.fromCharCode(32)+"0ms"),h=b[c],k=b.y,j=b.x,l=!1;else{if("dragend"==b.state){if(l)return;i=t(Math.abs(f)),o+=i,o<=e&&(o=e),o>=0&&(o=0),p[c]=o,this.context.jSetCssProp("transition",a.browser.cssTransformProp+String.fromCharCode(32)+s+"ms  cubic-bezier(.0, .0, .0, 1)"),this.context.jSetCssProp("transform","translate3d("+p.x+"px, "+p.y+"px, 0px)"),f=0}else{if(l)return;"horizontal"==this.settings.orientation&&Math.abs(b.x-j)>Math.abs(b.y-k)||"vertical"==this.settings.orientation&&Math.abs(b.x-j)<Math.abs(b.y-k)?(b.stop(),f=b[c]-h,o+=f,p[c]=o,this.context.jSetCssProp("transform","translate3d("+p.x+"px, "+p.y+"px, 0px)"),o>=0?this.buttons.prev.jAddClass(this.rootCSS+"-button-disabled"):this.buttons.prev.jRemoveClass(this.rootCSS+"-button-disabled"),o<=e?this.buttons.next.jAddClass(this.rootCSS+"-button-disabled"):this.buttons.next.jRemoveClass(this.rootCSS+"-button-disabled")):l=!0}h=b[c]}}).jBind(this),this.context.jAddEvent("touchdrag",g)},reflow:function(){var a,b,c,d=this.parent.jGetSize();d.height>0&&d.height>d.width?this.setOrientation("vertical"):this.setOrientation("horizontal"),a="vertical"==this.settings.orientation?"height":"width",b=this.context.jGetSize()[a],c=this.root.jGetSize()[a],b<=c?(this.root.jAddClass("no-buttons"),this.context.jSetCssProp("transition","").jGetSize(),this.context.jSetCssProp("transform","translate3d(0,0,0)"),this.buttons.prev.jAddClass(this.rootCSS+"-button-disabled"),this.buttons.next.jRemoveClass(this.rootCSS+"-button-disabled")):this.root.jRemoveClass("no-buttons"),this.selectedItem&&this.scroll(this.selectedItem,0)},setOrientation:function(a){"vertical"!==a&&"horizontal"!==a||a==this.settings.orientation||(this.root.jRemoveClass(this.rootCSS+"-"+this.settings.orientation),this.settings.orientation=a,this.root.jAddClass(this.rootCSS+"-"+this.settings.orientation),this.context.jSetCssProp("transition","none").jGetSize(),this.context.jSetCssProp("transform","").jSetCssProp("margin",""))}},c}(a),d=b.$;"function"!=typeof Object.assign&&(Object.assign=function(a){if(null==a)throw new TypeError("Cannot convert undefined or null to object");a=Object(a);for(var b=1;b<arguments.length;b++){var c=arguments[b];if(null!=c)for(var d in c)Object.prototype.hasOwnProperty.call(c,d)&&(a[d]=c[d])}return a}),b.browser.cssTransform||(b.browser.cssTransform=b.normalizeCSS("transform").dashize());var k,n,p,e={zoomOn:{type:"string",enum:["click","hover"],default:"hover"},zoomMode:{oneOf:[{type:"string",enum:["zoom","magnifier","preview","off"],default:"zoom"},{type:"boolean",enum:[!1]}],default:"zoom"},zoomWidth:{oneOf:[{type:"string",enum:["auto"]},{type:"number",minimum:1}],default:"auto"},zoomHeight:{oneOf:[{type:"string",enum:["auto"]},{type:"number",minimum:1}],default:"auto"},zoomPosition:{type:"string",default:"right"},zoomDistance:{type:"number",minimum:0,default:15},zoomCaption:{oneOf:[{type:"string",enum:["bottom","top","off"],default:"off"},{type:"boolean",enum:[!1]}],default:"off"},expand:{oneOf:[{type:"string",enum:["window","fullscreen","off"]},{type:"boolean",enum:[!1]}],default:"window"},expandZoomMode:{oneOf:[{type:"string",enum:["zoom","magnifier","off"],default:"zoom"},{type:"boolean",enum:[!1]}],default:"zoom"},expandZoomOn:{type:"string",enum:["click","always"],default:"click"},expandCaption:{type:"boolean",default:!0},closeOnClickOutside:{type:"boolean",default:!0},hint:{oneOf:[{type:"string",enum:["once","always","off"]},{type:"boolean",enum:[!1]}],default:"once"},smoothing:{type:"boolean",default:!0},upscale:{type:"boolean",default:!0},variableZoom:{type:"boolean",default:!1},lazyZoom:{type:"boolean",default:!1},autostart:{type:"boolean",default:!0},rightClick:{type:"boolean",default:!1},transitionEffect:{type:"boolean",default:!0},selectorTrigger:{type:"string",enum:["click","hover"],default:"click"},cssClass:{type:"string"},forceTouch:{type:"boolean",default:!1},textHoverZoomHint:{type:"string",default:"Hover to zoom"},textClickZoomHint:{type:"string",default:"Click to zoom"},textExpandHint:{type:"string",default:"Click to expand"},textBtnClose:{type:"string",default:"Close"},textBtnNext:{type:"string",default:"Next"},textBtnPrev:{type:"string",default:"Previous"}},f={zoomMode:{oneOf:[{type:"string",enum:["zoom","magnifier","off"],default:"zoom"},{type:"boolean",enum:[!1]}],default:"zoom"},expandZoomOn:{type:"string",enum:["click","always"],default:"click"},textExpandHint:{type:"string",default:"Tap to expand"},textHoverZoomHint:{type:"string",default:"Touch to zoom"},textClickZoomHint:{type:"string",default:"Double tap to zoom"}},h="mz",i=20,j=["onZoomReady","onUpdate","onZoomIn","onZoomOut","onExpandOpen","onExpandClose"],l={},m=d([]),o=window.devicePixelRatio||1,q=!0,r=b.browser.features.perspective?"translate3d(":"translate(",s=b.browser.features.perspective?",0)":")",t=null,u=function(){var e;return e}(),v=function(){return"mgctlbxN$MZ"+"p".toUpperCase()+" mgctlbxV$"+"v5.2.1".replace("v","")+" mgctlbxL$"+"c".toUpperCase()+(window.mgctlbx$Pltm&&"string"==b.jTypeOf(window.mgctlbx$Pltm)?" mgctlbxP$"+window.mgctlbx$Pltm.toLowerCase():"")},G=function(a,c,d,e,f){this.small={src:null,url:null,dppx:1,node:null,state:0,size:{width:0,height:0},loaded:!1},this.zoom={src:null,url:null,dppx:1,node:null,state:0,size:{width:0,height:0},loaded:!1},"object"==b.jTypeOf(a)?this.small=a:"string"==b.jTypeOf(a)&&(this.small.url=b.getAbsoluteURL(a)),"object"==b.jTypeOf(c)?this.zoom=c:"string"==b.jTypeOf(c)&&(this.zoom.url=b.getAbsoluteURL(c)),this.caption=d,this.options=e,this.origin=f,this.callback=null,this.link=null,this.node=null};G.prototype={parseNode:function(a,c,d){var e=a.byTag("img")[0];return d&&(this.small.node=e||b.$new("img").jAppendTo(a)),o>1&&(this.small.url=a.getAttribute("data-image-2x"),this.small.url&&(this.small.dppx=2),this.zoom.url=a.getAttribute("data-zoom-image-2x"),this.zoom.url&&(this.zoom.dppx=2)),this.small.src=a.getAttribute("data-image")||a.getAttribute("rev")||(e?e.getAttribute("src"):null),this.small.src&&(this.small.src=b.getAbsoluteURL(this.small.src)),this.small.url=this.small.url||this.small.src,this.small.url&&(this.small.url=b.getAbsoluteURL(this.small.url)),this.zoom.src=a.getAttribute("data-zoom-image")||a.getAttribute("href"),this.zoom.src&&(this.zoom.src=b.getAbsoluteURL(this.zoom.src)),this.zoom.url=this.zoom.url||this.zoom.src,this.zoom.url&&(this.zoom.url=b.getAbsoluteURL(this.zoom.url)),this.caption=a.getAttribute("data-caption")||a.getAttribute("title")||c,this.link=a.getAttribute("data-link"),this.origin=a,this},loadImg:function(a){var c=null;return arguments.length>1&&"function"===b.jTypeOf(arguments[1])&&(c=arguments[1]),0!==this[a].state?void(this[a].loaded&&this.onload(c)):(this[a].url&&this[a].node&&!this[a].node.getAttribute("src")&&!this[a].node.getAttribute("srcset")&&this[a].node.setAttribute("src",this[a].url),this[a].state=1,void new b.ImageLoader(this[a].node||this[a].url,{oncomplete:d(function(e){this[a].loaded=!0,this[a].state=e.ready?2:-1,e.ready&&(this[a].size=e.jGetSize(),this[a].node?(this[a].node.jSetCss({"max-width":this[a].size.width,"max-height":this[a].size.height}),this[a].node.currentSrc&&this[a].node.currentSrc!=this[a].node.src?this[a].url=this[a].node.currentSrc:b.getAbsoluteURL(this[a].node.getAttribute("src")||"")!=this[a].url&&this[a].node.setAttribute("src",this[a].url)):(this[a].node=d(e.img),this[a].node.getAttribute("style"),this[a].node.removeAttribute("style"),this[a].size.width/=this[a].dppx,this[a].size.height/=this[a].dppx)),this.onload(c)}).jBind(this)}))},loadSmall:function(){this.loadImg("small",arguments[0])},loadZoom:function(){this.loadImg("zoom",arguments[0])},load:function(){this.callback=null,arguments.length>0&&"function"===b.jTypeOf(arguments[0])&&(this.callback=arguments[0]),this.loadSmall(),this.loadZoom()},onload:function(a){if(a&&a.call(null,this),this.callback&&this.small.loaded&&this.zoom.loaded)return this.callback.call(null,this),void(this.callback=null)},loaded:function(){return this.small.loaded&&this.zoom.loaded},ready:function(){return 2===this.small.state&&2===this.zoom.state},getURL:function(a){var b="small"==a?"zoom":"small";return!this[a].loaded||this[a].loaded&&2===this[a].state?this[a].url:!this[b].loaded||this[b].loaded&&2===this[b].state?this[b].url:null},getNode:function(a){var b="small"==a?"zoom":"small";return!this[a].loaded||this[a].loaded&&2===this[a].state?this[a].node:!this[b].loaded||this[b].loaded&&2===this[b].state?this[b].node:null},jGetSize:function(a){var b="small"==a?"zoom":"small";return!this[a].loaded||this[a].loaded&&2===this[a].state?this[a].size:!this[b].loaded||this[b].loaded&&2===this[b].state?this[b].size:{width:0,height:0}},getRatio:function(a){var b="small"==a?"zoom":"small";return!this[a].loaded||this[a].loaded&&2===this[a].state?this[a].dppx:!this[b].loaded||this[b].loaded&&2===this[b].state?this[b].dppx:1},setCurNode:function(a){this.node=this.getNode(a)}};var H=function(a,c){this.options=new b.Options(e),this.option=d(function(){return arguments.length>1?this.set(arguments[0],arguments[1]):this.get(arguments[0])}).jBind(this.options),this.touchOptions=new b.Options(f),this.additionalImages=[],this.image=null,this.primaryImage=null,this.placeholder=d(a).jAddEvent("dragstart selectstart click",function(a){a.stop()}),this.id=null,this.node=null,this.stubNode=null,this.originalImg=null,this.originalImgSrc=null,this.originalTitle=null,this.normalSize={width:0,height:0},this.size={width:0,height:0},this.zoomSize={width:0,height:0},this.zoomSizeOrigin={width:0,height:0},this.boundaries={top:0,left:0,bottom:0,right:0},this.ready=!1,this.expanded=!1,this.activateTimer=null,this.resizeTimer=null,this.resizeCallback=d(function(){this.expanded&&(window.innerWidth>=997?(this.expandImageStage.style.width=this.expandImageStage.getWidth()+"px",this.expandImageStage.style.height=this.expandImageStage.getHeight()+"px"):(this.expandImageStage.style.width=null,this.expandImageStage.style.height=null)),this.reflowZoom(arguments[0])}).jBind(this),this.onResize=d(function(a){clearTimeout(this.resizeTimer),this.resizeTimer=d(this.resizeCallback).jDelay(10,"scroll"===a.type)}).jBindAsEvent(this),v&&(n.append(b.$new("div",{},{display:"none",visibility:"hidden"}).append(document.createTextNode(v))),v=void 0),this.lens=null,this.zoomBox=null,this.hint=null,this.hintMessage=null,this.hintRuns=0,this.mobileZoomHint=!0,this.loadingBox=null,this.loadTimer=null,this.thumb=null,this.expandBox=null,this.expandBg=null,this.expandCaption=null,this.expandStage=null,this.expandImageStage=null,this.expandFigure=null,this.expandControls=null,this.expandNav=null,this.expandThumbs=null,this.expandGallery=[],this.buttons={},this.start(c)};return H.prototype={loadOptions:function(a){switch(this.options.fromJSON(window[h+"Options"]||{}),this.options.fromString(this.placeholder.getAttribute("data-options")||""),b.browser.touchScreen||this.option("forceTouch",!1),(b.browser.mobile||this.option("forceTouch"))&&(this.options.fromJSON(this.touchOptions.getJSON()),this.options.fromJSON(window[h+"MobileOptions"]||{}),this.options.fromString(this.placeholder.getAttribute("data-mobile-options")||"")),"string"==b.jTypeOf(a)?this.options.fromString(a||""):this.options.fromJSON(a||{}),this.option("cssClass")&&this.option("cssClass",this.option("cssClass").replace(","," ")),!1===this.option("zoomCaption")&&this.option("zoomCaption","off"),!1===this.option("hint")&&this.option("hint","off"),this.option("hint")){case"off":this.hintRuns=0;break;case"once":this.hintRuns=2;break;case"always":this.hintRuns=1/0}"off"===this.option("zoomMode")&&this.option("zoomMode",!1),"off"===this.option("expand")&&this.option("expand",!1),"off"===this.option("expandZoomMode")&&this.option("expandZoomMode",!1),b.browser.mobile&&"zoom"==this.option("zoomMode")&&"inner"==this.option("zoomPosition")&&(this.option("expand")?this.option("zoomMode",!1):this.option("zoomOn","click"))},start:function(a){var c;if(this.loadOptions(a),!q||this.option("autostart")){if(this.id=this.placeholder.getAttribute("id")||"mz-"+Math.floor(Math.random()*b.now()),this.placeholder.setAttribute("id",this.id),this.node=b.$new("figure").jAddClass("mz-figure"),D(this.placeholder),this.originalImg=this.placeholder.querySelector("img"),this.originalImgSrc=this.originalImg?this.originalImg.getAttribute("src"):null,this.originalTitle=d(this.placeholder).getAttribute("title"),d(this.placeholder).removeAttribute("title"),this.primaryImage=(new G).parseNode(this.placeholder,this.originalTitle,!0),this.image=this.primaryImage,this.node.enclose(this.image.small.node).jAddClass(this.option("cssClass")),!0!==this.option("rightClick")&&this.node.jAddEvent("contextmenu",function(a){return a.stop(),!1}),this.node.jAddClass("mz-"+this.option("zoomOn")+"-zoom"),this.option("expand")||this.node.jAddClass("mz-no-expand"),this.lens={node:b.$new("div",{class:"mz-lens"},{top:0}).jAppendTo(this.node),image:b.$new("img",{src:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},{position:"absolute",top:0,left:0}),width:0,height:0,pos:{x:0,y:0},spos:{x:0,y:0},size:{width:0,height:0},border:{x:0,y:0},dx:0,dy:0,innertouch:!1,hide:function(){b.browser.features.transform?this.node.jSetCss({transform:"translate(-10000px,-10000px)"}):this.node.jSetCss({top:-1e4})}},this.lens.hide(),this.lens.node.append(this.lens.image),this.zoomBox={node:b.$new("div",{class:"mz-zoom-window"},{top:-1e5}).jAddClass(this.option("cssClass")).jAppendTo(n),image:b.$new("img",{src:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},{position:"absolute"}),aspectRatio:0,width:0,height:0,innerWidth:0,innerHeight:0,size:{width:"auto",wunits:"px",height:"auto",hunits:"px"},mode:this.option("zoomMode"),position:this.option("zoomPosition"),trigger:this.option("zoomOn"),custom:!1,active:!1,activating:!1,enabled:!1,enable:d(function(){this.zoomBox.enabled=!1!==arguments[0],this.node[this.zoomBox.enabled?"jRemoveClass":"jAddClass"]("mz-no-zoom")}).jBind(this),hide:d(function(){var a=d(this.node).jFetch("cr");this.zoomBox.node.jRemoveEvent("transitionend"),this.zoomBox.node.jSetCss({top:-1e5}).jAppendTo(n),this.zoomBox.node.jRemoveClass("mz-deactivating mz-p-"+("zoom"==this.zoomBox.mode?this.zoomBox.position:this.zoomBox.mode)),!this.expanded&&a&&a.jRemove(),this.zoomBox.image.getAttribute("style"),this.zoomBox.image.removeAttribute("style")}).jBind(this),setMode:d(function(a){this.node[!1===a?"jAddClass":"jRemoveClass"]("mz-no-zoom"),this.node["magnifier"==a?"jAddClass":"jRemoveClass"]("mz-magnifier-zoom"),this.zoomBox.node["magnifier"==a?"jAddClass":"jRemoveClass"]("mz-magnifier"),this.zoomBox.node["preview"==a?"jAddClass":"jRemoveClass"]("mz-preview"),"zoom"!=a&&(this.node.jRemoveClass("mz-inner-zoom"),this.zoomBox.node.jRemoveClass("mz-inner")),this.zoomBox.mode=a,!1===a&&this.zoomBox.enable(!1)}).jBind(this)},this.zoomBox.node.append(this.zoomBox.image),this.zoomBox.setMode(this.option("zoomMode")),this.zoomBox.image.removeAttribute("width"),this.zoomBox.image.removeAttribute("height"),"undefined"!=typeof u){var e=Math.floor(Math.random()*b.now());d(this.node).jStore("cr",b.$new((Math.floor(101*Math.random())+1)%2?"span":"div").setProps({id:"crMz"+e}).jSetCss({display:"inline",overflow:"hidden",visibility:"visible",color:u[1],fontSize:u[2],fontWeight:u[3],fontFamily:"sans-serif",position:"absolute",top:8,left:8,margin:"auto",width:"auto",textAlign:"right","line-height":"2em",zIndex:2147483647}).changeContent(w(u[0]))),d(d(this.node).jFetch("cr")).byTag("a")[0]&&d(d(d(this.node).jFetch("cr")).byTag("a")[0]).jAddEvent("tap btnclick",function(a){a.stopDistribution(),window.open(this.href)}).setProps({id:"mzCrA"+e}),b.addCSS("#"+this.id+" > figure.mz-figure > #crMz"+e+",#"+this.id+" > figure.mz-figure > #crMz"+e+" > #mzCrA"+e+",html body .mz-expand > #crMz"+e+",html body .mz-expand > #crMz"+e+" > #mzCrA"+e,{display:"inline !important;",visibility:"visible !important;",color:u[1]+" !important;","font-size":u[2]+"px !important;","z-index":"2147483647 !important;"},"mz-runtime-css",!0)}(c=(""+this.option("zoomWidth")).match(/^([0-9]+)?(px|%)?$/))&&(this.zoomBox.size.wunits=c[2]||"px",this.zoomBox.size.width=parseFloat(c[1])||"auto"),(c=(""+this.option("zoomHeight")).match(/^([0-9]+)?(px|%)?$/))&&(this.zoomBox.size.hunits=c[2]||"px",this.zoomBox.size.height=parseFloat(c[1])||"auto"),"magnifier"==this.zoomBox.mode?(this.node.jAddClass("mz-magnifier-zoom"),this.zoomBox.node.jAddClass("mz-magnifier"),"auto"===this.zoomBox.size.width&&(this.zoomBox.size.wunits="%",this.zoomBox.size.width=70),"auto"===this.zoomBox.size.height&&(this.zoomBox.size.hunits="%")):(this.option("zoom-position").match(/^#/)&&((this.zoomBox.custom=d(this.option("zoom-position").replace(/^#/,"")))?d(this.zoomBox.custom).jGetSize().height>50&&("auto"===this.zoomBox.size.width&&(this.zoomBox.size.wunits="%",this.zoomBox.size.width=100),"auto"===this.zoomBox.size.height&&(this.zoomBox.size.hunits="%",this.zoomBox.size.height=100)):this.option("zoom-position","right")),"preview"==this.zoomBox.mode&&("auto"===this.zoomBox.size.width&&(this.zoomBox.size.wunits="px"),"auto"===this.zoomBox.size.height&&(this.zoomBox.size.hunits="px")),"zoom"==this.zoomBox.mode&&("auto"!==this.zoomBox.size.width&&"inner"!=this.option("zoom-position")||(this.zoomBox.size.wunits="%",this.zoomBox.size.width=100),"auto"!==this.zoomBox.size.height&&"inner"!=this.option("zoom-position")||(this.zoomBox.size.hunits="%",this.zoomBox.size.height=100)),"inner"==this.option("zoom-position")&&this.node.jAddClass("mz-inner-zoom")),this.zoomBox.position=this.zoomBox.custom?"custom":this.option("zoom-position"),this.lens.border.x=parseFloat(this.lens.node.jGetCss("border-left-width")||"0"),this.lens.border.y=parseFloat(this.lens.node.jGetCss("border-top-width")||"0"),this.image.loadSmall(function(){2===this.image.small.state&&(this.image.setCurNode("small"),this.size=this.image.node.jGetSize(),this.registerEvents(),this.ready=!0,!0===this.option("lazyZoom")&&(C("onZoomReady",this.id),this.showHint()))}.jBind(this)),!0===this.option("lazyZoom")&&"always"!=this.option("zoomOn")||(this.image.load(d(function(a){this.setupZoom(a,!0)}).jBind(this)),this.loadTimer=d(this.showLoading).jBind(this).jDelay(400)),this.setupSelectors()}},stop:function(){this.unregisterEvents(),this.zoomBox&&this.zoomBox.node.kill(),this.expandThumbs&&(this.expandThumbs.stop(),this.expandThumbs=null),this.expandBox&&this.expandBox.kill(),this.expanded&&d(b.browser.getDoc()).jSetCss({overflow:""}),d(this.additionalImages).jEach(function(a){d(a.origin).jRemoveClass("mz-thumb-selected").jRemoveClass(this.option("cssClass")||"mz-$dummy-css-class-to-jRemove$")},this),this.originalImg&&(this.placeholder.append(this.originalImg),this.originalImgSrc&&this.originalImg.setAttribute("src",this.originalImgSrc)),this.originalTitle&&this.placeholder.setAttribute("title",this.originalTitle),this.node&&this.node.kill()},setupZoom:function(a,c){var e=this.image;return 2!==a.zoom.state?(this.image=a,this.ready=!0,void this.zoomBox.enable(!1)):(this.image=a,this.image.setCurNode(this.expanded?"zoom":"small"),this.zoomBox.image.src=this.image.getURL("zoom"),this.zoomBox.node.jRemoveClass("mz-preview"),this.zoomBox.image.getAttribute("style"),this.zoomBox.image.removeAttribute("style"),this.zoomBox.node.jGetSize(),void setTimeout(d(function(){var d,a=this.zoomBox.image.jGetSize();this.zoomSizeOrigin=this.image.jGetSize("zoom"),a.width*a.height>1&&a.width*a.height<this.zoomSizeOrigin.width*this.zoomSizeOrigin.height&&(this.zoomSizeOrigin=a),this.zoomSize=b.detach(this.zoomSizeOrigin),"preview"==this.zoomBox.mode&&this.zoomBox.node.jAddClass("mz-preview"),this.setCaption(),this.lens.image.src=this.image.node.currentSrc||this.image.node.src,this.zoomBox.enable(this.zoomBox.mode&&!(this.expanded&&"preview"==this.zoomBox.mode)),this.ready=!0,this.activateTimer=null,this.resizeCallback(),this.node.jAddClass("mz-ready"),this.hideLoading(),e!==this.image?(C("onUpdate",this.id,e.origin,this.image.origin),this.nextImage&&(d=this.nextImage,this.nextImage=null,this.update(d.image,d.onswipe))):c&&C("onZoomReady",this.id),this.initEvent?this.node.jCallEvent(this.initEvent.type,this.initEvent):this.expanded&&"always"==this.option("expandZoomOn")?this.activate():c&&this.showHint()}).jBind(this),256))},setupSelectors:function(){var c,e,a=this.id;e=new RegExp("zoom\\-id(\\s+)?:(\\s+)?"+a+"($|;)"),b.browser.features.query?(c=b.$A(document.querySelectorAll('[data-zoom-id="'+this.id+'"]')),c=d(c).concat(b.$A(document.querySelectorAll('[rel*="zoom-id"]')).filter(function(a){return e.test(a.getAttribute("rel")||"")}))):c=b.$A(document.getElementsByTagName("A")).filter(function(b){return a==b.getAttribute("data-zoom-id")||e.test(b.getAttribute("rel")||"")}),d(c).jEach(function(a){var b,c;d(a).jAddEvent("click",function(a){a.stopDefaults()}),b=(new G).parseNode(a,this.originalTitle),this.image.zoom.src.has(b.zoom.src)&&this.image.small.src.has(b.small.src)&&(d(b.origin).jAddClass("mz-thumb-selected"),b=this.image,b.origin=a),!b.link&&this.image.link&&(b.link=this.image.link),c=d(function(){this.update(b)}).jBind(this),d(a).jAddEvent("mousedown",function(a){"stopImmediatePropagation"in a&&a.stopImmediatePropagation()},5),d(a).jAddEvent("tap "+("hover"==this.option("selectorTrigger")?"mouseover mouseout":"btnclick"),d(function(a,b){this.updateTimer&&clearTimeout(this.updateTimer),this.updateTimer=!1,"mouseover"==a.type?this.updateTimer=d(c).jDelay(b):"tap"!=a.type&&"btnclick"!=a.type||c()}).jBindAsEvent(this,60)).jAddClass(this.option("cssClass")).jAddClass("mz-thumb"),b.loadSmall(),!0!==this.option("lazyZoom")&&b.loadZoom(),this.additionalImages.push(b)},this)},update:function(a,c){return this.ready?!(!a||a===this.image)&&(this.deactivate(null,!0),this.ready=!1,this.node.jRemoveClass("mz-ready"),this.loadTimer=d(this.showLoading).jBind(this).jDelay(400),void a.load(d(function(a){var e,f,g,h,j,k,l=b.browser.ieMode<10?"jGetSize":"getBoundingClientRect";return this.hideLoading(),a.setCurNode("small"),a.node?(this.setActiveThumb(a),e=this.image.node[l](),this.expanded&&(a.setCurNode("zoom"),g=b.$new("div").jAddClass("mz-expand-bg"),b.browser.features.cssFilters||b.browser.ieMode<10?g.append(b.$new("img",{src:a.getURL("zoom")}).jSetCss({opacity:0})):g.append(new b.SVGImage(a.node).blur(i).getNode().jSetCss({opacity:0})),d(g).jSetCss({"z-index":-99}).jAppendTo(this.expandBox)),this.expanded&&"zoom"===this.zoomBox.mode&&"always"===this.option("expandZoomOn")?(d(a.node).jSetCss({opacity:0}).jAppendTo(this.node),f=e,j=[a.node,this.image.node],k=[{opacity:[0,1]},{opacity:[1,0]}],d(a.node).jSetCss({"max-width":Math.min(a.jGetSize("zoom").width,this.expandMaxWidth()),"max-height":Math.min(a.jGetSize("zoom").height,this.expandMaxHeight())})):(this.node.jSetCss({height:this.node[l]().height}),this.image.node.jSetCss({position:"absolute",top:0,left:0,bottom:0,right:0,width:"100%",height:"100%","max-width":"","max-height":""}),d(a.node).jSetCss({"max-width":Math.min(a.jGetSize(this.expanded?"zoom":"small").width,this.expanded?this.expandMaxWidth():1/0),"max-height":Math.min(a.jGetSize(this.expanded?"zoom":"small").height,this.expanded?this.expandMaxHeight():1/0),position:"relative",top:0,left:0,opacity:0,transform:""}).jAppendTo(this.node),f=d(a.node)[l](),c||d(a.node).jSetCss({"min-width":e.width,height:e.height,"max-width":e.width,"max-height":""}),this.node.jSetCss({height:"",overflow:""}).jGetSize(),d(a.node).jGetSize(),j=[a.node,this.image.node],k=[b.extend({opacity:[0,1]},c?{scale:[.6,1]}:{"min-width":[e.width,f.width],"max-width":[e.width,f.width],height:[e.height,f.height]}),{opacity:[1,0]}]),this.expanded&&this.expandBg.firstChild&&g.firstChild&&(h=d(this.expandBg.firstChild).jGetCss("opacity"),b.browser.gecko?(j=j.concat([g.firstChild]),k=k.concat([{opacity:[1e-4,h]}])):(j=j.concat([g.firstChild,this.expandBg.firstChild]),k=k.concat([{opacity:[1e-4,h]},{opacity:[h,1e-4]}]))),void new b.PFX(j,{duration:c||this.option("transitionEffect")?c?400:350:0,transition:c?"cubic-bezier(0.175, 0.885, 0.320, 1)":e.width==f.width?"linear":"cubic-bezier(0.25, .1, .1, 1)",onComplete:d(function(){this.image.node.jRemove().getAttribute("style"),this.image.node.removeAttribute("style"),d(a.node).jSetCss(this.expanded?{width:"auto",height:"auto"}:{width:"",height:""}).jSetCss({"min-width":"","min-height":"",opacity:"","max-width":Math.min(a.jGetSize(this.expanded?"zoom":"small").width,this.expanded?this.expandMaxWidth():1/0),"max-height":Math.min(a.jGetSize(this.expanded?"zoom":"small").height,this.expanded?this.expandMaxHeight():1/0)}),this.expanded&&(this.expandBg.jRemove(),this.expandBg=void 0,this.expandBg=g.jSetCssProp("z-index",-100),d(this.expandBg.firstChild).jSetCss({opacity:""}),this.expandCaption&&(a.caption?a.link?this.expandCaption.changeContent("").append(b.$new("a",{href:a.link}).jAddEvent("tap btnclick",this.openLink.jBind(this)).changeContent(a.caption)):this.expandCaption.changeContent(a.caption).jAddClass("mz-show"):this.expandCaption.jRemoveClass("mz-show"))),this.setupZoom(a)}).jBind(this),onBeforeRender:d(function(a,b){void 0!==a.scale&&b.jSetCssProp("transform","scale("+a.scale+")")})}).start(k)):(this.ready=!0,void this.node.jAddClass("mz-ready"))}).jBind(this))):void(this.nextImage={image:a,onswipe:c})},setActiveThumb:function(a){var b=!1;d(this.additionalImages).jEach(function(c){d(c.origin).jRemoveClass("mz-thumb-selected"),c===a&&(b=!0)}),b&&a.origin&&d(a.origin).jAddClass("mz-thumb-selected"),this.expandThumbs&&this.expandThumbs.selectItem(a.selector)},setCaption:function(a){this.image.caption&&"off"!==this.option("zoomCaption")&&"magnifier"!==this.zoomBox.mode&&(this.zoomBox.caption||(this.zoomBox.caption=b.$new("div",{class:"mz-caption"}).jAppendTo(this.zoomBox.node.jAddClass("caption-"+this.option("zoomCaption")))),this.zoomBox.caption.changeContent(this.image.caption))},showHint:function(a,c,e){var f;if(!this.expanded){if(this.hintRuns<=0)return;!0!==e&&this.hintRuns--}return void 0!==c&&null!==c||(this.zoomBox.active||this.zoomBox.activating?c=this.option("expand")?this.option("textExpandHint"):"":!this.option("zoomMode")||!this.zoomBox.enabled&&this.image.loaded()?c=this.option("expand")?this.option("textExpandHint"):"":"hover"==this.zoomBox.trigger?c=this.option("textHoverZoomHint"):"click"==this.zoomBox.trigger&&(c=this.option("textClickZoomHint"))),c?(f=this.node,this.hint?d(this.hintMessage).changeContent(c):(this.hint=b.$new("div",{class:"mz-hint"}),this.hintMessage=b.$new("span",{class:"mz-hint-message"}).append(document.createTextNode(c)).jAppendTo(this.hint),d(this.hint).jAppendTo(this.node)),this.hint.jSetCss({"transition-delay":""}).jRemoveClass("mz-hint-hidden"),this.expanded?f=this.expandFigure:(this.zoomBox.active||this.zoomBox.activating)&&"magnifier"!==this.zoomBox.mode&&"inner"==this.zoomBox.position&&(f=this.zoomBox.node),!0===a&&setTimeout(d(function(){this.hint.jAddClass("mz-hint-hidden")}).jBind(this),16),void this.hint.jAppendTo(f)):void this.hideHint()},hideHint:function(){this.hint&&this.hint.jSetCss({"transition-delay":"0ms"}).jAddClass("mz-hint-hidden")},showLoading:function(){this.loadingBox||(this.loadingBox=b.$new("div",{class:"mz-loading"}),this.node.append(this.loadingBox),this.loadingBox.jGetSize()),this.loadingBox.jAddClass("shown")},hideLoading:function(){clearTimeout(this.loadTimer),this.loadTimer=null,this.loadingBox&&d(this.loadingBox).jRemoveClass("shown")},setSize:function(a,c){var g,h,e=b.detach(this.zoomBox.size),f=!this.expanded&&this.zoomBox.custom?d(this.zoomBox.custom).jGetSize():{width:0,height:0},i=this.size,j={x:0,y:0};c=c||this.zoomBox.position,this.normalSize=this.image.node.jGetSize(),this.size=this.image.node.jGetSize(),this.boundaries=this.image.node.getBoundingClientRect(),f.height||(f=this.size),!1!==this.option("upscale")&&!1!==this.zoomBox.mode&&"preview"!==this.zoomBox.mode||(a=!1),"preview"==this.zoomBox.mode&&("auto"===e.width&&(e.width=this.zoomSizeOrigin.width),"auto"===e.height&&(e.height=this.zoomSizeOrigin.height)),this.expanded&&"magnifier"==this.zoomBox.mode&&(e.width=70,e.height="auto"),"magnifier"==this.zoomBox.mode&&"auto"===e.height?(this.zoomBox.width=parseFloat(e.width/100)*Math.min(f.width,f.height),this.zoomBox.height=this.zoomBox.width):"zoom"==this.zoomBox.mode&&"inner"==c?(this.size=this.node.jGetSize(),f=this.size,this.boundaries=this.node.getBoundingClientRect(),this.zoomBox.width=f.width,this.zoomBox.height=f.height):(this.zoomBox.width="%"===e.wunits?parseFloat(e.width/100)*f.width:parseInt(e.width),this.zoomBox.height="%"===e.hunits?parseFloat(e.height/100)*f.height:parseInt(e.height)),"preview"==this.zoomBox.mode&&(h=Math.min(Math.min(this.zoomBox.width/this.zoomSizeOrigin.width,this.zoomBox.height/this.zoomSizeOrigin.height),1),this.zoomBox.width=this.zoomSizeOrigin.width*h,this.zoomBox.height=this.zoomSizeOrigin.height*h),this.zoomBox.width=Math.ceil(this.zoomBox.width),this.zoomBox.height=Math.ceil(this.zoomBox.height),this.zoomBox.aspectRatio=this.zoomBox.width/this.zoomBox.height,this.zoomBox.node.jSetCss({width:this.zoomBox.width,height:this.zoomBox.height}),a&&(f=this.expanded?this.expandBox.jGetSize():this.zoomBox.node.jGetSize(),!this.expanded&&this.normalSize.width*this.normalSize.height/(this.zoomSizeOrigin.width*this.zoomSizeOrigin.height)>.8?(this.zoomSize.width=1.5*this.zoomSizeOrigin.width,this.zoomSize.height=1.5*this.zoomSizeOrigin.height):this.zoomSize=b.detach(this.zoomSizeOrigin)),!1===this.zoomBox.mode||this.zoomBox.active||this.expanded&&"always"==this.option("expandZoomOn")||(this.normalSize.width*this.normalSize.height/(this.zoomSize.width*this.zoomSize.height)>.8?(this.zoomSize=b.detach(this.zoomSizeOrigin),this.zoomBox.enable(!1)):this.zoomBox.enable(!0)),this.zoomBox.image.jSetCss({width:this.zoomSize.width,height:this.zoomSize.height}),g=this.zoomBox.node.getInnerSize(),this.zoomBox.innerWidth=Math.ceil(g.width),this.zoomBox.innerHeight=Math.ceil(g.height),this.lens.width=Math.ceil(this.zoomBox.innerWidth/(this.zoomSize.width/this.size.width)),this.lens.height=Math.ceil(this.zoomBox.innerHeight/(this.zoomSize.height/this.size.height)),this.lens.node.jSetCss({width:this.lens.width,height:this.lens.height}),this.lens.image.jSetCss(this.size),b.extend(this.lens,this.lens.node.jGetSize()),this.zoomBox.active&&(clearTimeout(this.moveTimer),this.moveTimer=null,this.lens.innertouch?(this.lens.pos.x*=this.size.width/i.width,this.lens.pos.y*=this.size.height/i.height,j.x=this.lens.spos.x,j.y=this.lens.spos.y):(j.x=this.boundaries.left+this.lens.width/2+this.lens.pos.x*(this.size.width/i.width),j.y=this.boundaries.top+this.lens.height/2+this.lens.pos.y*(this.size.height/i.height)),this.animate(null,j))},reflowZoom:function(a){var c,e,f,g,h,i,j=d(this.node).jFetch("cr");if(f=y(5),h=this.zoomBox.position,g=this.expanded?"inner":this.zoomBox.custom?"custom":this.option("zoom-position"),i=this.expanded&&"zoom"==this.zoomBox.mode?this.expandBox:document.body,this.expanded&&(f.y=0,f.x=0),a||this.setSize(!0,g),c=this.boundaries.top,"magnifier"!==this.zoomBox.mode){if(a)return void this.setSize(!1);switch(g){case"inner":case"custom":c=0,e=0;break;case"top":c=this.boundaries.top-this.zoomBox.height-this.option("zoom-distance"),f.top>c&&(c=this.boundaries.bottom+this.option("zoom-distance"),g="bottom"),e=this.boundaries.left;break;case"bottom":c=this.boundaries.bottom+this.option("zoom-distance"),f.bottom<c+this.zoomBox.height&&(c=this.boundaries.top-this.zoomBox.height-this.option("zoom-distance"),g="top"),e=this.boundaries.left;break;case"left":e=this.boundaries.left-this.zoomBox.width-this.option("zoom-distance"),f.left>e&&f.right>=this.boundaries.right+this.option("zoom-distance")+this.zoomBox.width&&(e=this.boundaries.right+this.option("zoom-distance"),g="right");break;case"right":default:e=this.boundaries.right+this.option("zoom-distance"),f.right<e+this.zoomBox.width&&f.left<=this.boundaries.left-this.zoomBox.width-this.option("zoom-distance")&&(e=this.boundaries.left-this.zoomBox.width-this.option("zoom-distance"),g="left")}switch(this.option("zoom-position")){case"top":case"bottom":(f.top>c||f.bottom<c+this.zoomBox.height)&&(g="inner");break;case"left":case"right":(f.left>e||f.right<e+this.zoomBox.width)&&(g="inner")}if(this.zoomBox.position=g,!this.zoomBox.activating&&!this.zoomBox.active)return void(b.browser.mobile&&!this.expanded&&"zoom"==this.zoomBox.mode&&(this.option("expand")?this.zoomBox.enable("inner"!==g):"click"!==this.option("zoomOn")&&(this.zoomBox.trigger="inner"===g?"click":this.option("zoomOn"),this.unregisterActivateEvent(),this.unregisterDeactivateEvent(),this.registerActivateEvent("click"===this.zoomBox.trigger),this.registerDeactivateEvent("click"===this.zoomBox.trigger&&!this.option("expand"))),this.showHint(!1,null,!0)));if(this.setSize(!1),a)return;"custom"==g&&(i=this.zoomBox.custom,f.y=0,f.x=0),"inner"==g?("preview"!==this.zoomBox.mode&&(this.zoomBox.node.jAddClass("mz-inner"),this.node.jAddClass("mz-inner-zoom")),this.lens.hide(),c=this.boundaries.top+f.y,e=this.boundaries.left+f.x,!this.expanded&&b.browser.ieMode&&b.browser.ieMode<11&&(c=0,e=0,i=this.node)):(c+=f.y,e+=f.x,this.node.jRemoveClass("mz-inner-zoom"),this.zoomBox.node.jRemoveClass("mz-inner")),this.zoomBox.node.jSetCss({top:c,left:e})}else this.setSize(!1),i=this.node;this.zoomBox.node[this.expanded?"jAddClass":"jRemoveClass"]("mz-expanded"),!this.expanded&&j&&j.jAppendTo("zoom"==this.zoomBox.mode&&"inner"==g?this.zoomBox.node:this.node,(Math.floor(101*Math.random())+1)%2?"top":"bottom"),this.zoomBox.node.jAppendTo(i)},changeZoomLevel:function(a){var c,e,f,g,h=!1,i=a.isMouse?5:3/54;if(d(a).stop(),i=(100+i*Math.abs(a.deltaY))/100,a.deltaY<0&&(i=1/i),"magnifier"==this.zoomBox.mode)e=Math.max(100,Math.round(this.zoomBox.width*i)),e=Math.min(e,.9*this.size.width),f=e/this.zoomBox.aspectRatio,this.zoomBox.width=Math.ceil(e),this.zoomBox.height=Math.ceil(f),this.zoomBox.node.jSetCss({width:this.zoomBox.width,height:this.zoomBox.height}),c=this.zoomBox.node.getInnerSize(),this.zoomBox.innerWidth=Math.ceil(c.width),this.zoomBox.innerHeight=Math.ceil(c.height),h=!0;else{if(this.expanded||"zoom"!=this.zoomBox.mode)return;e=Math.max(50,Math.round(this.lens.width*i)),e=Math.min(e,.9*this.size.width),f=e/this.zoomBox.aspectRatio,this.zoomSize.width=Math.ceil(this.zoomBox.innerWidth/e*this.size.width),this.zoomSize.height=Math.ceil(this.zoomBox.innerHeight/f*this.size.height),this.zoomBox.image.jSetCss({width:this.zoomSize.width,height:this.zoomSize.height})}g=d(window).jGetScroll(),this.lens.width=Math.ceil(this.zoomBox.innerWidth/(this.zoomSize.width/this.size.width)),this.lens.height=Math.ceil(this.zoomBox.innerHeight/(this.zoomSize.height/this.size.height)),this.lens.node.jSetCss({width:this.lens.width,height:this.lens.height}),b.extend(this.lens,this.lens.node.jGetSize()),this.zoomBox.active&&(clearTimeout(this.moveTimer),this.moveTimer=null,h&&(this.moveTimer=!0),this.animate(null,{x:a.x-g.x,y:a.y-g.y}),h&&(this.moveTimer=null))},registerActivateEvent:function(a){var c,e=a?"dbltap btnclick":"touchstart"+(window.navigator.pointerEnabled?" pointerdown":window.navigator.msPointerEnabled?" MSPointerDown":"")+(window.navigator.pointerEnabled?" pointermove":window.navigator.msPointerEnabled?" MSPointerMove":" mousemove"),f=this.node.jFetch("mz:handlers:activate:fn",a?d(this.activate).jBindAsEvent(this):d(function(a){z(a)&&!A(a)||a&&"touch"===a.pointerType&&"pointerdown"!==a.type||(c=b.browser.ieMode<9?b.extend({},a):a,this.activateTimer||(clearTimeout(this.activateTimer),this.activateTimer=setTimeout(d(function(){this.activate(c)}).jBind(this),120)))}).jBindAsEvent(this));this.node.jStore("mz:handlers:activate:event",e).jAddEvent(e,f,10)},unregisterActivateEvent:function(a){var b=this.node.jFetch("mz:handlers:activate:event"),c=this.node.jFetch("mz:handlers:activate:fn");this.node.jRemoveEvent(b,c),this.node.jDel("mz:handlers:activate:fn")},registerDeactivateEvent:function(a){var b=a?"dbltap btnclick":"touchend"+(window.navigator.pointerEnabled?" pointerup pointerout pointermove":window.navigator.msPointerEnabled?" MSPointerUp MSPointerOut MSPointerMove":" mouseout mousemove"),c=this.node.jFetch("mz:handlers:deactivate:fn",d(function(a){if((!z(a)||A(a))&&(!a||"pointerup"!==a.type||"touch"===a.pointerType))if(!a||"pointermove"!==a.type&&"MSPointerMove"!==a.type&&"mousemove"!==a.type){if(this.zoomBox.node!==a.getRelated()&&("inner"!==this.zoomBox.position&&"magnifier"!==this.zoomBox.mode||!this.zoomBox.node.hasChild(a.getRelated()))&&!this.node.hasChild(a.getRelated()))return void this.deactivate(a)}else{if(!this.ready||!this.zoomBox.enabled||!this.zoomBox.active)return;var b=a.getClientXY();if(b.x<this.boundaries.left||b.x>this.boundaries.right||b.y<this.boundaries.top||b.y>this.boundaries.bottom)return void this.deactivate(a)}}).jBindAsEvent(this));this.node.jStore("mz:handlers:deactivate:event",b).jAddEvent(b,c,20)},unregisterDeactivateEvent:function(){var a=this.node.jFetch("mz:handlers:deactivate:event"),b=this.node.jFetch("mz:handlers:deactivate:fn");this.node.jRemoveEvent(a,b),this.node.jDel("mz:handlers:deactivate:fn")},registerEvents:function(){this.moveBind=this.move.jBind(this),this.node.jAddEvent(["touchstart",window.navigator.pointerEnabled?"pointerdown":"MSPointerDown"],d(function(a){(b.browser.androidBrowser||"android"===b.browser.platform&&b.browser.gecko)&&this.option("zoomMode")&&"click"!==this.option("zoomOn")&&"touchstart"===a.type&&(a.stopDefaults(),b.browser.gecko&&a.stopDistribution()),this.zoomBox.active&&"inner"===this.zoomBox.position&&(this.lens.spos=a.getClientXY())}).jBindAsEvent(this),10),this.node.jAddEvent(["touchend",window.navigator.pointerEnabled?"pointerup":"MSPointerUp"],d(function(a){z(a)&&A(a)&&(this.lens.touchmovement=!1)}).jBindAsEvent(this),10),this.node.jAddEvent("touchmove "+("android"===b.browser.platform?"":window.navigator.pointerEnabled?"pointermove":window.navigator.msPointerEnabled?"MSPointerMove":"mousemove"),d(this.animate).jBindAsEvent(this)),this.option("zoomMode")&&(this.registerActivateEvent("click"===this.option("zoomOn")),this.registerDeactivateEvent("click"===this.option("zoomOn")&&!this.option("expand"))),this.node.jAddEvent("mousedown",function(a){a.stopDistribution()},10).jAddEvent("btnclick",d(function(a){this.node.jRaiseEvent("MouseEvent","click"),this.expanded&&this.expandBox.jCallEvent("btnclick",a)}).jBind(this),15),this.option("expand")?this.node.jAddEvent("tap btnclick",d(this.expand).jBindAsEvent(this),15):this.node.jAddEvent("tap btnclick",d(this.openLink).jBindAsEvent(this),15),this.additionalImages.length>1&&this.swipe(),!b.browser.mobile&&this.option("variableZoom")&&this.node.jAddEvent("mousescroll",this.changeZoomLevel.jBindAsEvent(this)),d(window).jAddEvent(b.browser.mobile?"resize":"resize scroll",this.onResize)},unregisterEvents:function(){this.node&&this.node.jRemoveEvent("mousescroll"),d(window).jRemoveEvent("resize scroll",this.onResize),d(this.additionalImages).jEach(function(a){d(a.origin).jClearEvents()})},activate:function(a){var c,e,f,g,h,i=0,j=0;if(!this.ready||!this.zoomBox.enabled||this.zoomBox.active||this.zoomBox.activating)return void(this.image.loaded()||(a&&(this.initEvent=B(a),a.stopQueue()),this.image.load(this.setupZoom.jBind(this)),this.loadTimer||(this.loadTimer=d(this.showLoading).jBind(this).jDelay(400))));if(!a||"pointermove"!=a.type||"touch"!=a.pointerType){if(!this.option("zoomMode")&&this.option("expand")&&!this.expanded)return void(this.zoomBox.active=!0);this.zoomBox.activating=!0,this.expanded&&"zoom"==this.zoomBox.mode&&(g=this.image.node.jGetRect(),this.expandStage.jAddClass("mz-zoom-in"),h=this.expandFigure.jGetRect(),j=(g.left+g.right)/2-(h.left+h.right)/2,i=(g.top+g.bottom)/2-(h.top+h.bottom)/2),this.zoomBox.image.jRemoveEvent("transitionend"),this.zoomBox.node.jRemoveClass("mz-deactivating").jRemoveEvent("transitionend"),this.zoomBox.node.jAddClass("mz-activating"),this.node.jAddClass("mz-activating"),this.reflowZoom(),e="zoom"==this.zoomBox.mode?this.zoomBox.position:this.zoomBox.mode,!b.browser.features.transition||this.expanded&&"always"==this.option("expandZoomOn")?(this.zoomBox.node.jRemoveClass("mz-activating"),this.zoomBox.activating=!1,this.zoomBox.active=!0):"inner"==e?(f=this.image.node.jGetSize(),this.zoomBox.image.jSetCss({transform:"translate3d(0,"+i+"px, 0) scale("+f.width/this.zoomSize.width+", "+f.height/this.zoomSize.height+")"}).jGetSize(),this.zoomBox.image.jAddEvent("transitionend",d(function(){this.zoomBox.image.jRemoveEvent("transitionend"),this.zoomBox.node.jRemoveClass("mz-activating mz-p-"+e),this.zoomBox.activating=!1,this.zoomBox.active=!0}).jBind(this)),this.zoomBox.node.jAddClass("mz-p-"+e).jGetSize(),b.browser.mobile||!b.browser.chrome||"chrome"!==b.browser.uaName&&"opera"!==b.browser.uaName||(this.zoomBox.activating=!1,this.zoomBox.active=!0)):(this.zoomBox.node.jAddEvent("transitionend",d(function(){this.zoomBox.node.jRemoveEvent("transitionend"),this.zoomBox.node.jRemoveClass("mz-activating mz-p-"+e)}).jBind(this)),this.zoomBox.node.jSetCss({transition:"none"}),this.zoomBox.node.jAddClass("mz-p-"+e).jGetSize(),this.zoomBox.node.jSetCss({transition:""}).jGetSize(),this.zoomBox.node.jRemoveClass("mz-p-"+e),this.zoomBox.activating=!1,this.zoomBox.active=!0),this.expanded||this.showHint(!0),a?(a.stop().stopQueue(),c=a.getClientXY(),"magnifier"==this.zoomBox.mode&&/tap/i.test(a.type)&&(c.y-=this.zoomBox.height/2+10),"inner"==e&&(/tap/i.test(a.type)||z(a))&&(this.lens.pos={x:0,y:0},c.x=-(c.x-this.boundaries.left-this.size.width/2)*(this.zoomSize.width/this.size.width),c.y=-(c.y-this.boundaries.top-this.size.height/2)*(this.zoomSize.height/this.size.height))):(c={x:this.boundaries.left+(this.boundaries.right-this.boundaries.left)/2,y:this.boundaries.top+(this.boundaries.bottom-this.boundaries.top)/2},b.browser.mobile&&this.expanded&&"always"===this.option("expandZoomOn")&&(this.lens.innertouch=!0,this.lens.pos={x:0,y:0},c.x=-(c.x-this.boundaries.left-this.size.width/2)*(this.zoomSize.width/this.size.width),c.y=-(c.y-this.boundaries.top-this.size.height/2)*(this.zoomSize.height/this.size.height))),this.node.jRemoveClass("mz-activating").jAddClass("mz-active"),c.x+=-j,c.y+=-i,this.lens.spos={x:0,y:0},this.lens.dx=0,this.lens.dy=0,this.animate(a,c,!0),C("onZoomIn",this.id)}},deactivate:function(a,c){var e,f,g,h,i=0,j=0,k=this.zoomBox.active;this.initEvent=null,this.ready&&(a&&"pointerout"==a.type&&"touch"==a.pointerType||(clearTimeout(this.moveTimer),this.moveTimer=null,clearTimeout(this.activateTimer),this.activateTimer=null,this.zoomBox.activating=!1,this.zoomBox.active=!1,!0===c||this.expanded||k&&(b.browser.mobile&&!this.expanded&&"zoom"==this.zoomBox.mode?this.reflowZoom():this.showHint()),this.zoomBox.enabled&&(a&&a.stop(),this.zoomBox.image.jRemoveEvent("transitionend"),this.zoomBox.node.jRemoveClass("mz-activating").jRemoveEvent("transitionend"),this.expanded&&(h=this.expandFigure.jGetRect(),"always"!==this.option("expandZoomOn")&&this.expandStage.jRemoveClass("mz-zoom-in"),this.image.node.jSetCss({"max-height":this.expandMaxHeight()}),g=this.image.node.jGetRect(),j=(g.left+g.right)/2-(h.left+h.right)/2,i=(g.top+g.bottom)/2-(h.top+h.bottom)/2),e="zoom"==this.zoomBox.mode?this.zoomBox.position:this.zoomBox.mode,!b.browser.features.transition||!a||this.expanded&&"always"==this.option("expandZoomOn")?(this.zoomBox.hide(),this.node.jRemoveClass("mz-active")):"inner"==e?(this.zoomBox.image.jAddEvent("transitionend",d(function(){this.zoomBox.image.jRemoveEvent("transitionend"),this.node.jRemoveClass("mz-active"),setTimeout(d(function(){this.zoomBox.hide()}).jBind(this),32)}).jBind(this)),f=this.image.node.jGetSize(),this.zoomBox.node.jAddClass("mz-deactivating mz-p-"+e).jGetSize(),this.zoomBox.image.jSetCss({transform:"translate3d(0,"+i+"px,0) scale("+f.width/this.zoomSize.width+", "+f.height/this.zoomSize.height+")"})):(this.zoomBox.node.jAddEvent("transitionend",d(function(){this.zoomBox.hide(),this.node.jRemoveClass("mz-active")}).jBind(this)),this.zoomBox.node.jGetCss("opacity"),this.zoomBox.node.jAddClass("mz-deactivating mz-p-"+e),this.node.jRemoveClass("mz-active")),this.lens.dx=0,this.lens.dy=0,this.lens.spos={x:0,y:0},this.lens.hide(),k&&C("onZoomOut",this.id))))},animate:function(a,c,e){var g,h,j,l,f=c,i=0,k=0,n=!1;if(this.zoomBox.active||e){if(a){if(d(a).stopDefaults().stopDistribution(),z(a)&&!A(a))return;n=/tap/i.test(a.type)||z(a),n&&!this.lens.touchmovement&&(this.lens.touchmovement=n),f||(f=a.getClientXY())}"preview"!=this.zoomBox.mode&&("zoom"==this.zoomBox.mode&&"inner"===this.zoomBox.position&&(a&&n||!a&&this.lens.innertouch)?(this.lens.innertouch=!0,g=this.lens.pos.x+(f.x-this.lens.spos.x),h=this.lens.pos.y+(f.y-this.lens.spos.y),this.lens.spos=f,i=Math.min(0,this.zoomBox.innerWidth-this.zoomSize.width)/2,j=-i,k=Math.min(0,this.zoomBox.innerHeight-this.zoomSize.height)/2,l=-k):(this.lens.innertouch=!1,"magnifier"==this.zoomBox.mode&&(f.y=Math.max(this.boundaries.top,Math.min(f.y,this.boundaries.bottom)),f.x=Math.max(this.boundaries.left,Math.min(f.x,this.boundaries.right))),g=f.x-this.boundaries.left,h=f.y-this.boundaries.top,j=this.size.width-this.lens.width,l=this.size.height-this.lens.height,g-=this.lens.width/2,h-=this.lens.height/2),"magnifier"!==this.zoomBox.mode&&(g=Math.max(i,Math.min(g,j)),h=Math.max(k,Math.min(h,l))),this.lens.pos.x=g=Math.round(g),this.lens.pos.y=h=Math.round(h),"zoom"==this.zoomBox.mode&&"inner"!=this.zoomBox.position&&(b.browser.features.transform?(this.lens.node.jSetCss({transform:"translate("+this.lens.pos.x+"px,"+this.lens.pos.y+"px)"}),this.lens.image.jSetCss({transform:"translate("+-(this.lens.pos.x+this.lens.border.x)+"px, "+-(this.lens.pos.y+this.lens.border.y)+"px)"})):(this.lens.node.jSetCss({top:this.lens.pos.y,left:this.lens.pos.x}),this.lens.image.jSetCss({top:-(this.lens.pos.y+this.lens.border.y),left:-(this.lens.pos.x+this.lens.border.x)}))),"magnifier"==this.zoomBox.mode&&(!this.lens.touchmovement||a&&"dbltap"==a.type||(f.y-=this.zoomBox.height/2+10),this.zoomBox.node.jSetCss({top:f.y-this.boundaries.top-this.zoomBox.height/2,left:f.x-this.boundaries.left-this.zoomBox.width/2})),this.moveTimer||(this.lens.dx=0,this.lens.dy=0,this.move(1)))}},move:function(a){var c,d,e,f;isFinite(a)||(a=this.lens.innertouch?this.lens.touchmovement?.4:.16:this.option("smoothing")?.2:this.lens.touchmovement?.4:.8),c=(this.lens.pos.x-this.lens.dx)*a,d=(this.lens.pos.y-this.lens.dy)*a,this.lens.dx+=c,this.lens.dy+=d,(!this.moveTimer||Math.abs(c)>1e-6||Math.abs(d)>1e-6)&&(this.lens.innertouch?(e=this.lens.dx,f=this.lens.dy):(e=this.lens.dx*(this.zoomSize.width/this.size.width)-Math.max(0,this.zoomSize.width-this.zoomBox.innerWidth)/2,f=this.lens.dy*(this.zoomSize.height/this.size.height)-Math.max(0,this.zoomSize.height-this.zoomBox.innerHeight)/2,"magnifier"===this.zoomBox.mode&&(e=Math.round(e),f=Math.round(f)),e=-e,f=-f),this.zoomBox.image.jSetCss(b.browser.features.transform?{transform:r+e+"px,"+f+"px"+s+" scale(1)"}:{left:-(this.lens.dx*(this.zoomSize.width/this.size.width)+Math.min(0,this.zoomSize.width-this.zoomBox.innerWidth)/2),top:-(this.lens.dy*(this.zoomSize.height/this.size.height)+Math.min(0,this.zoomSize.height-this.zoomBox.innerHeight)/2)})),"magnifier"!=this.zoomBox.mode&&(this.moveTimer=setTimeout(this.moveBind,16))},swipe:function(){var a,c,g,j,k,n,o,e=30,f=201,h="",i={},l=0,m={transition:b.browser.cssTransform+String.fromCharCode(32)+"300ms cubic-bezier(.18,.35,.58,1)"},p=d(function(b){if(this.ready&&!this.zoomBox.active)if("dragstart"==b.state)clearTimeout(this.activateTimer),this.activateTimer=null,l=0,i={x:b.x,y:b.y,ts:b.timeStamp},a=this.size.width,c=a/2,this.image.node.jRemoveEvent("transitionend"),this.image.node.jSetCssProp("transition",""),this.image.node.jSetCssProp("transform","translate3d(0, 0, 0)"),o=null;else{if(j=b.x-i.x,k={x:0,y:0,z:0},null===o&&(o=Math.abs(b.x-i.x)<Math.abs(b.y-i.y)),o)return;if(b.stop(),"dragend"==b.state)return l=0,n=null,g=b.timeStamp-i.ts,(Math.abs(j)>c||g<f&&Math.abs(j)>e)&&(h=j>0?"backward":j<=0?"forward":"")&&("backward"==h?(n=this.getPrev(),l+=10*a):(n=this.getNext(),l-=10*a)),k.x=l,k.deg=-90*(k.x/a),this.image.node.jAddEvent("transitionend",d(function(a){this.image.node.jRemoveEvent("transitionend"),this.image.node.jSetCssProp("transition",""),n&&(this.image.node.jSetCss({transform:"translate3d("+k.x+"px, 0px, 0px)"}),this.update(n,!0))}).jBind(this)),this.image.node.jSetCss(m),this.image.node.jSetCss({"transition-duration":k.x?"100ms":"300ms",opacity:1-.7*Math.abs(k.x/a),transform:"translate3d("+k.x+"px, 0px, 0px)"}),void(j=0);k.x=j,k.z=-50*Math.abs(k.x/c),k.deg=-60*(k.x/c),this.image.node.jSetCss({opacity:1-.7*Math.abs(k.x/c),transform:"translate3d("+k.x+"px, 0px, "+k.z+"px)"})}}).jBind(this);this.node.jAddEvent("touchdrag",p)},setupExpandGallery:function(){var a,e;this.additionalImages.length?this.expandGallery=this.additionalImages:(a=this.placeholder.getAttribute("data-gallery"),a&&(e=b.browser.features.query?b.$A(document.querySelectorAll('.MagicZoom[data-gallery="'+a+'"], .MagicZoomPlus[data-gallery="'+a+'"]')):b.$A(document.getElementsByTagName("A")).filter(function(b){return a==b.getAttribute("data-gallery")}),d(e).jEach(function(a){var b,c;b=x(a),b&&b.additionalImages.length>0||(b?(c=new G(b.image.small.url,b.image.zoom.url,b.image.caption,null,b.image.origin),c.link=b.image.link):c=(new G).parseNode(a,b?b.originalTitle:null),this.image.zoom.src.has(c.zoom.url)&&this.image.small.src.has(c.small.url)&&(c=this.image),this.expandGallery.push(c))},this),this.primaryImage=this.image)),this.expandGallery.length>1?(this.expandStage.jAddClass("with-thumbs"),this.expandNav=b.$new("div",{class:"mz-expand-thumbnails"}).jAppendTo(this.expandStage),this.expandThumbs=new c(this.expandNav),d(this.expandGallery).jEach(function(a){var c=d(function(b){this.setActiveThumb(a),this.update(a)}).jBind(this);a.selector=this.expandThumbs.addItem(b.$new("img",{src:a.origin.getAttribute('data-expanded-thumb')||a.getURL("small")}).jAddEvent("tap btnclick",function(a){a.stop()}).jAddEvent("tap "+("hover"==this.option("selectorTrigger")?"mouseover mouseout":"btnclick"),d(function(a,b){this.updateTimer&&clearTimeout(this.updateTimer),this.updateTimer=!1,"mouseover"==a.type?this.updateTimer=d(c).jDelay(b):"tap"!=a.type&&"btnclick"!=a.type||c()}).jBindAsEvent(this,60)))},this),this.buttons.next.show(),this.buttons.prev.show()):(this.expandStage.jRemoveClass("with-thumbs"),this.buttons.next.hide(),this.buttons.prev.hide())},destroyExpandGallery:function(){var a;if(this.expandThumbs&&(this.expandThumbs.stop(),this.expandThumbs=null),this.expandNav&&(this.expandNav.jRemove(),this.expandNav=null),this.expandGallery.length>1&&!this.additionalImages.length)for(this.node.jRemoveEvent("touchdrag"),this.image.node.jRemove().getAttribute("style"),this.image.node.removeAttribute("style"),this.primaryImage.node.jAppendTo(this.node),this.setupZoom(this.primaryImage);a=this.expandGallery.pop();)a!==this.primaryImage&&(a.small.node&&(a.small.node.kill(),a.small.node=null),a.zoom.node&&(a.zoom.node.kill(),a.zoom.node=null),a=null);this.expandGallery=[]},close:function(){this.ready&&this.expanded&&("ios"===b.browser.platform&&"safari"===b.browser.uaName&&7===parseInt(b.browser.uaVersion)&&(clearInterval(t),t=null),d(document).jRemoveEvent("keydown",this.keyboardCallback),this.deactivate(null,!0),this.ready=!1,a.browser.fullScreen.capable&&a.browser.fullScreen.enabled()?a.browser.fullScreen.cancel():b.browser.features.transition?(this.node.jRemoveEvent("transitionend").jSetCss({transition:""}),this.node.jAddEvent("transitionend",this.onClose),b.browser.webkit&&setTimeout(d(function(){this.onClose()}).jBind(this),260),this.expandBg.jRemoveEvent("transitionend").jSetCss({transition:""}),this.expandBg.jSetCss({transition:"all 0.6s cubic-bezier(0.895, 0.030, 0.685, 0.220) 0.0s"}).jGetSize(),this.node.jSetCss({transition:"all .3s cubic-bezier(0.600, 0, 0.735, 0.045) 0s"}).jGetSize(),!1!==this.zoomBox.mode&&"always"==this.option("expandZoomOn")&&"magnifier"!==this.option("expandZoomMode")&&(this.image.node.jSetCss({"max-height":this.image.jGetSize("zoom").height}),this.image.node.jSetCss({"max-width":this.image.jGetSize("zoom").width})),this.expandBg.jSetCss({opacity:.4}),this.node.jSetCss({opacity:.01,transform:"scale(0.4)"})):this.onClose())},expand:function(c){if(!this.image.loaded()||!this.ready||this.expanded)return void(this.image.loaded()||(c&&(this.initEvent=B(c),c.stopQueue()),this.image.load(this.setupZoom.jBind(this)),this.loadTimer||(this.loadTimer=d(this.showLoading).jBind(this).jDelay(400))));c&&c.stopQueue();var e=d(this.node).jFetch("cr"),f=document.createDocumentFragment();this.hideHint(),this.hintRuns--,this.deactivate(null,!0),this.unregisterActivateEvent(),this.unregisterDeactivateEvent(),this.ready=!1,this.expandBox||(this.expandBox=b.$new("div").jAddClass("mz-expand").jAddClass(this.option("cssClass")).jSetCss({opacity:0}),this.expandStage=b.$new("div").jAddClass("mz-expand-stage").jAppendTo(this.expandBox),this.expandControls=b.$new("div").jAddClass("mz-expand-controls").jAppendTo(this.expandStage),d(["prev","next","close"]).jEach(function(a){var c="mz-button";switch(this.buttons[a]=b.$new("button",{title:this.option("text-btn-"+a)}).jAddClass(c).jAddClass(c+"-"+a),f.appendChild(this.buttons[a]),a){case"prev":this.buttons[a].jAddEvent("tap btnclick",function(a){a.stop(),this.update(this.getPrev())}.jBindAsEvent(this));break;case"next":this.buttons[a].jAddEvent("tap btnclick",function(a){a.stop(),this.update(this.getNext())}.jBindAsEvent(this));break;case"close":this.buttons[a].jAddEvent("tap btnclick",function(a){a.stop(),this.close()}.jBindAsEvent(this))}},this),this.expandControls.append(f),this.expandBox.jAddEvent("mousescroll touchstart dbltap",d(function(a){d(a).stop()})),this.option("closeOnClickOutside")&&this.expandBox.jAddEvent("tap btnclick",function(a){var b=a.jGetPageXY(),c=d("magnifier"===this.option("expandZoomMode")?this.zoomBox.node:this.zoomBox.image).jGetRect();return"always"!==this.option("expandZoomOn")&&c.top<=b.y&&b.y<=c.bottom&&c.left<=b.x&&b.x<=c.right?(a.stopQueue(),void this.deactivate(a)):void("always"!==this.option("expandZoomOn")&&this.node.hasChild(a.getOriginalTarget())||(a.stop(),this.close()))}.jBindAsEvent(this)),this.keyboardCallback=d(function(a){var b=null;27!==a.keyCode&&37!==a.keyCode&&39!==a.keyCode||(d(a).stop(),27===a.keyCode?this.close():(b=37===a.keyCode?this.getPrev():this.getNext(),b&&this.update(b)))}).jBindAsEvent(this),this.onExpand=d(function(){this.node.jRemoveEvent("transitionend").jSetCss({transition:"",transform:"translate3d(0, 0, 0)"}),this.expanded||(this.expanded=!0,this.expandBox.jRemoveClass("mz-expand-opening").jSetCss({opacity:1}),this.zoomBox.setMode(this.option("expandZoomMode")),this.zoomSize=b.detach(this.zoomSizeOrigin),this.resizeCallback(),this.expandCaption&&this.image.caption&&(this.image.link?this.expandCaption.append(b.$new("a",{href:this.image.link}).jAddEvent("tap btnclick",this.openLink.jBind(this)).changeContent(this.image.caption)):this.expandCaption.changeContent(this.image.caption),this.expandCaption.jAddClass("mz-show")),"always"!==this.option("expandZoomOn")&&(this.registerActivateEvent(!0),this.registerDeactivateEvent(!0)),this.ready=!0,"always"===this.option("expandZoomOn")&&(!1!==this.zoomBox.mode&&this.zoomBox.enable(!0),b.browser.mobile&&this.mobileZoomHint&&(this.mobileZoomHint=!1),this.activate()),(b.browser.mobile||this.option("forceTouch"))&&this.zoomBox.enabled&&((this.mobileZoomHint||this.hintRuns>0)&&this.showHint(!0,this.option("textClickZoomHint")),this.mobileZoomHint=!1),this.expandControls.jRemoveClass("mz-hidden").jAddClass("mz-fade mz-visible"),this.expandNav&&this.expandNav.jRemoveClass("mz-hidden").jAddClass("mz-fade mz-visible"),this.expandThumbs&&(this.expandThumbs.run(),this.setActiveThumb(this.image)),e&&e.jAppendTo(this.expandBox,(Math.floor(101*Math.random())+1)%2?"top":"bottom"),this.expandGallery.length&&!this.additionalImages.length&&this.swipe(),d(document).jAddEvent("keydown",this.keyboardCallback),"ios"==b.browser.platform&&"safari"==b.browser.uaName&&7==parseInt(b.browser.uaVersion)&&(t=E()),C("onExpandOpen",this.id))}).jBind(this),this.onClose=d(function(){this.node.jRemoveEvent("transitionend"),this.expanded&&(this.expanded&&(d(document).jRemoveEvent("keydown",this.keyboardCallback),this.deactivate(null,!0)),this.destroyExpandGallery(),this.expanded=!1,this.zoomBox.setMode(this.option("zoomMode")),this.node.replaceChild(this.image.getNode("small"),this.image.node),this.image.setCurNode("small"),d(this.image.node).jSetCss({width:"",height:"","max-width":Math.min(this.image.jGetSize("small").width),"max-height":Math.min(this.image.jGetSize("small").height)}),this.lens.image.src=this.image.getURL("small"),this.node.jSetCss({opacity:"",transition:""}),this.node.jSetCss({transform:"translate3d(0, 0, 0)"}),d(this.placeholder).replaceChild(this.node,this.stubNode),this.setSize(!0),this.expandCaption&&(this.expandCaption.jRemove(),this.expandCaption=null),this.unregisterActivateEvent(),this.unregisterDeactivateEvent(),"always"==this.option("zoomOn")?this.activate():!1!==this.option("zoomMode")&&(this.registerActivateEvent("click"===this.option("zoomOn")),this.registerDeactivateEvent("click"===this.option("zoomOn")&&!this.option("expand"))),this.showHint(),this.expandBg.jRemoveEvent("transitionend"),this.expandBox.jRemove(),this.expandBg.jRemove(),this.expandBg=null,d(b.browser.getDoc()).jRemoveClass("mz-expanded-view-open"),this.ready=!0,b.browser.ieMode<10?this.resizeCallback():d(window).jRaiseEvent("UIEvent","resize"),C("onExpandClose",this.id))}).jBind(this),this.expandImageStage=b.$new("div",{class:"mz-image-stage"}).jAppendTo(this.expandStage),this.expandFigure=b.$new("figure").jAppendTo(this.expandImageStage),this.stubNode=this.node.cloneNode(!1)),this.setupExpandGallery(),d(b.browser.getDoc()).jAddClass("mz-expanded-view-open"),d(document.body).jGetSize(),"fullscreen"==this.option("expand")?(this.prepareExpandedView(),a.browser.fullScreen.request(this.expandBox,{onEnter:d(function(){this.onExpand()}).jBind(this),onExit:this.onClose,fallback:d(function(){this.expandToWindow()}).jBind(this)})):setTimeout(d(function(){this.prepareExpandedView(),this.expandToWindow()}).jBind(this),96)},prepareExpandedView:function(){var a,c;a=b.$new("img",{src:this.image.getURL("zoom")}),this.expandBg=b.$new("div").jAddClass("mz-expand-bg").append(b.browser.features.cssFilters||b.browser.ieMode<10?a:new b.SVGImage(a).blur(i).getNode()).jAppendTo(this.expandBox),"always"===this.option("expandZoomOn")&&!1!==this.option("expandZoomMode")&&this.expandStage.jAddClass("mz-always-zoom"+("zoom"===this.option("expandZoomMode")?" mz-zoom-in":"")).jGetSize(),c=d(this.node)[b.browser.ieMode<10?"jGetSize":"getBoundingClientRect"](),d(this.stubNode).jSetCss({width:c.width,height:c.height}),this.node.replaceChild(this.image.getNode("zoom"),this.image.node),this.image.setCurNode("zoom"),this.expandBox.jAppendTo(document.body),this.expandMaxWidth=function(){var a=this.expandImageStage;return d(this.expandFigure).jGetSize().width>50&&(a=this.expandFigure),function(){return"always"==this.option("expandZoomOn")&&!1!==this.option("expandZoomMode")&&"magnifier"!==this.option("expandZoomMode")?1/0:Math.round(d(a).getInnerSize().width)}}.call(this),this.expandMaxHeight=function(){var a=this.expandImageStage;return d(this.expandFigure).jGetSize().height>50&&(a=this.expandFigure),function(){return"always"==this.option("expandZoomOn")&&!1!==this.option("expandZoomMode")&&"magnifier"!==this.option("expandZoomMode")?1/0:Math.round(d(a).getInnerSize().height)}}.call(this),this.expandControls.jRemoveClass("mz-fade mz-visible").jAddClass("mz-hidden"),this.expandNav&&this.expandNav.jRemoveClass("mz-fade mz-visible").jAddClass("mz-hidden"),this.image.node.jSetCss({"max-height":Math.min(this.image.jGetSize("zoom").height,this.expandMaxHeight())}),this.image.node.jSetCss({"max-width":Math.min(this.image.jGetSize("zoom").width,this.expandMaxWidth())}),this.expandFigure.append(d(this.placeholder).replaceChild(this.stubNode,this.node)),this.option("expandCaption")&&(this.expandCaption=b.$new("figcaption",{class:"mz-caption"}).jAppendTo(this.expandFigure))},expandToWindow:function(){this.node.jSetCss({transition:""}),this.node.jSetCss({transform:"scale(0.6)"}).jGetSize(),this.node.jSetCss({transition:b.browser.cssTransform+" 0.4s cubic-bezier(0.175, 0.885, 0.320, 1) 0s"}),b.browser.features.transition?(this.node.jAddEvent("transitionend",this.onExpand),!b.browser.chrome||"chrome"!==b.browser.uaName&&"opera"!==b.browser.uaName||setTimeout(d(function(){this.onExpand()}).jBind(this),500)):this.onExpand.jDelay(16,this),this.expandBox.jSetCss({opacity:1}),this.node.jSetCss({transform:"scale(1)"})},openLink:function(){this.image.link&&window.open(this.image.link,"_self")},getNext:function(){var a=(this.expanded?this.expandGallery:this.additionalImages).filter(function(a){return-1!==a.small.state||-1!==a.zoom.state}),b=a.length,c=d(a).indexOf(this.image)+1;return 1>=b?null:a[c>=b?0:c]},getPrev:function(){var a=(this.expanded?this.expandGallery:this.additionalImages).filter(function(a){return-1!==a.small.state||-1!==a.zoom.state}),b=a.length,c=d(a).indexOf(this.image)-1;return 1>=b?null:a[c<0?b-1:c]},imageByURL:function(a,c){var d=this.additionalImages.filter(function(b){return(b.zoom.src.has(a)||b.zoom.url.has(a))&&(b.small.src.has(c)||b.small.url.has(c))})||[];return d[0]||(c&&a&&"string"===b.jTypeOf(c)&&"string"===b.jTypeOf(a)?new G(c,a):null)},imageByOrigin:function(a){var b=this.additionalImages.filter(function(b){return b.origin===a})||[];return b[0]},imageByIndex:function(a){return this.additionalImages[a]}},k={version:"v5.2.1 (Plus)",start:function(a,c){var e=null,f=[];return b.$A(a?[d(a)]:b.$A(document.byClass("MagicZoom")).concat(b.$A(document.byClass("MagicZoomPlus")))).jEach(function(a){d(a)&&(x(a)||(e=new H(a,c),q&&!e.option("autostart")?(e.stop(),e=null):(m.push(e),f.push(e))))}.jBind(this)),a?f[0]:f},stop:function(a){var b,c;if(a)return void((c=x(a))&&(c=m.splice(m.indexOf(c),1))&&c[0].stop()&&delete c[0]);for(;b=m.length;)c=m.splice(b-1,1),c[0].stop(),delete c[0]},refresh:function(a){return this.stop(a),this.start(a)},update:function(a,c,d,e){var g,f=x(a);f&&(g="element"===b.jTypeOf(c)?f.imageByOrigin(c):f.imageByURL(c,d),
g&&f.update(g))},switchTo:function(a,c){var e,d=x(a);if(d){switch(b.jTypeOf(c)){case"element":e=d.imageByOrigin(c);break;case"number":e=d.imageByIndex(c)}e&&d.update(e)}},prev:function(a){var b;(b=x(a))&&b.update(b.getPrev())},next:function(a){var b;(b=x(a))&&b.update(b.getNext())},zoomIn:function(a){var b;(b=x(a))&&b.activate()},zoomOut:function(a){var b;(b=x(a))&&b.deactivate()},expand:function(a){var b;(b=x(a))&&b.expand()},close:function(a){var b;(b=x(a))&&b.close()},registerCallback:function(a,c){l[a]||(l[a]=[]),"function"==b.jTypeOf(c)&&l[a].push(c)},running:function(a){return!!x(a)}},d(document).jAddEvent("domready",function(){var a=window[h+"Options"]||{};v=v(),F(),n=b.$new("div",{class:"magic-hidden-wrapper"}).jAppendTo(document.body),p=b.browser.mobile&&window.matchMedia&&window.matchMedia("(max-device-width: 767px), (max-device-height: 767px)").matches,b.browser.mobile&&b.extend(e,f);for(var c=0;c<j.length;c++)a[j[c]]&&b.$F!==a[j[c]]&&k.registerCallback(j[c],a[j[c]]);k.start(),q=!1}),window.MagicZoomPlus=window.MagicZoomPlus||{},k}();