This repository has been archived by the owner on Jun 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
app.phone.ios.optimized.js
7 lines (7 loc) · 209 KB
/
app.phone.ios.optimized.js
1
2
3
4
5
6
7
var requirejs,require,define;(function(t){function e(t,e){if(t&&"."===t.charAt(0)&&e){e=e.split("/"),e=e.slice(0,e.length-1),t=e.concat(t.split("/"));var i,n;for(i=0;n=t[i];i++)if("."===n)t.splice(i,1),i-=1;else if(".."===n){if(1===i&&(".."===t[2]||".."===t[0]))break;i>0&&(t.splice(i-1,2),i-=2)}t=t.join("/")}return t}function i(e,i){return function(){return l.apply(t,u.call(arguments,0).concat([e,i]))}}function n(t){return function(i){return e(i,t)}}function o(t){return function(e){h[t]=e}}function s(e){if(c.hasOwnProperty(e)){var i=c[e];delete c[e],a.apply(t,i)}return h[e]}function r(t,i){var o,r,a=t.indexOf("!");return-1!==a?(o=e(t.slice(0,a),i),t=t.slice(a+1),r=s(o),t=r&&r.normalize?r.normalize(t,n(i)):e(t,i)):t=e(t,i),{f:o?o+"!"+t:t,n:t,p:r}}var a,l,h={},c={},u=[].slice;"function"!=typeof define&&(a=function(e,n,a,l){var u,d,p,f,m,g,v=[];if(l||(l=e),"function"==typeof a){for(!n.length&&a.length&&(n=["require","exports","module"]),f=0;n.length>f;f++)if(g=r(n[f],l),p=g.f,"require"===p)v[f]=i(e);else if("exports"===p)v[f]=h[e]={},u=!0;else if("module"===p)d=v[f]={id:e,uri:"",exports:h[e]};else if(h.hasOwnProperty(p)||c.hasOwnProperty(p))v[f]=s(p);else{if(!g.p)throw e+" missing "+p;g.p.load(g.n,i(l,!0),o(p),{}),v[f]=h[p]}m=a.apply(h[e],v),e&&(d&&d.exports!==t?h[e]=d.exports:u||(h[e]=m))}else e&&(h[e]=a)},requirejs=l=function(e,i,n,o){return"string"==typeof e?s(r(e,i).f):(e.splice||(i.splice?(e=i,i=arguments[2]):e=[]),o?a(t,e,i,n):setTimeout(function(){a(t,e,i,n)},15),l)},l.config=function(){return l},require||(require=l),define=function(t,e,i){e.splice||(i=e,e=[]),define.unordered?c[t]=[t,e,i]:a(t,e,i)},define.amd={jQuery:!0})})(),define("lang/config",[],function(){return{DEFAULT:"en",AVAILABLE:["en","fr"]}}),!function(t,e){function i(t,e){function i(){}i[l]=this[l];var o=this,s=new i,r=h(t),a=r?t:this,c=r?{}:t,u=function(){this.initialize?this.initialize.apply(this,arguments):(e||r&&o.apply(this,arguments),a.apply(this,arguments))};return u.methods=function(t){return n(s,t,o),u[l]=s,this},u.methods.call(u,c).prototype.constructor=u,u.extend=arguments.callee,u[l].implement=u.statics=function(t,e){return t="string"==typeof t?function(){var i={};return i[t]=e,i}():t,n(this,t,o),this},u}function n(t,e,i){for(var n in e)e.hasOwnProperty(n)&&(t[n]=h(e[n])&&h(i[l][n])&&r.test(e[n])?o(n,e[n],i):e[n])}function o(t,e,i){return function(){var n=this.supr;this.supr=i[l][t];var o=e.apply(this,arguments);return this.supr=n,o}}function s(t){return i.call(h(t)?t:a,t,1)}var r=/xyz/.test(function(){})?/\bsupr\b/:/.*/,a=function(){},l="prototype",h=function(t){return typeof t===e};if("undefined"!=typeof module&&module.exports)module.exports=s;else{var c=t.klass;s.noConflict=function(){return t.klass=c,this},t.klass=s}}(this,"function"),define("vendor/klass",function(){}),function(t){Function.prototype.bind||(Function.prototype.bind=function(t){var e=[].slice,i=e.call(arguments,1),n=this,o=function(){},s=function(){return n.apply(this instanceof o?this:t||{},i.concat(e.call(arguments)))};return o.prototype=n.prototype,s.prototype=new o,s}),t.Code===void 0&&(t.Code={}),t.Code.Util={registerNamespace:function(){var e,i,n,o,s,r=arguments,a=null;for(e=0,o=r.length;o>e;e++)for(n=r[e],n=n.split("."),a=n[0],t[a]===void 0&&(t[a]={}),a=t[a],i=1,s=n.length;s>i;++i)a[n[i]]=a[n[i]]||{},a=a[n[i]]},coalesce:function(){var t,e;for(t=0,e=arguments.length;e>t;t++)if(!this.isNothing(arguments[t]))return arguments[t];return null},extend:function(t,e,i){var n;if(this.isNothing(i)&&(i=!0),t&&e&&this.isObject(e))for(n in e)this.objectHasProperty(e,n)&&(i?t[n]=e[n]:t[n]===void 0&&(t[n]=e[n]))},clone:function(t){var e={};return this.extend(e,t),e},isObject:function(t){return t instanceof Object},isFunction:function(t){return"[object Function]"==={}.toString.call(t)},isArray:function(t){return t instanceof Array},isLikeArray:function(t){return"number"==typeof t.length},isNumber:function(t){return"number"==typeof t},isString:function(t){return"string"==typeof t},isNothing:function(t){return t===void 0||null===t?!0:!1},swapArrayElements:function(t,e,i){var n=t[e];t[e]=t[i],t[i]=n},trim:function(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},toCamelCase:function(t){return t.replace(/(\-[a-z])/g,function(t){return t.toUpperCase().replace("-","")})},toDashedCase:function(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})},arrayIndexOf:function(t,e,i){var n,o,s,r;for(s=-1,n=0,o=e.length;o>n;n++)if(r=e[n],this.isNothing(i)){if(r===t){s=n;break}}else if(this.objectHasProperty(r,i)&&r[i]===t){s=n;break}return s},objectHasProperty:function(t,e){return t.hasOwnProperty?t.hasOwnProperty(e):t[e]!==void 0}}}(window),function(t,e){e.Browser={ua:null,version:null,safari:null,webkit:null,opera:null,msie:null,chrome:null,mozilla:null,android:null,blackberry:null,iPad:null,iPhone:null,iPod:null,iOS:null,is3dSupported:null,isCSSTransformSupported:null,isTouchSupported:null,isGestureSupported:null,_detect:function(){this.ua=t.navigator.userAgent,this.version=this.ua.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[],this.safari=/Safari/gi.test(t.navigator.appVersion),this.webkit=/webkit/i.test(this.ua),this.opera=/opera/i.test(this.ua),this.msie=/msie/i.test(this.ua)&&!this.opera,this.chrome=/Chrome/i.test(this.ua),this.firefox=/Firefox/i.test(this.ua),this.fennec=/Fennec/i.test(this.ua),this.mozilla=/mozilla/i.test(this.ua)&&!/(compatible|webkit)/.test(this.ua),this.android=/android/i.test(this.ua),this.blackberry=/blackberry/i.test(this.ua),this.iOS=/iphone|ipod|ipad/gi.test(t.navigator.platform),this.iPad=/ipad/gi.test(t.navigator.platform),this.iPhone=/iphone/gi.test(t.navigator.platform),this.iPod=/ipod/gi.test(t.navigator.platform);var i=document.createElement("div");this.is3dSupported=!e.isNothing(i.style.WebkitPerspective),this.isCSSTransformSupported=!e.isNothing(i.style.WebkitTransform)||!e.isNothing(i.style.MozTransform)||!e.isNothing(i.style.transformProperty),this.isTouchSupported=this.isEventSupported("touchstart"),this.isGestureSupported=this.isEventSupported("gesturestart")},_eventTagNames:{select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"},isEventSupported:function(t){var i,n=document.createElement(this._eventTagNames[t]||"div"),t="on"+t;return i=e.objectHasProperty(n,t),i||(n.setAttribute(t,"return;"),i="function"==typeof n[t]),i},isLandscape:function(){return e.DOM.windowWidth()>e.DOM.windowHeight()}},e.Browser._detect()}(window,window.Code.Util),function(t,e){e.extend(e,{Events:{add:function(t,e,i){this._checkHandlersProperty(t),"mousewheel"===e&&(e=this._normaliseMouseWheelType()),t.__eventHandlers[e]===void 0&&(t.__eventHandlers[e]=[]),t.__eventHandlers[e].push(i),this._isBrowserObject(t)&&t.addEventListener(e,i,!1)},remove:function(t,i,n){if(this._checkHandlersProperty(t),"mousewheel"===i&&(i=this._normaliseMouseWheelType()),t.__eventHandlers[i]instanceof Array){var o,s,r=t.__eventHandlers[i];if(e.isNothing(n)){if(this._isBrowserObject(t))for(o=0,s=r.length;s>o;o++)t.removeEventListener(i,r[o],!1);t.__eventHandlers[i]=[]}else{for(o=0,s=r.length;s>o;o++)if(r[o]===n){r.splice(o,1);break}this._isBrowserObject(t)&&t.removeEventListener(i,n,!1)}}},fire:function(i,n){var o,s,r,a,l=Array.prototype.slice.call(arguments).splice(2);if("mousewheel"===n&&(n=this._normaliseMouseWheelType()),this._isBrowserObject(i)){if("string"!=typeof n)throw"type must be a string for DOM elements";if(r=this._NATIVE_EVENTS[n],o=document.createEvent(r?"HTMLEvents":"UIEvents"),o[r?"initEvent":"initUIEvent"](n,!0,!0,t,1),1>l.length)return i.dispatchEvent(o),void 0}if(this._checkHandlersProperty(i),o="string"==typeof n?{type:n}:n,o.target||(o.target=i),!o.type)throw Error("Event object missing 'type' property.");if(i.__eventHandlers[o.type]instanceof Array)for(r=i.__eventHandlers[o.type],l.unshift(o),o=0,s=r.length;s>o;o++)a=r[o],e.isNothing(a)||a.apply(i,l)},getMousePosition:function(t){var e={x:0,y:0};return t.pageX?e.x=t.pageX:t.clientX&&(e.x=t.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)),t.pageY?e.y=t.pageY:t.clientY&&(e.y=t.clientY+(document.documentElement.scrollTop||document.body.scrollTop)),e},getTouchEvent:function(t){return t},getWheelDelta:function(t){var i=0;return e.isNothing(t.wheelDelta)?e.isNothing(t.detail)||(i=-t.detail/3):i=t.wheelDelta/120,i},domReady:function(t){document.addEventListener("DOMContentLoaded",t,!1)},_checkHandlersProperty:function(t){e.isNothing(t.__eventHandlers)&&e.extend(t,{__eventHandlers:{}})},_isBrowserObject:function(e){return e===t||e===t.document?!0:this._isElement(e)||this._isNode(e)},_isElement:function(e){return"object"==typeof t.HTMLElement?e instanceof t.HTMLElement:"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName},_isNode:function(e){return"object"==typeof t.Node?e instanceof t.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},_normaliseMouseWheelType:function(){return e.Browser.isEventSupported("mousewheel")?"mousewheel":"DOMMouseScroll"},_NATIVE_EVENTS:{click:1,dblclick:1,mouseup:1,mousedown:1,contextmenu:1,mousewheel:1,DOMMouseScroll:1,mouseover:1,mouseout:1,mousemove:1,selectstart:1,selectend:1,keydown:1,keypress:1,keyup:1,orientationchange:1,touchstart:1,touchmove:1,touchend:1,touchcancel:1,gesturestart:1,gesturechange:1,gestureend:1,focus:1,blur:1,change:1,reset:1,select:1,submit:1,load:1,unload:1,beforeunload:1,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1}}})}(window,window.Code.Util),function(t,e){e.extend(e,{DOM:{setData:function(t,i,n){if(e.isLikeArray(t)){var o,s;for(o=0,s=t.length;s>o;o++)e.DOM._setData(t[o],i,n)}else e.DOM._setData(t,i,n)},_setData:function(t,i,n){e.DOM.setAttribute(t,"data-"+i,n)},getData:function(t,i,n){return e.DOM.getAttribute(t,"data-"+i,n)},removeData:function(t,i){if(e.isLikeArray(t)){var n,o;for(n=0,o=t.length;o>n;n++)e.DOM._removeData(t[n],i)}else e.DOM._removeData(t,i)},_removeData:function(t,i){e.DOM.removeAttribute(t,"data-"+i)},isChildOf:function(t,e){if(e===t)return!1;for(;t&&t!==e;)t=t.parentNode;return t===e},find:function(i,n){e.isNothing(n)&&(n=t.document);var o,s,r=n.querySelectorAll(i),a=[];for(o=0,s=r.length;s>o;o++)a.push(r[o]);return a},createElement:function(t,i,n){var o,t=document.createElement(t);for(o in i)e.objectHasProperty(i,o)&&t.setAttribute(o,i[o]);return t.innerHTML=n||"",t},appendChild:function(t,e){e.appendChild(t)},insertBefore:function(t,e,i){i.insertBefore(t,e)},appendText:function(t,i){e.DOM.appendChild(document.createTextNode(t),i)},appendToBody:function(t){this.appendChild(t,document.body)},removeChild:function(t,e){e.removeChild(t)},removeChildren:function(t){if(t.hasChildNodes())for(;t.childNodes.length>=1;)t.removeChild(t.childNodes[t.childNodes.length-1])},hasAttribute:function(t,i){return!e.isNothing(t.getAttribute(i))},getAttribute:function(t,i,n){return t=t.getAttribute(i),e.isNothing(t)&&!e.isNothing(n)&&(t=n),t},setAttribute:function(t,i,n){if(e.isLikeArray(t)){var o,s;for(o=0,s=t.length;s>o;o++)e.DOM._setAttribute(t[o],i,n)}else e.DOM._setAttribute(t,i,n)},_setAttribute:function(t,e,i){t.setAttribute(e,i)},removeAttribute:function(t,i){if(e.isLikeArray(t)){var n,o;for(n=0,o=t.length;o>n;n++)e.DOM._removeAttribute(t[n],i)}else e.DOM._removeAttribute(t,i)},_removeAttribute:function(t,e){this.hasAttribute(t,e)&&t.removeAttribute(e)},addClass:function(t,i){if(e.isLikeArray(t)){var n,o;for(n=0,o=t.length;o>n;n++)e.DOM._addClass(t[n],i)}else e.DOM._addClass(t,i)},_addClass:function(t,i){var n=e.DOM.getAttribute(t,"class","");RegExp("(?:^|\\s+)"+i+"(?:\\s+|$)").test(n)||(""!==n&&(n+=" "),n+=i,e.DOM.setAttribute(t,"class",n))},removeClass:function(t,i){if(e.isLikeArray(t)){var n,o;for(n=0,o=t.length;o>n;n++)e.DOM._removeClass(t[n],i)}else e.DOM._removeClass(t,i)},_removeClass:function(t,i){var n,o,s=e.DOM.getAttribute(t,"class",""),s=e.trim(s).split(" "),r="";for(n=0,o=s.length;o>n;n++)s[n]!==i&&(""!==r&&(r+=" "),r+=s[n]);""===r?e.DOM.removeAttribute(t,"class"):e.DOM.setAttribute(t,"class",r)},hasClass:function(t,i){return RegExp("(?:^|\\s+)"+i+"(?:\\s+|$)").test(e.DOM.getAttribute(t,"class",""))},setStyle:function(t,i,n){if(e.isLikeArray(t)){var o,s;for(o=0,s=t.length;s>o;o++)e.DOM._setStyle(t[o],i,n)}else e.DOM._setStyle(t,i,n)},_setStyle:function(t,i,n){var o;if(e.isObject(i))for(o in i)e.objectHasProperty(i,o)&&("width"===o?e.DOM.width(t,i[o]):"height"===o?e.DOM.height(t,i[o]):t.style[o]=i[o]);else t.style[i]=n},getStyle:function(e,i){var n=t.getComputedStyle(e,"").getPropertyValue(i);return""===n&&(n=e.style[i]),n},hide:function(t){if(e.isLikeArray(t)){var i,n;for(i=0,n=t.length;n>i;i++)e.DOM._hide(t[i])}else e.DOM._hide(t)},_hide:function(t){e.DOM.setData(t,"ccl-disp",e.DOM.getStyle(t,"display")),e.DOM.setStyle(t,"display","none")},show:function(t){if(e.isLikeArray(t)){var i,n;for(i=0,n=t.length;n>i;i++)e.DOM._show(t[i])}else e.DOM._show(t)},_show:function(t){if("none"===e.DOM.getStyle(t,"display")){var i=e.DOM.getData(t,"ccl-disp","block");("none"===i||""===i)&&(i="block"),e.DOM.setStyle(t,"display",i)}},width:function(t,i){return e.isNothing(i)||(e.isNumber(i)&&(i+="px"),t.style.width=i),this._getDimension(t,"width")},outerWidth:function(t){var i=e.DOM.width(t);return i+=parseInt(e.DOM.getStyle(t,"padding-left"),10)+parseInt(e.DOM.getStyle(t,"padding-right"),10),i+=parseInt(e.DOM.getStyle(t,"margin-left"),10)+parseInt(e.DOM.getStyle(t,"margin-right"),10),i+=parseInt(e.DOM.getStyle(t,"border-left-width"),10)+parseInt(e.DOM.getStyle(t,"border-right-width"),10)},height:function(t,i){return e.isNothing(i)||(e.isNumber(i)&&(i+="px"),t.style.height=i),this._getDimension(t,"height")},_getDimension:function(e,i){var n,o=t.parseInt(t.getComputedStyle(e,"").getPropertyValue(i));return isNaN(o)&&(n={display:e.style.display,left:e.style.left},e.style.display="block",e.style.left="-1000000px",o=t.parseInt(t.getComputedStyle(e,"").getPropertyValue(i)),e.style.display=n.display,e.style.left=n.left),o},outerHeight:function(t){var i=e.DOM.height(t);return i+=parseInt(e.DOM.getStyle(t,"padding-top"),10)+parseInt(e.DOM.getStyle(t,"padding-bottom"),10),i+=parseInt(e.DOM.getStyle(t,"margin-top"),10)+parseInt(e.DOM.getStyle(t,"margin-bottom"),10),i+=parseInt(e.DOM.getStyle(t,"border-top-width"),10)+parseInt(e.DOM.getStyle(t,"border-bottom-width"),10)},documentWidth:function(){return e.DOM.width(document.documentElement)},documentHeight:function(){return e.DOM.height(document.documentElement)},documentOuterWidth:function(){return e.DOM.width(document.documentElement)},documentOuterHeight:function(){return e.DOM.outerHeight(document.documentElement)},bodyWidth:function(){return e.DOM.width(document.body)},bodyHeight:function(){return e.DOM.height(document.body)},bodyOuterWidth:function(){return e.DOM.outerWidth(document.body)},bodyOuterHeight:function(){return e.DOM.outerHeight(document.body)},windowWidth:function(){return t.innerWidth},windowHeight:function(){return t.innerHeight},windowScrollLeft:function(){return t.pageXOffset},windowScrollTop:function(){return t.pageYOffset}}})}(window,window.Code.Util),function(t,e){e.extend(e,{Animation:{_applyTransitionDelay:50,_transitionEndLabel:void 0!==t.document.documentElement.style.webkitTransition?"webkitTransitionEnd":"transitionend",_transitionEndHandler:null,_transitionPrefix:void 0!==t.document.documentElement.style.webkitTransition?"webkitTransition":void 0!==t.document.documentElement.style.MozTransition?"MozTransition":"transition",_transformLabel:void 0!==t.document.documentElement.style.webkitTransform?"webkitTransform":void 0!==t.document.documentElement.style.MozTransition?"MozTransform":"transform",_getTransitionEndHandler:function(){return e.isNothing(this._transitionEndHandler)&&(this._transitionEndHandler=this._onTransitionEnd.bind(this)),this._transitionEndHandler},stop:function(i){if(e.Browser.isCSSTransformSupported){var n={};e.Events.remove(i,this._transitionEndLabel,this._getTransitionEndHandler()),e.isNothing(i.callbackLabel)&&delete i.callbackLabel,n[this._transitionPrefix+"Property"]="",n[this._transitionPrefix+"Duration"]="",n[this._transitionPrefix+"TimingFunction"]="",n[this._transitionPrefix+"Delay"]="",n[this._transformLabel]="",e.DOM.setStyle(i,n)}else e.isNothing(t.jQuery)||t.jQuery(i).stop(!0,!0)},fadeIn:function(i,n,o,s,r){return r=e.coalesce(r,1),0>=r&&(r=1),0>=n&&(e.DOM.setStyle(i,"opacity",r),!e.isNothing(o))?(o(i),void 0):(e.DOM.getStyle(i,"opacity")>=1&&e.DOM.setStyle(i,"opacity",0),e.Browser.isCSSTransformSupported?this._applyTransition(i,"opacity",r,n,o,s):e.isNothing(t.jQuery)||t.jQuery(i).fadeTo(n,r,o),void 0)},fadeTo:function(t,e,i,n,o){this.fadeIn(t,i,n,o,e)},fadeOut:function(i,n,o,s){return 0>=n&&(e.DOM.setStyle(i,"opacity",0),!e.isNothing(o))?(o(i),void 0):(e.Browser.isCSSTransformSupported?this._applyTransition(i,"opacity",0,n,o,s):t.jQuery(i).fadeTo(n,0,o),void 0)},slideBy:function(i,n,o,s,r,a){var l={},n=e.coalesce(n,0),o=e.coalesce(o,0),a=e.coalesce(a,"ease-out");l[this._transitionPrefix+"Property"]="all",l[this._transitionPrefix+"Delay"]="0",0===s?(l[this._transitionPrefix+"Duration"]="",l[this._transitionPrefix+"TimingFunction"]=""):(l[this._transitionPrefix+"Duration"]=s+"ms",l[this._transitionPrefix+"TimingFunction"]=e.coalesce(a,"ease-out"),e.Events.add(i,this._transitionEndLabel,this._getTransitionEndHandler())),l[this._transformLabel]=e.Browser.is3dSupported?"translate3d("+n+"px, "+o+"px, 0px)":"translate("+n+"px, "+o+"px)",e.isNothing(r)||(i.cclallcallback=r),e.DOM.setStyle(i,l),0===s&&t.setTimeout(function(){this._leaveTransforms(i)}.bind(this),this._applyTransitionDelay)},resetTranslate:function(t){var i={};i[this._transformLabel]=i[this._transformLabel]=e.Browser.is3dSupported?"translate3d(0px, 0px, 0px)":"translate(0px, 0px)",e.DOM.setStyle(t,i)},_applyTransition:function(i,n,o,s,r,a){var l={},a=e.coalesce(a,"ease-in");l[this._transitionPrefix+"Property"]=n,l[this._transitionPrefix+"Duration"]=s+"ms",l[this._transitionPrefix+"TimingFunction"]=a,l[this._transitionPrefix+"Delay"]="0",e.Events.add(i,this._transitionEndLabel,this._getTransitionEndHandler()),e.DOM.setStyle(i,l),e.isNothing(r)||(i["ccl"+n+"callback"]=r),t.setTimeout(function(){e.DOM.setStyle(i,n,o)},this._applyTransitionDelay)},_onTransitionEnd:function(t){e.Events.remove(t.currentTarget,this._transitionEndLabel,this._getTransitionEndHandler()),this._leaveTransforms(t.currentTarget)},_leaveTransforms:function(i){var n,o,s,r,a=i.style[this._transitionPrefix+"Property"],l=""!==a?"ccl"+a+"callback":"cclallcallback",a=e.coalesce(i.style.webkitTransform,i.style.MozTransform,i.style.transform),h=t.parseInt(e.DOM.getStyle(i,"left"),0),c=t.parseInt(e.DOM.getStyle(i,"top"),0),u={};""!==a&&(a=e.Browser.is3dSupported?a.match(/translate3d\((.*?)\)/):a.match(/translate\((.*?)\)/),e.isNothing(a)||(o=a[1].split(", "),s=t.parseInt(o[0],0),r=t.parseInt(o[1],0))),u[this._transitionPrefix+"Property"]="",u[this._transitionPrefix+"Duration"]="",u[this._transitionPrefix+"TimingFunction"]="",u[this._transitionPrefix+"Delay"]="",e.DOM.setStyle(i,u),t.setTimeout(function(){e.isNothing(o)||(u={},u[this._transformLabel]="",u.left=h+s+"px",u.top=c+r+"px",e.DOM.setStyle(i,u)),e.isNothing(i[l])||(n=i[l],delete i[l],n(i))}.bind(this),this._applyTransitionDelay)}}})}(window,window.Code.Util),function(t,e,i){i.registerNamespace("Code.Util.TouchElement"),i.TouchElement.EventTypes={onTouch:"CodeUtilTouchElementOnTouch"},i.TouchElement.ActionTypes={touchStart:"touchStart",touchMove:"touchMove",touchEnd:"touchEnd",touchMoveEnd:"touchMoveEnd",tap:"tap",doubleTap:"doubleTap",swipeLeft:"swipeLeft",swipeRight:"swipeRight",swipeUp:"swipeUp",swipeDown:"swipeDown",gestureStart:"gestureStart",gestureChange:"gestureChange",gestureEnd:"gestureEnd"}}(window,window.klass,window.Code.Util),function(t,e,i){i.registerNamespace("Code.Util.TouchElement"),i.TouchElement.TouchElementClass=e({el:null,captureSettings:null,touchStartPoint:null,touchEndPoint:null,touchStartTime:null,doubleTapTimeout:null,touchStartHandler:null,touchMoveHandler:null,touchEndHandler:null,mouseDownHandler:null,mouseMoveHandler:null,mouseUpHandler:null,mouseOutHandler:null,gestureStartHandler:null,gestureChangeHandler:null,gestureEndHandler:null,swipeThreshold:null,swipeTimeThreshold:null,doubleTapSpeed:null,dispose:function(){var t;this.removeEventHandlers();for(t in this)i.objectHasProperty(this,t)&&(this[t]=null)},initialize:function(t,e){this.el=t,this.captureSettings={swipe:!1,move:!1,gesture:!1,doubleTap:!1,preventDefaultTouchEvents:!0},i.extend(this.captureSettings,e),this.swipeThreshold=50,this.doubleTapSpeed=this.swipeTimeThreshold=250,this.touchStartPoint={x:0,y:0},this.touchEndPoint={x:0,y:0}},addEventHandlers:function(){i.isNothing(this.touchStartHandler)&&(this.touchStartHandler=this.onTouchStart.bind(this),this.touchMoveHandler=this.onTouchMove.bind(this),this.touchEndHandler=this.onTouchEnd.bind(this),this.mouseDownHandler=this.onMouseDown.bind(this),this.mouseMoveHandler=this.onMouseMove.bind(this),this.mouseUpHandler=this.onMouseUp.bind(this),this.mouseOutHandler=this.onMouseOut.bind(this),this.gestureStartHandler=this.onGestureStart.bind(this),this.gestureChangeHandler=this.onGestureChange.bind(this),this.gestureEndHandler=this.onGestureEnd.bind(this)),i.Events.add(this.el,"touchstart",this.touchStartHandler),this.captureSettings.move&&i.Events.add(this.el,"touchmove",this.touchMoveHandler),i.Events.add(this.el,"touchend",this.touchEndHandler),i.Events.add(this.el,"mousedown",this.mouseDownHandler),i.Browser.isGestureSupported&&this.captureSettings.gesture&&(i.Events.add(this.el,"gesturestart",this.gestureStartHandler),i.Events.add(this.el,"gesturechange",this.gestureChangeHandler),i.Events.add(this.el,"gestureend",this.gestureEndHandler))},removeEventHandlers:function(){i.Events.remove(this.el,"touchstart",this.touchStartHandler),this.captureSettings.move&&i.Events.remove(this.el,"touchmove",this.touchMoveHandler),i.Events.remove(this.el,"touchend",this.touchEndHandler),i.Events.remove(this.el,"mousedown",this.mouseDownHandler),i.Browser.isGestureSupported&&this.captureSettings.gesture&&(i.Events.remove(this.el,"gesturestart",this.gestureStartHandler),i.Events.remove(this.el,"gesturechange",this.gestureChangeHandler),i.Events.remove(this.el,"gestureend",this.gestureEndHandler))},getTouchPoint:function(t){return{x:t[0].pageX,y:t[0].pageY}},fireTouchEvent:function(e){var n,o=0,s=0,r=0,o=this.touchEndPoint.x-this.touchStartPoint.x,s=this.touchEndPoint.y-this.touchStartPoint.y,r=Math.sqrt(o*o+s*s);if(this.captureSettings.swipe&&(n=new Date,n-=this.touchStartTime,this.swipeTimeThreshold>=n)){if(t.Math.abs(o)>=this.swipeThreshold)return i.Events.fire(this,{type:i.TouchElement.EventTypes.onTouch,target:this,point:this.touchEndPoint,action:0>o?i.TouchElement.ActionTypes.swipeLeft:i.TouchElement.ActionTypes.swipeRight,targetEl:e.target,currentTargetEl:e.currentTarget}),void 0;if(t.Math.abs(s)>=this.swipeThreshold)return i.Events.fire(this,{type:i.TouchElement.EventTypes.onTouch,target:this,point:this.touchEndPoint,action:0>s?i.TouchElement.ActionTypes.swipeUp:i.TouchElement.ActionTypes.swipeDown,targetEl:e.target,currentTargetEl:e.currentTarget}),void 0}r>1?i.Events.fire(this,{type:i.TouchElement.EventTypes.onTouch,target:this,action:i.TouchElement.ActionTypes.touchMoveEnd,point:this.touchEndPoint,targetEl:e.target,currentTargetEl:e.currentTarget}):this.captureSettings.doubleTap?i.isNothing(this.doubleTapTimeout)?this.doubleTapTimeout=t.setTimeout(function(){this.doubleTapTimeout=null,i.Events.fire(this,{type:i.TouchElement.EventTypes.onTouch,target:this,point:this.touchEndPoint,action:i.TouchElement.ActionTypes.tap,targetEl:e.target,currentTargetEl:e.currentTarget})}.bind(this),this.doubleTapSpeed):(t.clearTimeout(this.doubleTapTimeout),this.doubleTapTimeout=null,i.Events.fire(this,{type:i.TouchElement.EventTypes.onTouch,target:this,point:this.touchEndPoint,action:i.TouchElement.ActionTypes.doubleTap,targetEl:e.target,currentTargetEl:e.currentTarget})):i.Events.fire(this,{type:i.TouchElement.EventTypes.onTouch,target:this,point:this.touchEndPoint,action:i.TouchElement.ActionTypes.tap,targetEl:e.target,currentTargetEl:e.currentTarget})},onTouchStart:function(t){this.captureSettings.preventDefaultTouchEvents&&t.preventDefault(),i.Events.remove(this.el,"mousedown",this.mouseDownHandler);var e=i.Events.getTouchEvent(t).touches;e.length>1&&this.captureSettings.gesture?this.isGesture=!0:(this.touchStartTime=new Date,this.isGesture=!1,this.touchStartPoint=this.getTouchPoint(e),i.Events.fire(this,{type:i.TouchElement.EventTypes.onTouch,target:this,action:i.TouchElement.ActionTypes.touchStart,point:this.touchStartPoint,targetEl:t.target,currentTargetEl:t.currentTarget}))},onTouchMove:function(t){if(this.captureSettings.preventDefaultTouchEvents&&t.preventDefault(),!this.isGesture||!this.captureSettings.gesture){var e=i.Events.getTouchEvent(t).touches;i.Events.fire(this,{type:i.TouchElement.EventTypes.onTouch,target:this,action:i.TouchElement.ActionTypes.touchMove,point:this.getTouchPoint(e),targetEl:t.target,currentTargetEl:t.currentTarget})}},onTouchEnd:function(t){if(!this.isGesture||!this.captureSettings.gesture){this.captureSettings.preventDefaultTouchEvents&&t.preventDefault();var e=i.Events.getTouchEvent(t);this.touchEndPoint=this.getTouchPoint(i.isNothing(e.changedTouches)?e.touches:e.changedTouches),i.Events.fire(this,{type:i.TouchElement.EventTypes.onTouch,target:this,action:i.TouchElement.ActionTypes.touchEnd,point:this.touchEndPoint,targetEl:t.target,currentTargetEl:t.currentTarget}),this.fireTouchEvent(t)}},onMouseDown:function(t){t.preventDefault(),i.Events.remove(this.el,"touchstart",this.mouseDownHandler),i.Events.remove(this.el,"touchmove",this.touchMoveHandler),i.Events.remove(this.el,"touchend",this.touchEndHandler),this.captureSettings.move&&i.Events.add(this.el,"mousemove",this.mouseMoveHandler),i.Events.add(this.el,"mouseup",this.mouseUpHandler),i.Events.add(this.el,"mouseout",this.mouseOutHandler),this.touchStartTime=new Date,this.isGesture=!1,this.touchStartPoint=i.Events.getMousePosition(t),i.Events.fire(this,{type:i.TouchElement.EventTypes.onTouch,target:this,action:i.TouchElement.ActionTypes.touchStart,point:this.touchStartPoint,targetEl:t.target,currentTargetEl:t.currentTarget})},onMouseMove:function(t){t.preventDefault(),i.Events.fire(this,{type:i.TouchElement.EventTypes.onTouch,target:this,action:i.TouchElement.ActionTypes.touchMove,point:i.Events.getMousePosition(t),targetEl:t.target,currentTargetEl:t.currentTarget})},onMouseUp:function(t){t.preventDefault(),this.captureSettings.move&&i.Events.remove(this.el,"mousemove",this.mouseMoveHandler),i.Events.remove(this.el,"mouseup",this.mouseUpHandler),i.Events.remove(this.el,"mouseout",this.mouseOutHandler),this.touchEndPoint=i.Events.getMousePosition(t),i.Events.fire(this,{type:i.TouchElement.EventTypes.onTouch,target:this,action:i.TouchElement.ActionTypes.touchEnd,point:this.touchEndPoint,targetEl:t.target,currentTargetEl:t.currentTarget}),this.fireTouchEvent(t)},onMouseOut:function(t){var e=t.relatedTarget;this.el===e||i.DOM.isChildOf(e,this.el)||(t.preventDefault(),this.captureSettings.move&&i.Events.remove(this.el,"mousemove",this.mouseMoveHandler),i.Events.remove(this.el,"mouseup",this.mouseUpHandler),i.Events.remove(this.el,"mouseout",this.mouseOutHandler),this.touchEndPoint=i.Events.getMousePosition(t),i.Events.fire(this,{type:i.TouchElement.EventTypes.onTouch,target:this,action:i.TouchElement.ActionTypes.touchEnd,point:this.touchEndPoint,targetEl:t.target,currentTargetEl:t.currentTarget}),this.fireTouchEvent(t))},onGestureStart:function(t){t.preventDefault();var e=i.Events.getTouchEvent(t);i.Events.fire(this,{type:i.TouchElement.EventTypes.onTouch,target:this,action:i.TouchElement.ActionTypes.gestureStart,scale:e.scale,rotation:e.rotation,targetEl:t.target,currentTargetEl:t.currentTarget})},onGestureChange:function(t){t.preventDefault();var e=i.Events.getTouchEvent(t);i.Events.fire(this,{type:i.TouchElement.EventTypes.onTouch,target:this,action:i.TouchElement.ActionTypes.gestureChange,scale:e.scale,rotation:e.rotation,targetEl:t.target,currentTargetEl:t.currentTarget})},onGestureEnd:function(t){t.preventDefault();var e=i.Events.getTouchEvent(t);i.Events.fire(this,{type:i.TouchElement.EventTypes.onTouch,target:this,action:i.TouchElement.ActionTypes.gestureEnd,scale:e.scale,rotation:e.rotation,targetEl:t.target,currentTargetEl:t.currentTarget})}})}(window,window.klass,window.Code.Util),function(t,e,i){i.registerNamespace("Code.PhotoSwipe.Image"),t.Code.PhotoSwipe.Image.EventTypes={onLoad:"onLoad",onError:"onError"}}(window,window.klass,window.Code.Util),function(t,e,i){i.registerNamespace("Code.PhotoSwipe.Image");var n=t.Code.PhotoSwipe;n.Image.ImageClass=e({refObj:null,imageEl:null,src:null,caption:null,metaData:null,imageLoadHandler:null,imageErrorHandler:null,dispose:function(){var t;this.shrinkImage();for(t in this)i.objectHasProperty(this,t)&&(this[t]=null)},initialize:function(e,i,n,o){this.refObj=e,this.src=this.originalSrc=i,this.caption=n,this.metaData=o,this.imageEl=new t.Image,this.imageLoadHandler=this.onImageLoad.bind(this),this.imageErrorHandler=this.onImageError.bind(this)},load:function(){this.imageEl.originalSrc=i.coalesce(this.imageEl.originalSrc,""),this.imageEl.originalSrc===this.src?this.imageEl.isError?i.Events.fire(this,{type:n.Image.EventTypes.onError,target:this}):i.Events.fire(this,{type:n.Image.EventTypes.onLoad,target:this}):(this.imageEl.isError=!1,this.imageEl.isLoading=!0,this.imageEl.naturalWidth=null,this.imageEl.naturalHeight=null,this.imageEl.isLandscape=!1,this.imageEl.onload=this.imageLoadHandler,this.imageEl.onerror=this.imageErrorHandler,this.imageEl.onabort=this.imageErrorHandler,this.imageEl.originalSrc=this.src,this.imageEl.src=this.src)},shrinkImage:function(){!i.isNothing(this.imageEl)&&this.imageEl.src.indexOf(this.src)>-1&&(this.imageEl.src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",i.isNothing(this.imageEl.parentNode)||i.DOM.removeChild(this.imageEl,this.imageEl.parentNode))},onImageLoad:function(){this.imageEl.onload=null,this.imageEl.naturalWidth=i.coalesce(this.imageEl.naturalWidth,this.imageEl.width),this.imageEl.naturalHeight=i.coalesce(this.imageEl.naturalHeight,this.imageEl.height),this.imageEl.isLandscape=this.imageEl.naturalWidth>this.imageEl.naturalHeight,this.imageEl.isLoading=!1,i.Events.fire(this,{type:n.Image.EventTypes.onLoad,target:this})},onImageError:function(){this.imageEl.onload=null,this.imageEl.onerror=null,this.imageEl.onabort=null,this.imageEl.isLoading=!1,this.imageEl.isError=!0,i.Events.fire(this,{type:n.Image.EventTypes.onError,target:this})}})}(window,window.klass,window.Code.Util),function(t,e,i){i.registerNamespace("Code.PhotoSwipe.Cache"),t=t.Code.PhotoSwipe,t.Cache.Mode={normal:"normal",aggressive:"aggressive"},t.Cache.Functions={getImageSource:function(t){return t.href},getImageCaption:function(t){if("IMG"===t.nodeName)return i.DOM.getAttribute(t,"alt");var e,n,o;for(e=0,n=t.childNodes.length;n>e;e++)if(o=t.childNodes[e],"IMG"===t.childNodes[e].nodeName)return i.DOM.getAttribute(o,"alt")},getImageMetaData:function(){return{}}}}(window,window.klass,window.Code.Util),function(t,e,i){i.registerNamespace("Code.PhotoSwipe.Cache");var n=t.Code.PhotoSwipe;n.Cache.CacheClass=e({images:null,settings:null,dispose:function(){var t,e,n;if(!i.isNothing(this.images)){for(e=0,n=this.images.length;n>e;e++)this.images[e].dispose();this.images.length=0}for(t in this)i.objectHasProperty(this,t)&&(this[t]=null)},initialize:function(t,e){var i,o,s,r,a,l;for(this.settings=e,this.images=[],i=0,o=t.length;o>i;i++)s=t[i],r=this.settings.getImageSource(s),a=this.settings.getImageCaption(s),l=this.settings.getImageMetaData(s),this.images.push(new n.Image.ImageClass(s,r,a,l))},getImages:function(t){var e,o,s,r=[];for(e=0,o=t.length;o>e;e++)s=this.images[t[e]],this.settings.cacheMode===n.Cache.Mode.aggressive&&(s.cacheDoNotShrink=!0),r.push(s);
if(this.settings.cacheMode===n.Cache.Mode.aggressive)for(e=0,o=this.images.length;o>e;e++)s=this.images[e],i.objectHasProperty(s,"cacheDoNotShrink")?delete s.cacheDoNotShrink:s.shrinkImage();return r}})}(window,window.klass,window.Code.Util,window.Code.PhotoSwipe.Image),function(t,e,i){i.registerNamespace("Code.PhotoSwipe.DocumentOverlay"),t.Code.PhotoSwipe.DocumentOverlay.CssClasses={documentOverlay:"ps-document-overlay"}}(window,window.klass,window.Code.Util),function(t,e,i){i.registerNamespace("Code.PhotoSwipe.DocumentOverlay");var n=t.Code.PhotoSwipe;n.DocumentOverlay.DocumentOverlayClass=e({el:null,settings:null,initialBodyHeight:null,dispose:function(){var t;i.Animation.stop(this.el),i.DOM.removeChild(this.el,this.el.parentNode);for(t in this)i.objectHasProperty(this,t)&&(this[t]=null)},initialize:function(e){this.settings=e,this.el=i.DOM.createElement("div",{"class":n.DocumentOverlay.CssClasses.documentOverlay},""),i.DOM.setStyle(this.el,{display:"block",position:"absolute",left:0,top:0,zIndex:this.settings.zIndex}),i.DOM.hide(this.el),this.settings.target===t?i.DOM.appendToBody(this.el):i.DOM.appendChild(this.el,this.settings.target),i.Animation.resetTranslate(this.el),this.initialBodyHeight=i.DOM.bodyOuterHeight()},resetPosition:function(){var e,n,o;this.settings.target===t?(e=i.DOM.windowWidth(),n=2*i.DOM.bodyOuterHeight(),o=this.settings.jQueryMobile?i.DOM.windowScrollTop()+"px":"0px",1>n&&(n=this.initialBodyHeight),i.DOM.windowHeight()>n&&(n=i.DOM.windowHeight())):(e=i.DOM.width(this.settings.target),n=i.DOM.height(this.settings.target),o="0px"),i.DOM.setStyle(this.el,{width:e,height:n,top:o})},fadeIn:function(t,e){this.resetPosition(),i.DOM.setStyle(this.el,"opacity",0),i.DOM.show(this.el),i.Animation.fadeIn(this.el,t,e)}})}(window,window.klass,window.Code.Util),function(t,e,i){i.registerNamespace("Code.PhotoSwipe.Carousel"),t=t.Code.PhotoSwipe,t.Carousel.EventTypes={onSlideByEnd:"PhotoSwipeCarouselOnSlideByEnd",onSlideshowStart:"PhotoSwipeCarouselOnSlideshowStart",onSlideshowStop:"PhotoSwipeCarouselOnSlideshowStop"},t.Carousel.CssClasses={carousel:"ps-carousel",content:"ps-carousel-content",item:"ps-carousel-item",itemLoading:"ps-carousel-item-loading",itemError:"ps-carousel-item-error"},t.Carousel.SlideByAction={previous:"previous",current:"current",next:"next"}}(window,window.klass,window.Code.Util),function(t,e,i){i.registerNamespace("Code.PhotoSwipe.Carousel");var n=t.Code.PhotoSwipe;n.Carousel.CarouselClass=e({el:null,contentEl:null,settings:null,cache:null,slideByEndHandler:null,currentCacheIndex:null,isSliding:null,isSlideshowActive:null,lastSlideByAction:null,touchStartPoint:null,touchStartPosition:null,imageLoadHandler:null,imageErrorHandler:null,slideshowTimeout:null,dispose:function(){var t,e,o;for(e=0,o=this.cache.images.length;o>e;e++)i.Events.remove(this.cache.images[e],n.Image.EventTypes.onLoad,this.imageLoadHandler),i.Events.remove(this.cache.images[e],n.Image.EventTypes.onError,this.imageErrorHandler);this.stopSlideshow(),i.Animation.stop(this.el),i.DOM.removeChild(this.el,this.el.parentNode);for(t in this)i.objectHasProperty(this,t)&&(this[t]=null)},initialize:function(e,o){var s,r,a;for(this.cache=e,this.settings=o,this.slideByEndHandler=this.onSlideByEnd.bind(this),this.imageLoadHandler=this.onImageLoad.bind(this),this.imageErrorHandler=this.onImageError.bind(this),this.currentCacheIndex=0,this.isSlideshowActive=this.isSliding=!1,3>this.cache.images.length&&(this.settings.loop=!1),this.el=i.DOM.createElement("div",{"class":n.Carousel.CssClasses.carousel},""),i.DOM.setStyle(this.el,{display:"block",position:"absolute",left:0,top:0,overflow:"hidden",zIndex:this.settings.zIndex}),i.DOM.hide(this.el),this.contentEl=i.DOM.createElement("div",{"class":n.Carousel.CssClasses.content},""),i.DOM.setStyle(this.contentEl,{display:"block",position:"absolute",left:0,top:0}),i.DOM.appendChild(this.contentEl,this.el),r=3>e.images.length?e.images.length:3,s=0;r>s;s++)a=i.DOM.createElement("div",{"class":n.Carousel.CssClasses.item+" "+n.Carousel.CssClasses.item+"-"+s},""),i.DOM.setAttribute(a,"style","float: left;"),i.DOM.setStyle(a,{display:"block",position:"relative",left:0,top:0,overflow:"hidden"}),this.settings.margin>0&&i.DOM.setStyle(a,{marginRight:this.settings.margin+"px"}),i.DOM.appendChild(a,this.contentEl);this.settings.target===t?i.DOM.appendToBody(this.el):i.DOM.appendChild(this.el,this.settings.target)},resetPosition:function(){var e,o,s,r,a,l;for(this.settings.target===t?(e=i.DOM.windowWidth(),o=i.DOM.windowHeight(),s=i.DOM.windowScrollTop()+"px"):(e=i.DOM.width(this.settings.target),o=i.DOM.height(this.settings.target),s="0px"),r=this.settings.margin>0?e+this.settings.margin:e,a=i.DOM.find("."+n.Carousel.CssClasses.item,this.contentEl),r*=a.length,i.DOM.setStyle(this.el,{top:s,width:e,height:o}),i.DOM.setStyle(this.contentEl,{width:r,height:o}),s=0,r=a.length;r>s;s++)l=a[s],i.DOM.setStyle(l,{width:e,height:o}),l=i.DOM.find("img",l)[0],i.isNothing(l)||this.resetImagePosition(l);this.setContentLeftPosition()},resetImagePosition:function(t){if(!i.isNothing(t)){i.DOM.getAttribute(t,"src");var e,n,o,s=i.DOM.width(this.el),r=i.DOM.height(this.el);"fitNoUpscale"===this.settings.imageScaleMethod?(n=t.naturalWidth,o=t.naturalHeight,n>s&&(e=s/n,n=Math.round(n*e),o=Math.round(o*e)),o>r&&(e=r/o,o=Math.round(o*e),n=Math.round(n*e))):(e=t.isLandscape?s/t.naturalWidth:r/t.naturalHeight,n=Math.round(t.naturalWidth*e),o=Math.round(t.naturalHeight*e),"zoom"===this.settings.imageScaleMethod?(e=1,r>o?e=r/o:s>n&&(e=s/n),1!==e&&(n=Math.round(n*e),o=Math.round(o*e))):"fit"===this.settings.imageScaleMethod&&(e=1,n>s?e=s/n:o>r&&(e=r/o),1!==e&&(n=Math.round(n*e),o=Math.round(o*e)))),i.DOM.setStyle(t,{position:"absolute",width:n,height:o,top:Math.round((r-o)/2)+"px",left:Math.round((s-n)/2)+"px",display:"block"})}},setContentLeftPosition:function(){var e,n,o;e=this.settings.target===t?i.DOM.windowWidth():i.DOM.width(this.settings.target),n=this.getItemEls(),o=0,this.settings.loop?o=-1*(e+this.settings.margin):this.currentCacheIndex===this.cache.images.length-1?o=-1*(n.length-1)*(e+this.settings.margin):this.currentCacheIndex>0&&(o=-1*(e+this.settings.margin)),i.DOM.setStyle(this.contentEl,{left:o+"px"})},show:function(t){this.currentCacheIndex=t,this.resetPosition(),this.setImages(!1),i.DOM.show(this.el),i.Animation.resetTranslate(this.contentEl);var e,o,t=this.getItemEls();for(e=0,o=t.length;o>e;e++)i.Animation.resetTranslate(t[e]);i.Events.fire(this,{type:n.Carousel.EventTypes.onSlideByEnd,target:this,action:n.Carousel.SlideByAction.current,cacheIndex:this.currentCacheIndex})},setImages:function(t){var e,i=this.getItemEls();e=this.currentCacheIndex+1;var n=this.currentCacheIndex-1;this.settings.loop?(e>this.cache.images.length-1&&(e=0),0>n&&(n=this.cache.images.length-1),e=this.cache.getImages([n,this.currentCacheIndex,e]),t||this.addCacheImageToItemEl(e[1],i[1]),this.addCacheImageToItemEl(e[2],i[2]),this.addCacheImageToItemEl(e[0],i[0])):1===i.length?t||(e=this.cache.getImages([this.currentCacheIndex]),this.addCacheImageToItemEl(e[0],i[0])):2===i.length?0===this.currentCacheIndex?(e=this.cache.getImages([this.currentCacheIndex,this.currentCacheIndex+1]),t||this.addCacheImageToItemEl(e[0],i[0]),this.addCacheImageToItemEl(e[1],i[1])):(e=this.cache.getImages([this.currentCacheIndex-1,this.currentCacheIndex]),t||this.addCacheImageToItemEl(e[1],i[1]),this.addCacheImageToItemEl(e[0],i[0])):0===this.currentCacheIndex?(e=this.cache.getImages([this.currentCacheIndex,this.currentCacheIndex+1,this.currentCacheIndex+2]),t||this.addCacheImageToItemEl(e[0],i[0]),this.addCacheImageToItemEl(e[1],i[1]),this.addCacheImageToItemEl(e[2],i[2])):(this.currentCacheIndex===this.cache.images.length-1?(e=this.cache.getImages([this.currentCacheIndex-2,this.currentCacheIndex-1,this.currentCacheIndex]),t||this.addCacheImageToItemEl(e[2],i[2]),this.addCacheImageToItemEl(e[1],i[1])):(e=this.cache.getImages([this.currentCacheIndex-1,this.currentCacheIndex,this.currentCacheIndex+1]),t||this.addCacheImageToItemEl(e[1],i[1]),this.addCacheImageToItemEl(e[2],i[2])),this.addCacheImageToItemEl(e[0],i[0]))},addCacheImageToItemEl:function(t,e){i.DOM.removeClass(e,n.Carousel.CssClasses.itemError),i.DOM.addClass(e,n.Carousel.CssClasses.itemLoading),i.DOM.removeChildren(e),i.DOM.setStyle(t.imageEl,{display:"none"}),i.DOM.appendChild(t.imageEl,e),i.Animation.resetTranslate(t.imageEl),i.Events.add(t,n.Image.EventTypes.onLoad,this.imageLoadHandler),i.Events.add(t,n.Image.EventTypes.onError,this.imageErrorHandler),t.load()},slideCarousel:function(e,o,s){if(!this.isSliding){var r,a;if(r=this.settings.target===t?i.DOM.windowWidth()+this.settings.margin:i.DOM.width(this.settings.target)+this.settings.margin,s=i.coalesce(s,this.settings.slideSpeed),!(1>t.Math.abs(a))){switch(o){case i.TouchElement.ActionTypes.swipeLeft:e=-1*r;break;case i.TouchElement.ActionTypes.swipeRight:e=r;break;default:a=e.x-this.touchStartPoint.x,e=t.Math.abs(a)>r/2?a>0?r:-1*r:0}this.lastSlideByAction=0>e?n.Carousel.SlideByAction.next:e>0?n.Carousel.SlideByAction.previous:n.Carousel.SlideByAction.current,!this.settings.loop&&(this.lastSlideByAction===n.Carousel.SlideByAction.previous&&0===this.currentCacheIndex||this.lastSlideByAction===n.Carousel.SlideByAction.next&&this.currentCacheIndex===this.cache.images.length-1)&&(e=0,this.lastSlideByAction=n.Carousel.SlideByAction.current),this.isSliding=!0,this.doSlideCarousel(e,s)}}},moveCarousel:function(t){this.isSliding||this.settings.enableDrag&&this.doMoveCarousel(t.x-this.touchStartPoint.x)},getItemEls:function(){return i.DOM.find("."+n.Carousel.CssClasses.item,this.contentEl)},previous:function(){this.stopSlideshow(),this.slideCarousel({x:0,y:0},i.TouchElement.ActionTypes.swipeRight,this.settings.nextPreviousSlideSpeed)},next:function(){this.stopSlideshow(),this.slideCarousel({x:0,y:0},i.TouchElement.ActionTypes.swipeLeft,this.settings.nextPreviousSlideSpeed)},slideshowNext:function(){this.slideCarousel({x:0,y:0},i.TouchElement.ActionTypes.swipeLeft)},startSlideshow:function(){this.stopSlideshow(),this.isSlideshowActive=!0,this.slideshowTimeout=t.setTimeout(this.slideshowNext.bind(this),this.settings.slideshowDelay),i.Events.fire(this,{type:n.Carousel.EventTypes.onSlideshowStart,target:this})},stopSlideshow:function(){i.isNothing(this.slideshowTimeout)||(t.clearTimeout(this.slideshowTimeout),this.slideshowTimeout=null,this.isSlideshowActive=!1,i.Events.fire(this,{type:n.Carousel.EventTypes.onSlideshowStop,target:this}))},onSlideByEnd:function(){if(!i.isNothing(this.isSliding)){var t=this.getItemEls();this.isSliding=!1,this.lastSlideByAction===n.Carousel.SlideByAction.next?this.currentCacheIndex+=1:this.lastSlideByAction===n.Carousel.SlideByAction.previous&&(this.currentCacheIndex-=1),this.settings.loop?(this.lastSlideByAction===n.Carousel.SlideByAction.next?i.DOM.appendChild(t[0],this.contentEl):this.lastSlideByAction===n.Carousel.SlideByAction.previous&&i.DOM.insertBefore(t[t.length-1],t[0],this.contentEl),0>this.currentCacheIndex?this.currentCacheIndex=this.cache.images.length-1:this.currentCacheIndex===this.cache.images.length&&(this.currentCacheIndex=0)):this.cache.images.length>3&&(this.currentCacheIndex>1&&this.currentCacheIndex<this.cache.images.length-2?this.lastSlideByAction===n.Carousel.SlideByAction.next?i.DOM.appendChild(t[0],this.contentEl):this.lastSlideByAction===n.Carousel.SlideByAction.previous&&i.DOM.insertBefore(t[t.length-1],t[0],this.contentEl):1===this.currentCacheIndex?this.lastSlideByAction===n.Carousel.SlideByAction.previous&&i.DOM.insertBefore(t[t.length-1],t[0],this.contentEl):this.currentCacheIndex===this.cache.images.length-2&&this.lastSlideByAction===n.Carousel.SlideByAction.next&&i.DOM.appendChild(t[0],this.contentEl)),this.lastSlideByAction!==n.Carousel.SlideByAction.current&&(this.setContentLeftPosition(),this.setImages(!0)),i.Events.fire(this,{type:n.Carousel.EventTypes.onSlideByEnd,target:this,action:this.lastSlideByAction,cacheIndex:this.currentCacheIndex}),this.isSlideshowActive&&(this.lastSlideByAction!==n.Carousel.SlideByAction.current?this.startSlideshow():this.stopSlideshow())}},onTouch:function(e,n){switch(this.stopSlideshow(),e){case i.TouchElement.ActionTypes.touchStart:this.touchStartPoint=n,this.touchStartPosition={x:t.parseInt(i.DOM.getStyle(this.contentEl,"left"),0),y:t.parseInt(i.DOM.getStyle(this.contentEl,"top"),0)};break;case i.TouchElement.ActionTypes.touchMove:this.moveCarousel(n);break;case i.TouchElement.ActionTypes.touchMoveEnd:case i.TouchElement.ActionTypes.swipeLeft:case i.TouchElement.ActionTypes.swipeRight:this.slideCarousel(n,e)}},onImageLoad:function(t){t=t.target,i.isNothing(t.imageEl.parentNode)||(i.DOM.removeClass(t.imageEl.parentNode,n.Carousel.CssClasses.itemLoading),this.resetImagePosition(t.imageEl)),i.Events.remove(t,n.Image.EventTypes.onLoad,this.imageLoadHandler),i.Events.remove(t,n.Image.EventTypes.onError,this.imageErrorHandler)},onImageError:function(t){t=t.target,i.isNothing(t.imageEl.parentNode)||(i.DOM.removeClass(t.imageEl.parentNode,n.Carousel.CssClasses.itemLoading),i.DOM.addClass(t.imageEl.parentNode,n.Carousel.CssClasses.itemError)),i.Events.remove(t,n.Image.EventTypes.onLoad,this.imageLoadHandler),i.Events.remove(t,n.Image.EventTypes.onError,this.imageErrorHandler)}})}(window,window.klass,window.Code.Util),function(t,e,i){i.registerNamespace("Code.PhotoSwipe.Carousel"),e=t.Code.PhotoSwipe,e.Carousel.CarouselClass=e.Carousel.CarouselClass.extend({getStartingPos:function(){var e=this.touchStartPosition;return i.isNothing(e)&&(e={x:t.parseInt(i.DOM.getStyle(this.contentEl,"left"),0),y:t.parseInt(i.DOM.getStyle(this.contentEl,"top"),0)}),e},doMoveCarousel:function(e){var n;i.Browser.isCSSTransformSupported?(n={},n[i.Animation._transitionPrefix+"Property"]="all",n[i.Animation._transitionPrefix+"Duration"]="",n[i.Animation._transitionPrefix+"TimingFunction"]="",n[i.Animation._transitionPrefix+"Delay"]="0",n[i.Animation._transformLabel]=i.Browser.is3dSupported?"translate3d("+e+"px, 0px, 0px)":"translate("+e+"px, 0px)",i.DOM.setStyle(this.contentEl,n)):i.isNothing(t.jQuery)||t.jQuery(this.contentEl).stop().css("left",this.getStartingPos().x+e+"px")},doSlideCarousel:function(e,n){var o;0>=n?this.slideByEndHandler():i.Browser.isCSSTransformSupported?(o=i.coalesce(this.contentEl.style.webkitTransform,this.contentEl.style.MozTransform,this.contentEl.style.transform,""),0===o.indexOf("translate3d("+e)?this.slideByEndHandler():0===o.indexOf("translate("+e)?this.slideByEndHandler():i.Animation.slideBy(this.contentEl,e,0,n,this.slideByEndHandler,this.settings.slideTimingFunction)):i.isNothing(t.jQuery)||(o={left:this.getStartingPos().x+e+"px"},"ease-out"===this.settings.animationTimingFunction&&(this.settings.animationTimingFunction="easeOutQuad"),i.isNothing(t.jQuery.easing[this.settings.animationTimingFunction])&&(this.settings.animationTimingFunction="linear"),t.jQuery(this.contentEl).animate(o,this.settings.slideSpeed,this.settings.animationTimingFunction,this.slideByEndHandler))}})}(window,window.klass,window.Code.Util,window.Code.PhotoSwipe.TouchElement),function(t,e,i){i.registerNamespace("Code.PhotoSwipe.Toolbar");var n=t.Code.PhotoSwipe;n.Toolbar.CssClasses={toolbar:"ps-toolbar",toolbarContent:"ps-toolbar-content",toolbarTop:"ps-toolbar-top",caption:"ps-caption",captionBottom:"ps-caption-bottom",captionContent:"ps-caption-content",close:"ps-toolbar-close",play:"ps-toolbar-play",previous:"ps-toolbar-previous",previousDisabled:"ps-toolbar-previous-disabled",next:"ps-toolbar-next",nextDisabled:"ps-toolbar-next-disabled"},n.Toolbar.ToolbarAction={close:"close",play:"play",next:"next",previous:"previous",none:"none"},n.Toolbar.EventTypes={onTap:"PhotoSwipeToolbarOnClick",onBeforeShow:"PhotoSwipeToolbarOnBeforeShow",onShow:"PhotoSwipeToolbarOnShow",onBeforeHide:"PhotoSwipeToolbarOnBeforeHide",onHide:"PhotoSwipeToolbarOnHide"},n.Toolbar.getToolbar=function(){return'<div class="'+n.Toolbar.CssClasses.close+'"><div class="'+n.Toolbar.CssClasses.toolbarContent+'"></div></div><div class="'+n.Toolbar.CssClasses.play+'"><div class="'+n.Toolbar.CssClasses.toolbarContent+'"></div></div><div class="'+n.Toolbar.CssClasses.previous+'"><div class="'+n.Toolbar.CssClasses.toolbarContent+'"></div></div><div class="'+n.Toolbar.CssClasses.next+'"><div class="'+n.Toolbar.CssClasses.toolbarContent+'"></div></div>'}}(window,window.klass,window.Code.Util),function(t,e,i){i.registerNamespace("Code.PhotoSwipe.Toolbar");var n=t.Code.PhotoSwipe;n.Toolbar.ToolbarClass=e({toolbarEl:null,closeEl:null,playEl:null,previousEl:null,nextEl:null,captionEl:null,captionContentEl:null,currentCaption:null,settings:null,cache:null,timeout:null,isVisible:null,fadeOutHandler:null,touchStartHandler:null,touchMoveHandler:null,clickHandler:null,dispose:function(){var t;this.clearTimeout(),this.removeEventHandlers(),i.Animation.stop(this.toolbarEl),i.Animation.stop(this.captionEl),i.DOM.removeChild(this.toolbarEl,this.toolbarEl.parentNode),i.DOM.removeChild(this.captionEl,this.captionEl.parentNode);for(t in this)i.objectHasProperty(this,t)&&(this[t]=null)},initialize:function(e,o){var s;this.settings=o,this.cache=e,this.isVisible=!1,this.fadeOutHandler=this.onFadeOut.bind(this),this.touchStartHandler=this.onTouchStart.bind(this),this.touchMoveHandler=this.onTouchMove.bind(this),this.clickHandler=this.onClick.bind(this),s=n.Toolbar.CssClasses.toolbar,this.settings.captionAndToolbarFlipPosition&&(s=s+" "+n.Toolbar.CssClasses.toolbarTop),this.toolbarEl=i.DOM.createElement("div",{"class":s},this.settings.getToolbar()),i.DOM.setStyle(this.toolbarEl,{left:0,position:"absolute",overflow:"hidden",zIndex:this.settings.zIndex}),this.settings.target===t?i.DOM.appendToBody(this.toolbarEl):i.DOM.appendChild(this.toolbarEl,this.settings.target),i.DOM.hide(this.toolbarEl),this.closeEl=i.DOM.find("."+n.Toolbar.CssClasses.close,this.toolbarEl)[0],this.settings.preventHide&&!i.isNothing(this.closeEl)&&i.DOM.hide(this.closeEl),this.playEl=i.DOM.find("."+n.Toolbar.CssClasses.play,this.toolbarEl)[0],this.settings.preventSlideshow&&!i.isNothing(this.playEl)&&i.DOM.hide(this.playEl),this.nextEl=i.DOM.find("."+n.Toolbar.CssClasses.next,this.toolbarEl)[0],this.previousEl=i.DOM.find("."+n.Toolbar.CssClasses.previous,this.toolbarEl)[0],s=n.Toolbar.CssClasses.caption,this.settings.captionAndToolbarFlipPosition&&(s=s+" "+n.Toolbar.CssClasses.captionBottom),this.captionEl=i.DOM.createElement("div",{"class":s},""),i.DOM.setStyle(this.captionEl,{left:0,position:"absolute",overflow:"hidden",zIndex:this.settings.zIndex}),this.settings.target===t?i.DOM.appendToBody(this.captionEl):i.DOM.appendChild(this.captionEl,this.settings.target),i.DOM.hide(this.captionEl),this.captionContentEl=i.DOM.createElement("div",{"class":n.Toolbar.CssClasses.captionContent},""),i.DOM.appendChild(this.captionContentEl,this.captionEl),this.addEventHandlers()},resetPosition:function(){var e,n,o;this.settings.target===t?(this.settings.captionAndToolbarFlipPosition?(n=i.DOM.windowScrollTop(),o=i.DOM.windowScrollTop()+i.DOM.windowHeight()-i.DOM.height(this.captionEl)):(n=i.DOM.windowScrollTop()+i.DOM.windowHeight()-i.DOM.height(this.toolbarEl),o=i.DOM.windowScrollTop()),e=i.DOM.windowWidth()):(this.settings.captionAndToolbarFlipPosition?(n="0",o=i.DOM.height(this.settings.target)-i.DOM.height(this.captionEl)):(n=i.DOM.height(this.settings.target)-i.DOM.height(this.toolbarEl),o=0),e=i.DOM.width(this.settings.target)),i.DOM.setStyle(this.toolbarEl,{top:n+"px",width:e}),i.DOM.setStyle(this.captionEl,{top:o+"px",width:e})},toggleVisibility:function(t){this.isVisible?this.fadeOut():this.show(t)},show:function(t){i.Animation.stop(this.toolbarEl),i.Animation.stop(this.captionEl),this.resetPosition(),this.setToolbarStatus(t),i.Events.fire(this,{type:n.Toolbar.EventTypes.onBeforeShow,target:this}),this.showToolbar(),this.setCaption(t),this.showCaption(),this.isVisible=!0,this.setTimeout(),i.Events.fire(this,{type:n.Toolbar.EventTypes.onShow,target:this})},setTimeout:function(){this.settings.captionAndToolbarAutoHideDelay>0&&(this.clearTimeout(),this.timeout=t.setTimeout(this.fadeOut.bind(this),this.settings.captionAndToolbarAutoHideDelay))},clearTimeout:function(){i.isNothing(this.timeout)||(t.clearTimeout(this.timeout),this.timeout=null)},fadeOut:function(){this.clearTimeout(),i.Events.fire(this,{type:n.Toolbar.EventTypes.onBeforeHide,target:this}),i.Animation.fadeOut(this.toolbarEl,this.settings.fadeOutSpeed),i.Animation.fadeOut(this.captionEl,this.settings.fadeOutSpeed,this.fadeOutHandler),this.isVisible=!1},addEventHandlers:function(){i.Browser.isTouchSupported&&(i.Browser.blackberry||i.Events.add(this.toolbarEl,"touchstart",this.touchStartHandler),i.Events.add(this.toolbarEl,"touchmove",this.touchMoveHandler),i.Events.add(this.captionEl,"touchmove",this.touchMoveHandler)),i.Events.add(this.toolbarEl,"click",this.clickHandler)},removeEventHandlers:function(){i.Browser.isTouchSupported&&(i.Browser.blackberry||i.Events.remove(this.toolbarEl,"touchstart",this.touchStartHandler),i.Events.remove(this.toolbarEl,"touchmove",this.touchMoveHandler),i.Events.remove(this.captionEl,"touchmove",this.touchMoveHandler)),i.Events.remove(this.toolbarEl,"click",this.clickHandler)},handleTap:function(t){this.clearTimeout();var e;t.target===this.nextEl||i.DOM.isChildOf(t.target,this.nextEl)?e=n.Toolbar.ToolbarAction.next:t.target===this.previousEl||i.DOM.isChildOf(t.target,this.previousEl)?e=n.Toolbar.ToolbarAction.previous:t.target===this.closeEl||i.DOM.isChildOf(t.target,this.closeEl)?e=n.Toolbar.ToolbarAction.close:(t.target===this.playEl||i.DOM.isChildOf(t.target,this.playEl))&&(e=n.Toolbar.ToolbarAction.play),this.setTimeout(),i.isNothing(e)&&(e=n.Toolbar.ToolbarAction.none),i.Events.fire(this,{type:n.Toolbar.EventTypes.onTap,target:this,action:e,tapTarget:t.target})},setCaption:function(t){i.DOM.removeChildren(this.captionContentEl),this.currentCaption=i.coalesce(this.cache.images[t].caption," "),i.isObject(this.currentCaption)?i.DOM.appendChild(this.currentCaption,this.captionContentEl):(""===this.currentCaption&&(this.currentCaption=" "),i.DOM.appendText(this.currentCaption,this.captionContentEl)),this.currentCaption=" "===this.currentCaption?"":this.currentCaption,this.resetPosition()},showToolbar:function(){i.DOM.setStyle(this.toolbarEl,{opacity:this.settings.captionAndToolbarOpacity}),i.DOM.show(this.toolbarEl)},showCaption:function(){(""===this.currentCaption||1>this.captionContentEl.childNodes.length)&&!this.settings.captionAndToolbarShowEmptyCaptions?i.DOM.hide(this.captionEl):(i.DOM.setStyle(this.captionEl,{opacity:this.settings.captionAndToolbarOpacity}),i.DOM.show(this.captionEl))},setToolbarStatus:function(t){this.settings.loop||(i.DOM.removeClass(this.previousEl,n.Toolbar.CssClasses.previousDisabled),i.DOM.removeClass(this.nextEl,n.Toolbar.CssClasses.nextDisabled),t>0&&this.cache.images.length-1>t||(0===t&&(i.isNothing(this.previousEl)||i.DOM.addClass(this.previousEl,n.Toolbar.CssClasses.previousDisabled)),t===this.cache.images.length-1&&(i.isNothing(this.nextEl)||i.DOM.addClass(this.nextEl,n.Toolbar.CssClasses.nextDisabled))))},onFadeOut:function(){i.DOM.hide(this.toolbarEl),i.DOM.hide(this.captionEl),i.Events.fire(this,{type:n.Toolbar.EventTypes.onHide,target:this})},onTouchStart:function(){},onTouchMove:function(t){t.preventDefault()},onClick:function(t){t.preventDefault(),this.handleTap(t)}})}(window,window.klass,window.Code.Util),function(t,e,i){i.registerNamespace("Code.PhotoSwipe.UILayer"),t.Code.PhotoSwipe.UILayer.CssClasses={uiLayer:"ps-uilayer"}}(window,window.klass,window.Code.Util),function(t,e,i){i.registerNamespace("Code.PhotoSwipe.UILayer");var n=t.Code.PhotoSwipe;n.UILayer.UILayerClass=i.TouchElement.TouchElementClass.extend({el:null,settings:null,dispose:function(){var t;this.removeEventHandlers(),i.DOM.removeChild(this.el,this.el.parentNode);for(t in this)i.objectHasProperty(this,t)&&(this[t]=null)},initialize:function(e){this.settings=e,this.el=i.DOM.createElement("div",{"class":n.UILayer.CssClasses.uiLayer},""),i.DOM.setStyle(this.el,{display:"block",position:"absolute",left:0,top:0,overflow:"hidden",zIndex:this.settings.zIndex,opacity:0}),i.DOM.hide(this.el),this.settings.target===t?i.DOM.appendToBody(this.el):i.DOM.appendChild(this.el,this.settings.target),this.supr(this.el,{swipe:!0,move:!0,gesture:i.Browser.iOS,doubleTap:!0,preventDefaultTouchEvents:this.settings.preventDefaultTouchEvents})},resetPosition:function(){this.settings.target===t?i.DOM.setStyle(this.el,{top:i.DOM.windowScrollTop()+"px",width:i.DOM.windowWidth(),height:i.DOM.windowHeight()}):i.DOM.setStyle(this.el,{top:"0px",width:i.DOM.width(this.settings.target),height:i.DOM.height(this.settings.target)})},show:function(){this.resetPosition(),i.DOM.show(this.el),this.addEventHandlers()},addEventHandlers:function(){this.supr()},removeEventHandlers:function(){this.supr()}})}(window,window.klass,window.Code.Util),function(t,e,i){i.registerNamespace("Code.PhotoSwipe.ZoomPanRotate"),t=t.Code.PhotoSwipe,t.ZoomPanRotate.CssClasses={zoomPanRotate:"ps-zoom-pan-rotate"},t.ZoomPanRotate.EventTypes={onTransform:"PhotoSwipeZoomPanRotateOnTransform"}}(window,window.klass,window.Code.Util),function(t,e,i){i.registerNamespace("Code.PhotoSwipe.ZoomPanRotate");var n=t.Code.PhotoSwipe;n.ZoomPanRotate.ZoomPanRotateClass=e({el:null,settings:null,containerEl:null,imageEl:null,transformSettings:null,panStartingPoint:null,transformEl:null,dispose:function(){var t;i.DOM.removeChild(this.el,this.el.parentNode);for(t in this)i.objectHasProperty(this,t)&&(this[t]=null)},initialize:function(e,o,s){var r,a,l;this.settings=e,this.settings.target===t?(e=document.body,r=i.DOM.windowWidth(),a=i.DOM.windowHeight(),l=i.DOM.windowScrollTop()+"px"):(e=this.settings.target,r=i.DOM.width(e),a=i.DOM.height(e),l="0px"),this.imageEl=o.imageEl.cloneNode(!1),i.DOM.setStyle(this.imageEl,{zIndex:1}),this.transformSettings={startingScale:1,scale:1,startingRotation:0,rotation:0,startingTranslateX:0,startingTranslateY:0,translateX:0,translateY:0},this.el=i.DOM.createElement("div",{"class":n.ZoomPanRotate.CssClasses.zoomPanRotate},""),i.DOM.setStyle(this.el,{left:0,top:l,position:"absolute",width:r,height:a,zIndex:this.settings.zIndex,display:"block"}),i.DOM.insertBefore(this.el,s.el,e),i.Browser.iOS?(this.containerEl=i.DOM.createElement("div"),i.DOM.setStyle(this.containerEl,{left:0,top:0,width:r,height:a,position:"absolute",zIndex:1}),i.DOM.appendChild(this.imageEl,this.containerEl),i.DOM.appendChild(this.containerEl,this.el),i.Animation.resetTranslate(this.containerEl),i.Animation.resetTranslate(this.imageEl),this.transformEl=this.containerEl):(i.DOM.appendChild(this.imageEl,this.el),this.transformEl=this.imageEl)},setStartingTranslateFromCurrentTransform:function(){var e=i.coalesce(this.transformEl.style.webkitTransform,this.transformEl.style.MozTransform,this.transformEl.style.transform);i.isNothing(e)||(e=e.match(/translate\((.*?)\)/),i.isNothing(e))||(e=e[1].split(", "),this.transformSettings.startingTranslateX=t.parseInt(e[0],10),this.transformSettings.startingTranslateY=t.parseInt(e[1],10))},getScale:function(t){return t*=this.transformSettings.startingScale,0!==this.settings.minUserZoom&&this.settings.minUserZoom>t?t=this.settings.minUserZoom:0!==this.settings.maxUserZoom&&t>this.settings.maxUserZoom&&(t=this.settings.maxUserZoom),t},setStartingScaleAndRotation:function(t,e){this.transformSettings.startingScale=this.getScale(t),this.transformSettings.startingRotation=(this.transformSettings.startingRotation+e)%360},zoomRotate:function(t,e){this.transformSettings.scale=this.getScale(t),this.transformSettings.rotation=this.transformSettings.startingRotation+e,this.applyTransform()},panStart:function(t){this.setStartingTranslateFromCurrentTransform(),this.panStartingPoint={x:t.x,y:t.y}},pan:function(t){var e=(t.y-this.panStartingPoint.y)/this.transformSettings.scale;this.transformSettings.translateX=this.transformSettings.startingTranslateX+(t.x-this.panStartingPoint.x)/this.transformSettings.scale,this.transformSettings.translateY=this.transformSettings.startingTranslateY+e,this.applyTransform()},zoomAndPanToPoint:function(e,n){if(this.settings.target===t){this.panStart({x:i.DOM.windowWidth()/2,y:i.DOM.windowHeight()/2});var o=(n.y-this.panStartingPoint.y)/this.transformSettings.scale;this.transformSettings.translateX=-1*(this.transformSettings.startingTranslateX+(n.x-this.panStartingPoint.x)/this.transformSettings.scale),this.transformSettings.translateY=-1*(this.transformSettings.startingTranslateY+o)}this.setStartingScaleAndRotation(e,0),this.transformSettings.scale=this.transformSettings.startingScale,this.transformSettings.rotation=0,this.applyTransform()},applyTransform:function(){var e=this.transformSettings.rotation%360,o=t.parseInt(this.transformSettings.translateX,10),s=t.parseInt(this.transformSettings.translateY,10),r="scale("+this.transformSettings.scale+") rotate("+e+"deg) translate("+o+"px, "+s+"px)";i.DOM.setStyle(this.transformEl,{webkitTransform:r,MozTransform:r,msTransform:r,transform:r}),i.Events.fire(this,{target:this,type:n.ZoomPanRotate.EventTypes.onTransform,scale:this.transformSettings.scale,rotation:this.transformSettings.rotation,rotationDegs:e,translateX:o,translateY:s})}})}(window,window.klass,window.Code.Util),function(t,e){e.registerNamespace("Code.PhotoSwipe");var i=t.Code.PhotoSwipe;i.CssClasses={buildingBody:"ps-building",activeBody:"ps-active"},i.EventTypes={onBeforeShow:"PhotoSwipeOnBeforeShow",onShow:"PhotoSwipeOnShow",onBeforeHide:"PhotoSwipeOnBeforeHide",onHide:"PhotoSwipeOnHide",onDisplayImage:"PhotoSwipeOnDisplayImage",onResetPosition:"PhotoSwipeOnResetPosition",onSlideshowStart:"PhotoSwipeOnSlideshowStart",onSlideshowStop:"PhotoSwipeOnSlideshowStop",onTouch:"PhotoSwipeOnTouch",onBeforeCaptionAndToolbarShow:"PhotoSwipeOnBeforeCaptionAndToolbarShow",onCaptionAndToolbarShow:"PhotoSwipeOnCaptionAndToolbarShow",onBeforeCaptionAndToolbarHide:"PhotoSwipeOnBeforeCaptionAndToolbarHide",onCaptionAndToolbarHide:"PhotoSwipeOnCaptionAndToolbarHide",onToolbarTap:"PhotoSwipeOnToolbarTap",onBeforeZoomPanRotateShow:"PhotoSwipeOnBeforeZoomPanRotateShow",onZoomPanRotateShow:"PhotoSwipeOnZoomPanRotateShow",onBeforeZoomPanRotateHide:"PhotoSwipeOnBeforeZoomPanRotateHide",onZoomPanRotateHide:"PhotoSwipeOnZoomPanRotateHide",onZoomPanRotateTransform:"PhotoSwipeOnZoomPanRotateTransform"},i.instances=[],i.activeInstances=[],i.setActivateInstance=function(t){if(e.arrayIndexOf(t.settings.target,i.activeInstances,"target")>-1)throw"Code.PhotoSwipe.activateInstance: Unable to active instance as another instance is already active for this target";i.activeInstances.push({target:t.settings.target,instance:t})},i.unsetActivateInstance=function(t){t=e.arrayIndexOf(t,i.activeInstances,"instance"),i.activeInstances.splice(t,1)},i.attach=function(t,n,o){var s,r;for(s=i.createInstance(t,n,o),n=0,o=t.length;o>n;n++)r=t[n],e.isNothing(r.nodeType)||1!==r.nodeType||(r.__photoSwipeClickHandler=i.onTriggerElementClick.bind(s),e.Events.remove(r,"click",r.__photoSwipeClickHandler),e.Events.add(r,"click",r.__photoSwipeClickHandler));return s},t.jQuery&&(t.jQuery.fn.photoSwipe=function(t,e){return i.attach(this,t,e)}),i.detatch=function(t){var n,o,s;for(n=0,o=t.originalImages.length;o>n;n++)s=t.originalImages[n],!e.isNothing(s.nodeType)&&1===s.nodeType&&(e.Events.remove(s,"click",s.__photoSwipeClickHandler),delete s.__photoSwipeClickHandler);i.disposeInstance(t)},i.createInstance=function(t,n,o){var s;if(e.isNothing(t))throw"Code.PhotoSwipe.attach: No images passed.";if(!e.isLikeArray(t))throw"Code.PhotoSwipe.createInstance: Images must be an array of elements or image urls.";if(1>t.length)throw"Code.PhotoSwipe.createInstance: No images to passed.";if(n=e.coalesce(n,{}),s=i.getInstance(o),!e.isNothing(s))throw'Code.PhotoSwipe.createInstance: Instance with id "'+o+' already exists."';return s=new i.PhotoSwipeClass(t,n,o),i.instances.push(s),s},i.disposeInstance=function(t){var e=i.getInstanceIndex(t);if(0>e)throw"Code.PhotoSwipe.disposeInstance: Unable to find instance to dispose.";
t.dispose(),i.instances.splice(e,1)},i.onTriggerElementClick=function(t){t.preventDefault(),this.show(t.currentTarget)},i.getInstance=function(t){var e,n,o;for(e=0,n=i.instances.length;n>e;e++)if(o=i.instances[e],o.id===t)return o;return null},i.getInstanceIndex=function(t){var e,n,o=-1;for(e=0,n=i.instances.length;n>e;e++)if(i.instances[e]===t){o=e;break}return o}}(window,window.Code.Util),function(t,e,i,n,o,s,r,a,l){i.registerNamespace("Code.PhotoSwipe");var h=t.Code.PhotoSwipe;h.PhotoSwipeClass=e({id:null,settings:null,isBackEventSupported:null,backButtonClicked:null,currentIndex:null,originalImages:null,mouseWheelStartTime:null,windowDimensions:null,cache:null,documentOverlay:null,carousel:null,uiLayer:null,toolbar:null,zoomPanRotate:null,windowOrientationChangeHandler:null,windowScrollHandler:null,windowHashChangeHandler:null,keyDownHandler:null,windowOrientationEventName:null,uiLayerTouchHandler:null,carouselSlideByEndHandler:null,carouselSlideshowStartHandler:null,carouselSlideshowStopHandler:null,toolbarTapHandler:null,toolbarBeforeShowHandler:null,toolbarShowHandler:null,toolbarBeforeHideHandler:null,toolbarHideHandler:null,mouseWheelHandler:null,zoomPanRotateTransformHandler:null,_isResettingPosition:null,_uiWebViewResetPositionTimeout:null,dispose:function(){var t;i.Events.remove(this,h.EventTypes.onBeforeShow),i.Events.remove(this,h.EventTypes.onShow),i.Events.remove(this,h.EventTypes.onBeforeHide),i.Events.remove(this,h.EventTypes.onHide),i.Events.remove(this,h.EventTypes.onDisplayImage),i.Events.remove(this,h.EventTypes.onResetPosition),i.Events.remove(this,h.EventTypes.onSlideshowStart),i.Events.remove(this,h.EventTypes.onSlideshowStop),i.Events.remove(this,h.EventTypes.onTouch),i.Events.remove(this,h.EventTypes.onBeforeCaptionAndToolbarShow),i.Events.remove(this,h.EventTypes.onCaptionAndToolbarShow),i.Events.remove(this,h.EventTypes.onBeforeCaptionAndToolbarHide),i.Events.remove(this,h.EventTypes.onCaptionAndToolbarHide),i.Events.remove(this,h.EventTypes.onZoomPanRotateTransform),this.removeEventHandlers(),i.isNothing(this.documentOverlay)||this.documentOverlay.dispose(),i.isNothing(this.carousel)||this.carousel.dispose(),i.isNothing(this.uiLayer)||this.uiLayer.dispose(),i.isNothing(this.toolbar)||this.toolbar.dispose(),this.destroyZoomPanRotate(),i.isNothing(this.cache)||this.cache.dispose();for(t in this)i.objectHasProperty(this,t)&&(this[t]=null)},initialize:function(e,o,s){this.id=i.isNothing(s)?"PhotoSwipe"+(""+(new Date).getTime()):s,this.originalImages=e,i.Browser.android&&(""+t.navigator.userAgent.match(/Android (\d+.\d+)/)).replace(/^.*\,/,"")>=2.1&&(this.isBackEventSupported=!0),this.isBackEventSupported||(this.isBackEventSupported=i.objectHasProperty(t,"onhashchange")),this.settings={fadeInSpeed:250,fadeOutSpeed:250,preventHide:!1,preventSlideshow:!1,zIndex:1e3,backButtonHideEnabled:!0,enableKeyboard:!0,enableMouseWheel:!0,mouseWheelSpeed:350,autoStartSlideshow:!1,jQueryMobile:!i.isNothing(t.jQuery)&&!i.isNothing(t.jQuery.mobile),jQueryMobileDialogHash:"&ui-state=dialog",enableUIWebViewRepositionTimeout:!1,uiWebViewResetPositionDelay:500,target:t,preventDefaultTouchEvents:!0,loop:!0,slideSpeed:250,nextPreviousSlideSpeed:0,enableDrag:!0,swipeThreshold:50,swipeTimeThreshold:250,slideTimingFunction:"ease-out",slideshowDelay:3e3,doubleTapSpeed:250,margin:20,imageScaleMethod:"fit",captionAndToolbarHide:!1,captionAndToolbarFlipPosition:!1,captionAndToolbarAutoHideDelay:5e3,captionAndToolbarOpacity:.8,captionAndToolbarShowEmptyCaptions:!0,getToolbar:h.Toolbar.getToolbar,allowUserZoom:!0,allowRotationOnUserZoom:!1,maxUserZoom:5,minUserZoom:.5,doubleTapZoomLevel:2.5,getImageSource:h.Cache.Functions.getImageSource,getImageCaption:h.Cache.Functions.getImageCaption,getImageMetaData:h.Cache.Functions.getImageMetaData,cacheMode:h.Cache.Mode.normal},i.extend(this.settings,o),this.settings.target!==t&&(o=i.DOM.getStyle(this.settings.target,"position"),("relative"!==o||"absolute"!==o)&&i.DOM.setStyle(this.settings.target,"position","relative")),this.settings.target!==t?(this.isBackEventSupported=!1,this.settings.backButtonHideEnabled=!1):this.settings.preventHide&&(this.settings.backButtonHideEnabled=!1),this.cache=new n.CacheClass(e,this.settings)},show:function(e){var n,o;if(this.backButtonClicked=this._isResettingPosition=!1,i.isNumber(e))this.currentIndex=e;else for(this.currentIndex=-1,n=0,o=this.originalImages.length;o>n;n++)if(this.originalImages[n]===e){this.currentIndex=n;break}if(0>this.currentIndex||this.currentIndex>this.originalImages.length-1)throw"Code.PhotoSwipe.PhotoSwipeClass.show: Starting index out of range";this.isAlreadyGettingPage=this.getWindowDimensions(),h.setActivateInstance(this),this.windowDimensions=this.getWindowDimensions(),this.settings.target===t?i.DOM.addClass(t.document.body,h.CssClasses.buildingBody):i.DOM.addClass(this.settings.target,h.CssClasses.buildingBody),this.createComponents(),i.Events.fire(this,{type:h.EventTypes.onBeforeShow,target:this}),this.documentOverlay.fadeIn(this.settings.fadeInSpeed,this.onDocumentOverlayFadeIn.bind(this))},getWindowDimensions:function(){return{width:i.DOM.windowWidth(),height:i.DOM.windowHeight()}},createComponents:function(){this.documentOverlay=new o.DocumentOverlayClass(this.settings),this.carousel=new s.CarouselClass(this.cache,this.settings),this.uiLayer=new a.UILayerClass(this.settings),this.settings.captionAndToolbarHide||(this.toolbar=new r.ToolbarClass(this.cache,this.settings))},resetPosition:function(){if(!this._isResettingPosition){var t=this.getWindowDimensions();(i.isNothing(this.windowDimensions)||t.width!==this.windowDimensions.width||t.height!==this.windowDimensions.height)&&(this._isResettingPosition=!0,this.windowDimensions=t,this.destroyZoomPanRotate(),this.documentOverlay.resetPosition(),this.carousel.resetPosition(),i.isNothing(this.toolbar)||this.toolbar.resetPosition(),this.uiLayer.resetPosition(),this._isResettingPosition=!1,i.Events.fire(this,{type:h.EventTypes.onResetPosition,target:this}))}},addEventHandler:function(t,e){i.Events.add(this,t,e)},addEventHandlers:function(){i.isNothing(this.windowOrientationChangeHandler)&&(this.windowOrientationChangeHandler=this.onWindowOrientationChange.bind(this),this.windowScrollHandler=this.onWindowScroll.bind(this),this.keyDownHandler=this.onKeyDown.bind(this),this.windowHashChangeHandler=this.onWindowHashChange.bind(this),this.uiLayerTouchHandler=this.onUILayerTouch.bind(this),this.carouselSlideByEndHandler=this.onCarouselSlideByEnd.bind(this),this.carouselSlideshowStartHandler=this.onCarouselSlideshowStart.bind(this),this.carouselSlideshowStopHandler=this.onCarouselSlideshowStop.bind(this),this.toolbarTapHandler=this.onToolbarTap.bind(this),this.toolbarBeforeShowHandler=this.onToolbarBeforeShow.bind(this),this.toolbarShowHandler=this.onToolbarShow.bind(this),this.toolbarBeforeHideHandler=this.onToolbarBeforeHide.bind(this),this.toolbarHideHandler=this.onToolbarHide.bind(this),this.mouseWheelHandler=this.onMouseWheel.bind(this),this.zoomPanRotateTransformHandler=this.onZoomPanRotateTransform.bind(this)),i.Browser.android?this.orientationEventName="resize":i.Browser.iOS&&!i.Browser.safari?i.Events.add(t.document.body,"orientationchange",this.windowOrientationChangeHandler):this.orientationEventName=i.isNothing(t.onorientationchange)?"resize":"orientationchange",i.isNothing(this.orientationEventName)||i.Events.add(t,this.orientationEventName,this.windowOrientationChangeHandler),this.settings.target===t&&i.Events.add(t,"scroll",this.windowScrollHandler),this.settings.enableKeyboard&&i.Events.add(t.document,"keydown",this.keyDownHandler),this.isBackEventSupported&&this.settings.backButtonHideEnabled&&(this.windowHashChangeHandler=this.onWindowHashChange.bind(this),this.settings.jQueryMobile?t.location.hash=this.settings.jQueryMobileDialogHash:(this.currentHistoryHashValue="PhotoSwipe"+(""+(new Date).getTime()),t.location.hash=this.currentHistoryHashValue),i.Events.add(t,"hashchange",this.windowHashChangeHandler)),this.settings.enableMouseWheel&&i.Events.add(t,"mousewheel",this.mouseWheelHandler),i.Events.add(this.uiLayer,i.TouchElement.EventTypes.onTouch,this.uiLayerTouchHandler),i.Events.add(this.carousel,s.EventTypes.onSlideByEnd,this.carouselSlideByEndHandler),i.Events.add(this.carousel,s.EventTypes.onSlideshowStart,this.carouselSlideshowStartHandler),i.Events.add(this.carousel,s.EventTypes.onSlideshowStop,this.carouselSlideshowStopHandler),i.isNothing(this.toolbar)||(i.Events.add(this.toolbar,r.EventTypes.onTap,this.toolbarTapHandler),i.Events.add(this.toolbar,r.EventTypes.onBeforeShow,this.toolbarBeforeShowHandler),i.Events.add(this.toolbar,r.EventTypes.onShow,this.toolbarShowHandler),i.Events.add(this.toolbar,r.EventTypes.onBeforeHide,this.toolbarBeforeHideHandler),i.Events.add(this.toolbar,r.EventTypes.onHide,this.toolbarHideHandler))},removeEventHandlers:function(){i.Browser.iOS&&!i.Browser.safari&&i.Events.remove(t.document.body,"orientationchange",this.windowOrientationChangeHandler),i.isNothing(this.orientationEventName)||i.Events.remove(t,this.orientationEventName,this.windowOrientationChangeHandler),i.Events.remove(t,"scroll",this.windowScrollHandler),this.settings.enableKeyboard&&i.Events.remove(t.document,"keydown",this.keyDownHandler),this.isBackEventSupported&&this.settings.backButtonHideEnabled&&i.Events.remove(t,"hashchange",this.windowHashChangeHandler),this.settings.enableMouseWheel&&i.Events.remove(t,"mousewheel",this.mouseWheelHandler),i.isNothing(this.uiLayer)||i.Events.remove(this.uiLayer,i.TouchElement.EventTypes.onTouch,this.uiLayerTouchHandler),i.isNothing(this.toolbar)||(i.Events.remove(this.carousel,s.EventTypes.onSlideByEnd,this.carouselSlideByEndHandler),i.Events.remove(this.carousel,s.EventTypes.onSlideshowStart,this.carouselSlideshowStartHandler),i.Events.remove(this.carousel,s.EventTypes.onSlideshowStop,this.carouselSlideshowStopHandler)),i.isNothing(this.toolbar)||(i.Events.remove(this.toolbar,r.EventTypes.onTap,this.toolbarTapHandler),i.Events.remove(this.toolbar,r.EventTypes.onBeforeShow,this.toolbarBeforeShowHandler),i.Events.remove(this.toolbar,r.EventTypes.onShow,this.toolbarShowHandler),i.Events.remove(this.toolbar,r.EventTypes.onBeforeHide,this.toolbarBeforeHideHandler),i.Events.remove(this.toolbar,r.EventTypes.onHide,this.toolbarHideHandler))},hide:function(){if(!this.settings.preventHide){if(i.isNothing(this.documentOverlay))throw"Code.PhotoSwipe.PhotoSwipeClass.hide: PhotoSwipe instance is already hidden";i.isNothing(this.hiding)&&(this.clearUIWebViewResetPositionTimeout(),this.destroyZoomPanRotate(),this.removeEventHandlers(),i.Events.fire(this,{type:h.EventTypes.onBeforeHide,target:this}),this.uiLayer.dispose(),this.uiLayer=null,i.isNothing(this.toolbar)||(this.toolbar.dispose(),this.toolbar=null),this.carousel.dispose(),this.carousel=null,i.DOM.removeClass(t.document.body,h.CssClasses.activeBody),this.documentOverlay.dispose(),this.documentOverlay=null,this._isResettingPosition=!1,h.unsetActivateInstance(this),i.Events.fire(this,{type:h.EventTypes.onHide,target:this}),this.goBackInHistory())}},goBackInHistory:function(){this.isBackEventSupported&&this.settings.backButtonHideEnabled&&(this.backButtonClicked||t.history.back())},play:function(){!this.isZoomActive()&&!this.settings.preventSlideshow&&!i.isNothing(this.carousel)&&(!i.isNothing(this.toolbar)&&this.toolbar.isVisible&&this.toolbar.fadeOut(),this.carousel.startSlideshow())},stop:function(){this.isZoomActive()||i.isNothing(this.carousel)||this.carousel.stopSlideshow()},previous:function(){this.isZoomActive()||i.isNothing(this.carousel)||this.carousel.previous()},next:function(){this.isZoomActive()||i.isNothing(this.carousel)||this.carousel.next()},toggleToolbar:function(){this.isZoomActive()||i.isNothing(this.toolbar)||this.toolbar.toggleVisibility(this.currentIndex)},fadeOutToolbarIfVisible:function(){!i.isNothing(this.toolbar)&&this.toolbar.isVisible&&this.settings.captionAndToolbarAutoHideDelay>0&&this.toolbar.fadeOut()},createZoomPanRotate:function(){this.stop(),this.canUserZoom()&&!this.isZoomActive()&&(i.Events.fire(this,h.EventTypes.onBeforeZoomPanRotateShow),this.zoomPanRotate=new l.ZoomPanRotateClass(this.settings,this.cache.images[this.currentIndex],this.uiLayer),this.uiLayer.captureSettings.preventDefaultTouchEvents=!0,i.Events.add(this.zoomPanRotate,h.ZoomPanRotate.EventTypes.onTransform,this.zoomPanRotateTransformHandler),i.Events.fire(this,h.EventTypes.onZoomPanRotateShow),!i.isNothing(this.toolbar)&&this.toolbar.isVisible&&this.toolbar.fadeOut())},destroyZoomPanRotate:function(){i.isNothing(this.zoomPanRotate)||(i.Events.fire(this,h.EventTypes.onBeforeZoomPanRotateHide),i.Events.remove(this.zoomPanRotate,h.ZoomPanRotate.EventTypes.onTransform,this.zoomPanRotateTransformHandler),this.zoomPanRotate.dispose(),this.zoomPanRotate=null,this.uiLayer.captureSettings.preventDefaultTouchEvents=this.settings.preventDefaultTouchEvents,i.Events.fire(this,h.EventTypes.onZoomPanRotateHide))},canUserZoom:function(){var t;if(i.Browser.msie){if(t=document.createElement("div"),i.isNothing(t.style.msTransform))return!1}else if(!i.Browser.isCSSTransformSupported)return!1;return this.settings.allowUserZoom?this.carousel.isSliding?!1:(t=this.cache.images[this.currentIndex],i.isNothing(t)?!1:t.isLoading?!1:!0):!1},isZoomActive:function(){return!i.isNothing(this.zoomPanRotate)},getCurrentImage:function(){return this.cache.images[this.currentIndex]},onDocumentOverlayFadeIn:function(){t.setTimeout(function(){var e=this.settings.target===t?t.document.body:this.settings.target;i.DOM.removeClass(e,h.CssClasses.buildingBody),i.DOM.addClass(e,h.CssClasses.activeBody),this.addEventHandlers(),this.carousel.show(this.currentIndex),this.uiLayer.show(),this.settings.autoStartSlideshow?this.play():i.isNothing(this.toolbar)||this.toolbar.show(this.currentIndex),i.Events.fire(this,{type:h.EventTypes.onShow,target:this}),this.setUIWebViewResetPositionTimeout()}.bind(this),250)},setUIWebViewResetPositionTimeout:function(){this.settings.enableUIWebViewRepositionTimeout&&i.Browser.iOS&&!i.Browser.safari&&(i.isNothing(this._uiWebViewResetPositionTimeout)||t.clearTimeout(this._uiWebViewResetPositionTimeout),this._uiWebViewResetPositionTimeout=t.setTimeout(function(){this.resetPosition(),this.setUIWebViewResetPositionTimeout()}.bind(this),this.settings.uiWebViewResetPositionDelay))},clearUIWebViewResetPositionTimeout:function(){i.isNothing(this._uiWebViewResetPositionTimeout)||t.clearTimeout(this._uiWebViewResetPositionTimeout)},onWindowScroll:function(){this.resetPosition()},onWindowOrientationChange:function(){this.resetPosition()},onWindowHashChange:function(){t.location.hash!=="#"+(this.settings.jQueryMobile?this.settings.jQueryMobileDialogHash:this.currentHistoryHashValue)&&(this.backButtonClicked=!0,this.hide())},onKeyDown:function(t){37===t.keyCode?(t.preventDefault(),this.previous()):39===t.keyCode?(t.preventDefault(),this.next()):38===t.keyCode||40===t.keyCode?t.preventDefault():27===t.keyCode?(t.preventDefault(),this.hide()):32===t.keyCode?(this.settings.hideToolbar?this.hide():this.toggleToolbar(),t.preventDefault()):13===t.keyCode&&(t.preventDefault(),this.play())},onUILayerTouch:function(e){if(this.isZoomActive())switch(e.action){case i.TouchElement.ActionTypes.gestureChange:this.zoomPanRotate.zoomRotate(e.scale,this.settings.allowRotationOnUserZoom?e.rotation:0);break;case i.TouchElement.ActionTypes.gestureEnd:this.zoomPanRotate.setStartingScaleAndRotation(e.scale,this.settings.allowRotationOnUserZoom?e.rotation:0);break;case i.TouchElement.ActionTypes.touchStart:this.zoomPanRotate.panStart(e.point);break;case i.TouchElement.ActionTypes.touchMove:this.zoomPanRotate.pan(e.point);break;case i.TouchElement.ActionTypes.doubleTap:this.destroyZoomPanRotate(),this.toggleToolbar();break;case i.TouchElement.ActionTypes.swipeLeft:this.destroyZoomPanRotate(),this.next(),this.toggleToolbar();break;case i.TouchElement.ActionTypes.swipeRight:this.destroyZoomPanRotate(),this.previous(),this.toggleToolbar()}else switch(e.action){case i.TouchElement.ActionTypes.touchMove:case i.TouchElement.ActionTypes.swipeLeft:case i.TouchElement.ActionTypes.swipeRight:this.fadeOutToolbarIfVisible(),this.carousel.onTouch(e.action,e.point);break;case i.TouchElement.ActionTypes.touchStart:case i.TouchElement.ActionTypes.touchMoveEnd:this.carousel.onTouch(e.action,e.point);break;case i.TouchElement.ActionTypes.tap:this.toggleToolbar();break;case i.TouchElement.ActionTypes.doubleTap:this.settings.target===t&&(e.point.x-=i.DOM.windowScrollLeft(),e.point.y-=i.DOM.windowScrollTop());var n=this.cache.images[this.currentIndex].imageEl,o=t.parseInt(i.DOM.getStyle(n,"top"),10),s=t.parseInt(i.DOM.getStyle(n,"left"),10),r=s+i.DOM.width(n),n=o+i.DOM.height(n);s>e.point.x?e.point.x=s:e.point.x>r&&(e.point.x=r),o>e.point.y?e.point.y=o:e.point.y>n&&(e.point.y=n),this.createZoomPanRotate(),this.isZoomActive()&&this.zoomPanRotate.zoomAndPanToPoint(this.settings.doubleTapZoomLevel,e.point);break;case i.TouchElement.ActionTypes.gestureStart:this.createZoomPanRotate()}i.Events.fire(this,{type:h.EventTypes.onTouch,target:this,point:e.point,action:e.action})},onCarouselSlideByEnd:function(t){this.currentIndex=t.cacheIndex,i.isNothing(this.toolbar)||(this.toolbar.setCaption(this.currentIndex),this.toolbar.setToolbarStatus(this.currentIndex)),i.Events.fire(this,{type:h.EventTypes.onDisplayImage,target:this,action:t.action,index:t.cacheIndex})},onToolbarTap:function(t){switch(t.action){case r.ToolbarAction.next:this.next();break;case r.ToolbarAction.previous:this.previous();break;case r.ToolbarAction.close:this.hide();break;case r.ToolbarAction.play:this.play()}i.Events.fire(this,{type:h.EventTypes.onToolbarTap,target:this,toolbarAction:t.action,tapTarget:t.tapTarget})},onMouseWheel:function(t){var e=i.Events.getWheelDelta(t);t.timeStamp-(this.mouseWheelStartTime||0)<this.settings.mouseWheelSpeed||(this.mouseWheelStartTime=t.timeStamp,this.settings.invertMouseWheel&&(e*=-1),0>e?this.next():e>0&&this.previous())},onCarouselSlideshowStart:function(){i.Events.fire(this,{type:h.EventTypes.onSlideshowStart,target:this})},onCarouselSlideshowStop:function(){i.Events.fire(this,{type:h.EventTypes.onSlideshowStop,target:this})},onToolbarBeforeShow:function(){i.Events.fire(this,{type:h.EventTypes.onBeforeCaptionAndToolbarShow,target:this})},onToolbarShow:function(){i.Events.fire(this,{type:h.EventTypes.onCaptionAndToolbarShow,target:this})},onToolbarBeforeHide:function(){i.Events.fire(this,{type:h.EventTypes.onBeforeCaptionAndToolbarHide,target:this})},onToolbarHide:function(){i.Events.fire(this,{type:h.EventTypes.onCaptionAndToolbarHide,target:this})},onZoomPanRotateTransform:function(t){i.Events.fire(this,{target:this,type:h.EventTypes.onZoomPanRotateTransform,scale:t.scale,rotation:t.rotation,rotationDegs:t.rotationDegs,translateX:t.translateX,translateY:t.translateY})}})}(window,window.klass,window.Code.Util,window.Code.PhotoSwipe.Cache,window.Code.PhotoSwipe.DocumentOverlay,window.Code.PhotoSwipe.Carousel,window.Code.PhotoSwipe.Toolbar,window.Code.PhotoSwipe.UILayer,window.Code.PhotoSwipe.ZoomPanRotate),define("vendor/photoswipe",function(){}),function(){"undefined"==typeof Joshfire&&(Joshfire={});var t={version:[0,9,3],onReady:function(t){t&&t()},adapter:"ios",adapterDeps:["phone"],adapterModules:{android:["dependencies.json","vendor/iscroll"],"android-old":["app","dependencies.json","inputs/touch","ui/toolbar","uielements/list","uielements/panel","uielements/video.mediaelement","vendor/iscroll"],browser:["app","inputs/http","inputs/keyboard","inputs/mouse","uielement","uielements/list","uielements/mediacontrols","uielements/page","uielements/panel","uielements/panel.manager","uielements/video.mediaelement","uielements/video.popup","uielements/video.youtube.swf","utils/activitymonitor","utils/datasource","utils/dollar","utils/localstorage","utils/navigation","utils/onready","utils/stresstest"],googletv:["dependencies.json","inputs/keyboard","ui/videoplayer","uielement"],ios:["dependencies.json"],lgtv:["dependencies.json","ui/videoplayer","uielement","utils/dollar"],node:["app.factory","app","class","global.exec","inputs/http","uielements/page","uielements/panel","uielements/panel.manager","uielements/video.mediaelement","utils/datasource","utils/dollar","utils/eventsocket","utils/templatecompiler.cli","utils/templatecompiler","vendor/json2","view"],none:[],philips:["dependencies.json","ui/videoplayer","uielement","uielements/list","uielements/video.mediaelement","utils/dollar","utils/stresstest"],phone:["collection","ui/toolbar","uielement","utils/dollar","utils/onready"],qt4:[],samsungtv:["dependencies.json","inputs/remote","ui/cardpanel","ui/grid","ui/horizontallayout","ui/slidepanel","ui/toolbar","ui/verticallist","ui/videoplayer","uielement","utils/dollar","utils/onready","utils/widgetapi","view"],tv:["inputs/remote","ui/cardpanel","ui/grid","ui/horizontallayout","ui/slidepanel","ui/toolbar","ui/verticallist","ui/videoplayer","uielement","utils/dollar","utils/onready"]},debug:!1,path:(Joshfire.framework||{}).path||""},e=RegExp("^(.*)/adapters/"+t.adapter+"/bootstrap\\.js$"),i=null,n=null,o="",s=0,r=0,a=0,l="";if(!t.path&&"undefined"!=typeof document)for(i=document.getElementsByTagName("script"),r=i.length-1;r>=0;r--)if(n=e.exec(i[r].getAttribute("src")),n&&(t.path=n[1],"/"!==t.path[0]&&-1===t.path.indexOf("//"))){for(o=i[r].getAttribute("data-main"),o&&(s=o.split("/").length-1),a=0;s>a;a++)l+="../";t.path=l+t.path}require!==void 0&&require.config&&require.config({paths:{"joshfire-framework":t.path},urlArgs:Joshfire.debug?"bust="+(new Date).getTime():""}),Joshfire.framework=t,"undefined"!=typeof module&&module.exports&&(module.exports.JoshfireFramework=t)}.call(this),function(t){t.onReady=function(e){t.require(["joshlib!vendor/zepto"],function(){e.call()})}}(Joshfire),define("joshlib",{normalize:function(t){var e="joshfire-framework/",i=[Joshfire.framework.adapter].concat(Joshfire.framework.adapterDeps),n=Joshfire.framework.adapterModules;if("adapters/none/"===t.substring(0,14))return e+t.substring(14);if("adapters/"===t.substring(0,9))return e+t;for(var o=0;i.length>o;o++)for(var s=0;n[i[o]].length>s;s++)if(t===n[i[o]][s])return e+"adapters/"+i[o]+"/"+t;return e+t},load:function(t,e,i){e([t],function(t){i(t)})}}),define("joshfire-framework/adapters/phone/utils/onready",[],function(){return function(t){/complete|loaded|interactive/.test(document.readyState)&&t(),document.addEventListener("DOMContentLoaded",t,!1)}}),define("joshfire-framework/vendor/zepto",[],function(){(function(t){String.prototype.trim===t&&(String.prototype.trim=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}),Array.prototype.reduce===t&&(Array.prototype.reduce=function(e){if(this===void 0||null===this)throw new TypeError;var i,n=Object(this),o=n.length>>>0,s=0;if("function"!=typeof e)throw new TypeError;if(0==o&&1==arguments.length)throw new TypeError;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in n){i=n[s++];break}if(++s>=o)throw new TypeError}for(;o>s;)s in n&&(i=e.call(t,i,n[s],s,n)),s++;return i})})();var t=function(){function t(t){return"[object Function]"==B.call(t)}function e(t){return t instanceof Object}function i(e){var i,n;if("[object Object]"!==B.call(e))return!1;if(n=t(e.constructor)&&e.constructor.prototype,!n||!hasOwnProperty.call(n,"isPrototypeOf"))return!1;for(i in e);return i===g||hasOwnProperty.call(e,i)}function n(t){return t instanceof Array}function o(t){return"number"==typeof t.length}function s(t){return t.filter(function(t){return t!==g&&null!==t})}function r(t){return t.length>0?[].concat.apply([],t):t}function a(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function l(t){return t in O?O[t]:O[t]=RegExp("(^|\\s)"+t+"(\\s|$)")}function h(t,e){return"number"!=typeof e||M[a(t)]?e:e+"px"}function c(t){var e,i;return x[t]||(e=C.createElement(t),C.body.appendChild(e),i=D(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==i&&(i="block"),x[t]=i),x[t]}function u(t,e){return e===g?y(t):y(t).filter(e)}function d(e,i,n,o){return t(i)?i.call(e,n,o):i}function p(t,e,i){var n=t%2?e:e.parentNode;n?n.insertBefore(i,t?1==t?n.firstChild:2==t?e:null:e.nextSibling):y(i).remove()}function f(t,e){e(t);for(var i in t.childNodes)f(t.childNodes[i],e)}function m(t){var e=t.innerHTML||"",i=t.getAttribute("src"),n=null,o=null;e?window.eval.call(window,e):i&&(n=C.getElementsByTagName("head")[0]||C.documentElement,o=C.createElement("script"),o.type="text/javascript",o.setAttribute("src",i),n.insertBefore(o,n.firstChild)),t.parentNode&&t.parentNode.removeChild(t)}var g,v,y,w,b,E,S=[],T=S.slice,C=window.document,x={},O={},D=C.defaultView.getComputedStyle,M={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},P=/^\s*<(\w+|!)[^>]*>/,H=[1,3,8,9,11],I=["after","prepend","before","append"],_=C.createElement("table"),A=C.createElement("tr"),k={tr:C.createElement("tbody"),tbody:_,thead:_,tfoot:_,td:A,th:A,"*":C.createElement("div")},j=/complete|loaded|interactive/,N=/^\.([\w-]+)$/,L=/^#([\w-]+)$/,z=/^[\w-]+$/,B={}.toString,R={},U=C.createElement("div");return R.matches=function(t,e){if(!t||1!==t.nodeType)return!1;var i=t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(i)return i.call(t,e);var n,o=t.parentNode,s=!o;return s&&(o=U).appendChild(t),n=~R.qsa(o,e).indexOf(t),s&&U.removeChild(t),n},b=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},E=function(t){return t.filter(function(e,i){return t.indexOf(e)==i})},R.fragment=function(t,e){e===g&&(e=P.test(t)&&RegExp.$1),e in k||(e="*");var i=k[e];return i.innerHTML=""+t,y.each(T.call(i.childNodes),function(){i.removeChild(this)})},R.Z=function(t,e){return t=t||[],t.__proto__=arguments.callee.prototype,t.selector=e||"",t},R.isZ=function(t){return t instanceof R.Z},R.init=function(e,o){if(e){if(t(e))return y(C).ready(e);if(R.isZ(e))return e;var r;if(n(e))r=s(e);else if(i(e))r=[y.extend({},e)],e=null;else if(H.indexOf(e.nodeType)>=0||e===window)r=[e],e=null;else if(P.test(e))r=R.fragment(e.trim(),RegExp.$1),e=null;else{if(o!==g)return y(o).find(e);r=R.qsa(C,e)}return R.Z(r,e)}return R.Z()},y=function(t,e){return R.init(t,e)},y.extend=function(t){return T.call(arguments,1).forEach(function(e){for(v in e)e[v]!==g&&(t[v]=e[v])}),t},R.qsa=function(t,e){var i;return t===C&&L.test(e)?(i=t.getElementById(RegExp.$1))?[i]:S:1!==t.nodeType&&9!==t.nodeType?S:T.call(N.test(e)?t.getElementsByClassName(RegExp.$1):z.test(e)?t.getElementsByTagName(e):t.querySelectorAll(e))},y.isFunction=t,y.isObject=e,y.isArray=n,y.isPlainObject=i,y.inArray=function(t,e,i){return S.indexOf.call(e,t,i)},y.trim=function(t){return t.trim()},y.uuid=0,y.map=function(t,e){var i,n,s,a=[];if(o(t))for(n=0;t.length>n;n++)i=e(t[n],n),null!=i&&a.push(i);else for(s in t)i=e(t[s],s),null!=i&&a.push(i);return r(a)},y.each=function(t,e){var i,n;if(o(t)){for(i=0;t.length>i;i++)if(e.call(t[i],i,t[i])===!1)return t}else for(n in t)if(e.call(t[n],n,t[n])===!1)return t;return t},y.fn={forEach:S.forEach,reduce:S.reduce,push:S.push,indexOf:S.indexOf,concat:S.concat,map:function(t){return y.map(this,function(e,i){return t.call(e,i,e)})},slice:function(){return y(T.apply(this,arguments))},ready:function(t){return j.test(C.readyState)?t(y):C.addEventListener("DOMContentLoaded",function(){t(y)},!1),this},get:function(t){return t===g?T.call(this):this[t]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return this.forEach(function(e,i){t.call(e,i,e)}),this},filter:function(t){return y([].filter.call(this,function(e){return R.matches(e,t)}))},add:function(t,e){return y(E(this.concat(y(t,e))))},is:function(t){return this.length>0&&R.matches(this[0],t)},not:function(e){var i=[];if(t(e)&&e.call!==g)this.each(function(t){e.call(this,t)||i.push(this)});else{var n="string"==typeof e?this.filter(e):o(e)&&t(e.item)?T.call(e):y(e);this.forEach(function(t){0>n.indexOf(t)&&i.push(t)})}return y(i)},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!e(t)?t:y(t)},last:function(){var t=this[this.length-1];return t&&!e(t)?t:y(t)},find:function(t){var e;return e=1==this.length?R.qsa(this[0],t):this.map(function(){return R.qsa(this,t)}),y(e)},closest:function(t,e){for(var i=this[0];i&&!R.matches(i,t);)i=i!==e&&i!==C&&i.parentNode;return y(i)},parents:function(t){for(var e=[],i=this;i.length>0;)i=y.map(i,function(t){return(t=t.parentNode)&&t!==C&&0>e.indexOf(t)?(e.push(t),t):g});return u(e,t)},parent:function(t){return u(E(this.pluck("parentNode")),t)},children:function(t){return u(this.map(function(){return T.call(this.children)}),t)},siblings:function(t){return u(this.map(function(t,e){return T.call(e.parentNode.children).filter(function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return this.map(function(){return this[t]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=null),"none"==D(this,"").getPropertyValue("display")&&(this.style.display=c(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){return this.each(function(){y(this).wrapAll(y(t)[0].cloneNode(!1))})},wrapAll:function(t){return this[0]&&(y(this[0]).before(t=y(t)),t.append(this)),this},unwrap:function(){return this.parent().each(function(){y(this).replaceWith(y(this).children())}),this},clone:function(){return y(this.map(function(){return this.cloneNode(!0)}))},hide:function(){return this.css("display","none")},toggle:function(t){return(t===g?"none"==this.css("display"):t)?this.show():this.hide()},prev:function(){return y(this.pluck("previousElementSibling"))},next:function(){return y(this.pluck("nextElementSibling"))},html:function(t){return t===g?this.length>0?this[0].innerHTML:null:this.each(function(e){var i=this.innerHTML;y(this).empty().append(d(this,t,e,i))})},text:function(t){return t===g?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=t})},attr:function(t,i){var n;return"string"==typeof t&&i===g?0==this.length||1!==this[0].nodeType?g:"value"==t&&"INPUT"==this[0].nodeName?this.val():!(n=this[0].getAttribute(t))&&t in this[0]?this[0][t]:n:this.each(function(n){if(1===this.nodeType)if(e(t))for(v in t)this.setAttribute(v,t[v]);else this.setAttribute(t,d(this,i,n,this.getAttribute(t)))})},removeAttr:function(t){return this.each(function(){1===this.nodeType&&this.removeAttribute(t)})},prop:function(t,e){return e===g?this[0]?this[0][t]:g:this.each(function(i){this[t]=d(this,e,i,this[t])})},data:function(t,e){var i=this.attr("data-"+a(t),e);return null!==i?i:g},val:function(t){return t===g?this.length>0?this[0].value:g:this.each(function(e){this.value=d(this,t,e,this.value)})},offset:function(){if(0==this.length)return null;var t=this[0].getBoundingClientRect();return{left:t.left+window.pageXOffset,top:t.top+window.pageYOffset,width:t.width,height:t.height}},css:function(t,e){if(e===g&&"string"==typeof t)return 0==this.length?g:this[0].style[b(t)]||D(this[0],"").getPropertyValue(t);var i="";for(v in t)"string"==typeof t[v]&&""==t[v]?this.each(function(){this.style.removeProperty(a(v))}):i+=a(v)+":"+h(v,t[v])+";";return"string"==typeof t&&(""==e?this.each(function(){this.style.removeProperty(a(t))}):i=a(t)+":"+h(t,e)),this.each(function(){this.style.cssText+=";"+i})},index:function(t){return t?this.indexOf(y(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return 1>this.length?!1:l(t).test(this[0].className)},addClass:function(t){return this.each(function(e){w=[];var i=this.className,n=d(this,t,e,i);n.split(/\s+/g).forEach(function(t){y(this).hasClass(t)||w.push(t)},this),w.length&&(this.className+=(i?" ":"")+w.join(" "))
})},removeClass:function(t){return this.each(function(e){return t===g?this.className="":(w=this.className,d(this,t,e,w).split(/\s+/g).forEach(function(t){w=w.replace(l(t)," ")}),this.className=w.trim(),g)})},toggleClass:function(t,e){return this.each(function(i){var n=d(this,t,i,this.className);(e===g?!y(this).hasClass(n):e)?y(this).addClass(n):y(this).removeClass(n)})}},["width","height"].forEach(function(t){y.fn[t]=function(e){var i,n=t.replace(/./,function(t){return t[0].toUpperCase()});return e===g?this[0]==window?window["inner"+n]:this[0]==C?C.documentElement["offset"+n]:(i=this.offset())&&i[t]:this.each(function(i){var n=y(this);n.css(t,d(this,e,i,n[t]()))})}}),I.forEach(function(t,i){y.fn[t]=function(){var t=y.map(arguments,function(t){return e(t)?t:R.fragment(t)});if(1>t.length)return this;var n=this.length,o=n>1,s=2>i;return this.each(function(e,r){for(var a=0;t.length>a;a++){var l=t[s?t.length-a-1:a];f(l,function(t){null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||m(t)}),o&&n-1>e&&(l=l.cloneNode(!0)),p(i,r,l)}})},y.fn[i%2?t+"To":"insert"+(i?"Before":"After")]=function(e){return y(e)[t](this),this}}),R.Z.prototype=y.fn,R.camelize=b,R.uniq=E,y.zepto=R,y}();return window.Zepto=t,"$"in window||(window.$=t),function(t){function e(t){return t._zid||(t._zid=u++)}function i(t,i,s,r){if(i=n(i),i.ns)var a=o(i.ns);return(c[e(t)]||[]).filter(function(t){return!(!t||i.e&&t.e!=i.e||i.ns&&!a.test(t.ns)||s&&e(t.fn)!==e(s)||r&&t.sel!=r)})}function n(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function o(t){return RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function s(e,i,n){t.isObject(e)?t.each(e,n):e.split(/\s/).forEach(function(t){n(t,i)})}function r(i,o,r,a,l,h){h=!!h;var u=e(i),d=c[u]||(c[u]=[]);s(o,r,function(e,o){var s=l&&l(o,e),r=s||o,c=function(t){var e=r.apply(i,[t].concat(t.data));return e===!1&&t.preventDefault(),e},u=t.extend(n(e),{fn:o,proxy:c,sel:a,del:s,i:d.length});d.push(u),i.addEventListener(u.e,c,h)})}function a(t,n,o,r){var a=e(t);s(n||"",o,function(e,n){i(t,e,n,r).forEach(function(e){delete c[a][e.i],t.removeEventListener(e.e,e.proxy,!1)})})}function l(e){var i=t.extend({originalEvent:e},e);return t.each(m,function(t,n){i[t]=function(){return this[n]=p,e[t].apply(e,arguments)},i[n]=f}),i}function h(t){if(!("defaultPrevented"in t)){t.defaultPrevented=!1;var e=t.preventDefault;t.preventDefault=function(){this.defaultPrevented=!0,e.call(this)}}}var c=(t.zepto.qsa,{}),u=1,d={};d.click=d.mousedown=d.mouseup=d.mousemove="MouseEvents",t.event={add:r,remove:a},t.proxy=function(i,n){if(t.isFunction(i)){var o=function(){return i.apply(n,arguments)};return o._zid=e(i),o}if("string"==typeof n)return t.proxy(i[n],i);throw new TypeError("expected function")},t.fn.bind=function(t,e){return this.each(function(){r(this,t,e)})},t.fn.unbind=function(t,e){return this.each(function(){a(this,t,e)})},t.fn.one=function(t,e){return this.each(function(i,n){r(this,t,e,null,function(t,e){return function(){var i=t.apply(n,arguments);return a(n,e,t),i}})})};var p=function(){return!0},f=function(){return!1},m={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};t.fn.delegate=function(e,i,n){var o=!1;return("blur"==i||"focus"==i)&&(t.iswebkit?i="blur"==i?"focusout":"focus"==i?"focusin":i:o=!0),this.each(function(s,a){r(a,i,n,e,function(i){return function(n){var o,s=t(n.target).closest(e,a).get(0);return s?(o=t.extend(l(n),{currentTarget:s,liveFired:a}),i.apply(s,[o].concat([].slice.call(arguments,1)))):void 0}},o)})},t.fn.undelegate=function(t,e,i){return this.each(function(){a(this,e,i,t)})},t.fn.live=function(e,i){return t(document.body).delegate(this.selector,e,i),this},t.fn.die=function(e,i){return t(document.body).undelegate(this.selector,e,i),this},t.fn.on=function(e,i,n){return void 0==i||t.isFunction(i)?this.bind(e,i):this.delegate(i,e,n)},t.fn.off=function(e,i,n){return void 0==i||t.isFunction(i)?this.unbind(e,i):this.undelegate(i,e,n)},t.fn.trigger=function(e,i){return"string"==typeof e&&(e=t.Event(e)),h(e),e.data=i,this.each(function(){"dispatchEvent"in this&&this.dispatchEvent(e)})},t.fn.triggerHandler=function(e,n){var o,s;return this.each(function(r,a){o=l("string"==typeof e?t.Event(e):e),o.data=n,o.target=a,t.each(i(a,e.type||e),function(t,e){return s=e.proxy(o),o.isImmediatePropagationStopped()?!1:void 0})}),s},"focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout change select keydown keypress keyup error".split(" ").forEach(function(e){t.fn[e]=function(t){return this.bind(e,t)}}),["focus","blur"].forEach(function(e){t.fn[e]=function(t){if(t)this.bind(e,t);else if(this.length)try{this.get(0)[e]()}catch(i){}return this}}),t.Event=function(t,e){var i=document.createEvent(d[t]||"Events"),n=!0;if(e)for(var o in e)"bubbles"==o?n=!!e[o]:i[o]=e[o];return i.initEvent(t,n,!0,null,null,null,null,null,null,null,null,null,null,null,null),i}}(t),function(t){function e(t){var e=this.os={},i=this.browser={},n=t.match(/WebKit\/([\d.]+)/),o=t.match(/(Android)\s+([\d.]+)/),s=t.match(/(iPad).*OS\s([\d_]+)/),r=!s&&t.match(/(iPhone\sOS)\s([\d_]+)/),a=t.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),l=a&&t.match(/TouchPad/),h=t.match(/Kindle\/([\d.]+)/),c=t.match(/Silk\/([\d._]+)/),u=t.match(/(BlackBerry).*Version\/([\d.]+)/);(i.webkit=!!n)&&(i.version=n[1]),o&&(e.android=!0,e.version=o[2]),r&&(e.ios=e.iphone=!0,e.version=r[2].replace(/_/g,".")),s&&(e.ios=e.ipad=!0,e.version=s[2].replace(/_/g,".")),a&&(e.webos=!0,e.version=a[2]),l&&(e.touchpad=!0),u&&(e.blackberry=!0,e.version=u[2]),h&&(e.kindle=!0,e.version=h[1]),c&&(i.silk=!0,i.version=c[1]),!c&&e.android&&t.match(/Kindle Fire/)&&(i.silk=!0)}e.call(t,navigator.userAgent),t.__detect=e}(t),function(t,e){function i(t){return t.toLowerCase()}function n(t){return o?o+t:i(t)}var o,s="",r={Webkit:"webkit",Moz:"",O:"o",ms:"MS"},a=window.document,l=a.createElement("div"),h=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,c={};t.each(r,function(t,n){return l.style[t+"TransitionProperty"]!==e?(s="-"+i(t)+"-",o=n,!1):e}),c[s+"transition-property"]=c[s+"transition-duration"]=c[s+"transition-timing-function"]=c[s+"animation-name"]=c[s+"animation-duration"]="",t.fx={off:o===e&&l.style.transitionProperty===e,cssPrefix:s,transitionEnd:n("TransitionEnd"),animationEnd:n("AnimationEnd")},t.fn.animate=function(e,i,n,o){return t.isObject(i)&&(n=i.easing,o=i.complete,i=i.duration),i&&(i/=1e3),this.anim(e,i,n,o)},t.fn.anim=function(i,n,o,r){var a,l,u,d={},p=this,f=t.fx.transitionEnd;if(n===e&&(n=.4),t.fx.off&&(n=0),"string"==typeof i)d[s+"animation-name"]=i,d[s+"animation-duration"]=n+"s",f=t.fx.animationEnd;else{for(l in i)h.test(l)?(a||(a=[]),a.push(l+"("+i[l]+")")):d[l]=i[l];a&&(d[s+"transform"]=a.join(" ")),t.fx.off||"object"!=typeof i||(d[s+"transition-property"]=Object.keys(i).join(", "),d[s+"transition-duration"]=n+"s",d[s+"transition-timing-function"]=o||"linear")}return u=function(i){if(i!==e){if(i.target!==i.currentTarget)return;t(i.target).unbind(f,arguments.callee)}t(this).css(c),r&&r.call(this)},n>0&&this.bind(f,u),setTimeout(function(){p.css(d),0>=n&&setTimeout(function(){p.each(function(){u.call(this)})},0)},0),this},l=null}(t),function(t){function e(e,i,n){var o=t.Event(i);return t(e).trigger(o,n),!o.defaultPrevented}function i(t,i,n,o){return t.global?e(i||y,n,o):void 0}function n(e){e.global&&0===t.active++&&i(e,null,"ajaxStart")}function o(e){e.global&&!--t.active&&i(e,null,"ajaxStop")}function s(t,e){var n=e.context;return e.beforeSend.call(n,t,e)===!1||i(e,n,"ajaxBeforeSend",[t,e])===!1?!1:(i(e,n,"ajaxSend",[t,e]),void 0)}function r(t,e,n){var o=n.context,s="success";n.success.call(o,t,s,e),i(n,o,"ajaxSuccess",[e,n,t]),l(s,e,n)}function a(t,e,n,o){var s=o.context;o.error.call(s,n,e,t),i(o,s,"ajaxError",[n,o,t]),l(e,n,o)}function l(t,e,n){var s=n.context;n.complete.call(s,e,t),i(n,s,"ajaxComplete",[e,n]),o(n)}function h(){}function c(t){return t&&(t==T?"html":t==S?"json":b.test(t)?"script":E.test(t)&&"xml")||"text"}function u(t,e){return(t+"&"+e).replace(/[&?]{1,2}/,"?")}function d(e){v(e.data)&&(e.contentType&&"application/x-www-form-urlencoded"!==e.contentType?"application/json"===e.contentType&&(e.data=JSON.stringify(e.data)):e.data=t.param(e.data)),!e.data||e.type&&"GET"!=e.type.toUpperCase()||(e.url=u(e.url,e.data))}function p(e,i,n,o){var s=t.isArray(i);t.each(i,function(i,r){o&&(i=n?o:o+"["+(s?"":i)+"]"),!o&&s?e.add(r.name,r.value):(n?t.isArray(r):v(r))?p(e,r,n,i):e.add(i,r)})}var f,m,g=0,v=t.isObject,y=window.document,w=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,b=/^(?:text|application)\/javascript/i,E=/^(?:text|application)\/xml/i,S="application/json",T="text/html",C=/^\s*$/;t.active=0,t.ajaxJSONP=function(e){var i,n="jsonp"+ ++g,o=y.createElement("script"),s=function(){t(o).remove(),n in window&&(window[n]=h),l("abort",a,e)},a={abort:s};return e.error&&(o.onerror=function(){a.abort(),e.error()}),window[n]=function(s){clearTimeout(i),t(o).remove(),delete window[n],r(s,a,e)},d(e),o.src=e.url.replace(/=\?/,"="+n),t("head").append(o),e.timeout>0&&(i=setTimeout(function(){a.abort(),l("timeout",a,e)},e.timeout)),a},t.ajaxSettings={type:"GET",beforeSend:h,success:h,error:h,complete:h,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript",json:S,xml:"application/xml, text/xml",html:T,text:"text/plain"},crossDomain:!1,timeout:0},t.ajax=function(e){var i=t.extend({},e||{});for(f in t.ajaxSettings)void 0===i[f]&&(i[f]=t.ajaxSettings[f]);n(i),i.crossDomain||(i.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(i.url)&&RegExp.$2!=window.location.host);var o=i.dataType,l=/=\?/.test(i.url);if("jsonp"==o||l)return l||(i.url=u(i.url,"callback=?")),t.ajaxJSONP(i);i.url||(i.url=""+window.location),d(i);var p,g=i.accepts[o],v={},y=/^([\w-]+:)\/\//.test(i.url)?RegExp.$1:window.location.protocol,w=t.ajaxSettings.xhr();if(i.crossDomain||(v["X-Requested-With"]="XMLHttpRequest"),g&&(v.Accept=g,g.indexOf(",")>-1&&(g=g.split(",",2)[0]),w.overrideMimeType&&w.overrideMimeType(g)),i.xhrFields)for(var b in i.xhrFields)w[b]=i.xhrFields[b];(i.contentType||i.data&&"GET"!=i.type.toUpperCase())&&(v["Content-Type"]=i.contentType||"application/x-www-form-urlencoded"),i.headers=t.extend(v,i.headers||{}),w.onreadystatechange=function(){if(4==w.readyState){clearTimeout(p);var t,e=!1;if(w.status>=200&&300>w.status||304==w.status||0==w.status&&"file:"==y){o=o||c(w.getResponseHeader("content-type")),t=w.responseText;try{"script"==o?(1,eval)(t):"xml"==o?t=w.responseXML:"json"==o&&(t=C.test(t)?null:JSON.parse(t))}catch(n){e=n}e?a(e,"parsererror",w,i):r(t,w,i)}else a(null,"error",w,i)}};var E="async"in i?i.async:!0;w.open(i.type,i.url,E);for(m in i.headers)w.setRequestHeader(m,i.headers[m]);return s(w,i)===!1?(w.abort(),!1):(i.timeout>0&&(p=setTimeout(function(){w.onreadystatechange=h,w.abort(),a(null,"timeout",w,i)},i.timeout)),w.send(i.data?i.data:null),w)},t.get=function(e,i){return t.ajax({url:e,success:i})},t.post=function(e,i,n,o){return t.isFunction(i)&&(o=o||n,n=i,i=null),t.ajax({type:"POST",url:e,data:i,success:n,dataType:o})},t.getJSON=function(e,i){return t.ajax({url:e,success:i,dataType:"json"})},t.fn.load=function(e,i){if(!this.length)return this;var n,o=this,s=e.split(/\s/);return s.length>1&&(e=s[0],n=s[1]),t.get(e,function(e){o.html(n?t(y.createElement("div")).html(e.replace(w,"")).find(n).html():e),i&&i.call(o)}),this};var x=encodeURIComponent;t.param=function(t,e){var i=[];return i.add=function(t,e){this.push(x(t)+"="+x(e))},p(i,t,e),i.join("&").replace("%20","+")}}(t),function(t){t.fn.serializeArray=function(){var e,i=[];return t(Array.prototype.slice.call(this.get(0).elements)).each(function(){e=t(this);var n=e.attr("type");"fieldset"!=this.nodeName.toLowerCase()&&!this.disabled&&"submit"!=n&&"reset"!=n&&"button"!=n&&("radio"!=n&&"checkbox"!=n||this.checked)&&i.push({name:e.attr("name"),value:e.val()})}),i},t.fn.serialize=function(){var t=[];return this.serializeArray().forEach(function(e){t.push(encodeURIComponent(e.name)+"="+encodeURIComponent(e.value))}),t.join("&")},t.fn.submit=function(e){if(e)this.bind("submit",e);else if(this.length){var i=t.Event("submit");this.eq(0).trigger(i),i.defaultPrevented||this.get(0).submit()}return this}}(t),function(t){function e(t){return"tagName"in t?t:t.parentNode}function i(t,e,i,n){var o=Math.abs(t-e),s=Math.abs(i-n);return o>=s?t-e>0?"Left":"Right":i-n>0?"Up":"Down"}function n(){l=null,h.last&&(h.el.trigger("longTap"),h={})}function o(){l&&clearTimeout(l),l=null}function s(e,i,n,o,s){"function"!=typeof i||s||(s=i,i=void 0);var r={opacity:n};return o&&(r.scale=o,e.css(t.fx.cssPrefix+"transform-origin","0 0")),e.animate(r,i,null,s)}function r(e,i,n,o){return s(e,i,0,n,function(){p.call(t(this)),o&&o.call(this)})}var a,l,h={},c=750,u=window.document,d=(u.documentElement,t.fn.show),p=t.fn.hide,f=t.fn.toggle;t.fn.show=function(t,e){return d.call(this),void 0===t?t=0:this.css("opacity",0),s(this,t,1,"1,1",e)},t.fn.hide=function(t,e){return void 0===t?p.call(this):r(this,t,"0,0",e)},t.fn.toggle=function(e,i){return void 0===e||"boolean"==typeof e?f.call(this,e):this.each(function(){var n=t(this);n["none"==n.css("display")?"show":"hide"](e,i)})},t.fn.fadeTo=function(t,e,i){return s(this,t,e,null,i)},t.fn.fadeIn=function(t,e){var i=this.css("opacity");return i>0?this.css("opacity",0):i=1,d.call(this).fadeTo(t,i,e)},t.fn.fadeOut=function(t,e){return r(this,t,null,e)},t.fn.fadeToggle=function(e,i){return this.each(function(){var n=t(this);n[0==n.css("opacity")||"none"==n.css("display")?"fadeIn":"fadeOut"](e,i)})},t(u).ready(function(){var s,r;t(u.body).bind("touchstart",function(i){s=Date.now(),r=s-(h.last||s),h.el=t(e(i.touches[0].target)),a&&clearTimeout(a),h.x1=i.touches[0].pageX,h.y1=i.touches[0].pageY,r>0&&250>=r&&(h.isDoubleTap=!0),h.last=s,l=setTimeout(n,c)}).bind("touchmove",function(t){o(),h.x2=t.touches[0].pageX,h.y2=t.touches[0].pageY}).bind("touchend",function(){o(),h.isDoubleTap?(h.el.trigger("doubleTap"),h={}):h.x2&&Math.abs(h.x1-h.x2)>30||h.y2&&Math.abs(h.y1-h.y2)>30?(h.el.trigger("swipe")&&h.el.trigger("swipe"+i(h.x1,h.x2,h.y1,h.y2)),h={}):"last"in h&&(h.el.trigger("tap"),a=setTimeout(function(){a=null,h.el.trigger("singleTap"),h={}},250))}).bind("touchcancel",function(){a&&clearTimeout(a),l&&clearTimeout(l),l=a=null,h={}})}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(e){t.fn[e]=function(t){return this.bind(e,t)}})}(t),t}),define("joshfire-framework/adapters/phone/utils/dollar",["joshlib!vendor/zepto"],function(t){return t}),define("joshfire-framework/vendor/underscore",[],function(){return function(){function t(e,i,n){if(e===i)return 0!==e||1/e==1/i;if(null==e||null==i)return e===i;if(e._chain&&(e=e._wrapped),i._chain&&(i=i._wrapped),e.isEqual&&T.isFunction(e.isEqual))return e.isEqual(i);if(i.isEqual&&T.isFunction(i.isEqual))return i.isEqual(e);var o=h.call(e);if(o!=h.call(i))return!1;switch(o){case"[object String]":return e==i+"";case"[object Number]":return e!=+e?i!=+i:0==e?1/e==1/i:e==+i;case"[object Date]":case"[object Boolean]":return+e==+i;case"[object RegExp]":return e.source==i.source&&e.global==i.global&&e.multiline==i.multiline&&e.ignoreCase==i.ignoreCase}if("object"!=typeof e||"object"!=typeof i)return!1;for(var s=n.length;s--;)if(n[s]==e)return!0;n.push(e);var r=0,a=!0;if("[object Array]"==o){if(r=e.length,a=r==i.length)for(;r--&&(a=r in e==r in i&&t(e[r],i[r],n)););}else{if("constructor"in e!="constructor"in i||e.constructor!=i.constructor)return!1;for(var l in e)if(T.has(e,l)&&(r++,!(a=T.has(i,l)&&t(e[l],i[l],n))))break;if(a){for(l in i)if(T.has(i,l)&&!r--)break;a=!r}}return n.pop(),a}var e=this,i=e._,n={},o=Array.prototype,s=Object.prototype,r=Function.prototype,a=o.slice,l=o.unshift,h=s.toString,c=s.hasOwnProperty,u=o.forEach,d=o.map,p=o.reduce,f=o.reduceRight,m=o.filter,g=o.every,v=o.some,y=o.indexOf,w=o.lastIndexOf,b=Array.isArray,E=Object.keys,S=r.bind,T=function(t){return new k(t)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=T),exports._=T):e._=T,T.VERSION="1.3.3";var C=T.each=T.forEach=function(t,e,i){if(null!=t)if(u&&t.forEach===u)t.forEach(e,i);else if(t.length===+t.length){for(var o=0,s=t.length;s>o;o++)if(o in t&&e.call(i,t[o],o,t)===n)return}else for(var r in t)if(T.has(t,r)&&e.call(i,t[r],r,t)===n)return};T.map=T.collect=function(t,e,i){var n=[];return null==t?n:d&&t.map===d?t.map(e,i):(C(t,function(t,o,s){n[n.length]=e.call(i,t,o,s)}),t.length===+t.length&&(n.length=t.length),n)},T.reduce=T.foldl=T.inject=function(t,e,i,n){var o=arguments.length>2;if(null==t&&(t=[]),p&&t.reduce===p)return n&&(e=T.bind(e,n)),o?t.reduce(e,i):t.reduce(e);if(C(t,function(t,s,r){o?i=e.call(n,i,t,s,r):(i=t,o=!0)}),!o)throw new TypeError("Reduce of empty array with no initial value");return i},T.reduceRight=T.foldr=function(t,e,i,n){var o=arguments.length>2;if(null==t&&(t=[]),f&&t.reduceRight===f)return n&&(e=T.bind(e,n)),o?t.reduceRight(e,i):t.reduceRight(e);var s=T.toArray(t).reverse();return n&&!o&&(e=T.bind(e,n)),o?T.reduce(s,e,i,n):T.reduce(s,e)},T.find=T.detect=function(t,e,i){var n;return x(t,function(t,o,s){return e.call(i,t,o,s)?(n=t,!0):void 0}),n},T.filter=T.select=function(t,e,i){var n=[];return null==t?n:m&&t.filter===m?t.filter(e,i):(C(t,function(t,o,s){e.call(i,t,o,s)&&(n[n.length]=t)}),n)},T.reject=function(t,e,i){var n=[];return null==t?n:(C(t,function(t,o,s){e.call(i,t,o,s)||(n[n.length]=t)}),n)},T.every=T.all=function(t,e,i){var o=!0;return null==t?o:g&&t.every===g?t.every(e,i):(C(t,function(t,s,r){return(o=o&&e.call(i,t,s,r))?void 0:n}),!!o)};var x=T.some=T.any=function(t,e,i){e||(e=T.identity);var o=!1;return null==t?o:v&&t.some===v?t.some(e,i):(C(t,function(t,s,r){return o||(o=e.call(i,t,s,r))?n:void 0}),!!o)};T.include=T.contains=function(t,e){var i=!1;return null==t?i:y&&t.indexOf===y?-1!=t.indexOf(e):i=x(t,function(t){return t===e})},T.invoke=function(t,e){var i=a.call(arguments,2);return T.map(t,function(t){return(T.isFunction(e)?e||t:t[e]).apply(t,i)})},T.pluck=function(t,e){return T.map(t,function(t){return t[e]})},T.max=function(t,e,i){if(!e&&T.isArray(t)&&t[0]===+t[0])return Math.max.apply(Math,t);if(!e&&T.isEmpty(t))return-1/0;var n={computed:-1/0};return C(t,function(t,o,s){var r=e?e.call(i,t,o,s):t;r>=n.computed&&(n={value:t,computed:r})}),n.value},T.min=function(t,e,i){if(!e&&T.isArray(t)&&t[0]===+t[0])return Math.min.apply(Math,t);if(!e&&T.isEmpty(t))return 1/0;var n={computed:1/0};return C(t,function(t,o,s){var r=e?e.call(i,t,o,s):t;n.computed>r&&(n={value:t,computed:r})}),n.value},T.shuffle=function(t){var e,i=[];return C(t,function(t,n){e=Math.floor(Math.random()*(n+1)),i[n]=i[e],i[e]=t}),i},T.sortBy=function(t,e,i){var n=T.isFunction(e)?e:function(t){return t[e]};return T.pluck(T.map(t,function(t,e,o){return{value:t,criteria:n.call(i,t,e,o)}}).sort(function(t,e){var i=t.criteria,n=e.criteria;return void 0===i?1:void 0===n?-1:n>i?-1:i>n?1:0}),"value")},T.groupBy=function(t,e){var i={},n=T.isFunction(e)?e:function(t){return t[e]};return C(t,function(t,e){var o=n(t,e);(i[o]||(i[o]=[])).push(t)}),i},T.sortedIndex=function(t,e,i){i||(i=T.identity);for(var n=0,o=t.length;o>n;){var s=n+o>>1;i(t[s])<i(e)?n=s+1:o=s}return n},T.toArray=function(t){return t?T.isArray(t)?a.call(t):T.isArguments(t)?a.call(t):t.toArray&&T.isFunction(t.toArray)?t.toArray():T.values(t):[]},T.size=function(t){return T.isArray(t)?t.length:T.keys(t).length},T.first=T.head=T.take=function(t,e,i){return null==e||i?t[0]:a.call(t,0,e)},T.initial=function(t,e,i){return a.call(t,0,t.length-(null==e||i?1:e))},T.last=function(t,e,i){return null==e||i?t[t.length-1]:a.call(t,Math.max(t.length-e,0))},T.rest=T.tail=function(t,e,i){return a.call(t,null==e||i?1:e)},T.compact=function(t){return T.filter(t,function(t){return!!t})},T.flatten=function(t,e){return T.reduce(t,function(t,i){return T.isArray(i)?t.concat(e?i:T.flatten(i)):(t[t.length]=i,t)},[])},T.without=function(t){return T.difference(t,a.call(arguments,1))},T.uniq=T.unique=function(t,e,i){var n=i?T.map(t,i):t,o=[];return 3>t.length&&(e=!0),T.reduce(n,function(i,n,s){return(e?T.last(i)===n&&i.length:T.include(i,n))||(i.push(n),o.push(t[s])),i},[]),o},T.union=function(){return T.uniq(T.flatten(arguments,!0))},T.intersection=T.intersect=function(t){var e=a.call(arguments,1);return T.filter(T.uniq(t),function(t){return T.every(e,function(e){return T.indexOf(e,t)>=0})})},T.difference=function(t){var e=T.flatten(a.call(arguments,1),!0);return T.filter(t,function(t){return!T.include(e,t)})},T.zip=function(){for(var t=a.call(arguments),e=T.max(T.pluck(t,"length")),i=Array(e),n=0;e>n;n++)i[n]=T.pluck(t,""+n);return i},T.indexOf=function(t,e,i){if(null==t)return-1;var n,o;if(i)return n=T.sortedIndex(t,e),t[n]===e?n:-1;if(y&&t.indexOf===y)return t.indexOf(e);for(n=0,o=t.length;o>n;n++)if(n in t&&t[n]===e)return n;return-1},T.lastIndexOf=function(t,e){if(null==t)return-1;if(w&&t.lastIndexOf===w)return t.lastIndexOf(e);for(var i=t.length;i--;)if(i in t&&t[i]===e)return i;return-1},T.range=function(t,e,i){1>=arguments.length&&(e=t||0,t=0),i=arguments[2]||1;for(var n=Math.max(Math.ceil((e-t)/i),0),o=0,s=Array(n);n>o;)s[o++]=t,t+=i;return s};var O=function(){};T.bind=function(t,e){var i,n;if(t.bind===S&&S)return S.apply(t,a.call(arguments,1));if(!T.isFunction(t))throw new TypeError;return n=a.call(arguments,2),i=function(){if(!(this instanceof i))return t.apply(e,n.concat(a.call(arguments)));O.prototype=t.prototype;var o=new O,s=t.apply(o,n.concat(a.call(arguments)));return Object(s)===s?s:o}},T.bindAll=function(t){var e=a.call(arguments,1);return 0==e.length&&(e=T.functions(t)),C(e,function(e){t[e]=T.bind(t[e],t)}),t},T.memoize=function(t,e){var i={};return e||(e=T.identity),function(){var n=e.apply(this,arguments);return T.has(i,n)?i[n]:i[n]=t.apply(this,arguments)}},T.delay=function(t,e){var i=a.call(arguments,2);return setTimeout(function(){return t.apply(null,i)},e)},T.defer=function(t){return T.delay.apply(T,[t,1].concat(a.call(arguments,1)))},T.throttle=function(t,e){var i,n,o,s,r,a,l=T.debounce(function(){r=s=!1},e);return function(){i=this,n=arguments;var h=function(){o=null,r&&t.apply(i,n),l()};return o||(o=setTimeout(h,e)),s?r=!0:a=t.apply(i,n),l(),s=!0,a}},T.debounce=function(t,e,i){var n;return function(){var o=this,s=arguments,r=function(){n=null,i||t.apply(o,s)};i&&!n&&t.apply(o,s),clearTimeout(n),n=setTimeout(r,e)}},T.once=function(t){var e,i=!1;return function(){return i?e:(i=!0,e=t.apply(this,arguments))}},T.wrap=function(t,e){return function(){var i=[t].concat(a.call(arguments,0));return e.apply(this,i)}},T.compose=function(){var t=arguments;return function(){for(var e=arguments,i=t.length-1;i>=0;i--)e=[t[i].apply(this,e)];return e[0]}},T.after=function(t,e){return 0>=t?e():function(){return 1>--t?e.apply(this,arguments):void 0}},T.keys=E||function(t){if(t!==Object(t))throw new TypeError("Invalid object");var e=[];for(var i in t)T.has(t,i)&&(e[e.length]=i);return e},T.values=function(t){return T.map(t,T.identity)},T.functions=T.methods=function(t){var e=[];for(var i in t)T.isFunction(t[i])&&e.push(i);return e.sort()},T.extend=function(t){return C(a.call(arguments,1),function(e){for(var i in e)t[i]=e[i]}),t},T.pick=function(t){var e={};return C(T.flatten(a.call(arguments,1)),function(i){i in t&&(e[i]=t[i])}),e},T.defaults=function(t){return C(a.call(arguments,1),function(e){for(var i in e)null==t[i]&&(t[i]=e[i])}),t},T.clone=function(t){return T.isObject(t)?T.isArray(t)?t.slice():T.extend({},t):t},T.tap=function(t,e){return e(t),t},T.isEqual=function(e,i){return t(e,i,[])},T.isEmpty=function(t){if(null==t)return!0;if(T.isArray(t)||T.isString(t))return 0===t.length;for(var e in t)if(T.has(t,e))return!1;return!0},T.isElement=function(t){return!(!t||1!=t.nodeType)},T.isArray=b||function(t){return"[object Array]"==h.call(t)},T.isObject=function(t){return t===Object(t)},T.isArguments=function(t){return"[object Arguments]"==h.call(t)},T.isArguments(arguments)||(T.isArguments=function(t){return!(!t||!T.has(t,"callee"))}),T.isFunction=function(t){return"[object Function]"==h.call(t)},T.isString=function(t){return"[object String]"==h.call(t)},T.isNumber=function(t){return"[object Number]"==h.call(t)},T.isFinite=function(t){return T.isNumber(t)&&isFinite(t)},T.isNaN=function(t){return t!==t},T.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"==h.call(t)},T.isDate=function(t){return"[object Date]"==h.call(t)},T.isRegExp=function(t){return"[object RegExp]"==h.call(t)},T.isNull=function(t){return null===t},T.isUndefined=function(t){return void 0===t},T.has=function(t,e){return c.call(t,e)},T.noConflict=function(){return e._=i,this},T.identity=function(t){return t},T.times=function(t,e,i){for(var n=0;t>n;n++)e.call(i,n)},T.escape=function(t){return(""+t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")},T.result=function(t,e){if(null==t)return null;var i=t[e];return T.isFunction(i)?i.call(t):i},T.mixin=function(t){C(T.functions(t),function(e){N(e,T[e]=t[e])})};var D=0;T.uniqueId=function(t){var e=D++;return t?t+e:e},T.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var M=/.^/,P={"\\":"\\","'":"'",r:"\r",n:"\n",t:" ",u2028:"\u2028",u2029:"\u2029"};for(var H in P)P[P[H]]=H;var I=/\\|'|\r|\n|\t|\u2028|\u2029/g,_=/\\(\\|'|r|n|t|u2028|u2029)/g,A=function(t){return t.replace(_,function(t,e){return P[e]})};T.template=function(t,e,i){i=T.defaults(i||{},T.templateSettings);var n="__p+='"+t.replace(I,function(t){return"\\"+P[t]}).replace(i.escape||M,function(t,e){return"'+\n_.escape("+A(e)+")+\n'"}).replace(i.interpolate||M,function(t,e){return"'+\n("+A(e)+")+\n'"}).replace(i.evaluate||M,function(t,e){return"';\n"+A(e)+"\n;__p+='"})+"';\n";i.variable||(n="with(obj||{}){\n"+n+"}\n"),n="var __p='';var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n"+n+"return __p;\n";var o=Function(i.variable||"obj","_",n);if(e)return o(e,T);var s=function(t){return o.call(this,t,T)};return s.source="function("+(i.variable||"obj")+"){\n"+n+"}",s},T.chain=function(t){return T(t).chain()};var k=function(t){this._wrapped=t};T.prototype=k.prototype;var j=function(t,e){return e?T(t).chain():t},N=function(t,e){k.prototype[t]=function(){var t=a.call(arguments);return l.call(t,this._wrapped),j(e.apply(T,t),this._chain)}};T.mixin(T),C(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=o[t];k.prototype[t]=function(){var i=this._wrapped;e.apply(i,arguments);var n=i.length;return"shift"!=t&&"splice"!=t||0!==n||delete i[0],j(i,this._chain)}}),C(["concat","join","slice"],function(t){var e=o[t];k.prototype[t]=function(){return j(e.apply(this._wrapped,arguments),this._chain)}}),k.prototype.chain=function(){return this._chain=!0,this},k.prototype.value=function(){return this._wrapped}}.call(this),"undefined"!=typeof exports?"undefined"!=typeof module&&module.exports?exports:exports._:this._}),define("joshfire-framework/vendor/iscroll",[],function(){return function(t,e){function i(t){return""===s?t:(t=t.charAt(0).toUpperCase()+t.substr(1),s+t)}var n=Math,o=e.createElement("div").style,s=function(){for(var t,e="t,webkitT,MozT,msT,OT".split(","),i=0,n=e.length;n>i;i++)if(t=e[i]+"ransform",t in o)return e[i].substr(0,e[i].length-1);return!1}(),r=s?"-"+s.toLowerCase()+"-":"",a=i("transform"),l=i("transitionProperty"),h=i("transitionDuration"),c=i("transformOrigin"),u=i("transitionTimingFunction"),d=i("transitionDelay"),p=/android/gi.test(navigator.appVersion),f=/iphone|ipad/gi.test(navigator.appVersion),m=/hp-tablet/gi.test(navigator.appVersion),g=i("perspective")in o,v="ontouchstart"in t&&!m,y=s!==!1,w=i("transition")in o,b="resize",E=v?"touchstart":"mousedown",S=v?"touchmove":"mousemove",T=v?"touchend":"mouseup",C=v?"touchcancel":"mouseup",x=function(){if(s===!1)return!1;var t={"":"transitionend",webkit:"webkitTransitionEnd",Moz:"transitionend",O:"otransitionend",ms:"MSTransitionEnd"};return t[s]}(),O=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(t){return setTimeout(t,1)}}(),D=function(){return t.cancelRequestAnimationFrame||t.webkitCancelAnimationFrame||t.webkitCancelRequestAnimationFrame||t.mozCancelRequestAnimationFrame||t.oCancelRequestAnimationFrame||t.msCancelRequestAnimationFrame||clearTimeout}(),M=g?" translateZ(0)":"",P=function(i,n){var o,s=this;s.wrapper="object"==typeof i?i:e.getElementById(i),s.wrapper.style.overflow="hidden",s.scroller=s.wrapper.children[0],s.options={hScroll:!0,vScroll:!0,x:0,y:0,bounce:!0,bounceLock:!1,momentum:!0,lockDirection:!0,useTransform:!0,useTransition:!1,topOffset:0,checkDOMChanges:!1,handleClick:!0,hScrollbar:!0,vScrollbar:!0,fixedScrollbar:p,hideScrollbar:f,fadeScrollbar:f&&g,scrollbarClass:"",zoom:!1,zoomMin:1,zoomMax:4,doubleTapZoom:2,wheelAction:"scroll",snap:!1,snapThreshold:1,onRefresh:null,onBeforeScrollStart:function(t){t.preventDefault()},onScrollStart:null,onBeforeScrollMove:null,onScrollMove:null,onBeforeScrollEnd:null,onScrollEnd:null,onTouchEnd:null,onDestroy:null,onZoomStart:null,onZoom:null,onZoomEnd:null};for(o in n)s.options[o]=n[o];s.x=s.options.x,s.y=s.options.y,s.options.useTransform=y&&s.options.useTransform,s.options.hScrollbar=s.options.hScroll&&s.options.hScrollbar,s.options.vScrollbar=s.options.vScroll&&s.options.vScrollbar,s.options.zoom=s.options.useTransform&&s.options.zoom,s.options.useTransition=w&&s.options.useTransition,s.options.zoom&&p&&(M=""),s.scroller.style[l]=s.options.useTransform?r+"transform":"top left",s.scroller.style[h]="0",s.scroller.style[c]="0 0",s.options.useTransition&&(s.scroller.style[u]="cubic-bezier(0.33,0.66,0.66,1)"),s.options.useTransform?s.scroller.style[a]="translate("+s.x+"px,"+s.y+"px)"+M:s.scroller.style.cssText+=";position:absolute;top:"+s.y+"px;left:"+s.x+"px",s.options.useTransition&&(s.options.fixedScrollbar=!0),s.refresh(),s._bind(b,t),s._bind(E),v||"none"!=s.options.wheelAction&&(s._bind("DOMMouseScroll"),s._bind("mousewheel")),s.options.checkDOMChanges&&(s.checkDOMTime=setInterval(function(){s._checkDOMChanges()},500))};P.prototype={enabled:!0,x:0,y:0,steps:[],scale:1,currPageX:0,currPageY:0,pagesX:[],pagesY:[],aniTime:null,wheelZoomCount:0,handleEvent:function(t){var e=this;switch(t.type){case E:if(!v&&0!==t.button)return;e._start(t);break;case S:e._move(t);break;case T:case C:e._end(t);break;case b:e._resize();break;case"DOMMouseScroll":case"mousewheel":e._wheel(t);break;case x:e._transitionEnd(t)}},_checkDOMChanges:function(){this.moved||this.zoomed||this.animating||this.scrollerW==this.scroller.offsetWidth*this.scale&&this.scrollerH==this.scroller.offsetHeight*this.scale||this.refresh()},_scrollbar:function(t){var i,o=this;return o[t+"Scrollbar"]?(o[t+"ScrollbarWrapper"]||(i=e.createElement("div"),o.options.scrollbarClass?i.className=o.options.scrollbarClass+t.toUpperCase():i.style.cssText="position:absolute;z-index:100;"+("h"==t?"height:7px;bottom:1px;left:2px;right:"+(o.vScrollbar?"7":"2")+"px":"width:7px;bottom:"+(o.hScrollbar?"7":"2")+"px;top:2px;right:1px"),i.style.cssText+=";pointer-events:none;"+r+"transition-property:opacity;"+r+"transition-duration:"+(o.options.fadeScrollbar?"350ms":"0")+";overflow:hidden;opacity:"+(o.options.hideScrollbar?"0":"1"),o.wrapper.appendChild(i),o[t+"ScrollbarWrapper"]=i,i=e.createElement("div"),o.options.scrollbarClass||(i.style.cssText="position:absolute;z-index:100;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);"+r+"background-clip:padding-box;"+r+"box-sizing:border-box;"+("h"==t?"height:100%":"width:100%")+";"+r+"border-radius:3px;border-radius:3px"),i.style.cssText+=";pointer-events:none;"+r+"transition-property:"+r+"transform;"+r+"transition-timing-function:cubic-bezier(0.33,0.66,0.66,1);"+r+"transition-duration:0;"+r+"transform: translate(0,0)"+M,o.options.useTransition&&(i.style.cssText+=";"+r+"transition-timing-function:cubic-bezier(0.33,0.66,0.66,1)"),o[t+"ScrollbarWrapper"].appendChild(i),o[t+"ScrollbarIndicator"]=i),"h"==t?(o.hScrollbarSize=o.hScrollbarWrapper.clientWidth,o.hScrollbarIndicatorSize=n.max(n.round(o.hScrollbarSize*o.hScrollbarSize/o.scrollerW),8),o.hScrollbarIndicator.style.width=o.hScrollbarIndicatorSize+"px",o.hScrollbarMaxScroll=o.hScrollbarSize-o.hScrollbarIndicatorSize,o.hScrollbarProp=o.hScrollbarMaxScroll/o.maxScrollX):(o.vScrollbarSize=o.vScrollbarWrapper.clientHeight,o.vScrollbarIndicatorSize=n.max(n.round(o.vScrollbarSize*o.vScrollbarSize/o.scrollerH),8),o.vScrollbarIndicator.style.height=o.vScrollbarIndicatorSize+"px",o.vScrollbarMaxScroll=o.vScrollbarSize-o.vScrollbarIndicatorSize,o.vScrollbarProp=o.vScrollbarMaxScroll/o.maxScrollY),o._scrollbarPos(t,!0),void 0):(o[t+"ScrollbarWrapper"]&&(y&&(o[t+"ScrollbarIndicator"].style[a]=""),o[t+"ScrollbarWrapper"].parentNode&&o[t+"ScrollbarWrapper"].parentNode.removeChild(o[t+"ScrollbarWrapper"]),o[t+"ScrollbarWrapper"]=null,o[t+"ScrollbarIndicator"]=null),void 0)
},_resize:function(){var t=this;setTimeout(function(){t.refresh()},p?200:0)},_pos:function(t,e){this.zoomed||(t=this.hScroll?t:0,e=this.vScroll?e:0,this.options.useTransform?this.scroller.style[a]="translate("+t+"px,"+e+"px) scale("+this.scale+")"+M:(t=n.round(t),e=n.round(e),this.scroller.style.left=t+"px",this.scroller.style.top=e+"px"),this.x=t,this.y=e,this._scrollbarPos("h"),this._scrollbarPos("v"))},_scrollbarPos:function(t,e){var i,o=this,s="h"==t?o.x:o.y;o[t+"Scrollbar"]&&(s=o[t+"ScrollbarProp"]*s,0>s?(o.options.fixedScrollbar||(i=o[t+"ScrollbarIndicatorSize"]+n.round(3*s),8>i&&(i=8),o[t+"ScrollbarIndicator"].style["h"==t?"width":"height"]=i+"px"),s=0):s>o[t+"ScrollbarMaxScroll"]&&(o.options.fixedScrollbar?s=o[t+"ScrollbarMaxScroll"]:(i=o[t+"ScrollbarIndicatorSize"]-n.round(3*(s-o[t+"ScrollbarMaxScroll"])),8>i&&(i=8),o[t+"ScrollbarIndicator"].style["h"==t?"width":"height"]=i+"px",s=o[t+"ScrollbarMaxScroll"]+(o[t+"ScrollbarIndicatorSize"]-i))),o[t+"ScrollbarWrapper"].style[d]="0",o[t+"ScrollbarWrapper"].style.opacity=e&&o.options.hideScrollbar?"0":"1",o[t+"ScrollbarIndicator"].style[a]="translate("+("h"==t?s+"px,0)":"0,"+s+"px)")+M)},_start:function(e){var i,o,s,r,l,h=this,c=v?e.touches[0]:e;h.enabled&&(h.options.onBeforeScrollStart&&h.options.onBeforeScrollStart.call(h,e),(h.options.useTransition||h.options.zoom)&&h._transitionTime(0),h.moved=!1,h.animating=!1,h.zoomed=!1,h.distX=0,h.distY=0,h.absDistX=0,h.absDistY=0,h.dirX=0,h.dirY=0,h.options.zoom&&v&&e.touches.length>1&&(r=n.abs(e.touches[0].pageX-e.touches[1].pageX),l=n.abs(e.touches[0].pageY-e.touches[1].pageY),h.touchesDistStart=n.sqrt(r*r+l*l),h.originX=n.abs(e.touches[0].pageX+e.touches[1].pageX-2*h.wrapperOffsetLeft)/2-h.x,h.originY=n.abs(e.touches[0].pageY+e.touches[1].pageY-2*h.wrapperOffsetTop)/2-h.y,h.options.onZoomStart&&h.options.onZoomStart.call(h,e)),h.options.momentum&&(h.options.useTransform?(i=getComputedStyle(h.scroller,null)[a].replace(/[^0-9\-.,]/g,"").split(","),o=+i[4],s=+i[5]):(o=+getComputedStyle(h.scroller,null).left.replace(/[^0-9-]/g,""),s=+getComputedStyle(h.scroller,null).top.replace(/[^0-9-]/g,"")),(o!=h.x||s!=h.y)&&(h.options.useTransition?h._unbind(x):D(h.aniTime),h.steps=[],h._pos(o,s),h.options.onScrollEnd&&h.options.onScrollEnd.call(h))),h.absStartX=h.x,h.absStartY=h.y,h.startX=h.x,h.startY=h.y,h.pointX=c.pageX,h.pointY=c.pageY,h.startTime=e.timeStamp||Date.now(),h.options.onScrollStart&&h.options.onScrollStart.call(h,e),h._bind(S,t),h._bind(T,t),h._bind(C,t))},_move:function(t){var e,i,o,s=this,r=v?t.touches[0]:t,l=r.pageX-s.pointX,h=r.pageY-s.pointY,c=s.x+l,u=s.y+h,d=t.timeStamp||Date.now();return s.options.onBeforeScrollMove&&s.options.onBeforeScrollMove.call(s,t),s.options.zoom&&v&&t.touches.length>1?(e=n.abs(t.touches[0].pageX-t.touches[1].pageX),i=n.abs(t.touches[0].pageY-t.touches[1].pageY),s.touchesDist=n.sqrt(e*e+i*i),s.zoomed=!0,o=1/s.touchesDistStart*s.touchesDist*this.scale,s.options.zoomMin>o?o=.5*s.options.zoomMin*Math.pow(2,o/s.options.zoomMin):o>s.options.zoomMax&&(o=2*s.options.zoomMax*Math.pow(.5,s.options.zoomMax/o)),s.lastScale=o/this.scale,c=this.originX-this.originX*s.lastScale+this.x,u=this.originY-this.originY*s.lastScale+this.y,this.scroller.style[a]="translate("+c+"px,"+u+"px) scale("+o+")"+M,s.options.onZoom&&s.options.onZoom.call(s,t),void 0):(s.pointX=r.pageX,s.pointY=r.pageY,(c>0||s.maxScrollX>c)&&(c=s.options.bounce?s.x+l/2:c>=0||s.maxScrollX>=0?0:s.maxScrollX),(u>s.minScrollY||s.maxScrollY>u)&&(u=s.options.bounce?s.y+h/2:u>=s.minScrollY||s.maxScrollY>=0?s.minScrollY:s.maxScrollY),s.distX+=l,s.distY+=h,s.absDistX=n.abs(s.distX),s.absDistY=n.abs(s.distY),6>s.absDistX&&6>s.absDistY||(s.options.lockDirection&&(s.absDistX>s.absDistY+5?(u=s.y,h=0):s.absDistY>s.absDistX+5&&(c=s.x,l=0)),s.moved=!0,s._pos(c,u),s.dirX=l>0?-1:0>l?1:0,s.dirY=h>0?-1:0>h?1:0,d-s.startTime>300&&(s.startTime=d,s.startX=s.x,s.startY=s.y),s.options.onScrollMove&&s.options.onScrollMove.call(s,t)),void 0)},_end:function(i){if(!v||0===i.touches.length){var o,s,r,l,c,u,d,p=this,f=v?i.changedTouches[0]:i,m={dist:0,time:0},g={dist:0,time:0},y=(i.timeStamp||Date.now())-p.startTime,w=p.x,b=p.y;if(p._unbind(S,t),p._unbind(T,t),p._unbind(C,t),p.options.onBeforeScrollEnd&&p.options.onBeforeScrollEnd.call(p,i),p.zoomed)return d=p.scale*p.lastScale,d=Math.max(p.options.zoomMin,d),d=Math.min(p.options.zoomMax,d),p.lastScale=d/p.scale,p.scale=d,p.x=p.originX-p.originX*p.lastScale+p.x,p.y=p.originY-p.originY*p.lastScale+p.y,p.scroller.style[h]="200ms",p.scroller.style[a]="translate("+p.x+"px,"+p.y+"px) scale("+p.scale+")"+M,p.zoomed=!1,p.refresh(),p.options.onZoomEnd&&p.options.onZoomEnd.call(p,i),void 0;if(!p.moved)return v&&(p.doubleTapTimer&&p.options.zoom?(clearTimeout(p.doubleTapTimer),p.doubleTapTimer=null,p.options.onZoomStart&&p.options.onZoomStart.call(p,i),p.zoom(p.pointX,p.pointY,1==p.scale?p.options.doubleTapZoom:1),p.options.onZoomEnd&&setTimeout(function(){p.options.onZoomEnd.call(p,i)},200)):this.options.handleClick&&(p.doubleTapTimer=setTimeout(function(){for(p.doubleTapTimer=null,o=f.target;1!=o.nodeType;)o=o.parentNode;"SELECT"!=o.tagName&&"INPUT"!=o.tagName&&"TEXTAREA"!=o.tagName&&(s=e.createEvent("MouseEvents"),s.initMouseEvent("click",!0,!0,i.view,1,f.screenX,f.screenY,f.clientX,f.clientY,i.ctrlKey,i.altKey,i.shiftKey,i.metaKey,0,null),s._fake=!0,o.dispatchEvent(s))},p.options.zoom?250:0))),p._resetPos(400),p.options.onTouchEnd&&p.options.onTouchEnd.call(p,i),void 0;if(300>y&&p.options.momentum&&(m=w?p._momentum(w-p.startX,y,-p.x,p.scrollerW-p.wrapperW+p.x,p.options.bounce?p.wrapperW:0):m,g=b?p._momentum(b-p.startY,y,-p.y,0>p.maxScrollY?p.scrollerH-p.wrapperH+p.y-p.minScrollY:0,p.options.bounce?p.wrapperH:0):g,w=p.x+m.dist,b=p.y+g.dist,(p.x>0&&w>0||p.x<p.maxScrollX&&p.maxScrollX>w)&&(m={dist:0,time:0}),(p.y>p.minScrollY&&b>p.minScrollY||p.y<p.maxScrollY&&p.maxScrollY>b)&&(g={dist:0,time:0})),m.dist||g.dist)return c=n.max(n.max(m.time,g.time),10),p.options.snap&&(r=w-p.absStartX,l=b-p.absStartY,n.abs(r)<p.options.snapThreshold&&n.abs(l)<p.options.snapThreshold?p.scrollTo(p.absStartX,p.absStartY,200):(u=p._snap(w,b),w=u.x,b=u.y,c=n.max(u.time,c))),p.scrollTo(n.round(w),n.round(b),c),p.options.onTouchEnd&&p.options.onTouchEnd.call(p,i),void 0;if(p.options.snap)return r=w-p.absStartX,l=b-p.absStartY,n.abs(r)<p.options.snapThreshold&&n.abs(l)<p.options.snapThreshold?p.scrollTo(p.absStartX,p.absStartY,200):(u=p._snap(p.x,p.y),(u.x!=p.x||u.y!=p.y)&&p.scrollTo(u.x,u.y,u.time)),p.options.onTouchEnd&&p.options.onTouchEnd.call(p,i),void 0;p._resetPos(200),p.options.onTouchEnd&&p.options.onTouchEnd.call(p,i)}},_resetPos:function(t){var e=this,i=e.x>=0?0:e.x<e.maxScrollX?e.maxScrollX:e.x,n=e.y>=e.minScrollY||e.maxScrollY>0?e.minScrollY:e.y<e.maxScrollY?e.maxScrollY:e.y;return i==e.x&&n==e.y?(e.moved&&(e.moved=!1,e.options.onScrollEnd&&e.options.onScrollEnd.call(e)),e.hScrollbar&&e.options.hideScrollbar&&("webkit"==s&&(e.hScrollbarWrapper.style[d]="300ms"),e.hScrollbarWrapper.style.opacity="0"),e.vScrollbar&&e.options.hideScrollbar&&("webkit"==s&&(e.vScrollbarWrapper.style[d]="300ms"),e.vScrollbarWrapper.style.opacity="0"),void 0):(e.scrollTo(i,n,t||0),void 0)},_wheel:function(t){var e,i,n,o,s,r=this;if("wheelDeltaX"in t)e=t.wheelDeltaX/12,i=t.wheelDeltaY/12;else if("wheelDelta"in t)e=i=t.wheelDelta/12;else{if(!("detail"in t))return;e=i=3*-t.detail}return"zoom"==r.options.wheelAction?(s=r.scale*Math.pow(2,1/3*(i?i/Math.abs(i):0)),r.options.zoomMin>s&&(s=r.options.zoomMin),s>r.options.zoomMax&&(s=r.options.zoomMax),s!=r.scale&&(!r.wheelZoomCount&&r.options.onZoomStart&&r.options.onZoomStart.call(r,t),r.wheelZoomCount++,r.zoom(t.pageX,t.pageY,s,400),setTimeout(function(){r.wheelZoomCount--,!r.wheelZoomCount&&r.options.onZoomEnd&&r.options.onZoomEnd.call(r,t)},400)),void 0):(n=r.x+e,o=r.y+i,n>0?n=0:r.maxScrollX>n&&(n=r.maxScrollX),o>r.minScrollY?o=r.minScrollY:r.maxScrollY>o&&(o=r.maxScrollY),0>r.maxScrollY&&r.scrollTo(n,o,0),void 0)},_transitionEnd:function(t){var e=this;t.target==e.scroller&&(e._unbind(x),e._startAni())},_startAni:function(){var t,e,i,o=this,s=o.x,r=o.y,a=Date.now();if(!o.animating){if(!o.steps.length)return o._resetPos(400),void 0;if(t=o.steps.shift(),t.x==s&&t.y==r&&(t.time=0),o.animating=!0,o.moved=!0,o.options.useTransition)return o._transitionTime(t.time),o._pos(t.x,t.y),o.animating=!1,t.time?o._bind(x):o._resetPos(0),void 0;i=function(){var l,h,c=Date.now();return c>=a+t.time?(o._pos(t.x,t.y),o.animating=!1,o.options.onAnimationEnd&&o.options.onAnimationEnd.call(o),o._startAni(),void 0):(c=(c-a)/t.time-1,e=n.sqrt(1-c*c),l=(t.x-s)*e+s,h=(t.y-r)*e+r,o._pos(l,h),o.animating&&(o.aniTime=O(i)),void 0)},i()}},_transitionTime:function(t){t+="ms",this.scroller.style[h]=t,this.hScrollbar&&(this.hScrollbarIndicator.style[h]=t),this.vScrollbar&&(this.vScrollbarIndicator.style[h]=t)},_momentum:function(t,e,i,o,s){var r=6e-4,a=n.abs(t)/e,l=a*a/(2*r),h=0,c=0;return t>0&&l>i?(c=s/(6/(l/a*r)),i+=c,a=a*i/l,l=i):0>t&&l>o&&(c=s/(6/(l/a*r)),o+=c,a=a*o/l,l=o),l*=0>t?-1:1,h=a/r,{dist:l,time:n.round(h)}},_offset:function(t){for(var e=-t.offsetLeft,i=-t.offsetTop;t=t.offsetParent;)e-=t.offsetLeft,i-=t.offsetTop;return t!=this.wrapper&&(e*=this.scale,i*=this.scale),{left:e,top:i}},_snap:function(t,e){var i,o,s,r,a,l,h=this;for(s=h.pagesX.length-1,i=0,o=h.pagesX.length;o>i;i++)if(t>=h.pagesX[i]){s=i;break}for(s==h.currPageX&&s>0&&0>h.dirX&&s--,t=h.pagesX[s],a=n.abs(t-h.pagesX[h.currPageX]),a=a?500*(n.abs(h.x-t)/a):0,h.currPageX=s,s=h.pagesY.length-1,i=0;s>i;i++)if(e>=h.pagesY[i]){s=i;break}return s==h.currPageY&&s>0&&0>h.dirY&&s--,e=h.pagesY[s],l=n.abs(e-h.pagesY[h.currPageY]),l=l?500*(n.abs(h.y-e)/l):0,h.currPageY=s,r=n.round(n.max(a,l))||200,{x:t,y:e,time:r}},_bind:function(t,e,i){(e||this.scroller).addEventListener(t,this,!!i)},_unbind:function(t,e,i){(e||this.scroller).removeEventListener(t,this,!!i)},destroy:function(){var e=this;e.scroller.style[a]="",e.hScrollbar=!1,e.vScrollbar=!1,e._scrollbar("h"),e._scrollbar("v"),e._unbind(b,t),e._unbind(E),e._unbind(S,t),e._unbind(T,t),e._unbind(C,t),e.options.hasTouch||(e._unbind("DOMMouseScroll"),e._unbind("mousewheel")),e.options.useTransition&&e._unbind(x),e.options.checkDOMChanges&&clearInterval(e.checkDOMTime),e.options.onDestroy&&e.options.onDestroy.call(e)},refresh:function(){var t,e,i,o,s=this,r=0,a=0;if(s.scale<s.options.zoomMin&&(s.scale=s.options.zoomMin),s.wrapperW=s.wrapper.clientWidth||1,s.wrapperH=s.wrapper.clientHeight||1,s.minScrollY=-s.options.topOffset||0,s.scrollerW=n.round(s.scroller.offsetWidth*s.scale),s.scrollerH=n.round((s.scroller.offsetHeight+s.minScrollY)*s.scale),s.maxScrollX=s.wrapperW-s.scrollerW,s.maxScrollY=s.wrapperH-s.scrollerH+s.minScrollY,s.dirX=0,s.dirY=0,s.options.onRefresh&&s.options.onRefresh.call(s),s.hScroll=s.options.hScroll&&0>s.maxScrollX,s.vScroll=s.options.vScroll&&(!s.options.bounceLock&&!s.hScroll||s.scrollerH>s.wrapperH),s.hScrollbar=s.hScroll&&s.options.hScrollbar,s.vScrollbar=s.vScroll&&s.options.vScrollbar&&s.scrollerH>s.wrapperH,t=s._offset(s.wrapper),s.wrapperOffsetLeft=-t.left,s.wrapperOffsetTop=-t.top,"string"==typeof s.options.snap)for(s.pagesX=[],s.pagesY=[],o=s.scroller.querySelectorAll(s.options.snap),e=0,i=o.length;i>e;e++)r=s._offset(o[e]),r.left+=s.wrapperOffsetLeft,r.top+=s.wrapperOffsetTop,s.pagesX[e]=r.left<s.maxScrollX?s.maxScrollX:r.left*s.scale,s.pagesY[e]=r.top<s.maxScrollY?s.maxScrollY:r.top*s.scale;else if(s.options.snap){for(s.pagesX=[];r>=s.maxScrollX;)s.pagesX[a]=r,r-=s.wrapperW,a++;for(s.maxScrollX%s.wrapperW&&(s.pagesX[s.pagesX.length]=s.maxScrollX-s.pagesX[s.pagesX.length-1]+s.pagesX[s.pagesX.length-1]),r=0,a=0,s.pagesY=[];r>=s.maxScrollY;)s.pagesY[a]=r,r-=s.wrapperH,a++;s.maxScrollY%s.wrapperH&&(s.pagesY[s.pagesY.length]=s.maxScrollY-s.pagesY[s.pagesY.length-1]+s.pagesY[s.pagesY.length-1])}s._scrollbar("h"),s._scrollbar("v"),s.zoomed||(s.scroller.style[h]="0",s._resetPos(400))},scrollTo:function(t,e,i,n){var o,s,r=this,a=t;for(r.stop(),a.length||(a=[{x:t,y:e,time:i,relative:n}]),o=0,s=a.length;s>o;o++)a[o].relative&&(a[o].x=r.x-a[o].x,a[o].y=r.y-a[o].y),r.steps.push({x:a[o].x,y:a[o].y,time:a[o].time||0});r._startAni()},scrollToElement:function(t,e){var i,o=this;t=t.nodeType?t:o.scroller.querySelector(t),t&&(i=o._offset(t),i.left+=o.wrapperOffsetLeft,i.top+=o.wrapperOffsetTop,i.left=i.left>0?0:i.left<o.maxScrollX?o.maxScrollX:i.left,i.top=i.top>o.minScrollY?o.minScrollY:i.top<o.maxScrollY?o.maxScrollY:i.top,e=void 0===e?n.max(2*n.abs(i.left),2*n.abs(i.top)):e,o.scrollTo(i.left,i.top,e))},scrollToPage:function(t,e,i){var n,o,s=this;i=void 0===i?400:i,s.options.onScrollStart&&s.options.onScrollStart.call(s),s.options.snap?(t="next"==t?s.currPageX+1:"prev"==t?s.currPageX-1:t,e="next"==e?s.currPageY+1:"prev"==e?s.currPageY-1:e,t=0>t?0:t>s.pagesX.length-1?s.pagesX.length-1:t,e=0>e?0:e>s.pagesY.length-1?s.pagesY.length-1:e,s.currPageX=t,s.currPageY=e,n=s.pagesX[t],o=s.pagesY[e]):(n=-s.wrapperW*t,o=-s.wrapperH*e,s.maxScrollX>n&&(n=s.maxScrollX),s.maxScrollY>o&&(o=s.maxScrollY)),s.scrollTo(n,o,i)},disable:function(){this.stop(),this._resetPos(0),this.enabled=!1,this._unbind(S,t),this._unbind(T,t),this._unbind(C,t)},enable:function(){this.enabled=!0},stop:function(){this.options.useTransition?this._unbind(x):D(this.aniTime),this.steps=[],this.moved=!1,this.animating=!1},zoom:function(t,e,i,n){var o=this,s=i/o.scale;o.options.useTransform&&(o.zoomed=!0,n=void 0===n?200:n,t=t-o.wrapperOffsetLeft-o.x,e=e-o.wrapperOffsetTop-o.y,o.x=t-t*s+o.x,o.y=e-e*s+o.y,o.scale=i,o.refresh(),o.x=o.x>0?0:o.x<o.maxScrollX?o.maxScrollX:o.x,o.y=o.y>o.minScrollY?o.minScrollY:o.y<o.maxScrollY?o.maxScrollY:o.y,o.scroller.style[h]=n+"ms",o.scroller.style[a]="translate("+o.x+"px,"+o.y+"px) scale("+i+")"+M,o.zoomed=!1)},isReady:function(){return!this.moved&&!this.zoomed&&!this.animating}},o=null,"undefined"!=typeof exports?exports.iScroll=P:t.iScroll=P}(window,document),window.iScroll}),function(t){var e=function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t},i=function(t){if("VideoObject"===t["@type"]||"AudioObject"===t["@type"])return t;var e=null;switch(t["@type"]){case"MusicRecording":e=["audio","associatedMedia","video"];break;default:e=["video","associatedMedia","audio"]}for(var i=0,n=e.length;n>i;i++){var o=e[i];if(t[o]!==void 0)return t[o]}},n=function(t,e){e=e||{},t=t||{};var i={width:e.width||500,height:e.height||281};if("AudioObject"===t["@type"]&&(i.height=e.height||40),e.adjustSize){var n=4/3;t.width&&t.height?n=t.width/t.height:"widescreen"===t["yt:aspectRatio"]&&(n=16/9);var o={width:Math.round(i.height*n),height:Math.round(i.width/n)};o.width>i.width+1?i.height=o.height:o.width<i.width-1&&(i.width=o.width)}return i},o=function(t){"function"==typeof this.initialize?this.initialize(t):o.prototype.initialize.call(this,t)};o.extend=function(t){var i=function(t){o.call(this,t)};return e(i.prototype,t),i},e(o.prototype,{initialize:function(){},toHtml:function(t){"function"==typeof t&&t(null,"",{})}});var s=function(t){if(t.match(/soundcloud/g))return"audio/mp3";var e=t.split(".").pop();switch(e=e.indexOf("?")>-1?e.split("?")[0]:e,e=e.indexOf("#")>-1?e.split("#")[0]:e){case"webm":return"video/webm";case"ogv":return"video/ogg";case"mp4":return"video/mp4";case"m4v":return"video/mp4";case"ogg":return"audio/ogg";case"mp3":return"audio/mp3";case"m4a":return"audio/mp4";default:return""}},r=o.extend({initialize:function(t){this.sources=t.sources,this.poster=t.poster,this.width=t.width||500,this.height=t.height||281,this.autoPlay=t.autoPlay||!1},toHtml:function(t){for(var e=this.poster?' poster="'+this.poster+'"':"",i=this.autoPlay?" autoplay":"",n='<video width="'+this.width+'" height="'+this.height+'" '+e+i+" controls "+'class="video-js vjs-default-skin" data-setup="{}">',o=0;this.sources.length>o;o++){var r=this.sources[o];n+='<source src="'+r+'" type="'+s(r)+'"></source>'}n+="</video>","function"==typeof t&&t(null,n,{width:this.width,height:this.height})}}),a=o.extend({initialize:function(t){this.sources=t.sources,this.poster=t.poster||"",this.width=t.width||500,this.height=t.height||281,this.autoPlay=t.autoPlay||!1},addPolyFill:function(){var t=document.getElementsByTagName("body")[0],e=document.createElement("link"),i=document.createElement("script");e.setAttribute("href","http://vjs.zencdn.net/c/video-js.css"),e.setAttribute("rel","stylesheet"),i.setAttribute("src","http://vjs.zencdn.net/c/video.js"),t.appendChild(e),t.appendChild(i)},toHtml:function(t){for(var e=this.poster?' poster="'+this.poster+'"':"",i=this.autoPlay?" autoplay":"",n='<video width="'+this.width+'" height="'+this.height+'" '+e+i+" controls"+' class="video-js vjs-default-skin" data-setup="{}">',o=0;this.sources.length>o;o++){var r=this.sources[o];n+='<source src="'+r+'" type="'+s(r)+'"></source>'}n+="</video>","undefined"!=typeof window&&window.VideoJS===void 0&&this.addPolyFill(),"function"==typeof t&&t(null,n,{width:this.width,height:this.height})}}),l=o.extend({initialize:function(t){this.sources=t.sources,this.width=t.width||500,this.height=t.height||40,this.autoPlay=t.autoPlay||!1},iCanHazAudioTag:function(){if(!document)return!1;var t=document.createElement("audio");return t.canPlayType},toHtml:function(t){var e="";if(this.sources&&this.sources.length){for(var i=0;this.sources.length>i;i++)if(this.iCanHazAudioTag(this.sources[i])){var n=this.autoPlay?" autoplay":"";e='<audio controls src="'+this.sources[i]+'"'+n+"></audio>";break}e||(e='<a href="'+this.sources[0]+'" target="_blank">Play</a>')}"function"==typeof t&&t(null,e,{})}}),h=o.extend({initialize:function(t){this.sources=t.sources,this.width=t.width||500,this.height=t.height||281,this.autoPlay=t.autoPlay||!1},toHtml:function(t){for(var e="mediaplayerlib-mediaelement-video-"+h.nextId++,i=this.poster?' poster="'+this.poster+'"':"",n=this.autoPlay?" autoplay":"",o='<video width="'+this.width+'" height="'+this.height+'" '+i+n+" controls"+' id="'+e+'">',s=0;this.sources.length>s;s++){var r=this.sources[s];o+='<source src="'+r+'"></source>'}o+="</video>",o+="<script>",o+='$("#'+e+'").mediaelementplayer({',o+="playerWidth: "+this.width+",",o+="playerHeight: "+this.height,o+="});",o+="</script>","function"==typeof t&&t(null,o,{width:this.width,height:this.height})}});h.nextId=0;var c=o.extend({initialize:function(t){this.options=t},toHtml:function(e){for(var i=null,n=0;c.endPoints.length>n;n++)this.options.url.match(c.endPoints[n].regexp)&&(i=c.endPoints[n]);if(!i)return"function"==typeof e&&e(null,null),void 0;if("undefined"!=typeof module){var o=i.url(null,this.options),s=require("http"),r=require("url"),a=r.parse(o),l={host:a.hostname,path:a.pathname+a.search,port:80,method:"GET"},h=s.request(l,function(t){var i="";t.on("data",function(t){i+=t}),t.on("end",function(){e!==void 0&&e(null,JSON.parse(i).html)}),t.on("close",function(t){e!==void 0&&e(t)})});h.on("error",function(t){e!==void 0&&e(t)}),h.end()}else{var u=c.cbName(),r=i.url(u,this.options),d=document.getElementsByTagName("body")[0],p=document.createElement("script");t[u]=function(i){d.removeChild(p),delete t[u],"function"==typeof e&&e(null,i.html)},p.setAttribute("src",r),d.appendChild(p)}}});c.endPoints=[{regexp:/soundcloud\.com/i,url:function(t,e){var i=null;return i=t?"http://soundcloud.com/oembed?format=js&callback="+t+"&url="+encodeURIComponent(e.url):"http://soundcloud.com/oembed?format=json&url="+encodeURIComponent(e.url),e.width&&(i+="&maxwidth="+e.width),e.height&&(i+="&maxheight="+e.height),i}},{regexp:/vimeo\.com/i,url:function(t,e){var i=null;return i=t?"http://vimeo.com/api/oembed.json?callback="+t+"&url="+encodeURIComponent(e.url):"http://vimeo.com/api/oembed.json?url="+encodeURIComponent(e.url),e.width&&(i+="&width="+e.width),e.height&&(i+="&height="+e.height),i}},{regexp:/slideshare\.net/i,url:function(t,e){var i=null;return i=t?"http://www.slideshare.net/api/oembed/2?format=jsonp&callback="+t+"&url="+encodeURIComponent(e.url):"http://www.slideshare.net/api/oembed/2?url="+encodeURIComponent(e.url),e.width&&(i+="&maxwidth="+e.width),e.height&&(i+="&maxheight="+e.height),i}}],c.numCbName=0,c.cbName=function(){return"OEmbedCallBack"+c.numCbName++};var u=o.extend({initialize:function(t){this.url=t.url,this.width=t.width||500,this.height=t.height||281;var e=this.url.match(/youtube/gi),i=this.url.match(/vimeo/gi);t.html5&&e&&(this.url+=-1===this.url.indexOf("?")?"?html5=1":"&html5=1"),t.autoPlay&&(e||i)&&(this.url+=-1===this.url.indexOf("?")?"?autoplay=1":"&autoplay=1"),t.customPlayer&&e&&(this.url+=-1===this.url.indexOf("?")?"?controls=0":"&controls=0",this.callCustomPlayerBuilder=!0,this.options=t),t.playerAPI&&e&&(this.callScriptBuilder=!0,this.options=t)},toHtml:function(t){var e=function(){var t=function(){return(0|65536*(1+Math.random())).toString(16).substring(1)};return"mediaplayerlib-"+t()+t()+t()};if(this.callScriptBuilder||this.callCustomPlayerBuilder){this.options.guid=e();var i="",n={},o=_.bind(function(e,o,s){e&&"function"==typeof t&&t(e,null,null),i+=o,i+='<iframe id="'+this.options.guid+'" src="'+this.url+'" width="'+this.width+'" height="'+this.height+'" frameborder="0"></iframe>',_(n).extend(s,{width:this.width,height:this.height}),"function"==typeof t&&t(null,i,n)},this),s=_.bind(function(t){var e=new d(this.options);e.toHtml(t)},this),r=_.bind(function(){var t=new p(this.options);t.toHtml(o)},this);this.callScriptBuilder&&this.callCustomPlayerBuilder?s(function(t,e,s){i=e,n=s,r(o)}):this.callScriptBuilder?s(o):this.callCustomPlayerBuilder&&r(o)}else{var a='<iframe src="'+this.url+'" width="'+this.width+'" height="'+this.height+'" frameborder="0"></iframe>';"function"==typeof t&&t(null,a,{width:this.width,height:this.height})}}}),d=o.extend({initialize:function(t){this.url=t.url,this.publisher=t.publisher,this.width=t.width||500,this.height=t.height||281,this.guid=t.guid,this.onYouTubeIframeAPIReady=t.onYouTubeIframeAPIReady},toHtml:function(t){var e=this.url||"",i="",n="",o=function(){var t=function(){return(0|65536*(1+Math.random())).toString(16).substring(1)};return"mediaplayerlib-"+t()+t()+t()};n=this.guid||o(),"Ooyala"===this.publisher?(e+=(-1===e.indexOf("?")?"?":"&")+"width="+encodeURIComponent(this.width)+"&height="+encodeURIComponent(this.height),i='<div id="'+n+'"></div>'+'<script type="text/javascript">'+'document.getElementById("'+n+'").appendChild(document.createElement("script"));'+'window.ooyalaActiveScript = document.getElementById("'+n+'").firstChild;'+"</script>"+'<script type="text/javascript" src="'+e+'"></script>'):"Youtube"===this.publisher?(i='<script type="text/javascript">var tag = document.createElement("script");tag.src = "https://www.youtube.com/iframe_api";document.getElementById("'+n+'").parentNode.appendChild(tag);'+"</script>",this.onYouTubeIframeAPIReady&&(window.onYouTubeIframeAPIReady=this.onYouTubeIframeAPIReady(n))):i='<script type="text/javascript" src="'+e+'"></script>',"function"==typeof t&&t(null,i,{width:this.width,height:this.height})}}),p=o.extend({initialize:function(t){this.width=t.width||500,this.height=t.height||281,this.onKeydownCB=t.onKeydown,this.maskEvents=t.maskEvents,this.controlEvents=t.controlEvents,this.guid=t.guid,this.initDone=!1,console.log(this)},toHtml:function(t){var e='<div id="'+this.guid+'-events" class="video-mask js-video-mask" style="position:absolute; width:100%; height:100%">'+'<div class="video-controls js-video-controls">'+"</div>"+'<div class="video-spinner js-video-spinner">'+"</div>"+'<div class="video-timeline js-video-timeline" >'+'<div class="video-done js-video-done"></div>'+'<div class="video-undone"></div>'+"</div>"+"</div>";"function"==typeof t&&t(null,e,{width:this.width,height:this.height,customPlayer:{init:_.bind(this.init,this),exit:_.bind(this.exit,this),setPlaying:_.bind(this.setPlaying,this),hideControls:_.bind(this.hideControls,this),showControls:_.bind(this.showControls,this),hideSpinner:_.bind(this.hideSpinner,this),showSpinner:_.bind(this.showSpinner,this),hideTimeline:_.bind(this.hideTimeline,this),showTimeline:_.bind(this.showTimeline,this),onVideoSeek:_.bind(this.onVideoSeek,this),guid:this.guid}})},init:function(){if(this.initDone)return this;this.initDone=!0;var t=function(t,e){var i=function(t,i){$("body").on(t,e,i)};for(var n in t)i(n,t[n])};return t(this.maskEvents,"#"+this.guid+"-events"),t(this.controlEvents,"#"+this.guid+"-events .js-video-controls"),this.onKeydownCB&&(this.onKeydown=_.bind(function(t){return this.onKeydownCB(t)},this),$("body").on("keydown",this.onKeydown)),this},exit:function(){var t=function(t,e){var i=function(t,i){$("body").off(t,e,i)};for(var n in t)i(n,t[n])};this.initDone&&(t(this.maskEvents,"#"+this.guid+"-events"),t(this.controlEvents,"#"+this.guid+"-events .js-video-controls"),this.onKeydown&&$("body").off("keydown",this.onKeydown))},setPlaying:function(t){t?$("#"+this.guid+"-events").removeClass("js-video-paused"):$("#"+this.guid+"-events").addClass("js-video-paused")},hideControls:function(t){return t("#"+this.guid+"-events .js-video-controls"),this},showControls:function(t){return t("#"+this.guid+"-events .js-video-controls"),this},hideSpinner:function(t){return t("#"+this.guid+"-events .js-video-spinner"),this},showSpinner:function(t){return t("#"+this.guid+"-events .js-video-spinner"),this},hideTimeline:function(t){return t("#"+this.guid+"-events .js-video-timeline"),this},showTimeline:function(t){return t("#"+this.guid+"-events .js-video-timeline"),this},onVideoSeek:function(t,e){return e>100&&(e=100),0>e&&(e=0),$("#"+this.guid+"-events .js-video-done").css("width",e+"%"),this}}),f=o.extend({toHtml:function(t){"function"==typeof t&&t(Error("Unknown media type."),"Unknown media type.")}}),m=function(){};e(m.prototype,{execute:function(t,e){return new f(e)}}),m.extend=function(t){var i=function(t){m.call(this,t)};return e(i.prototype,t),i};var g=m.extend({execute:function(t,o){var s,r=i(t)||{},l=n(r,o);if(e(o,l),"VideoObject"===r["@type"])if("iframe"===r.playerType)e(o,{url:r.embedURL,publisher:r.publisher?r.publisher.name:null}),s=new u(o);else if("script"===r.playerType)e(o,{url:r.embedURL,publisher:r.publisher?r.publisher.name:null}),s=new d(o);else if(r.contentURL){var h=null;r.image&&r.image.contentURL&&(h=r.image.contentURL),e(o,{poster:h,sources:[r.contentURL]}),s=new a(o)}return s||new f}}),v=m.extend({execute:function(t,o){var s,a=i(t)||{},h=n(a,o);if(e(o,h),"iframe"===a.playerType)e(o,{url:a.embedURL,html5:!0}),s=new u(o);else if("script"===a.playerType)e(o,{url:a.embedURL,html5:!0,publisher:a.publisher?a.publisher.name:null}),s=new d(o);else if("VideoObject"===a["@type"]){if(a.contentURL){var c=null;a.image&&(c=a.image.contentURL),e(o,{poster:c,sources:[a.contentURL]}),s=new r(o)}}else"AudioObject"===a["@type"]&&a.contentURL&&(e(o,{sources:[a.contentURL]}),s=new l(o));return s}}),y=m.extend({execute:function(t,o){var s=i(t)||{},r=n(s,o);e(o,r);var a;if("VideoObject"===t["@type"]){if(t.contentURL!==void 0){var l=null;s.image&&(l=s.image.contentURL),e(o,{poster:l,sources:[t.contentURL]}),a=new h(o)}}else"AudioObject"===t["@type"]&&t.contentURL!==void 0&&e(o,{sources:[t.contentURL]});return a}}),w=m.extend({execute:function(t,i){var n;return t.url!==void 0&&(e(i,{url:t.url}),n=new c(i)),n}}),b=function(){this.strategies={def:new g,html5:new v,mediaElement:new y,oembed:new w}};e(b.prototype,{resolve:function(t,e){e=e||{};var i;if(e.strategy!==void 0&&this.strategies[e.strategy]!==void 0){var n=this.strategies[e.strategy];i=n.execute(t,e)}return i||this.strategies.def.execute(t,e)},insertFragment:function(t,e){function i(t,e){e(t);for(var n in t.childNodes)i(t.childNodes[n],e)}function n(t){var e=t.text||t.textContent||t.innerHTML||"",i=t.getAttribute("src"),n=document.getElementsByTagName("head")[0]||document.documentElement,o=document.createElement("script");o.type="text/javascript",i&&o.setAttribute("src",i),e&&o.appendChild(document.createTextNode(e)),n.insertBefore(o,n.firstChild),t.parentNode&&t.parentNode.removeChild(t)}var o=null;o="[object String]"===Object.prototype.toString.call(e)?document.getElementById(e):e,o.innerHTML=(""+t).trim();var s=[],r=null;i(o,function(t){!t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||s.push(t)});for(r in s)n(s[r])},insert:function(t,e,i,n){var o=this;this.resolve(t,e).toHtml(function(t,e){o.insertFragment(e,i),"function"==typeof n&&n(null)})}}),"undefined"!=typeof Joshfire&&Joshfire.define!==void 0?Joshfire.define([],function(){return new b}):define!==void 0?define("joshfire-framework/utils/mediaplayerlib",[],function(){return new b}):t.mediaFactory=new b}("undefined"!=typeof module?module.exports:window),define("joshfire-framework/vendor/backbone",["joshlib!vendor/underscore","joshlib!utils/dollar"],function(t,e){return function(){var i,n=this,o=n.Backbone,s=Array.prototype.slice,r=Array.prototype.splice;i="undefined"!=typeof exports?exports:n.Backbone={},i.VERSION="0.9.2",i.setDomLibrary=function(t){e=t},i.noConflict=function(){return n.Backbone=o,this},i.emulateHTTP=!1,i.emulateJSON=!1;var a=/\s+/,l=i.Events={on:function(t,e,i){var n,o,s,r,l;if(!e)return this;for(t=t.split(a),n=this._callbacks||(this._callbacks={});o=t.shift();)l=n[o],s=l?l.tail:{},s.next=r={},s.context=i,s.callback=e,n[o]={tail:r,next:l?l.next:s};return this},off:function(e,i,n){var o,s,r,l,h,c;if(s=this._callbacks){if(!(e||i||n))return delete this._callbacks,this;for(e=e?e.split(a):t.keys(s);o=e.shift();)if(r=s[o],delete s[o],r&&(i||n))for(l=r.tail;(r=r.next)!==l;)h=r.callback,c=r.context,(i&&h!==i||n&&c!==n)&&this.on(o,h,c);return this}},trigger:function(t){var e,i,n,o,r,l,h;if(!(n=this._callbacks))return this;for(l=n.all,t=t.split(a),h=s.call(arguments,1);e=t.shift();){if(i=n[e])for(o=i.tail;(i=i.next)!==o;)i.callback.apply(i.context||this,h);if(i=l)for(o=i.tail,r=[e].concat(h);(i=i.next)!==o;)i.callback.apply(i.context||this,r)}return this}};l.bind=l.on,l.unbind=l.off;var h=i.Model=function(e,i){var n;e||(e={}),i&&i.parse&&(e=this.parse(e)),(n=O(this,"defaults"))&&(e=t.extend({},n,e)),i&&i.collection&&(this.collection=i.collection),this.attributes={},this._escapedAttributes={},this.cid=t.uniqueId("c"),this.changed={},this._silent={},this._pending={},this.set(e,{silent:!0}),this.changed={},this._silent={},this._pending={},this._previousAttributes=t.clone(this.attributes),this.initialize.apply(this,arguments)};t.extend(h.prototype,l,{changed:null,_silent:null,_pending:null,idAttribute:"id",initialize:function(){},toJSON:function(){return t.clone(this.attributes)},get:function(t){return this.attributes[t]},escape:function(e){var i;if(i=this._escapedAttributes[e])return i;var n=this.get(e);return this._escapedAttributes[e]=t.escape(null==n?"":""+n)},has:function(t){return null!=this.get(t)},set:function(e,i,n){var o,s,r;if(t.isObject(e)||null==e?(o=e,n=i):(o={},o[e]=i),n||(n={}),!o)return this;if(o instanceof h&&(o=o.attributes),n.unset)for(s in o)o[s]=void 0;if(!this._validate(o,n))return!1;this.idAttribute in o&&(this.id=o[this.idAttribute]);var a=n.changes={},l=this.attributes,c=this._escapedAttributes,u=this._previousAttributes||{};for(s in o)r=o[s],(!t.isEqual(l[s],r)||n.unset&&t.has(l,s))&&(delete c[s],(n.silent?this._silent:a)[s]=!0),n.unset?delete l[s]:l[s]=r,t.isEqual(u[s],r)&&t.has(l,s)==t.has(u,s)?(delete this.changed[s],delete this._pending[s]):(this.changed[s]=r,n.silent||(this._pending[s]=!0));return n.silent||this.change(n),this},unset:function(t,e){return(e||(e={})).unset=!0,this.set(t,null,e)},clear:function(e){return(e||(e={})).unset=!0,this.set(t.clone(this.attributes),e)},fetch:function(e){e=e?t.clone(e):{};var n=this,o=e.success;return e.success=function(t,i,s){return n.set(n.parse(t,s),e)?(o&&o(n,t),void 0):!1},e.error=i.wrapError(e.error,n,e),(this.sync||i.sync).call(this,"read",this,e)},save:function(e,n,o){var s,r;if(t.isObject(e)||null==e?(s=e,o=n):(s={},s[e]=n),o=o?t.clone(o):{},o.wait){if(!this._validate(s,o))return!1;r=t.clone(this.attributes)}var a=t.extend({},o,{silent:!0});if(s&&!this.set(s,o.wait?a:o))return!1;var l=this,h=o.success;o.success=function(e,i,n){var r=l.parse(e,n);
return o.wait&&(delete o.wait,r=t.extend(s||{},r)),l.set(r,o)?(h?h(l,e):l.trigger("sync",l,e,o),void 0):!1},o.error=i.wrapError(o.error,l,o);var c=this.isNew()?"create":"update",u=(this.sync||i.sync).call(this,c,this,o);return o.wait&&this.set(r,a),u},destroy:function(e){e=e?t.clone(e):{};var n=this,o=e.success,s=function(){n.trigger("destroy",n,n.collection,e)};if(this.isNew())return s(),!1;e.success=function(t){e.wait&&s(),o?o(n,t):n.trigger("sync",n,t,e)},e.error=i.wrapError(e.error,n,e);var r=(this.sync||i.sync).call(this,"delete",this,e);return e.wait||s(),r},url:function(){var t=O(this,"urlRoot")||O(this.collection,"url")||D();return this.isNew()?t:t+("/"==t.charAt(t.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(t){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},change:function(e){e||(e={});var i=this._changing;this._changing=!0;for(var n in this._silent)this._pending[n]=!0;var o=t.extend({},e.changes,this._silent);this._silent={};for(var n in o)this.trigger("change:"+n,this,this.get(n),e);if(i)return this;for(;!t.isEmpty(this._pending);){this._pending={},this.trigger("change",this,e);for(var n in this.changed)this._pending[n]||this._silent[n]||delete this.changed[n];this._previousAttributes=t.clone(this.attributes)}return this._changing=!1,this},hasChanged:function(e){return arguments.length?t.has(this.changed,e):!t.isEmpty(this.changed)},changedAttributes:function(e){if(!e)return this.hasChanged()?t.clone(this.changed):!1;var i,n=!1,o=this._previousAttributes;for(var s in e)t.isEqual(o[s],i=e[s])||((n||(n={}))[s]=i);return n},previous:function(t){return arguments.length&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return t.clone(this._previousAttributes)},isValid:function(){return!this.validate(this.attributes)},_validate:function(e,i){if(i.silent||!this.validate)return!0;e=t.extend({},this.attributes,e);var n=this.validate(e,i);return n?(i&&i.error?i.error(this,n,i):this.trigger("error",this,n,i),!1):!0}});var c=i.Collection=function(t,e){e||(e={}),e.model&&(this.model=e.model),e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,{silent:!0,parse:e.parse})};t.extend(c.prototype,l,{model:h,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},add:function(e,i){var n,o,s,a,l,h,c={},u={},d=[];for(i||(i={}),e=t.isArray(e)?e.slice():[e],n=0,s=e.length;s>n;n++){if(!(a=e[n]=this._prepareModel(e[n],i)))throw Error("Can't add an invalid model to a collection");l=a.cid,h=a.id,c[l]||this._byCid[l]||null!=h&&(u[h]||this._byId[h])?d.push(n):c[l]=u[h]=a}for(n=d.length;n--;)e.splice(d[n],1);for(n=0,s=e.length;s>n;n++)(a=e[n]).on("all",this._onModelEvent,this),this._byCid[a.cid]=a,null!=a.id&&(this._byId[a.id]=a);if(this.length+=s,o=null!=i.at?i.at:this.models.length,r.apply(this.models,[o,0].concat(e)),this.comparator&&this.sort({silent:!0}),i.silent)return this;for(n=0,s=this.models.length;s>n;n++)c[(a=this.models[n]).cid]&&(i.index=n,a.trigger("add",a,this,i));return this},remove:function(e,i){var n,o,s,r;for(i||(i={}),e=t.isArray(e)?e.slice():[e],n=0,o=e.length;o>n;n++)r=this.getByCid(e[n])||this.get(e[n]),r&&(delete this._byId[r.id],delete this._byCid[r.cid],s=this.indexOf(r),this.models.splice(s,1),this.length--,i.silent||(i.index=s,r.trigger("remove",r,this,i)),this._removeReference(r));return this},push:function(t,e){return t=this._prepareModel(t,e),this.add(t,e),t},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t),e},unshift:function(e,i){return e=this._prepareModel(e,i),this.add(e,t.extend({at:0},i)),e},shift:function(t){var e=this.at(0);return this.remove(e,t),e},get:function(t){return null==t?void 0:this._byId[null!=t.id?t.id:t]},getByCid:function(t){return t&&this._byCid[t.cid||t]},at:function(t){return this.models[t]},where:function(e){return t.isEmpty(e)?[]:this.filter(function(t){for(var i in e)if(e[i]!==t.get(i))return!1;return!0})},sort:function(e){if(e||(e={}),!this.comparator)throw Error("Cannot sort a set without a comparator");var i=t.bind(this.comparator,this);return 1==this.comparator.length?this.models=this.sortBy(i):this.models.sort(i),e.silent||this.trigger("reset",this,e),this},pluck:function(e){return t.map(this.models,function(t){return t.get(e)})},reset:function(e,i){e||(e=[]),i||(i={});for(var n=0,o=this.models.length;o>n;n++)this._removeReference(this.models[n]);return this._reset(),this.add(e,t.extend({silent:!0},i)),i.silent||this.trigger("reset",this,i),this},fetch:function(e){e=e?t.clone(e):{},void 0===e.parse&&(e.parse=!0);var n=this,o=e.success;return e.success=function(t,i,s){n[e.add?"add":"reset"](n.parse(t,s),e),o&&o(n,t)},e.error=i.wrapError(e.error,n,e),(this.sync||i.sync).call(this,"read",this,e)},create:function(e,i){var n=this;if(i=i?t.clone(i):{},e=this._prepareModel(e,i),!e)return!1;i.wait||n.add(e,i);var o=i.success;return i.success=function(t,s){i.wait&&n.add(t,i),o?o(t,s):t.trigger("sync",e,s,i)},e.save(null,i),e},parse:function(t){return t},chain:function(){return t(this.models).chain()},_reset:function(){this.length=0,this.models=[],this._byId={},this._byCid={}},_prepareModel:function(t,e){if(e||(e={}),t instanceof h)t.collection||(t.collection=this);else{var i=t;e.collection=this,t=new this.model(i,e),t._validate(t.attributes,e)||(t=!1)}return t},_removeReference:function(t){this==t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,n){("add"!=t&&"remove"!=t||i==this)&&("destroy"==t&&this.remove(e,n),e&&t==="change:"+e.idAttribute&&(delete this._byId[e.previous(e.idAttribute)],this._byId[e.id]=e),this.trigger.apply(this,arguments))}});var u=["forEach","each","map","reduce","reduceRight","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","sortBy","sortedIndex","toArray","size","first","initial","rest","last","without","indexOf","shuffle","lastIndexOf","isEmpty","groupBy"];t.each(u,function(e){c.prototype[e]=function(){return t[e].apply(t,[this.models].concat(t.toArray(arguments)))}});var d=i.Router=function(t){t||(t={}),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},p=/:\w+/g,f=/\*\w+/g,m=/[-[\]{}()+?.,\\^$|#\s]/g;t.extend(d.prototype,l,{initialize:function(){},route:function(e,n,o){return i.history||(i.history=new g),t.isRegExp(e)||(e=this._routeToRegExp(e)),o||(o=this[n]),i.history.route(e,t.bind(function(t){var s=this._extractParameters(e,t);o&&o.apply(this,s),this.trigger.apply(this,["route:"+n].concat(s)),i.history.trigger("route",this,n,s)},this)),this},navigate:function(t,e){i.history.navigate(t,e)},_bindRoutes:function(){if(this.routes){var t=[];for(var e in this.routes)t.unshift([e,this.routes[e]]);for(var i=0,n=t.length;n>i;i++)this.route(t[i][0],t[i][1],this[t[i][1]])}},_routeToRegExp:function(t){return t=t.replace(m,"\\$&").replace(p,"([^/]+)").replace(f,"(.*?)"),RegExp("^"+t+"$")},_extractParameters:function(t,e){return t.exec(e).slice(1)}});var g=i.History=function(){this.handlers=[],t.bindAll(this,"checkUrl")},v=/^[#\/]/,y=/msie [\w.]+/;g.started=!1,t.extend(g.prototype,l,{interval:50,getHash:function(t){var e=t?t.location:window.location,i=e.href.match(/#(.*)$/);return i?i[1]:""},getFragment:function(t,e){if(null==t)if(this._hasPushState||e){t=window.location.pathname;var i=window.location.search;i&&(t+=i)}else t=this.getHash();return t.indexOf(this.options.root)||(t=t.substr(this.options.root.length)),t.replace(v,"")},start:function(i){if(g.started)throw Error("Backbone.history has already been started");g.started=!0,this.options=t.extend({},{root:"/"},this.options,i),this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&window.history&&window.history.pushState);var n=this.getFragment(),o=document.documentMode,s=y.exec(navigator.userAgent.toLowerCase())&&(!o||7>=o);s&&(this.iframe=e('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(n)),this._hasPushState?e(window).bind("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!s?e(window).bind("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=n;var r=window.location,a=r.pathname==this.options.root;return this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!a?(this.fragment=this.getFragment(null,!0),window.location.replace(this.options.root+"#"+this.fragment),!0):(this._wantsPushState&&this._hasPushState&&a&&r.hash&&(this.fragment=this.getHash().replace(v,""),window.history.replaceState({},document.title,r.protocol+"//"+r.host+this.options.root+this.fragment)),this.options.silent?void 0:this.loadUrl())},stop:function(){e(window).unbind("popstate",this.checkUrl).unbind("hashchange",this.checkUrl),clearInterval(this._checkUrlInterval),g.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(){var t=this.getFragment();return t==this.fragment&&this.iframe&&(t=this.getFragment(this.getHash(this.iframe))),t==this.fragment?!1:(this.iframe&&this.navigate(t),this.loadUrl()||this.loadUrl(this.getHash()),void 0)},loadUrl:function(e){var i=this.fragment=this.getFragment(e),n=t.any(this.handlers,function(t){return t.route.test(i)?(t.callback(i),!0):void 0});return n},navigate:function(t,e){if(!g.started)return!1;e&&e!==!0||(e={trigger:e});var i=(t||"").replace(v,"");this.fragment!=i&&(this._hasPushState?(0!=i.indexOf(this.options.root)&&(i=this.options.root+i),this.fragment=i,window.history[e.replace?"replaceState":"pushState"]({},document.title,i)):this._wantsHashChange?(this.fragment=i,this._updateHash(window.location,i,e.replace),this.iframe&&i!=this.getFragment(this.getHash(this.iframe))&&(e.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,i,e.replace))):window.location.assign(this.options.root+t),e.trigger&&this.loadUrl(t))},_updateHash:function(t,e,i){i?t.replace((""+t).replace(/(javascript:|#).*$/,"")+"#"+e):t.hash=e}});var w=i.View=function(e){this.cid=t.uniqueId("view"),this._configure(e||{}),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},b=/^(\S+)\s*(.*)$/,E=["model","collection","el","id","attributes","className","tagName"];t.extend(w.prototype,l,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this},make:function(t,i,n){var o=document.createElement(t);return i&&e(o).attr(i),n&&e(o).html(n),o},setElement:function(t,i){return this.$el&&this.undelegateEvents(),this.$el=t instanceof e?t:e(t),this.el=this.$el[0],i!==!1&&this.delegateEvents(),this},delegateEvents:function(e){if(e||(e=O(this,"events"))){this.undelegateEvents();for(var i in e){var n=e[i];if(t.isFunction(n)||(n=this[e[i]]),!n)throw Error('Method "'+e[i]+'" does not exist');var o=i.match(b),s=o[1],r=o[2];n=t.bind(n,this),s+=".delegateEvents"+this.cid,""===r?this.$el.bind(s,n):this.$el.delegate(r,s,n)}}},undelegateEvents:function(){this.$el.unbind(".delegateEvents"+this.cid)},_configure:function(e){this.options&&(e=t.extend({},this.options,e));for(var i=0,n=E.length;n>i;i++){var o=E[i];e[o]&&(this[o]=e[o])}this.options=e},_ensureElement:function(){if(this.el)this.setElement(this.el,!1);else{var t=O(this,"attributes")||{};this.id&&(t.id=this.id),this.className&&(t["class"]=this.className),this.setElement(this.make(this.tagName,t),!1)}}});var S=function(t,e){var i=x(this,t,e);return i.extend=this.extend,i};h.extend=c.extend=d.extend=w.extend=S;var T={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};i.sync=function(n,o,s){var r=T[n];s||(s={});var a={type:r,dataType:"json"};return s.url||(a.url=O(o,"url")||D()),s.data||!o||"create"!=n&&"update"!=n||(a.contentType="application/json",a.data=JSON.stringify(o.toJSON())),i.emulateJSON&&(a.contentType="application/x-www-form-urlencoded",a.data=a.data?{model:a.data}:{}),i.emulateHTTP&&("PUT"===r||"DELETE"===r)&&(i.emulateJSON&&(a.data._method=r),a.type="POST",a.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",r)}),"GET"===a.type||i.emulateJSON||(a.processData=!1),e.ajax(t.extend(a,s))},i.wrapError=function(t,e,i){return function(n,o){o=n===e?o:n,t?t(e,o,i):e.trigger("error",e,o,i)}};var C=function(){},x=function(e,i,n){var o;return o=i&&i.hasOwnProperty("constructor")?i.constructor:function(){e.apply(this,arguments)},t.extend(o,e),C.prototype=e.prototype,o.prototype=new C,i&&t.extend(o.prototype,i),n&&t.extend(o,n),o.prototype.constructor=o,o.__super__=e.prototype,o},O=function(e,i){return e&&e[i]?t.isFunction(e[i])?e[i]():e[i]:null},D=function(){throw Error('A "url" property or function must be specified')}}.call(this),"undefined"!=typeof exports?exports:this.Backbone}),define("joshfire-framework/collection",["joshlib!vendor/backbone","joshlib!vendor/underscore"],function(t,e){var i=t.Collection.extend({initialize:function(t,e){this.ds=null,this.dsq={},e=e||{},e.dataSource&&this.setDataSource(e.dataSource),e.dataSourceQuery&&this.setDataSourceQuery(e.dataSourceQuery)},setDataSource:function(t){this.ds=t},setDataSourceQuery:function(t){this.dsq=t},sync:function(t,i,n){if(!this.ds)return this.trigger("syncerror",{method:t,err:"init failed, ds is null"}),n&&n.error&&n.error("init failed, ds is null"),void 0;n=n||{};var o={};this.dsq&&(o=e.extend(o,this.dsq)),n.dataSourceQuery&&(o=e.extend(o,n.dataSourceQuery)),"read"===t&&(this.trigger("syncstarted",{method:t}),this.ds.find(o,e.bind(function(e,i){if(e)return this.trigger("syncerror",{method:t,err:e}),n.error&&n.error(e),void 0;if(this.ds.children){var o=[];o=Array.prototype.concat.apply(o,i.entries.map(function(t){return t.entries})),n.success&&n.success(o)}else n.success&&n.success(i.entries||[]);this.trigger("syncsuccess",{method:t})},this)))}});return i}),define("joshfire-framework/adapters/phone/collection",["joshlib!adapters/none/collection"],function(t){return t.adapted=!0,t}),define("joshfire-framework/view",["joshlib!utils/dollar","joshlib!vendor/backbone","joshlib!vendor/underscore"],function(t,e,i){var n=e.View.extend({compileTemplate:i.template,initialize:function(e){if(e){this.data=e.data||{},this.loadImagesSmoothly=e.loadImagesSmoothly||!1,this.imageClass=e.imageClass,this.processImageEl=e.processImageEl;var n=this;this.getImages=e.getImages||function(){var e=t.map(this.$("img"),function(e){return n.imageClass&&t(e).addClass(n.imageClass),{el:e,url:t(e).attr("src")}});return e},this.customLoadEvent=e.customLoadEvent||!1,this.loadingClass=e.loadingClass||null,this.loadingClass&&(i.isString(this.loadingClass)||(this.loadingClass="loading"))}else this.data={}},render:function(){var t=this;this.generate(function(e,i){i!==!1&&t.setContent(i),t.enhance()})},setContent:function(t){this.$el.html(""),this.$el.append(t)},generate:function(t){t(null,"")},wrapContent:function(t,e){t=t||"";var i=function(t){return t?t.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/"/g,"""):""};if(!this.el)return"<div>"+t+"</div>";for(var n="<"+this.el.nodeName.toLowerCase(),o=0;this.el.attributes.length>o;o++){var s=this.el.attributes[o];n+=s.value?" "+s.name+'="'+i(s.value)+'"':" "+s.name}return e&&(n+=' data-joshfire-child="'+i(e)+'"'),n+=">"+t+"</"+this.el.nodeName.toLowerCase()+">"},hide:function(){this.$el.hide(),this.trigger("hidden"),this.trigger("hide")},show:function(){this.$el.show(),this.trigger("shown"),this.trigger("show")},runImageLoader:function(){var e=this;if(!this.getImages)return UIItem.prototype.enhance.call(this),this.trigger("load"),void 0;var n=this.getImages();if(!n||0===n.length)return this.customLoadEvent?this.trigger("imagesLoad"):this.trigger("load"),void 0;var o=0,s=function(i){i&&t(i).removeClass("loading"),o+=1,o===n.length&&(e.customLoadEvent?e.trigger("imagesLoad"):e.trigger("load"))};i.each(n,function(i){if(!i.el||!i.url)return s(i.el);var n=i.el;e.processImageEl&&(n=e.processImageEl(i.el)),t(n).addClass("loading");var o=new Image;o.onload=function(){s(n),o=null},o.onerror=function(){s(n),o=null},o.src=i.url})},enhance:function(){this.isLoadingNeeded()&&this.$el&&(this.showLoader(),this.unbind("load",this.hideLoader,this),this.bind("load",this.hideLoader,this)),this.isImageLoadingNeeded()&&this.$el&&this.runImageLoader(),this.customLoadEvent||this.isImageLoadingNeeded()||this.trigger("load")},isLoadingNeeded:function(){return this.loadingClass},isImageLoadingNeeded:function(){return this.loadImagesSmoothly},showLoader:function(){this.$el.addClass(this.loadingClass)},hideLoader:function(){this.$el.removeClass(this.loadingClass)}});return n}),define("joshfire-framework/uielement",["joshlib!view"],function(t){var e=t.extend({});return e}),define("joshfire-framework/adapters/phone/uielement",["joshlib!adapters/none/uielement","joshlib!vendor/iscroll","joshlib!vendor/underscore"],function(t,e,i){var n=t.extend({initialize:function(e){this.options.scroller&&this.$el.css({overflow:"hidden"}),this.options.scrollerSelector&&(this.scrollerSelector=this.options.scrollerSelector),this.bind("shown",function(){this.hasScroller&&this.iScroller&&this.iScroller.refresh()},this),t.prototype.initialize.call(this,e)},enhance:function(){var e=this;if(this.options.scroller){e.insertScroller(),window.skiped&&e.iScroller.scrollToElement("li:nth-child("+window.skiped+")",200);var i=e.$("img");i.length&&e.$("img").bind("load",function(){setTimeout(function(){e.iScroller.refresh()},10)})}t.prototype.enhance.call(this)},insertScroller:function(){var t=this;this.hasScroller=!0,t.iScroller&&t.iScroller.destroy();var n=t.el;t.scrollerSelector&&(n=t.$(t.scrollerSelector).get(0)||t.el),t.iScroller=new e(n,i.extend({useTransition:!0,onBeforeScrollStart:function(t){for(var e=t.target;1!=e.nodeType;)e=e.parentNode;"SELECT"!=e.tagName&&"INPUT"!=e.tagName&&"TEXTAREA"!=e.tagName&&t.preventDefault()}},t.options.scrollOptions||{})),t.options.scrollOptions&&t.options.scrollOptions.disabled&&t.iScroller.disable(),document.addEventListener("orientationChanged",function(){t.iScroller&&t.iScroller.refresh()})}});return n}),define("joshfire-framework/ui/listitem",["joshlib!uielement","joshlib!vendor/underscore"],function(t,e){var i=t.extend({initialize:function(i){this.view=i.view,this.offset=i.offset,this.customLoadEvent=!0,this.view&&this.view.bind("load",e.bind(function(){this.trigger("load")},this)),t.prototype.initialize.call(this,i)},setElement:function(t){this.view&&this.view.setElement(t)},generate:function(t){this.view.data.offset=this.offset,this.view.generate(t)},render:function(){this.view.render()},setContent:function(t){this.view.setContent(t)},hide:function(){this.view.hide()},show:function(){this.view.show()},enhance:function(){this.view.enhance()}});return i}),define("joshfire-framework/router",["joshlib!vendor/backbone","joshlib!vendor/underscore"],function(t,e){var i=function(i){e.extend(i,{historyStart:function(e){t.history.start(e)}});var n=t.Router.extend(i);return new n};return i}),define("joshfire-framework/class",["joshlib!vendor/underscore"],function(t){var e=!1,i=/xyz/.test(function(){})?/\b__super\b/:/.*/,n=function(){};return n.extend=function(t){function n(){!e&&this.__constructor&&this.__constructor.apply(this,arguments)}var o=this.prototype;e=!0;var s=new this;e=!1;for(var r in t)s[r]="function"==typeof t[r]&&"function"==typeof o[r]&&i.test(t[r])?function(t,e){return function(){var i=this.__super;this.__super=o[t];var n=e.apply(this,arguments);return this.__super=i,n}}(r,t[r]):t[r];return n.prototype=s,n.constructor=n,n.extend=arguments.callee,n},function(){return t.isFunction(arguments[0])?arguments[0].extend(arguments[1]):n.extend(arguments[0])}}),define("joshfire-framework/utils/i18n",["joshlib!class","joshlib!vendor/underscore","joshlib!utils/dollar"],function(t,e,i){var n=t({terms:null,setLocale:function(t,n){var o=this;o.opt=e.defaults(t,{url:"./lang/dictionaries",locale:o._detectLocale(),format:"json"}),e.extend(this,t),"auto"===o.locale.toLowerCase()&&(o.locale=o._detectLocale()),t.availableLocales&&-1===e(t.availableLocales).indexOf(o.locale)&&(o.locale=t.defaultLocale||"en");var s=o.url+"/"+o.locale+"."+o.format;-1==(""+document.location).indexOf("file://")?i.ajax({url:s,dataType:"json",success:function(t){t&&t.terms?o.terms=t.terms:console.warn("JSi18n : No dictionary was loaded."),"function"==typeof n&&n()}}):(o.terms={},"function"==typeof n&&n())},getLocale:function(){return this.locale},getText:function(t){var e=this;for(var i in e.terms)if(e.terms.hasOwnProperty(i)&&t.toLowerCase()==i.toLowerCase())return e.terms[i];return t},translateStaticContent:function(){var t=this;i("*[data-translate]").each(function(){i(this).removeAttr("data-translate"),i(this).html(t.T(i(this).html()))})},_detectLocale:function(){var t=navigator.language?navigator.language:navigator.userLanguage;return t.split("-").length>1?t.split("-")[0]:t}}),o=new n;return{getText:e.bind(o.getText,o),setLocale:e.bind(o.setLocale,o),getLocale:e.bind(o.getLocale,o)}}),define("joshfire-framework/ui/item",["joshlib!uielement","joshlib!utils/dollar","joshlib!vendor/underscore","joshlib!utils/i18n"],function(t,e,i,n){var o=t.extend({initialize:function(i){i.template?this.template=this.compileTemplate(i.template):i.templateEl&&(this.template=this.compileTemplate(e(i.templateEl).text())),this.setModel(i.model),t.prototype.initialize.call(this,i)},setModel:function(t,e){this.model=t,t&&t.bind("change",this.render,this),e&&this.render()},generate:function(t){if(!this.template)return t(null,"");if(!this.model)return t(null,"");var e={model:this.model,obj:this.model,item:this.model?this.model.toJSON():{},T:n.getText};i.extend(e,this.data),t(null,this.template(e))}});return o}),define("joshfire-framework/ui/dynamiccontainer",["joshlib!uielement","joshlib!ui/item","joshlib!utils/dollar","joshlib!vendor/underscore"],function(t,e,i,n){var o=t.extend({initialize:function(o){this.setModel(o.model),this.setCollection(o.collection),this.viewTemplateEl=o.viewTemplateEl||o.itemTemplateEl,this.viewOptions=o.viewOptions||o.itemOptions||{},this.viewOptions.templateEl=this.viewOptions.templateEl||this.viewTemplateEl,this.viewOptions.template=this.viewOptions.template||o.viewTemplate||o.itemTemplate,o.template?this.template=this.compileTemplate(o.template):o.templateEl&&(this.template=this.compileTemplate(i(o.templateEl).text())),this.viewFactory=function(t,i){var s={model:t,collection:i};return n.extend(s,this.viewOptions),factory=o.viewFactory||o.itemFactory,factory?factory(s):new e(s)},this.customLoadEvent=!0,this.bind("shown",function(){this.view&&this.view.trigger("shown")},this),this.bind("hidden",function(){this.view&&this.view.trigger("hidden")},this),t.prototype.initialize.call(this,o)},setModel:function(t,e){this.model&&this.model.unbind("change",this.render,this),this.model=t,t&&t.bind("change",this.render,this),e&&this.render()},setCollection:function(t,e){this.collection&&(this.collection.unbind("change",this.render,this),this.collection.unbind("add",this.render,this),this.collection.unbind("remove",this.render,this),this.collection.unbind("reset",this.render,this)),this.collection=t,t&&(t.bind("change",this.render,this),t.bind("add",this.render,this),t.bind("remove",this.render,this),t.bind("reset",this.render,this)),e&&this.render()},generate:function(t){var e=this;return this.view&&this.view.unbind("load",this.triggerLoad,this),this.view=this.viewFactory(this.model,this.collection),this.view?(this.view.bind("load",this.triggerLoad,this),!this.view.model&&this.view.setModel&&this.view.setModel(this.model),!this.view.collection&&this.view.setCollection&&this.view.setCollection(this.collection),this.view.generate(function(i,n){var o=e.view.wrapContent(n),s=null;return s=o&&e.template?e.template({child:o}):o?o:"",t(i,s)}),void 0):t(null,"")},setContent:function(e){t.prototype.setContent.call(this,e),this.view&&this.el&&this.setViewElement(!0)},setElement:function(e,i){t.prototype.setElement.call(this,e,i),this.setViewElement(i)},setViewElement:function(t){this.view&&this.view.setElement(this.el.firstChild,t)},enhance:function(){var e=this;this.view.enhance();var i=["navUp","navRight","navDown","navLeft","navAction","navFocus","navBlur"];n.each(i,function(t){e[t]=e.view[t]}),t.prototype.enhance.call(this)},triggerLoad:function(){this.trigger("load")}});return o}),define("joshfire-framework/ui/factorymedia",["joshlib!ui/item","joshlib!utils/mediaplayerlib","joshlib!vendor/underscore"],function(t,e,i){var n=t.extend({initialize:function(e){this.mediaOptions=e.mediaOptions||{},t.prototype.initialize.call(this,e)},generate:function(n){var o=/^([0-9]{1,3})%$/,s=null,r=0,a=i.clone(this.mediaOptions);if(!this.model)return n(null,"");a.width&&i.isString(a.width)&&(s=a.width.match(o),s&&(r=parseInt(s[1],10),a.width=this.options.width?this.options.width*r/100:this.$el.width()*r/100,a.width=Math.floor(a.width))),a.height&&i.isString(a.height)&&(s=a.height.match(o),s&&(r=parseInt(s[1],10),a.height=this.options.height?this.options.height*r/100:this.$el.height()*r/100,a.height=Math.floor(a.height)));var l=e.resolve(this.model.toJSON(),a);l.toHtml(i.bind(function(e,o,s){return this.template?(i.extend(this.data,{media:{html:o,metadata:s},width:this.options.width,height:this.options.height}),t.prototype.generate.call(this,n),void 0):n(null,o)},this))}});return n}),define("joshfire-framework/ui/imagesloader",["joshlib!ui/item","joshlib!utils/dollar","joshlib!vendor/underscore"],function(t,e,i){var n=t.extend({initialize:function(i){this.imageClass=i.imageClass,this.processImageEl=i.processImageEl;var n=this;this.getImages=i.getImages||function(){var t=e.map(this.$("img"),function(t){return n.imageClass&&e(t).addClass(n.imageClass),{el:t,url:e(t).attr("src")}});return t},this.customLoadEvent=!0,t.prototype.initialize.call(this,i)},enhance:function(){var n=this;if(!this.getImages)return t.prototype.enhance.call(this),this.trigger("load"),void 0;var o=this.getImages();if(!o||0===o.length)return t.prototype.enhance.call(this),this.trigger("load"),void 0;var s=0,r=function(t){t&&e(t).removeClass("loading"),s+=1,s===o.length&&n.trigger("load")};i.each(o,function(t){if(!t.el||!t.url)return r(t.el);var i=t.el;n.processImageEl&&(i=n.processImageEl(t.el)),e(i).addClass("loading");var o=new Image;o.onload=function(){r(i),o=null},o.onerror=function(){r(i),o=null},o.src=t.url}),t.prototype.enhance.call(this)}});return n}),define("joshfire-framework/ui/list",["joshlib!uielement","joshlib!ui/listitem","joshlib!ui/item","joshlib!utils/dollar","joshlib!vendor/underscore","joshlib!utils/i18n"],function(t,e,i,n,o,s){var r=t.extend({initialize:function(s){this.template=s.templateEl?this.compileTemplate(n(s.templateEl).text()):s.template?this.compileTemplate(s.template):this.compileTemplate("<ul><%= children %></ul>"),this.UIItemClass=s.UIItemClass||e,this.itemOptions=s.itemOptions||{scroller:!1},this.itemTemplateEl=s.itemTemplateEl,this.itemOptions.templateEl=this.itemOptions.templateEl||this.itemTemplateEl,this.itemOptions.template=this.itemOptions.template||s.itemTemplate,this.contentSelector=s.contentSelector,this.data=s.data||{},this.items=[],this.itemFactory=s.itemFactory||function(t,e){var n={model:t,offset:e};return o.extend(n,this.itemOptions),new i(n)},s.customLoadEvent&&(this.wantsCustomLoadEvent=!0),this.customLoadEvent=!0,this.dataLoadingClass="loading",s.dataLoadingClass!==void 0&&(this.dataLoadingClass=s.dataLoadingClass),this.dataLoadingClass===!1&&(this.dataLoadingClass=null),this.bind("shown",function(){o.each(this.items,function(t){t.trigger("shown")})},this),this.bind("hidden",function(){o.each(this.items,function(t){t.trigger("hidden")})},this),t.prototype.initialize.call(this,s),s.collection&&this.setCollection(s.collection)},setCollection:function(t,e){this.collection&&(this.collection.unbind("change",this.colChangedHandler,this),this.collection.unbind("add",this.colChangedHandler,this),this.collection.unbind("remove",this.colChangedHandler,this),this.collection.unbind("reset",this.colChangedHandler,this),this.collection.unbind("syncstarted",this.syncStartedHandler,this),this.collection.unbind("syncsuccess",this.syncSuccessHandler,this),this.collection.unbind("syncerror",this.syncErrorHandler,this)),this.collection=t,t&&(t.bind("change",this.colChangedHandler,this),t.bind("add",this.colChangedHandler,this),t.bind("remove",this.colChangedHandler,this),t.bind("reset",this.colChangedHandler,this),t.bind("syncstarted",this.syncStartedHandler,this),t.bind("syncsuccess",this.syncSuccessHandler,this),t.bind("syncerror",this.syncErrorHandler,this)),this.update(e)},colChangedHandler:function(){this.update(!0)},update:function(t){this.items=Array(this.collection.length),this.itemsLoaded=0;for(var i=function(){++this.itemsLoaded,this.itemsLoaded!==this.items.length||this.wantsCustomLoadEvent||this.trigger("load")},n=0;this.collection.length>n;n++){var s=this.collection.at(n);this.items[n]=new e({view:this.itemFactory.call(this,s,n),model:s,offset:n}),this.items[n].bind("load",o.bind(i,this))}t&&this.render()},generate:function(t){var e=this.items,i=Array(e.length),n=0,r=this.template,a=this;if(!e.length){var l=r({children:"",collection:this.collection,T:s.getText});return t(null,l),void 0}for(var h=0;e.length>h;h++)(function(s,l){this.generateItem(function(s,h){if(i[l]=h,++n===e.length){var c={children:i.join(""),collection:a.collection};c=o.extend(c,a.data);var u=r(c);t(null,u)}},s)}).call(this,e[h],h)},generateItem:function(t,e){e.generate(t)},enhance:function(){for(var e=this.$("li"),i=0;this.items.length>i;i++){var o=this.items[i];o.setElement(e[i]),o.enhance()}this.$(".joshfire-link").unbind("click").bind("click",function(t){t.preventDefault();var e=n(t.currentTarget).attr("data-joshfire-link-url");return window.location=e,!1}),t.prototype.enhance.call(this),0!==this.items.length||this.wantsCustomLoadEvent||this.trigger("load")},setContent:function(t){this.contentSelector?this.$(this.contentSelector).html(t):n(this.el).html(t)},syncStartedHandler:function(){this.dataLoadingClass&&n(this.el).addClass(this.dataLoadingClass)},syncSuccessHandler:function(){var t=this;this.dataLoadingClass&&window.setTimeout(function(){n(t.el).removeClass(t.dataLoadingClass)},5e3)},syncErrorHandler:function(){this.dataLoadingClass&&n(this.el).removeClass(this.dataLoadingClass)}});return r}),define("ui/imagegallery",["joshlib!ui/list","vendor/klass","vendor/photoswipe","joshlib!vendor/underscore"],function(t,e,i,n){var o=t.extend({name:"imagegallery",initialize:function(e){this.photoswipe={getImageCaption:function(t){return t.title},minUserZoom:1},e.photoswipe&&n.extend(this.photoswipe,e.photoswipe),this.linkSelector=e.linkSelector||'a[href$=".jpg"],a[href$=".jpeg"],a[href$=".png"],a[href$=".gif"]',t.prototype.initialize.call(this,e)},enhance:function(){var e=this.$(this.linkSelector);e.length&&Code.PhotoSwipe.attach(e,this.photoswipe),t.prototype.enhance.call(this)}});return o}),define("joshfire-framework/adapters/phone/ui/toolbar",["joshlib!ui/list","joshlib!utils/dollar","joshlib!vendor/underscore"],function(t,e,i){var n=t.extend({tagName:"div",className:"joshfire-toolbar",initialize:function(e){this.maxOnScreen=e.maxOnScreen||5,this.margin=e.margin||5,this.currPage=0,this.useWindowWidth=e.useWindowWidth||!1,t.prototype.initialize.call(this,e)},enhance:function(){var n=this,o=function(){if(this.collection){this.$(".arrow").remove();var t,o;if(n.useWindowWidth)t=window.innerWidth;else{var s=this.el.getBoundingClientRect();t=s.width}if(this.collection.length<=this.maxOnScreen)this.$("ul").width(t),o=(t-this.margin)/this.collection.length,this.$("li").css({width:o-this.margin+"px","padding-left":this.margin+"px"});else{var r=Math.ceil(this.collection.length/(this.maxOnScreen-2));this.$("ul").css({width:r*t+"px"}),o=Math.round((t-this.margin)/this.maxOnScreen);
for(var a=this.$("li").css({width:o-this.margin+"px","padding-left":this.margin+"px"}),l=this.maxOnScreen-2;a.length>l;l+=this.maxOnScreen-2)a.length>l+1&&e(a[l]).after('<li class="arrow"><a class="next">next<span></span></a></li><li class="arrow"><a class="prev">prev<span></span></a></li>');this.$(".next").parent().css({width:o-this.margin+"px","padding-left":this.margin+"px"}),this.$(".prev").parent().css({width:o-this.margin+"px","padding-left":2*this.margin+"px"}),this.$(".next").bind("click",i.bind(function(t){var e=0,n=i.bind(this.iScroller.scrollTo,this.iScroller);return t.preventDefault(),this.currPage=Math.min(r,this.currPage+1),e+=-1*this.currPage*this.maxOnScreen*o,e+=-1*this.margin*this.currPage,n(e,0,200),!1},this)),this.$(".prev").bind("click",i.bind(function(t){var e=0,n=i.bind(this.iScroller.scrollTo,this.iScroller);return t.preventDefault(),this.currPage=Math.max(0,this.currPage-1),e+=-1*this.currPage*this.maxOnScreen*o,e+=-1*this.margin*this.currPage,n(e,0,200),!1},this))}}};o.call(this),t.prototype.enhance.call(this),window.addEventListener("resize",i.bind(o,this))}});return n}),define("joshfire-framework/ui/layout",["joshlib!uielement","joshlib!vendor/underscore","joshlib!utils/dollar","joshlib!utils/i18n"],function(t,e,i,n){var o=t.extend({rendering:!1,initialize:function(n){n.template?this.template=this.compileTemplate(n.template):n.templateEl&&(this.template=this.compileTemplate(i(n.templateEl).text())),n.customLoadEvent&&(this.wantsCustomLoadEvent=!0),this.customLoadEvent=!0,this.setChildren(n.children),this.on("shown",function(){e.each(this.children,function(t){t.trigger("shown")})},this),this.on("hidden",function(){e.each(this.children,function(t){t.trigger("hidden")})},this),t.prototype.initialize.call(this,n)},setChildren:function(t){this.children=t,this.numChildren=0,this.numChildrenLoaded=0,t&&e.each(t,function(t){++this.numChildren,t.on("load",function(){this.rendering?(++this.numChildrenLoaded,this.numChildrenLoaded===this.numChildren&&(this.rendering=!1,this.wantsCustomLoadEvent||this.trigger("load"))):this.wantsCustomLoadEvent||this.trigger("load")},this)},this)},getChild:function(t){return t?this.children[t]:void 0},generate:function(t){if(!this.children)return t(null,"");this.childrenOffsets={},this.numChildrenLoaded=0;var i=0,o="",s={};e.each(this.children,function(r,a){r.generate(e.bind(function(l,h){var c=r.wrapContent(h,a);if(this.childrenOffsets[a]=i,s[a]=c,o+=c,++i===this.numChildren){var u=null;if(this.template){var d={children:s,T:n.getText};e.extend(d,this.data),u=this.template(d)}else u=o;t(null,u)}},this))},this)},setContent:function(e){t.prototype.setContent.call(this,e),this.children&&this.el&&this.setChildrenElements(!0)},setElement:function(e,i){t.prototype.setElement.call(this,e,i),this.setChildrenElements(i)},setChildrenElements:function(){e.each(this.children,function(t,e){var n=i(this.el).find("*[data-joshfire-child="+e+"]")[0];t.setElement(n,!0)},this)},enhance:function(){this.rendering=!0,t.prototype.enhance.call(this),this.children&&this.el&&e.each(this.children,function(t){t.enhance()},this),(!this.children||0===this.children.length&&!this.wantsCustomLoadEvent)&&(this.rendering=!1,this.trigger("load"))}});return o}),define("joshfire-framework/ui/cardpanel",["joshlib!ui/layout","joshlib!vendor/underscore","joshlib!utils/i18n"],function(t,e,i){var n=t.extend({initialize:function(e){this.showChild(e.currentChild||e.defaultChildren),t.prototype.initialize.call(this,e)},showChild:function(t){this.currentChild!==t&&(this.canUseDOM&&this.transition(this.currentChild,t),this.currentChild=t)},showChildren:function(t){this.showChild(t)},transition:function(t,i){e.each(this.children,function(t,e){e!=i&&t.hide()}),i&&this.children[i].show()},setChildrenElements:function(){e.each(this.children,function(t,e){var i=this.el.getElementsByClassName("joshfire-wrapper")[0].childNodes[this.childrenOffsets[e]];t.setElement(i,!0)},this)},addChild:function(t,i){var n=this,o=this.children||{};this.el.parentNode&&(o[t]=i,this.setChildren(o),this.childrenOffsets=this.childrenOffsets||{},this.childrenOffsets[t]=this.childrenOffsets?e.size(this.childrenOffsets):0,i.generate(e.bind(function(t,e){var o=i.wrapContent(e);n.$(".joshfire-wrapper").append(o),n.setChildrenElements(),i.enhance()},this)))},generate:function(t){this.childrenOffsets={},this.numChildrenLoaded=0;var n=0,o="",s={},r=function(t){t=t||"";var n='<div class="joshfire-wrapper">'+t+"</div>",o=null;if(this.template){var r={childrenOuterHTML:n,childrenHTML:s,T:i.getText};e.extend(r,this.data),o=this.template(r)}else o=n;return o};if(!this.children||0===e.size(this.children)){var a=r(o);t(null,a)}e.each(this.children,function(i,a){i.generate(e.bind(function(e,l){var h=i.wrapContent(l);if(this.childrenOffsets[a]=n,s[a]=h,o+=h,++n===this.numChildren){var c=r(o);t(null,c)}},this))},this)},enhance:function(){t.prototype.enhance.call(this),this.$(".joshfire-wrapper").first().css({height:"100%"}),this.currentChild&&this.transition(null,this.currentChild),this.canUseDOM=!0}});return n}),define("joshfire-framework/ui/slidepanel",["joshlib!ui/cardpanel","joshlib!vendor/underscore","joshlib!utils/dollar"],function(t,e,i){var n=t.extend({initialize:function(e){this.cssTransition=e.cssTransition||".4s ease-in-out all",t.prototype.initialize.call(this,e)},showChild:function(e,i){this.transitionDirection=i||"none",t.prototype.showChild.call(this,e)},transition:function(n,o){if(!this.transitionDirection||"none"===this.transitionDirection)return t.prototype.transition.call(this,n,o),void 0;var s=this.children[o];if(s.hide(),i(s.el).css({position:"absolute",width:"100%",height:"100%",left:0,top:0}),n){var r=0,a=0,l=this.children[n],h=this.$el.width(),c=this.$el.height(),u={position:"absolute",width:"100%",height:"100%"};switch(this.transitionDirection){case"left":e.extend(u,{position:"absolute",width:"100%",height:"100%",left:"100%",top:0}),r="-"+h+"px",a=0;break;case"right":e.extend(u,{position:"absolute",width:"100%",height:"100%",left:"-100%",top:0}),r=h+"px",a=0;break;case"up":e.extend(u,{position:"absolute",width:"100%",height:"100%",left:0,top:"100%"}),r=0,a="-"+c+"px";break;case"down":e.extend(u,{position:"absolute",width:"100%",height:"100%",left:0,top:"-100%"}),r=0,a=c+"px"}i(l.el).css(u);var d="translate("+r+","+a+")";this.$(".joshfire-wrapper").first().css({"-webkit-transition":"none","-moz-transition":"none","-ms-transition":"none","-o-transition":"none",transition:"none","-webkit-transform":d,"-moz-transform":d,"-ms-transform":d,"-o-transform":d,transform:d})}e.each(this.children,e.bind(function(t,e){e===n||e===o?t.show():t.hide()},this)),setTimeout(e.bind(function(){this.$(".joshfire-wrapper").first().css({"-webkit-transition":this.cssTransition,"-moz-transition":this.cssTransition,"-ms-transition":this.cssTransition,"-o-transition":this.cssTransition,transition:this.cssTransition,"-webkit-transform":"translate(0,0)","-moz-transform":"translate(0,0)","-ms-transform":"translate(0,0)","-o-transform":"translate(0,0)",transform:"translate(0,0)"})},this),0)},enhance:function(){t.prototype.enhance.call(this),this.$(".joshfire-wrapper").first().css({position:"relative"})}});return n}),define("joshfire-framework/ui/fadeinpanel",["joshlib!ui/cardpanel","joshlib!vendor/underscore","joshlib!utils/dollar"],function(t,e,i){var n=t.extend({initialize:function(e){this.cssTransition=e.cssTransition||".4s ease-in-out all",t.prototype.initialize.call(this,e)},transition:function(t,n){var o=this.children[n];o.hide(),i(o.el).css({filter:"alpha(opacity=0)","-khtml-opacity":0,"-moz-opacity":0,"-ms-opacity":0,"-o-opacity":0,opacity:0,"-webkit-transition":"none","-moz-transition":"none","-ms-transition":"none","-o-transition":"none",transition:"none"}),e.each(this.children,e.bind(function(t){t.hide()},this)),o.show(),i(o.el).css({filter:"alpha(opacity=100)","-khtml-opacity":1,"-moz-opacity":1,"-ms-opacity":1,"-o-opacity":1,opacity:1,"-webkit-transition":"0.7s ease-in-out all","-moz-transition":"0.7s ease-in-out all","-ms-transition":"0.7s ease-in-out all","-o-transition":"0.7s ease-in-out all",transition:"0.7s ease-in-out all","-webkit-backface-visibility":"hidden"})}});return n}),define("joshfire-framework/ui/imageloader",["joshlib!ui/imagesloader","joshlib!vendor/underscore","joshlib!utils/i18n"],function(t,e,i){var n=t.extend({initialize:function(e){this.getImageUrl=e.getImageUrl||function(){return this.model?this.model.imageUrl:null};var i=this;e.getImages=function(){var t=null;return e.imageContainer&&(t=i.$(e.imageContainer)),t||(t=i.$el),[{el:t.get(0),url:i.getImageUrl()}]},t.prototype.initialize.call(this,e)},generate:function(t){if(!this.model)return t(null,""),void 0;var n={model:this.model,obj:this.model,item:this.model?this.model.toJSON():{},imageUrl:this.getImageUrl.call(this),T:i.getText};e.extend(n,this.data),t(null,this.template(n))}});return n}),define("sleek",["joshlib!collection","joshlib!ui/dynamiccontainer","joshlib!ui/item","joshlib!ui/list","joshlib!ui/cardpanel","joshlib!ui/fadeinpanel","joshlib!ui/factorymedia","joshlib!ui/imageloader","joshlib!ui/imagesloader","joshlib!router","joshlib!vendor/backbone","joshlib!vendor/underscore","joshlib!utils/dollar","joshlib!utils/i18n","lang/config","ui/imagegallery"],function(t,e,i,n,o,s,r,a,l,h,c,u,d,p,f,m){var g=function(){u.bindAll(this,"initialize","setColor","slugify")};return g.extend=c.View.extend,u.extend(g.prototype,c.Events),u.extend(g.prototype,{deviceFamily:"all",clientWidth:document.body.clientWidth,initialized:!1,loadedHookTriggered:!1,fastNavigateSelector:!1,convertItemType:function(t){var e=null;switch(t){case"Article/Status":e="status";break;case"NewsArticle":case"BlogPosting":case"Article":case"CreativeWork":e="news";break;case"Event":e="event";break;case"ImageObject":e="photo";break;case"VideoObject":e="video";break;case"MusicRecording":e="sound";break;case"Product":e="product";break;default:e="other"}return e},initialize:function(){var t=this;this.localizer=p,this.title=Joshfire.factory.config.app.name,this.tabs=Joshfire.factory.config.template.options.tabs||[],this.tabicons=Joshfire.factory.config.template.options.tabicons||[],this.backgroundURL=Joshfire.factory.config.template.options.backgroundimage?Joshfire.factory.config.template.options.backgroundimage.url:Joshfire.factory.config.template.options.backgroundurl,this.logoURL=Joshfire.factory.config.app.logo?Joshfire.factory.config.app.logo.contentURL:null,document.title=this.title,this.localizer.setLocale({locale:Joshfire.factory.config.template.options.language||"auto",availableLocales:f.AVAILABLE,defaultLocale:f.DEFAULT},function(){t.setMomentLanguage(),t.setColor(Joshfire.factory.config.template.options.color||"gray",function(){var e=t.getDatasources(),i=Array(e.length),n=0;u.forEach(e,u.bind(function(e,n){var o=this.tabs[n]||e.name||"",s=this.tabicons[n],r=n+"--"+this.slugify(o.toLowerCase()),a=this.createCollection(e),l=e.getOutputType();i[n]={name:o,slug:r,icon:s||t.convertItemType(l),outputType:t.convertItemType(l),collection:a,index:n}},t));var o=t.createViews(i),s=t.createRoutes(i,o);t.router=h(s),t.setupFastNavigate(),t.init(),t.initialized=!0;var n=function(){!t.loadedHookTriggered&&t.initialized&&(t.loadedHookTriggered=!0,Joshfire.factory.getAddOns("loaded").run())};o.bind("load",n),setTimeout(n,2e4),o.render(),t.router.historyStart()})})},createCollection:function(e){return new t([],{dataSource:e,dataSourceQuery:{}})},setupFastNavigate:function(){if(this.fastNavigateSelector){var t=this,e=function(e){var i=d(e.currentTarget).attr("href");return"#"==i.substring(0,1)?(t.router.navigate(i.substring(1),!0),e.preventDefault(),e.stopPropagation(),!1):void 0};d(this.fastNavigateSelector).live("touchstart mousedown",e)}},init:function(){},getDatasources:function(){var t=Joshfire.factory.getDataSource("main"),e=[];return t&&t.children&&t.children.length>0&&(e=e.concat(t.children)),e},setColor:function(t,e){d("#color").remove(),window.Sid.css("css/"+this.deviceFamily+"."+t+".css",e,"afterfirststyle")},setTitle:function(t){d("#title").html(t)},getClassName:function(t,e){if("list"!==e)return"single"===e?"single content detail":"content detail";switch(t){case"status":case"event":return"content hashed-list";case"photo":return"content mosaic-list";default:return"content simple-list"}},createToolbar:function(t){for(var e=new c.Collection,i=null,n=0;t.length>n;n++)i=t[n],e.add({name:i.name,icon:i.icon,linkURL:"#"+i.slug,outputType:i.outputType,slug:i.slug});var o=this.createToolbarElement();return o.setCollection(e),o.render(),o},createViews:function(t){var e={},n=null;return this.createAdditionalViews(e),t&&0!==t.length?(this.toolbarView=this.createToolbar(t),u.forEach(t,u.bind(function(t){var i=this.createSectionView(t);e[t.slug]=i},this)),n=new s({el:"#cards",children:e})):n=new i({el:"#cards",model:new c.Model,templateEl:"#template-nodata"})},createAdditionalViews:function(){},createToolbarElement:function(){return new n({el:"#toolbar",templateEl:"#template-toolbar",itemTemplateEl:"#toolbar-item"})},createSectionView:function(t){var i=new e({collection:t.collection,viewFactory:this.viewFactory(t)});return t.view=i,i},viewFactory:function(t){return u.bind(function(e){var i=e.collection;if("photo"===t.outputType)return this.createListElement(t);if(1===i.length)return this.createDetailContainer(t,!0);var n=this.createListElement(t),o=this.createDetailContainer(t),s=this.createListAndDetailView(n,o);return s},this)},createListAndDetailView:function(){},refreshList:function(t,e){t.collection.fetch({dataSourceQuery:{nocache:!0},success:u.bind(function(){this.showList(t,e)},this)})},updateList:function(t,e){t.collection.fetch({success:u.bind(function(){this.showList(t,e)},this)})},showList:function(t,e){e.view.children&&e.view.children.list?e.view.showChild("list","left"):t.collection.length&&(e.setModel(t.collection.at(0)),e.render())},moveToList:function(t){t.view.children&&t.view.children.list&&t.view.showChild("list","left")},updateDetail:function(t,e,i){t.collection.fetch({success:u.bind(function(){this.showDetail(t,e,i)},this)})},showDetail:function(t,e,i){if(e.view.children&&e.view.children.detail){var n=e.view.children.detail;t.collection.length>i&&(n.setModel(t.collection.at(i)),n.render()),e.view.showChild("detail","right")}},createListElement:function(t){if("photo"===t.outputType){var e=t.collection.length>1?"":"single",i=e?"#template-single-photo":"#template-list-view";return new m({templateEl:i,scroller:!0,itemFactory:this.itemFactory(t),collection:t.collection,className:e+" "+t.outputType+" "+this.getClassName(t.outputType,"list"),dataLoadingClass:"dataloading",loadingClass:"loading"})}return new n({templateEl:"#template-list-view",scroller:!0,itemFactory:this.itemFactory(t),collection:t.collection,className:t.outputType+" "+this.getClassName(t.outputType,"list")})},createDetailContainer:function(t,i){var n=this;return new e({viewFactory:function(e){return u.extend(e,{slug:t.slug}),n.createDetailElement(e,i)},className:n.getClassName(t,i?"single":"detail")})},createDetailElement:function(t){if(!t.model)return new i({});var e=this.convertItemType(t.model.get("@type")),n=this;switch(e){case"video":return new r({templateEl:"#template-"+e,scroller:!0,scrollerSelector:".wrapper",width:n.getContentWidth(),height:n.getContentHeight(),mediaOptions:{strategy:"html5",width:"100%",height:"80%",adjustSize:!0}});case"sound":return new r({templateEl:"#template-"+e,mediaOptions:{strategy:"html5"}});case"status":return new a({templateEl:"#template-"+e,scroller:!0,getImageUrl:function(){return n.getAuthorThumbnail(t.model.toJSON())}});case"photo":case"product":case"other":return new a({templateEl:"#template-"+e,scroller:!0,getImageUrl:function(){return n.getThumbnail(t.model.toJSON())}});default:return new l({templateEl:"#template-"+e,scroller:!0,imageClass:"fadein",processImageEl:function(t){var e=document.createElement("div");e.setAttribute("class","loader inv");var i=document.createElement("div");return i.setAttribute("class","figure"),i.appendChild(e),t.getAttribute("width")?i.setAttribute("style","width:"+t.getAttribute("width")+"px;max-width:100%"):i.setAttribute("style","width:"+t.getAttribute("width")+"px;max-width:100%"),t.parentNode.replaceChild(i,t),i.appendChild(t),i}})}},itemFactory:function(t){var e=this;return function(n,o){var s=n.toJSON(),r=t.outputType||e.convertItemType(s["@type"]),l="#template-"+r+"-item",h={data:{section:t},model:n,offset:o,templateEl:l};switch(r){case"photo":case"video":case"product":case"news":return h.getImageUrl=function(){return e.getThumbnail(s,o,.2)},h.imageContainer=".figure",new a(h);case"status":return h.getImageUrl=function(){return e.getAuthorThumbnail(s,o)},h.imageContainer=".figure",new a(h);default:return new i(h)}}},createRoutes:function(t){return{routes:{"":"home"},home:function(){t.length?window.location="#"+t[0].slug:(d("#title").html("No data"),document.body.id="nodata",d("#refresh").hide())}}},getContentWidth:function(){var t=d(".slide-panel").get(),e=u.max(t,function(t){return d(t).width()});return Math.floor(d(e).width())},getContentHeight:function(){var t=d(".slide-panel").get(),e=u.max(t,function(t){return d(t).height()});return d(e).height()},getThumbnail:function(t,e,i){if(!t)return"";i=i||.2;var n=this.clientWidth*i,o=0,s=0,r=t.thumbnail,a=null,l=null,h=null;if(r&&r.length>0){h=r[0],s=h.width||0;for(var c=0;r.length>c;c++)l=r[c],o=l.width||0,(o>=n&&(s>o||n>s)||n>s&&o>s)&&(h=r[c]);a=h.contentURL}return a||(t.image&&t.image.contentURL?a=t.image.contentURL:"ImageObject"===t["@type"]&&t.contentURL&&(a=t.contentURL)),a||(a=""),a},setMomentLanguage:function(){"en"!==this.localizer.getLocale()&&window.Sid.js("lang/moment/"+this.localizer.getLocale()+".js",u.bind(function(){moment.lang(this.localizer.getLocale())},this))},getAuthorThumbnail:function(t,e){if(!t)return"";var i="";return t.author&&t.author[0]&&(i=this.getThumbnail(t.author[0],e,.2)),i||(i=this.getThumbnail(t,e,.2)),i},slugify:function(t){return t=t.replace(/[^\-a-zA-Z0-9,&\s]+/gi,""),t=t.replace(/-/gi,"_"),t=t.replace(/\s/gi,"-"),t=t.replace(/&/gi,"-")}}),g}),define("sleek.custom",["sleek"],function(t){return t}),define("sleek.phone",["sleek.custom","joshlib!ui/toolbar","joshlib!ui/slidepanel","joshlib!utils/dollar","joshlib!vendor/underscore"],function(t,e,i,n,o){return t.extend({deviceFamily:"phone",fastNavigateSelector:"#container header a, #container #toolbar a",createToolbarElement:function(){return new e({el:"#toolbar",templateEl:"#template-toolbar",itemTemplateEl:"#toolbar-item",scroller:!0,scrollOptions:{vScroll:!1,hScrollbar:!1,snap:!0,bounce:!1,disabled:!0},useWindowWidth:!0})},createListAndDetailView:function(t,e){var n=new i({children:{list:t,detail:e},currentChild:"list",className:"slide-panel"});return n},createRoutes:function(e,i){var s=t.prototype.createRoutes.call(this,e,i),r=n("#title"),a=n("#toolbar"),l=n("#back"),h=n("#refresh"),c=this;return o.forEach(e,function(t){s.routes[t.slug]=t.slug,s[t.slug]=function(){r.html(t.name),document.body.id=t.outputType,n("iframe, audio, video, object, embed","#container").remove(),a.find(".active").removeClass("active"),a.find(".section-"+t.slug).addClass("active"),h.show().unbind("touchstart mousedown").bind("touchstart mousedown",o.bind(function(i){return c.refreshList(t,e),i.preventDefault(),!1},this)),l.hide();var e=i.children[t.slug];t.collection.length?(c.moveToList(e),i.showChild(t.slug)):(i.showChild(t.slug),c.updateList(t,e))},"photo"!==t.outputType&&(s.routes[t.slug+"/:offset"]=t.slug+"Detail",s[t.slug+"Detail"]=function(e){e=parseInt(e,10),r.html(t.name),document.body.id=t.outputType,n("iframe, audio, video, object, embed","#container").remove(),a.find(".active").removeClass("active"),a.find(".section-"+t.slug).addClass("active"),h.hide(),l.attr("href","#"+t.slug),l.css({display:"block"});var o=i.children[t.slug];i.showChild(t.slug),t.collection.length?c.showDetail(t,o,e):c.updateDetail(t,o,e)})}),s}})}),define("app.phone",["sleek.phone","joshlib!utils/onready"],function(t,e){var i=new t;e(i.initialize)});