Skip to content

Instantly share code, notes, and snippets.

@irudoy
Created February 26, 2016 07:04
Show Gist options
  • Save irudoy/d350725588c5e4066efc to your computer and use it in GitHub Desktop.
Save irudoy/d350725588c5e4066efc to your computer and use it in GitHub Desktop.
Fotorama 4.6.4 UMD
/*!
* Fotorama 4.6.4 | http://fotorama.io/license/
*/
fotoramaVersion="4.6.4",function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){function b(b){var c="bez_"+a.makeArray(arguments).join("_").replace(".","p");if("function"!=typeof a.easing[c]){var d=function(a,b){var c=[null,null],d=[null,null],e=[null,null],f=function(f,g){return e[g]=3*a[g],d[g]=3*(b[g]-a[g])-e[g],c[g]=1-e[g]-d[g],f*(e[g]+f*(d[g]+f*c[g]))},g=function(a){return e[0]+a*(2*d[0]+3*c[0]*a)},h=function(a){for(var b,c=a,d=0;++d<14&&(b=f(c,0)-a,!(Math.abs(b)<.001));)c-=b/g(c);return c};return function(a){return f(h(a),1)}};a.easing[c]=function(a,c,e,f,g){return f*d([b[0],b[1]],[b[2],b[3]])(c/g)+e}}return c}function c(){}function d(a,b,c){return Math.max(isNaN(b)?-(1/0):b,Math.min(isNaN(c)?1/0:c,a))}function e(a){return a.match(/ma/)&&a.match(/-?\d+(?!d)/g)[a.match(/3d/)?12:4]}function f(a){return Eb?+e(a.css("transform")):+a.css("left").replace("px","")}function g(a){var b={};return Eb?b.transform="translate3d("+a+"px,0,0)":b.left=a,b}function h(a){return{"transition-duration":a+"ms"}}function i(a,b){return isNaN(a)?b:a}function j(a,b){return i(+String(a).replace(b||"px",""))}function k(a){return/%$/.test(a)?j(a,"%"):void 0}function l(a,b){return i(k(a)/100*b,j(a))}function m(a){return(!isNaN(j(a))||!isNaN(j(a,"%")))&&a}function n(a,b,c,d){return(a-(d||0))*(b+(c||0))}function o(a,b,c,d){return-Math.round(a/(b+(c||0))-(d||0))}function p(a){var b=a.data();if(!b.tEnd){var c=a[0],d={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",msTransition:"MSTransitionEnd",transition:"transitionend"};P(c,d[qb.prefixed("transition")],function(a){b.tProp&&a.propertyName.match(b.tProp)&&b.onEndFn()}),b.tEnd=!0}}function q(a,b,c,d){var e,f=a.data();f&&(f.onEndFn=function(){e||(e=!0,clearTimeout(f.tT),c())},f.tProp=b,clearTimeout(f.tT),f.tT=setTimeout(function(){f.onEndFn()},1.5*d),p(a))}function r(a,b){if(a.length){var d=a.data();Eb?(a.css(h(0)),d.onEndFn=c,clearTimeout(d.tT)):a.stop();var e=s(b,function(){return f(a)});return a.css(g(e)),e}}function s(){for(var a,b=0,c=arguments.length;c>b&&(a=b?arguments[b]():arguments[b],"number"!=typeof a);b++);return a}function t(a,b){return Math.round(a+(b-a)/1.5)}function u(){return u.p=u.p||("https:"===location.protocol?"https://":"http://"),u.p}function v(a){var b=document.createElement("a");return b.href=a,b}function w(a,b){if("string"!=typeof a)return a;a=v(a);var c,d;if(a.host.match(/youtube\.com/)&&a.search){if(c=a.search.split("v=")[1]){var e=c.indexOf("&");-1!==e&&(c=c.substring(0,e)),d="youtube"}}else a.host.match(/youtube\.com|youtu\.be/)?(c=a.pathname.replace(/^\/(embed\/|v\/)?/,"").replace(/\/.*/,""),d="youtube"):a.host.match(/vimeo\.com/)&&(d="vimeo",c=a.pathname.replace(/^\/(video\/)?/,"").replace(/\/.*/,""));return c&&d||!b||(c=a.href,d="custom"),c?{id:c,type:d,s:a.search.replace(/^\?/,""),p:u()}:!1}function x(b,c,d){var e,f,g=b.video;return"youtube"===g.type?(f=u()+"img.youtube.com/vi/"+g.id+"/default.jpg",e=f.replace(/\/default.jpg$/,"/hqdefault.jpg"),b.thumbsReady=!0):"vimeo"===g.type?a.ajax({url:u()+"vimeo.com/api/v2/video/"+g.id+".json",dataType:"jsonp",success:function(a){b.thumbsReady=!0,y(c,{img:a[0].thumbnail_large,thumb:a[0].thumbnail_small},b.i,d)}}):b.thumbsReady=!0,{img:e,thumb:f}}function y(b,c,d,e){for(var f=0,g=b.length;g>f;f++){var h=b[f];if(h.i===d&&h.thumbsReady){var i={videoReady:!0};i[Tb]=i[Vb]=i[Ub]=!1,e.splice(f,1,a.extend({},h,i,c));break}}}function z(b){function c(b,c,e){var f=b.children("img").eq(0),g=b.attr("href"),h=b.attr("src"),i=f.attr("src"),j=c.video,k=e?w(g,j===!0):!1;k?g=!1:k=j,d(b,f,a.extend(c,{video:k,img:c.img||g||h||i,thumb:c.thumb||i||h||g}))}function d(b,c,d){var e=d.thumb&&d.img!==d.thumb,f=j(d.width||b.attr("width")),g=j(d.height||b.attr("height"));a.extend(d,{width:f,height:g,thumbratio:O(d.thumbratio||j(d.thumbwidth||c&&c.attr("width")||e||f)/j(d.thumbheight||c&&c.attr("height")||e||g))})}var e=[];return b.children().each(function(){var b=a(this),f=N(a.extend(b.data(),{id:b.attr("id")}));if(b.is("a, img"))c(b,f,!0);else{if(b.is(":empty"))return;d(b,null,a.extend(f,{html:this,_html:b.html()}))}e.push(f)}),e}function A(a){return 0===a.offsetWidth&&0===a.offsetHeight}function B(b){return!a.contains(document.documentElement,b)}function C(a,b,c,d){return C.i||(C.i=1,C.ii=[!0]),d=d||C.i,"undefined"==typeof C.ii[d]&&(C.ii[d]=!0),a()?b():C.ii[d]&&setTimeout(function(){C.ii[d]&&C(a,b,c,d)},c||100),C.i++}function D(a){location.replace(location.protocol+"//"+location.host+location.pathname.replace(/^\/?/,"/")+location.search+"#"+a)}function E(a,b,c,e){var f=a.data(),g=f.measures;if(g&&(!f.l||f.l.W!==g.width||f.l.H!==g.height||f.l.r!==g.ratio||f.l.w!==b.w||f.l.h!==b.h||f.l.m!==c||f.l.p!==e)){var h=g.width,i=g.height,j=b.w/b.h,k=g.ratio>=j,m="scaledown"===c,n="contain"===c,o="cover"===c,p=W(e);k&&(m||n)||!k&&o?(h=d(b.w,0,m?h:1/0),i=h/g.ratio):(k&&o||!k&&(m||n))&&(i=d(b.h,0,m?i:1/0),h=i*g.ratio),a.css({width:h,height:i,left:l(p.x,b.w-h),top:l(p.y,b.h-i)}),f.l={W:g.width,H:g.height,r:g.ratio,w:b.w,h:b.h,m:c,p:e}}return!0}function F(a,b){var c=a[0];c.styleSheet?c.styleSheet.cssText=b:a.html(b)}function G(a,b,c){return b===c?!1:b>=a?"left":a>=c?"right":"left right"}function H(a,b,c,d){if(!c)return!1;if(!isNaN(a))return a-(d?0:1);for(var e,f=0,g=b.length;g>f;f++){var h=b[f];if(h.id===a){e=f;break}}return e}function I(b,d,e){e=e||{},b.each(function(){var b,f=a(this),g=f.data();g.clickOn||(g.clickOn=!0,a.extend($(f,{onStart:function(a){b=a,(e.onStart||c).call(this,a)},onMove:e.onMove||c,onTouchEnd:e.onTouchEnd||c,onEnd:function(a){a.moved||d.call(this,b)}}),{noMove:!0}))})}function J(a,b){return'<div class="'+a+'">'+(b||"")+"</div>"}function K(a){for(var b=a.length;b;){var c=Math.floor(Math.random()*b--),d=a[b];a[b]=a[c],a[c]=d}return a}function L(b){return"[object Array]"==Object.prototype.toString.call(b)&&a.map(b,function(b){return a.extend({},b)})}function M(a,b,c){a.scrollLeft(b||0).scrollTop(c||0)}function N(b){if(b){var c={};return a.each(b,function(a,b){c[a.toLowerCase()]=b}),c}}function O(a){if(a){var b=+a;return isNaN(b)?(b=a.split("/"),+b[0]/+b[1]||void 0):b}}function P(a,b,c,d){b&&(a.addEventListener?a.addEventListener(b,c,!!d):a.attachEvent("on"+b,c))}function Q(a){return!!a.getAttribute("disabled")}function R(a){return{tabindex:-1*a+"",disabled:a}}function S(a,b){P(a,"keyup",function(c){Q(a)||13==c.keyCode&&b.call(a,c)})}function T(a,b){P(a,"focus",a.onfocusin=function(c){b.call(a,c)},!0)}function U(a,b){a.preventDefault?a.preventDefault():a.returnValue=!1,b&&a.stopPropagation&&a.stopPropagation()}function V(a){return a?">":"<"}function W(a){return a=(a+"").split(/\s+/),{x:m(a[0])||Zb,y:m(a[1])||Zb}}function X(b,d){var e=b.data(),f=Math.round(d.pos),i=function(){e.sliding=!1,(d.onEnd||c)()};"undefined"!=typeof d.overPos&&d.overPos!==d.pos&&(f=d.overPos,i=function(){X(b,a.extend({},d,{overPos:d.pos,time:Math.max(Mb,d.time/2)}))});var j=a.extend(g(f),d.width&&{width:d.width});e.sliding=!0,Eb?(b.css(a.extend(h(d.time),j)),d.time>10?q(b,"transform",i,d.time):i()):b.stop().animate(j,d.time,Xb,i)}function Y(b,d,e,f,g,h){var i="undefined"!=typeof h;if(i||(g.push(arguments),Array.prototype.push.call(arguments,g.length),!(g.length>1))){b=b||a(b),d=d||a(d);var j=b[0],k=d[0],l="crossfade"===f.method,m=function(){if(!m.done){m.done=!0;var a=(i||g.shift())&&g.shift();a&&Y.apply(this,a),(f.onEnd||c)(!!a)}},n=f.time/(h||1);e.removeClass(Na+" "+Ma),b.stop().addClass(Na),d.stop().addClass(Ma),l&&k&&b.fadeTo(0,0),b.fadeTo(l?n:0,1,l&&m),d.fadeTo(n,0,m),j&&l||k||m()}}function Z(b){var c=(b.touches||[])[0]||b;b._x=c.pageX,b._y=c.clientY,b._now=a.now()}function $(b,d){function e(b){return l=a(b.target),t.checked=o=p=r=!1,j||t.flow||b.touches&&b.touches.length>1||b.which>1||ac&&ac.type!==b.type&&cc||(o=d.select&&l.is(d.select,s))?o:(n="touchstart"===b.type,p=l.is("a, a *",s),m=t.control,q=t.noMove||t.noSwipe||m?16:t.snap?0:4,Z(b),k=ac=b,bc=b.type.replace(/down|start/,"move").replace(/Down/,"Move"),(d.onStart||c).call(s,b,{control:m,$target:l}),j=t.flow=!0,void(n&&!t.go||U(b)))}function f(a){if(a.touches&&a.touches.length>1||Jb&&!a.isPrimary||bc!==a.type||!j)return j&&g(),void(d.onTouchEnd||c)();Z(a);var b=Math.abs(a._x-k._x),e=Math.abs(a._y-k._y),f=b-e,h=(t.go||t.x||f>=0)&&!t.noSwipe,i=0>f;n&&!t.checked?(j=h)&&U(a):(U(a),(d.onMove||c).call(s,a,{touch:n})),!r&&Math.sqrt(Math.pow(b,2)+Math.pow(e,2))>q&&(r=!0),t.checked=t.checked||h||i}function g(a){(d.onTouchEnd||c)();var b=j;t.control=j=!1,b&&(t.flow=!1),!b||p&&!t.checked||(a&&U(a),cc=!0,clearTimeout(dc),dc=setTimeout(function(){cc=!1},1e3),(d.onEnd||c).call(s,{moved:r,$target:l,control:m,touch:n,startEvent:k,aborted:!a||"MSPointerCancel"===a.type}))}function h(){t.flow||setTimeout(function(){t.flow=!0},10)}function i(){t.flow&&setTimeout(function(){t.flow=!1},Lb)}var j,k,l,m,n,o,p,q,r,s=b[0],t={};return Jb?(P(s,"MSPointerDown",e),P(document,"MSPointerMove",f),P(document,"MSPointerCancel",g),P(document,"MSPointerUp",g)):(P(s,"touchstart",e),P(s,"touchmove",f),P(s,"touchend",g),P(document,"touchstart",h),P(document,"touchend",i),P(document,"touchcancel",i),Ab.on("scroll",i),b.on("mousedown",e),Bb.on("mousemove",f).on("mouseup",g)),b.on("click","a",function(a){t.checked&&U(a)}),t}function _(b,e){function f(a,d){A=!0,k=l=a._x,q=a._now,p=[[q,k]],m=n=D.noMove||d?0:r(b,(e.getPos||c)()),(e.onStart||c).call(B,a)}function h(a,b){u=D.min,v=D.max,w=D.snap,x=a.altKey,A=z=!1,y=b.control,y||C.sliding||f(a)}function i(a,d){D.noSwipe||(A||f(a),l=a._x,p.push([a._now,l]),n=m-(k-l),o=G(n,u,v),u>=n?n=t(n,u):n>=v&&(n=t(n,v)),D.noMove||(b.css(g(n)),z||(z=!0,d.touch||Jb||b.addClass(ab)),(e.onMove||c).call(B,a,{pos:n,edge:o})))}function j(g){if(!D.noSwipe||!g.moved){A||f(g.startEvent,!0),g.touch||Jb||b.removeClass(ab),s=a.now();for(var h,i,j,k,o,q,r,t,y,z=s-Lb,C=null,E=Mb,F=e.friction,G=p.length-1;G>=0;G--){if(h=p[G][0],i=Math.abs(h-z),null===C||j>i)C=h,k=p[G][1];else if(C===z||i>j)break;j=i}r=d(n,u,v);var H=k-l,I=H>=0,J=s-C,K=J>Lb,L=!K&&n!==m&&r===n;w&&(r=d(Math[L?I?"floor":"ceil":"round"](n/w)*w,u,v),u=v=r),L&&(w||r===n)&&(y=-(H/J),E*=d(Math.abs(y),e.timeLow,e.timeHigh),o=Math.round(n+y*E/F),w||(r=o),(!I&&o>v||I&&u>o)&&(q=I?u:v,t=o-q,w||(r=q),t=d(r+.03*t,q-50,q+50),E=Math.abs((n-t)/(y/F)))),E*=x?10:1,(e.onEnd||c).call(B,a.extend(g,{moved:g.moved||K&&w,pos:n,newPos:r,overPos:t,time:E}))}}var k,l,m,n,o,p,q,s,u,v,w,x,y,z,A,B=b[0],C=b.data(),D={};return D=a.extend($(e.$wrap,a.extend({},e,{onStart:h,onMove:i,onEnd:j})),D)}function aa(b,d){var e,f,g,h=b[0],i={prevent:{}};return P(h,Kb,function(b){var h=b.wheelDeltaY||-1*b.deltaY||0,j=b.wheelDeltaX||-1*b.deltaX||0,k=Math.abs(j)&&!Math.abs(h),l=V(0>j),m=f===l,n=a.now(),o=Lb>n-g;f=l,g=n,k&&i.ok&&(!i.prevent[l]||e)&&(U(b,!0),e&&m&&o||(d.shift&&(e=!0,clearTimeout(i.t),i.t=setTimeout(function(){e=!1},Nb)),(d.onEnd||c)(b,d.shift?l:j)))}),i}function ba(){a.each(a.Fotorama.instances,function(a,b){b.index=a})}function ca(b){a.Fotorama.instances.push(b),ba()}function da(b){a.Fotorama.instances.splice(b.index,1),ba()}var ea="fotorama",fa="fullscreen",ga=ea+"__wrap",ha=ga+"--css2",ia=ga+"--css3",ja=ga+"--video",ka=ga+"--fade",la=ga+"--slide",ma=ga+"--no-controls",na=ga+"--no-shadows",oa=ga+"--pan-y",pa=ga+"--rtl",qa=ga+"--only-active",ra=ga+"--no-captions",sa=ga+"--toggle-arrows",ta=ea+"__stage",ua=ta+"__frame",va=ua+"--video",wa=ta+"__shaft",xa=ea+"__grab",ya=ea+"__pointer",za=ea+"__arr",Aa=za+"--disabled",Ba=za+"--prev",Ca=za+"--next",Da=ea+"__nav",Ea=Da+"-wrap",Fa=Da+"__shaft",Ga=Da+"--dots",Ha=Da+"--thumbs",Ia=Da+"__frame",Ja=Ia+"--dot",Ka=Ia+"--thumb",La=ea+"__fade",Ma=La+"-front",Na=La+"-rear",Oa=ea+"__shadow",Pa=Oa+"s",Qa=Pa+"--left",Ra=Pa+"--right",Sa=ea+"__active",Ta=ea+"__select",Ua=ea+"--hidden",Va=ea+"--fullscreen",Wa=ea+"__fullscreen-icon",Xa=ea+"__error",Ya=ea+"__loading",Za=ea+"__loaded",$a=Za+"--full",_a=Za+"--img",ab=ea+"__grabbing",bb=ea+"__img",cb=bb+"--full",db=ea+"__dot",eb=ea+"__thumb",fb=eb+"-border",gb=ea+"__html",hb=ea+"__video",ib=hb+"-play",jb=hb+"-close",kb=ea+"__caption",lb=ea+"__caption__wrap",mb=ea+"__spinner",nb='" tabindex="0" role="button',ob=a&&a.fn.jquery.split(".");if(!ob||ob[0]<1||1==ob[0]&&ob[1]<8)throw"Fotorama requires jQuery 1.8 or later and will not run without it.";var pb={},qb=function(a,b,c){function d(a){r.cssText=a}function e(a,b){return typeof a===b}function f(a,b){return!!~(""+a).indexOf(b)}function g(a,b){for(var d in a){var e=a[d];if(!f(e,"-")&&r[e]!==c)return"pfx"==b?e:!0}return!1}function h(a,b,d){for(var f in a){var g=b[a[f]];if(g!==c)return d===!1?a[f]:e(g,"function")?g.bind(d||b):g}return!1}function i(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),f=(a+" "+u.join(d+" ")+d).split(" ");return e(b,"string")||e(b,"undefined")?g(f,b):(f=(a+" "+v.join(d+" ")+d).split(" "),h(f,b,c))}var j,k,l,m="2.6.2",n={},o=b.documentElement,p="modernizr",q=b.createElement(p),r=q.style,s=({}.toString," -webkit- -moz- -o- -ms- ".split(" ")),t="Webkit Moz O ms",u=t.split(" "),v=t.toLowerCase().split(" "),w={},x=[],y=x.slice,z=function(a,c,d,e){var f,g,h,i,j=b.createElement("div"),k=b.body,l=k||b.createElement("body");if(parseInt(d,10))for(;d--;)h=b.createElement("div"),h.id=e?e[d]:p+(d+1),j.appendChild(h);return f=["&#173;",'<style id="s',p,'">',a,"</style>"].join(""),j.id=p,(k?j:l).innerHTML+=f,l.appendChild(j),k||(l.style.background="",l.style.overflow="hidden",i=o.style.overflow,o.style.overflow="hidden",o.appendChild(l)),g=c(j,a),k?j.parentNode.removeChild(j):(l.parentNode.removeChild(l),o.style.overflow=i),!!g},A={}.hasOwnProperty;l=e(A,"undefined")||e(A.call,"undefined")?function(a,b){return b in a&&e(a.constructor.prototype[b],"undefined")}:function(a,b){return A.call(a,b)},Function.prototype.bind||(Function.prototype.bind=function(a){var b=this;if("function"!=typeof b)throw new TypeError;var c=y.call(arguments,1),d=function(){if(this instanceof d){var e=function(){};e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(y.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(y.call(arguments)))};return d}),w.csstransforms3d=function(){var a=!!i("perspective");return a};for(var B in w)l(w,B)&&(k=B.toLowerCase(),n[k]=w[B](),x.push((n[k]?"":"no-")+k));return n.addTest=function(a,b){if("object"==typeof a)for(var d in a)l(a,d)&&n.addTest(d,a[d]);else{if(a=a.toLowerCase(),n[a]!==c)return n;b="function"==typeof b?b():b,"undefined"!=typeof enableClasses&&enableClasses&&(o.className+=" "+(b?"":"no-")+a),n[a]=b}return n},d(""),q=j=null,n._version=m,n._prefixes=s,n._domPrefixes=v,n._cssomPrefixes=u,n.testProp=function(a){return g([a])},n.testAllProps=i,n.testStyles=z,n.prefixed=function(a,b,c){return b?i(a,b,c):i(a,"pfx")},n}(window,document),rb={ok:!1,is:function(){return!1},request:function(){},cancel:function(){},event:"",prefix:""},sb="webkit moz o ms khtml".split(" ");if("undefined"!=typeof document.cancelFullScreen)rb.ok=!0;else for(var tb=0,ub=sb.length;ub>tb;tb++)if(rb.prefix=sb[tb],"undefined"!=typeof document[rb.prefix+"CancelFullScreen"]){rb.ok=!0;break}rb.ok&&(rb.event=rb.prefix+"fullscreenchange",rb.is=function(){switch(this.prefix){case"":return document.fullScreen;case"webkit":return document.webkitIsFullScreen;default:return document[this.prefix+"FullScreen"]}},rb.request=function(a){return""===this.prefix?a.requestFullScreen():a[this.prefix+"RequestFullScreen"]()},rb.cancel=function(a){return""===this.prefix?document.cancelFullScreen():document[this.prefix+"CancelFullScreen"]()});var vb,wb={lines:12,length:5,width:2,radius:7,corners:1,rotate:15,color:"rgba(128, 128, 128, .75)",hwaccel:!0},xb={top:"auto",left:"auto",className:""};!function(a,b){vb=b()}(this,function(){"use strict";function a(a,b){var c,d=document.createElement(a||"div");for(c in b)d[c]=b[c];return d}function b(a){for(var b=1,c=arguments.length;c>b;b++)a.appendChild(arguments[b]);return a}function c(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-"),f=.01+c/d*100,g=Math.max(1-(1-a)/b*(100-f),a),h=k.substring(0,k.indexOf("Animation")).toLowerCase(),i=h&&"-"+h+"-"||"";return m[e]||(n.insertRule("@"+i+"keyframes "+e+"{0%{opacity:"+g+"}"+f+"%{opacity:"+a+"}"+(f+.01)+"%{opacity:1}"+(f+b)%100+"%{opacity:"+a+"}100%{opacity:"+g+"}}",n.cssRules.length),m[e]=1),e}function d(a,b){var c,d,e=a.style;for(b=b.charAt(0).toUpperCase()+b.slice(1),d=0;d<l.length;d++)if(c=l[d]+b,void 0!==e[c])return c;return void 0!==e[b]?b:void 0}function e(a,b){for(var c in b)a.style[d(a,c)||c]=b[c];return a}function f(a){for(var b=1;b<arguments.length;b++){var c=arguments[b];for(var d in c)void 0===a[d]&&(a[d]=c[d])}return a}function g(a){for(var b={x:a.offsetLeft,y:a.offsetTop};a=a.offsetParent;)b.x+=a.offsetLeft,b.y+=a.offsetTop;return b}function h(a,b){return"string"==typeof a?a:a[b%a.length]}function i(a){return"undefined"==typeof this?new i(a):void(this.opts=f(a||{},i.defaults,o))}function j(){function c(b,c){return a("<"+b+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',c)}n.addRule(".spin-vml","behavior:url(#default#VML)"),i.prototype.lines=function(a,d){function f(){return e(c("group",{coordsize:k+" "+k,coordorigin:-j+" "+-j}),{width:k,height:k})}function g(a,g,i){b(m,b(e(f(),{rotation:360/d.lines*a+"deg",left:~~g}),b(e(c("roundrect",{arcsize:d.corners}),{width:j,height:d.width,left:d.radius,top:-d.width>>1,filter:i}),c("fill",{color:h(d.color,a),opacity:d.opacity}),c("stroke",{opacity:0}))))}var i,j=d.length+d.width,k=2*j,l=2*-(d.width+d.length)+"px",m=e(f(),{position:"absolute",top:l,left:l});if(d.shadow)for(i=1;i<=d.lines;i++)g(i,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(i=1;i<=d.lines;i++)g(i);return b(a,m)},i.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d<e.childNodes.length&&(e=e.childNodes[b+d],e=e&&e.firstChild,e=e&&e.firstChild,e&&(e.opacity=c))}}var k,l=["webkit","Moz","ms","O"],m={},n=function(){var c=a("style",{type:"text/css"});return b(document.getElementsByTagName("head")[0],c),c.sheet||c.styleSheet}(),o={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"auto",left:"auto",position:"relative"};i.defaults={},f(i.prototype,{spin:function(b){this.stop();var c,d,f=this,h=f.opts,i=f.el=e(a(0,{className:h.className}),{position:h.position,width:0,zIndex:h.zIndex}),j=h.radius+h.length+h.width;if(b&&(b.insertBefore(i,b.firstChild||null),d=g(b),c=g(i),e(i,{left:("auto"==h.left?d.x-c.x+(b.offsetWidth>>1):parseInt(h.left,10)+j)+"px",top:("auto"==h.top?d.y-c.y+(b.offsetHeight>>1):parseInt(h.top,10)+j)+"px"})),i.setAttribute("role","progressbar"),f.lines(i,f.opts),!k){var l,m=0,n=(h.lines-1)*(1-h.direction)/2,o=h.fps,p=o/h.speed,q=(1-h.opacity)/(p*h.trail/100),r=p/h.lines;!function s(){m++;for(var a=0;a<h.lines;a++)l=Math.max(1-(m+(h.lines-a)*r)%p*q,h.opacity),f.opacity(i,a*h.direction+n,l,h);f.timeout=f.el&&setTimeout(s,~~(1e3/o))}()}return f},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=void 0),this},lines:function(d,f){function g(b,c){return e(a(),{position:"absolute",width:f.length+f.width+"px",height:f.width+"px",background:b,boxShadow:c,transformOrigin:"left",transform:"rotate("+~~(360/f.lines*j+f.rotate)+"deg) translate("+f.radius+"px,0)",borderRadius:(f.corners*f.width>>1)+"px"})}for(var i,j=0,l=(f.lines-1)*(1-f.direction)/2;j<f.lines;j++)i=e(a(),{position:"absolute",top:1+~(f.width/2)+"px",transform:f.hwaccel?"translate3d(0,0,0)":"",opacity:f.opacity,animation:k&&c(f.opacity,f.trail,l+j*f.direction,f.lines)+" "+1/f.speed+"s linear infinite"}),f.shadow&&b(i,e(g("#000","0 0 4px #000"),{top:"2px"})),b(d,b(i,g(h(f.color,j),"0 0 1px rgba(0,0,0,.1)")));return d},opacity:function(a,b,c){b<a.childNodes.length&&(a.childNodes[b].style.opacity=c)}});var p=e(a("group"),{behavior:"url(#default#VML)"});return!d(p,"transform")&&p.adj?j():k=d(p,"animation"),i});var yb,zb,Ab=a(window),Bb=a(document),Cb="quirks"===location.hash.replace("#",""),Db=qb.csstransforms3d,Eb=Db&&!Cb,Fb=Db||"CSS1Compat"===document.compatMode,Gb=rb.ok,Hb=navigator.userAgent.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i),Ib=!Eb||Hb,Jb=navigator.msPointerEnabled,Kb="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",Lb=250,Mb=300,Nb=1400,Ob=5e3,Pb=2,Qb=64,Rb=500,Sb=333,Tb="$stageFrame",Ub="$navDotFrame",Vb="$navThumbFrame",Wb="auto",Xb=b([.1,0,.25,1]),Yb=99999,Zb="50%",$b={width:null,minwidth:null,maxwidth:"100%",height:null,minheight:null,maxheight:null,ratio:null,margin:Pb,glimpse:0,fit:"contain",position:Zb,thumbposition:Zb,nav:"dots",navposition:"bottom",navwidth:null,thumbwidth:Qb,thumbheight:Qb,thumbmargin:Pb,thumbborderwidth:Pb,thumbfit:"cover",allowfullscreen:!1,transition:"slide",clicktransition:null,transitionduration:Mb,captions:!0,hash:!1,startindex:0,loop:!1,autoplay:!1,stopautoplayontouch:!0,keyboard:!1,arrows:!0,click:!0,swipe:!0,trackpad:!1,enableifsingleframe:!1,controlsonstart:!0,shuffle:!1,direction:"ltr",shadows:!0,spinner:null},_b={left:!0,right:!0,down:!1,up:!1,space:!1,home:!1,end:!1};C.stop=function(a){C.ii[a]=!1};var ac,bc,cc,dc;jQuery.Fotorama=function(b,c){function e(){a.each(wc,function(a,b){if(!b.i){b.i=kd++;var c=w(b.video,!0);if(c){var d={};b.video=c,b.img||b.thumb?b.thumbsReady=!0:d=x(b,wc,gd),y(wc,{img:d.img,thumb:d.thumb},b.i,gd)}}})}function f(a){return Xc[a]||gd.fullScreen}function i(a){var b="keydown."+ea,d=ea+hd,e="keydown."+d,g="resize."+d+" orientationchange."+d;a?(Bb.on(e,function(a){var b,d;Ac&&27===a.keyCode?(b=!0,kc(Ac,!0,!0)):(gd.fullScreen||c.keyboard&&!gd.index)&&(27===a.keyCode?(b=!0,gd.cancelFullScreen()):a.shiftKey&&32===a.keyCode&&f("space")||37===a.keyCode&&f("left")||38===a.keyCode&&f("up")?d="<":32===a.keyCode&&f("space")||39===a.keyCode&&f("right")||40===a.keyCode&&f("down")?d=">":36===a.keyCode&&f("home")?d="<<":35===a.keyCode&&f("end")&&(d=">>")),(b||d)&&U(a),d&&gd.show({index:d,slow:a.altKey,user:!0})}),gd.index||Bb.off(b).on(b,"textarea, input, select",function(a){!zb.hasClass(fa)&&a.stopPropagation()}),Ab.on(g,gd.resize)):(Bb.off(e),Ab.off(g))}function k(a){a!==k.f&&(a?(b.html("").addClass(ea+" "+id).append(od).before(md).before(nd),ca(gd)):(od.detach(),md.detach(),nd.detach(),b.html(ld.urtext).removeClass(id),da(gd)),i(a),k.f=a)}function p(){wc=gd.data=wc||L(c.data)||z(b),xc=gd.size=wc.length,!vc.ok&&c.shuffle&&K(wc),e(),Hd=A(Hd),xc&&k(!0)}function q(){var a=2>xc&&!c.enableifsingleframe||Ac;Kd.noMove=a||Qc,Kd.noSwipe=a||!c.swipe,!Uc&&qd.toggleClass(xa,!c.click&&!Kd.noMove&&!Kd.noSwipe),Jb&&od.toggleClass(oa,!Kd.noSwipe)}function t(a){a===!0&&(a=""),c.autoplay=Math.max(+a||Ob,1.5*Tc)}function u(){function b(a,b){d[a?"add":"remove"].push(b)}gd.options=c=N(c),Qc="crossfade"===c.transition||"dissolve"===c.transition,Kc=c.loop&&(xc>2||Qc&&(!Uc||"slide"!==Uc)),Tc=+c.transitionduration||Mb,Wc="rtl"===c.direction,Xc=a.extend({},c.keyboard&&_b,c.keyboard);var d={add:[],remove:[]};xc>1||c.enableifsingleframe?(Lc=c.nav,Nc="top"===c.navposition,d.remove.push(Ta),ud.toggle(!!c.arrows)):(Lc=!1,ud.hide()),ab(),zc=new vb(a.extend(wb,c.spinner,xb,{direction:Wc?-1:1})),Hb(),Kb(),c.autoplay&&t(c.autoplay),Rc=j(c.thumbwidth)||Qb,Sc=j(c.thumbheight)||Qb,Ld.ok=Nd.ok=c.trackpad&&!Ib,q(),cc(c,[Jd]),Mc="thumbs"===Lc,Mc?(pb(xc,"navThumb"),yc=zd,fd=Vb,F(md,a.Fotorama.jst.style({w:Rc,h:Sc,b:c.thumbborderwidth,m:c.thumbmargin,s:hd,q:!Fb})),wd.addClass(Ha).removeClass(Ga)):"dots"===Lc?(pb(xc,"navDot"),yc=yd,fd=Ub,wd.addClass(Ga).removeClass(Ha)):(Lc=!1,wd.removeClass(Ha+" "+Ga)),Lc&&(Nc?vd.insertBefore(pd):vd.insertAfter(pd),ub.nav=!1,ub(yc,xd,"nav")),Oc=c.allowfullscreen,Oc?(Bd.prependTo(pd),Pc=Gb&&"native"===Oc):(Bd.detach(),Pc=!1),b(Qc,ka),b(!Qc,la),b(!c.captions,ra),b(Wc,pa),b("always"!==c.arrows,sa),Vc=c.shadows&&!Ib,b(!Vc,na),od.addClass(d.add.join(" ")).removeClass(d.remove.join(" ")),Id=a.extend({},c)}function v(a){return 0>a?(xc+a%xc)%xc:a>=xc?a%xc:a}function A(a){return d(a,0,xc-1)}function Q(a){return Kc?v(a):A(a)}function W(a){return a>0||Kc?a-1:!1}function Z(a){return xc-1>a||Kc?a+1:!1}function $(){Kd.min=Kc?-(1/0):-n(xc-1,Jd.w,c.margin,Dc),Kd.max=Kc?1/0:-n(0,Jd.w,c.margin,Dc),Kd.snap=Jd.w+c.margin}function ba(){Md.min=Math.min(0,Jd.nw-xd.width()),Md.max=0,xd.toggleClass(xa,!(Md.noMove=Md.min===Md.max))}function La(b,c,d){if("number"==typeof b){b=new Array(b);var e=!0}return a.each(b,function(a,b){if(e&&(b=a),"number"==typeof b){var f=wc[v(b)];if(f){var g="$"+c+"Frame",h=f[g];d.call(this,a,b,f,h,g,h&&h.data())}}})}function Ma(a,b,d,e){(!Yc||"*"===Yc&&e===Jc)&&(a=m(c.width)||m(a)||Rb,b=m(c.height)||m(b)||Sb,gd.resize({width:a,ratio:c.ratio||d||a/b},0,e!==Jc&&"*"))}function Na(b,d,e,f,g,h){La(b,d,function(b,i,j,k,l,m){function n(a){var b=v(i);dc(a,{index:b,src:x,frame:wc[b]})}function o(){t.remove(),a.Fotorama.cache[x]="error",j.html&&"stage"===d||!y||y===x?(!x||j.html||r?"stage"===d&&(k.trigger("f:load").removeClass(Ya+" "+Xa).addClass(Za),n("load"),Ma()):(k.trigger("f:error").removeClass(Ya).addClass(Xa),n("error")),m.state="error",!(xc>1&&wc[i]===j)||j.html||j.deleted||j.video||r||(j.deleted=!0,gd.splice(i,1))):(j[w]=x=y,Na([i],d,e,f,g,!0))}function p(){a.Fotorama.measures[x]=u.measures=a.Fotorama.measures[x]||{width:s.width,height:s.height,ratio:s.width/s.height},Ma(u.measures.width,u.measures.height,u.measures.ratio,i),t.off("load error").addClass(bb+(r?" "+cb:"")).prependTo(k),E(t,(a.isFunction(e)?e():e)||Jd,f||j.fit||c.fit,g||j.position||c.position),a.Fotorama.cache[x]=m.state="loaded",setTimeout(function(){k.trigger("f:load").removeClass(Ya+" "+Xa).addClass(Za+" "+(r?$a:_a)),"stage"===d?n("load"):(j.thumbratio===Wb||!j.thumbratio&&c.thumbratio===Wb)&&(j.thumbratio=u.measures.ratio,tc())},0)}function q(){var a=10;C(function(){return!dd||!a--&&!Ib},function(){p()})}if(k){var r=gd.fullScreen&&j.full&&j.full!==j.img&&!m.$full&&"stage"===d;if(!m.$img||h||r){var s=new Image,t=a(s),u=t.data();m[r?"$full":"$img"]=t;var w="stage"===d?r?"full":"img":"thumb",x=j[w],y=r?null:j["stage"===d?"thumb":"img"];if("navThumb"===d&&(k=m.$wrap),!x)return void o();a.Fotorama.cache[x]?!function z(){"error"===a.Fotorama.cache[x]?o():"loaded"===a.Fotorama.cache[x]?setTimeout(q,0):setTimeout(z,100)}():(a.Fotorama.cache[x]="*",t.on("load",q).on("error",o)),m.state="",s.src=x}}})}function Oa(a){Gd.append(zc.spin().el).appendTo(a)}function ab(){Gd.detach(),zc&&zc.stop()}function hb(){var a=Bc[Tb];a&&!a.data().state&&(Oa(a),a.on("f:load f:error",function(){a.off("f:load f:error"),ab()}))}function ob(b){S(b,qc),T(b,function(){setTimeout(function(){M(wd)},0),Xb({time:Tc,guessIndex:a(this).data().eq,minMax:Md})})}function pb(b,c){La(b,c,function(b,d,e,f,g,h){if(!f){f=e[g]=od[g].clone(),h=f.data(),h.data=e;var i=f[0];"stage"===c?(e.html&&a('<div class="'+gb+'"></div>').append(e._html?a(e.html).removeAttr("id").html(e._html):e.html).appendTo(f),e.caption&&a(J(kb,J(lb,e.caption))).appendTo(f),e.video&&f.addClass(va).append(Dd.clone()),T(i,function(){setTimeout(function(){M(pd)},0),nc({index:h.eq,user:!0})}),rd=rd.add(f)):"navDot"===c?(ob(i),yd=yd.add(f)):"navThumb"===c&&(ob(i),h.$wrap=f.children(":first"),zd=zd.add(f),e.video&&h.$wrap.append(Dd.clone()))}})}function qb(a,b,c,d){return a&&a.length&&E(a,b,c,d)}function sb(b){La(b,"stage",function(b,d,e,f,g,i){if(f){var j=v(d),k=e.fit||c.fit,l=e.position||c.position;i.eq=j,Pd[Tb][j]=f.css(a.extend({left:Qc?0:n(d,Jd.w,c.margin,Dc)},Qc&&h(0))),B(f[0])&&(f.appendTo(qd),kc(e.$video)),qb(i.$img,Jd,k,l),qb(i.$full,Jd,k,l)}})}function tb(b,d){if("thumbs"===Lc&&!isNaN(b)){var e=-b,f=-b+Jd.nw;zd.each(function(){var b=a(this),g=b.data(),h=g.eq,i=function(){return{h:Sc,w:g.w}},j=i(),k=wc[h]||{},l=k.thumbfit||c.thumbfit,m=k.thumbposition||c.thumbposition;j.w=g.w,g.l+g.w<e||g.l>f||qb(g.$img,j,l,m)||d&&Na([h],"navThumb",i,l,m)})}}function ub(b,d,e){if(!ub[e]){var f="nav"===e&&Mc,g=0;d.append(b.filter(function(){for(var b,c=a(this),d=c.data(),e=0,f=wc.length;f>e;e++)if(d.data===wc[e]){b=!0,d.eq=e;break}return b||c.remove()&&!1}).sort(function(b,c){return a(b).data().eq-a(c).data().eq}).each(function(){if(f){var b=a(this),d=b.data(),e=Math.round(Sc*d.data.thumbratio)||Rc;d.l=g,d.w=e,b.css({width:e}),g+=e+c.thumbmargin}})),ub[e]=!0}}function Cb(a){return a-Qd>Jd.w/3}function Db(a){return!(Kc||Hd+a&&Hd-xc+a||Ac)}function Hb(){var a=Db(0),b=Db(1);sd.toggleClass(Aa,a).attr(R(a)),td.toggleClass(Aa,b).attr(R(b))}function Kb(){Ld.ok&&(Ld.prevent={"<":Db(0),">":Db(1)})}function Nb(a){var b,d,e=a.data();return Mc?(b=e.l,d=e.w):(b=a.position().left,d=a.width()),{c:b+d/2,min:-b+10*c.thumbmargin,max:-b+Jd.w-d-10*c.thumbmargin}}function Pb(a){var b=Bc[fd].data();X(Ad,{time:1.2*a,pos:b.l,width:b.w-2*c.thumbborderwidth})}function Xb(a){var b=wc[a.guessIndex][fd];if(b){var c=Md.min!==Md.max,e=a.minMax||c&&Nb(Bc[fd]),f=c&&(a.keep&&Xb.l?Xb.l:d((a.coo||Jd.nw/2)-Nb(b).c,e.min,e.max)),g=c&&d(f,Md.min,Md.max),h=1.1*a.time;X(xd,{time:h,pos:g||0,onEnd:function(){tb(g,!0)}}),jc(wd,G(g,Md.min,Md.max)),Xb.l=f}}function Zb(){$b(fd),Od[fd].push(Bc[fd].addClass(Sa))}function $b(a){for(var b=Od[a];b.length;)b.shift().removeClass(Sa)}function ac(b){var c=Pd[b];a.each(Cc,function(a,b){delete c[v(b)]}),a.each(c,function(a,b){delete c[a],b.detach()})}function bc(a){Dc=Ec=Hd;var b=Bc[Tb];b&&($b(Tb),Od[Tb].push(b.addClass(Sa)),a||gd.show.onEnd(!0),r(qd,0,!0),ac(Tb),sb(Cc),$(),ba())}function cc(b,c){b&&a.each(c,function(c,d){d&&a.extend(d,{width:b.width||d.width,height:b.height,minwidth:b.minwidth,maxwidth:b.maxwidth,minheight:b.minheight,maxheight:b.maxheight,ratio:O(b.ratio)})})}function dc(a,c){b.trigger(ea+":"+a,[gd,c])}function ec(){clearTimeout(fc.t),dd=1,c.stopautoplayontouch?gd.stopAutoplay():ad=!0}function fc(){dd&&(c.stopautoplayontouch||(gc(),hc()),fc.t=setTimeout(function(){dd=0},Mb+Lb))}function gc(){ad=!(!Ac&&!bd)}function hc(){if(clearTimeout(hc.t),C.stop(hc.w),!c.autoplay||ad)return void(gd.autoplay&&(gd.autoplay=!1,dc("stopautoplay")));gd.autoplay||(gd.autoplay=!0,dc("startautoplay"));var a=Hd,b=Bc[Tb].data();hc.w=C(function(){return b.state||a!==Hd},function(){hc.t=setTimeout(function(){if(!ad&&a===Hd){var b=Ic,c=wc[b][Tb].data();hc.w=C(function(){return c.state||b!==Ic},function(){ad||b!==Ic||gd.show(Kc?V(!Wc):Ic)})}},c.autoplay)})}function ic(){gd.fullScreen&&(gd.fullScreen=!1,Gb&&rb.cancel(jd),zb.removeClass(fa),yb.removeClass(fa),b.removeClass(Va).insertAfter(nd),Jd=a.extend({},cd),kc(Ac,!0,!0),pc("x",!1),gd.resize(),Na(Cc,"stage"),M(Ab,$c,Zc),dc("fullscreenexit"))}function jc(a,b){Vc&&(a.removeClass(Qa+" "+Ra),b&&!Ac&&a.addClass(b.replace(/^|\s/g," "+Pa+"--")))}function kc(a,b,c){b&&(od.removeClass(ja),Ac=!1,q()),a&&a!==Ac&&(a.remove(),dc("unloadvideo")),c&&(gc(),hc())}function lc(a){od.toggleClass(ma,a)}function mc(a){if(!Kd.flow){var b=a?a.pageX:mc.x,d=b&&!Db(Cb(b))&&c.click;mc.p!==d&&pd.toggleClass(ya,d)&&(mc.p=d,mc.x=b)}}function nc(a){clearTimeout(nc.t),c.clicktransition&&c.clicktransition!==c.transition?setTimeout(function(){var b=c.transition;gd.setOptions({transition:c.clicktransition}),Uc=b,nc.t=setTimeout(function(){gd.show(a)},10)},0):gd.show(a)}function oc(b,d){var e=b.target,f=a(e);f.hasClass(ib)?gd.playVideo():e===Cd?gd.toggleFullScreen():Ac?e===Fd&&kc(Ac,!0,!0):d?lc():c.click&&nc({index:b.shiftKey||V(Cb(b._x)),slow:b.altKey,user:!0})}function pc(a,b){Kd[a]=Md[a]=b}function qc(b){var c=a(this).data().eq;nc({index:c,slow:b.altKey,user:!0,coo:b._x-wd.offset().left})}function rc(a){nc({index:ud.index(this)?">":"<",slow:a.altKey,user:!0})}function sc(a){T(a,function(){setTimeout(function(){M(pd)},0),lc(!1)})}function tc(){if(p(),u(),!tc.i){tc.i=!0;var a=c.startindex;(a||c.hash&&location.hash)&&(Jc=H(a||location.hash.replace(/^#/,""),wc,0===gd.index||a,a)),Hd=Dc=Ec=Fc=Jc=Q(Jc)||0}if(xc){if(uc())return;Ac&&kc(Ac,!0),Cc=[],ac(Tb),tc.ok=!0,gd.show({
index:Hd,time:0}),gd.resize()}else gd.destroy()}function uc(){return!uc.f===Wc?(uc.f=Wc,Hd=xc-1-Hd,gd.reverse(),!0):void 0}function vc(){vc.ok||(vc.ok=!0,dc("ready"))}yb=a("html"),zb=a("body");var wc,xc,yc,zc,Ac,Bc,Cc,Dc,Ec,Fc,Gc,Hc,Ic,Jc,Kc,Lc,Mc,Nc,Oc,Pc,Qc,Rc,Sc,Tc,Uc,Vc,Wc,Xc,Yc,Zc,$c,_c,ad,bd,cd,dd,ed,fd,gd=this,hd=a.now(),id=ea+hd,jd=b[0],kd=1,ld=b.data(),md=a("<style></style>"),nd=a(J(Ua)),od=a(J(ga)),pd=a(J(ta)).appendTo(od),qd=(pd[0],a(J(wa)).appendTo(pd)),rd=a(),sd=a(J(za+" "+Ba+nb)),td=a(J(za+" "+Ca+nb)),ud=sd.add(td).appendTo(pd),vd=a(J(Ea)),wd=a(J(Da)).appendTo(vd),xd=a(J(Fa)).appendTo(wd),yd=a(),zd=a(),Ad=(qd.data(),xd.data(),a(J(fb)).appendTo(xd)),Bd=a(J(Wa+nb)),Cd=Bd[0],Dd=a(J(ib)),Ed=a(J(jb)).appendTo(pd),Fd=Ed[0],Gd=a(J(mb)),Hd=!1,Id={},Jd={},Kd={},Ld={},Md={},Nd={},Od={},Pd={},Qd=0,Rd=[];od[Tb]=a(J(ua)),od[Vb]=a(J(Ia+" "+Ka+nb,J(eb))),od[Ub]=a(J(Ia+" "+Ja+nb,J(db))),Od[Tb]=[],Od[Vb]=[],Od[Ub]=[],Pd[Tb]={},od.addClass(Eb?ia:ha).toggleClass(ma,!c.controlsonstart),ld.fotorama=this,gd.startAutoplay=function(a){return gd.autoplay?this:(ad=bd=!1,t(a||c.autoplay),hc(),this)},gd.stopAutoplay=function(){return gd.autoplay&&(ad=bd=!0,hc()),this},gd.show=function(a){var b;"object"!=typeof a?(b=a,a={}):b=a.index,b=">"===b?Ec+1:"<"===b?Ec-1:"<<"===b?0:">>"===b?xc-1:b,b=isNaN(b)?H(b,wc,!0):b,b="undefined"==typeof b?Hd||0:b,gd.activeIndex=Hd=Q(b),Gc=W(Hd),Hc=Z(Hd),Ic=v(Hd+(Wc?-1:1)),Cc=[Hd,Gc,Hc],Ec=Kc?b:Hd;var e=Math.abs(Fc-Ec),f=s(a.time,function(){return Math.min(Tc*(1+(e-1)/12),2*Tc)}),g=a.overPos;a.slow&&(f*=10);var h=Bc;gd.activeFrame=Bc=wc[Hd];var i=h===Bc&&!a.user;kc(Ac,Bc.i!==wc[v(Dc)].i),pb(Cc,"stage"),sb(Ib?[Ec]:[Ec,W(Ec),Z(Ec)]),pc("go",!0),i||dc("show",{user:a.user,time:f}),ad=!0;var j=gd.show.onEnd=function(b){if(!j.ok){if(j.ok=!0,b||bc(!0),i||dc("showend",{user:a.user}),!b&&Uc&&Uc!==c.transition)return gd.setOptions({transition:Uc}),void(Uc=!1);hb(),Na(Cc,"stage"),pc("go",!1),Kb(),mc(),gc(),hc()}};if(Qc){var k=Bc[Tb],l=Hd!==Fc?wc[Fc][Tb]:null;Y(k,l,rd,{time:f,method:c.transition,onEnd:j},Rd)}else X(qd,{pos:-n(Ec,Jd.w,c.margin,Dc),overPos:g,time:f,onEnd:j});if(Hb(),Lc){Zb();var m=A(Hd+d(Ec-Fc,-1,1));Xb({time:f,coo:m!==Hd&&a.coo,guessIndex:"undefined"!=typeof a.coo?m:Hd,keep:i}),Mc&&Pb(f)}return _c="undefined"!=typeof Fc&&Fc!==Hd,Fc=Hd,c.hash&&_c&&!gd.eq&&D(Bc.id||Hd+1),this},gd.requestFullScreen=function(){return Oc&&!gd.fullScreen&&(Zc=Ab.scrollTop(),$c=Ab.scrollLeft(),M(Ab),pc("x",!0),cd=a.extend({},Jd),b.addClass(Va).appendTo(zb.addClass(fa)),yb.addClass(fa),kc(Ac,!0,!0),gd.fullScreen=!0,Pc&&rb.request(jd),gd.resize(),Na(Cc,"stage"),hb(),dc("fullscreenenter")),this},gd.cancelFullScreen=function(){return Pc&&rb.is()?rb.cancel(document):ic(),this},gd.toggleFullScreen=function(){return gd[(gd.fullScreen?"cancel":"request")+"FullScreen"]()},P(document,rb.event,function(){!wc||rb.is()||Ac||ic()}),gd.resize=function(a){if(!wc)return this;var b=arguments[1]||0,e=arguments[2];cc(gd.fullScreen?{width:"100%",maxwidth:null,minwidth:null,height:"100%",maxheight:null,minheight:null}:N(a),[Jd,e||gd.fullScreen||c]);var f=Jd.width,g=Jd.height,h=Jd.ratio,i=Ab.height()-(Lc?wd.height():0);return m(f)&&(od.addClass(qa).css({width:f,minWidth:Jd.minwidth||0,maxWidth:Jd.maxwidth||Yb}),f=Jd.W=Jd.w=od.width(),Jd.nw=Lc&&l(c.navwidth,f)||f,c.glimpse&&(Jd.w-=Math.round(2*(l(c.glimpse,f)||0))),qd.css({width:Jd.w,marginLeft:(Jd.W-Jd.w)/2}),g=l(g,i),g=g||h&&f/h,g&&(f=Math.round(f),g=Jd.h=Math.round(d(g,l(Jd.minheight,i),l(Jd.maxheight,i))),pd.stop().animate({width:f,height:g},b,function(){od.removeClass(qa)}),bc(),Lc&&(wd.stop().animate({width:Jd.nw},b),Xb({guessIndex:Hd,time:b,keep:!0}),Mc&&ub.nav&&Pb(b)),Yc=e||!0,vc())),Qd=pd.offset().left,this},gd.setOptions=function(b){return a.extend(c,b),tc(),this},gd.shuffle=function(){return wc&&K(wc)&&tc(),this},gd.destroy=function(){return gd.cancelFullScreen(),gd.stopAutoplay(),wc=gd.data=null,k(),Cc=[],ac(Tb),tc.ok=!1,this},gd.playVideo=function(){var b=Bc,c=b.video,d=Hd;return"object"==typeof c&&b.videoReady&&(Pc&&gd.fullScreen&&gd.cancelFullScreen(),C(function(){return!rb.is()||d!==Hd},function(){d===Hd&&(b.$video=b.$video||a(a.Fotorama.jst.video(c)),b.$video.appendTo(b[Tb]),od.addClass(ja),Ac=b.$video,q(),ud.blur(),Bd.blur(),dc("loadvideo"))})),this},gd.stopVideo=function(){return kc(Ac,!0,!0),this},pd.on("mousemove",mc),Kd=_(qd,{onStart:ec,onMove:function(a,b){jc(pd,b.edge)},onTouchEnd:fc,onEnd:function(a){jc(pd);var b=(Jb&&!ed||a.touch)&&c.arrows&&"always"!==c.arrows;if(a.moved||b&&a.pos!==a.newPos&&!a.control){var d=o(a.newPos,Jd.w,c.margin,Dc);gd.show({index:d,time:Qc?Tc:a.time,overPos:a.overPos,user:!0})}else a.aborted||a.control||oc(a.startEvent,b)},timeLow:1,timeHigh:1,friction:2,select:"."+Ta+", ."+Ta+" *",$wrap:pd}),Md=_(xd,{onStart:ec,onMove:function(a,b){jc(wd,b.edge)},onTouchEnd:fc,onEnd:function(a){function b(){Xb.l=a.newPos,gc(),hc(),tb(a.newPos,!0)}if(a.moved)a.pos!==a.newPos?(ad=!0,X(xd,{time:a.time,pos:a.newPos,overPos:a.overPos,onEnd:b}),tb(a.newPos),Vc&&jc(wd,G(a.newPos,Md.min,Md.max))):b();else{var c=a.$target.closest("."+Ia,xd)[0];c&&qc.call(c,a.startEvent)}},timeLow:.5,timeHigh:2,friction:5,$wrap:wd}),Ld=aa(pd,{shift:!0,onEnd:function(a,b){ec(),fc(),gd.show({index:b,slow:a.altKey})}}),Nd=aa(wd,{onEnd:function(a,b){ec(),fc();var c=r(xd)+.25*b;xd.css(g(d(c,Md.min,Md.max))),Vc&&jc(wd,G(c,Md.min,Md.max)),Nd.prevent={"<":c>=Md.max,">":c<=Md.min},clearTimeout(Nd.t),Nd.t=setTimeout(function(){Xb.l=c,tb(c,!0)},Lb),tb(c)}}),od.hover(function(){setTimeout(function(){dd||lc(!(ed=!0))},0)},function(){ed&&lc(!(ed=!1))}),I(ud,function(a){U(a),rc.call(this,a)},{onStart:function(){ec(),Kd.control=!0},onTouchEnd:fc}),ud.each(function(){S(this,function(a){rc.call(this,a)}),sc(this)}),S(Cd,gd.toggleFullScreen),sc(Cd),a.each("load push pop shift unshift reverse sort splice".split(" "),function(a,b){gd[b]=function(){return wc=wc||[],"load"!==b?Array.prototype[b].apply(wc,arguments):arguments[0]&&"object"==typeof arguments[0]&&arguments[0].length&&(wc=L(arguments[0])),tc(),gd}}),tc()},a.fn.fotorama=function(b){return this.each(function(){var c=this,d=a(this),e=d.data(),f=e.fotorama;f?f.setOptions(b,!0):C(function(){return!A(c)},function(){e.urtext=d.html(),new a.Fotorama(d,a.extend({},$b,window.fotoramaDefaults,b,e))})})},a.Fotorama.instances=[],a.Fotorama.cache={},a.Fotorama.measures={},a=a||{},a.Fotorama=a.Fotorama||{},a.Fotorama.jst=a.Fotorama.jst||{},a.Fotorama.jst.style=function(a){var b,c="";pb.escape;return c+=".fotorama"+(null==(b=a.s)?"":b)+" .fotorama__nav--thumbs .fotorama__nav__frame{\npadding:"+(null==(b=a.m)?"":b)+"px;\nheight:"+(null==(b=a.h)?"":b)+"px}\n.fotorama"+(null==(b=a.s)?"":b)+" .fotorama__thumb-border{\nheight:"+(null==(b=a.h-a.b*(a.q?0:2))?"":b)+"px;\nborder-width:"+(null==(b=a.b)?"":b)+"px;\nmargin-top:"+(null==(b=a.m)?"":b)+"px}"},a.Fotorama.jst.video=function(a){function b(){c+=d.call(arguments,"")}var c="",d=(pb.escape,Array.prototype.join);return c+='<div class="fotorama__video"><iframe src="',b(("youtube"==a.type?a.p+"youtube.com/embed/"+a.id+"?autoplay=1":"vimeo"==a.type?a.p+"player.vimeo.com/video/"+a.id+"?autoplay=1&badge=0":a.id)+(a.s&&"custom"!=a.type?"&"+a.s:"")),c+='" frameborder="0" allowfullscreen></iframe></div>\n'},a(function(){a("."+ea+':not([data-auto="false"])').fotorama()})});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment