vendor: 16,793 bytes, lines 1-21
1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{ 2let window = _____WB$wombat$assign$function_____("window"); 3let self = _____WB$wombat$assign$function_____("self"); 4let document = _____WB$wombat$assign$function_____("document"); 5let location = _____WB$wombat$assign$function_____("location"); 6let top = _____WB$wombat$assign$function_____("top"); 7let parent = _____WB$wombat$assign$function_____("parent"); 8let frames = _____WB$wombat$assign$function_____("frames"); 9let opens = _____WB$wombat$assign$function_____("opens"); 10/* Modernizr 2.8.3 (Custom Build) | MIT & BSD 11 * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load 12 */ 13;window.Modernizr=function(a,b,c){function C(a){j.cssText=a}function D(a,b){return C(n.join(a+";")+(b||""))}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,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function H(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:E(f,"function")?f.bind(d||b):f}return!1}function I(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return E(b,"string")||E(b,"undefined")?G(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),H(e,b,c))}function J(){e.input=function(c){for(var d=0,e=c.length;d<e;d++)u[c[d]]=c[d]in k;return u.list&&(u.list=!!b.createElement("datalist")&&!!a.HTMLDataListElement),u}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)k.setAttribute("type",f=a[d]),e=k.type!=="text",e&&(k.value=l,k.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&k.style.WebkitAppearance!==c?(g.appendChild(k),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(k,null).WebkitAppearance!=="textfield"&&k.offsetHeight!==0,g.removeChild(k)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=k.checkValidity&&k.checkValidity()===!1:e=k.value!=l)),t[a[d]]=!!e;return t}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var d="2.8.3",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k=b.createElement("input"),l=":)",m={}.toString,n=" -webkit- -moz- -o- -ms- ".split(" "),o="Webkit Moz O ms",p=o.split(" "),q=o.toLowerCase().split(" "),r={svg:"http://www.w3.org/2000/svg"},s={},t={},u={},v=[],w=v.slice,x,y=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["­",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},z=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=E(e[d],"function"),E(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),A={}.hasOwnProperty,B;!E(A,"undefined")&&!E(A.call,"undefined")?B=function(a,b){return A.call(a,b)}:B=function(a,b){return b in a&&E(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=w.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e}),s.flexbox=function(){return I("flexWrap")},s.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},s.canvastext=function(){return!!e.canvas&&!!E(b.createElement("canvas").getContext("2d").fillText,"function")},s.webgl=function(){return!!a.WebGLRenderingContext},s.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:y(["@media (",n.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},s.geolocation=function(){return"geolocation"in navigator},s.postmessage=function(){return!!a.postMessage},s.websqldatabase=function(){return!!a.openDatabase},s.indexedDB=function(){return!!I("indexedDB",a)},s.hashchange=function(){return z("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},s.history=function(){return!!a.history&&!!history.pushState},s.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},s.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},s.rgba=function(){return C("background-color:rgba(150,255,150,.5)"),F(j.backgroundColor,"rgba")},s.hsla=function(){return C("background-color:hsla(120,40%,100%,.5)"),F(j.backgroundColor,"rgba")||F(j.backgroundColor,"hsla")},s.multiplebgs=function(){return C("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},s.backgroundsize=function(){return I("backgroundSize")},s.borderimage=function(){return I("borderImage")},s.borderradius=function(){return I("borderRadius")},s.boxshadow=function(){return I("boxShadow")},s.textshadow=function(){return b.createElement("div").style.textShadow===""},s.opacity=function(){return D("opacity:.55"),/^0.55$/.test(j.opacity)},s.cssanimations=function(){return I("animationName")},s.csscolumns=function(){return I("columnCount")},s.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return C((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),F(j.backgroundImage,"gradient")},s.cssreflections=function(){return I("boxReflect")},s.csstransforms=function(){return!!I("transform")},s.csstransforms3d=function(){var a=!!I("perspective");return a&&"webkitPerspective"in g.style&&y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},s.csstransitions=function(){return I("transition")},s.fontface=function(){var a;return y('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&g.indexOf(d.split(" ")[0])===0}),a},s.generatedcontent=function(){var a;return y(["#",h,"{font:0/0 a}#",h,':after{content:"',l,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}),a},s.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},s.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c},s.localstorage=function(){try{return localStorage.setItem(h,h),localStorage.removeItem(h),!0}catch(a){return!1}},s.sessionstorage=function(){try{return sessionStorage.setItem(h,h),sessionStorage.removeItem(h),!0}catch(a){return!1}},s.webworkers=function(){return!!a.Worker},s.applicationcache=function(){return!!a.applicationCache},s.svg=function(){return!!b.createElementNS&&!!b.createElementNS(r.svg,"svg").createSVGRect},s.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="<svg/>",(a.firstChild&&a.firstChild.namespaceURI)==r.svg},s.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(m.call(b.createElementNS(r.svg,"animate")))},s.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(m.call(b.createElementNS(r.svg,"clipPath")))};for(var K in s)B(s,K)&&(x=K.toLowerCase(),e[x]=s[K](),v.push((e[x]?"":"no-")+x));return e.input||J(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)B(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},C(""),i=k=null,function(a,b){function l(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&!e.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode(),e=0,f=m(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function q(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return s.shivMethods?o(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(s,b.frag)}function r(a){a||(a=b);var c=n(a);return s.shivCSS&&!g&&!c.hasCSS&&(c.hasCSS=!!l(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),k||q(a,c),a}var c="3.7.0",d=a.html5||{},e=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,f=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,g,h="_html5shiv",i=0,j={},k;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",g="hidden"in a,k=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivCSS:d.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a.html5=s,r(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.hasEvent=z,e.testProp=function(a){return G([a])},e.testAllProps=I,e.testStyles=y,e.prefixed=function(a,b,c){return b?I(a,b,c):I(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+v.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))}; 14!function (t) { 15 "use strict"; 16 var s = {slide: 0, delay: 5e3, preload: !1, preloadImage: !1, preloadVideo: !1, timer: !0, overlay: !1, autoplay: !0, shuffle: !1, cover: !0, color: null, align: "center", valign: "center", transition: "fade", transitionDuration: 1e3, transitionRegister: [], animation: null, animationDuration: "auto", animationRegister: [], init: function () { 17 }, play: function () { 18 }, pause: function () { 19 }, walk: function () { 20 }, slides: []}, i = {}, e = function (i, e) { 21 this.elmt = i, this.settings = t.extend({}, s, t.vegas.defaults, e), this.slide = this.settings.slide, this.total = this.settings.slides.length, this.noshow = this.total < 2, this.paused = !this.settings.autoplay || this.noshow, this.$elmt = t(i), this.$timer = null, this.$overlay
21= null, this.$slide = null, this.timeout = null, this.transitions = ["fade", "fade2", "blur", "blur2", "flash", "flash2", "negative", "negative2", "burn", "burn2", "slideLeft", "slideLeft2", "slideRight", "slideRight2", "slideUp", "slideUp2", "slideDown", "slideDown2", "zoomIn", "zoomIn2", "zoomOut", "zoomOut2", "swirlLeft", "swirlLeft2", "swirlRight", "swirlRight2"], this.animations = ["kenburns", "kenburnsLeft", "kenburnsRight", "kenburnsUp", "kenburnsUpLeft", "kenburnsUpRight", "kenburnsDown", "kenburnsDownLeft", "kenburnsDownRight"], this.settings.transitionRegister instanceof Array == !1 && (this.settings.transitionRegister = [this.settings.transitionRegister]), this.settings.animationRegister instanceof Array == !1 && (this.settings.animationRegister = [this.settings.animationRegister]), this.transitions = this.transitions.concat(this.settings.transitionRegister), this.animations = this.animations.concat(this.settings.animationRegister), this.support = {objectFit: "objectFit"in document.body.style, transition: "transition"in document.body.style || "WebkitTransition"in document.body.style, video: t.vegas.isVideoCompatible()}, this.settings.shuffle === !0 && this.shuffle(), this._init() 22 }; 23 e.prototype = {_init: function () { 24 var s, i, e, n = "BODY" === this.elmt.tagName, o = this.settings.timer, a = this.settings.overlay, r = this; 25 this._preload(), n || (this.$elmt.css("height", this.$elmt.css("height")), s = t('<div class="vegas-wrapper">').css("overflow", this.$elmt.css("overflow")).css("padding", this.$elmt.css("padding")), this.$elmt.css("padding") || s.css("padding-top", this.$elmt.css("padding-top")).css("padding-bottom", this.$elmt.css("padding-bottom")).css("padding-left", this.$elmt.css("padding-left")).css("padding-right", this.$elmt.css("padding-right")), this.$elmt.clone(!0).children().appendTo(s), this.elmt.innerHTML = ""), o && this.support.transition && (e = t('<div class="vegas-timer"><div class="vegas-timer-progress">'), this.$timer = e, this.$elmt.prepend(e)), a && (i = t('<div class="vegas-overlay">'), "string" == typeof a && i.css("background-image", "url(" + a + ")"), this.$overlay = i, this.$elmt.prepend(i)), this.$elmt.addClass("vegas-container"), n || this.$elmt.append(s), setTimeout(function () { 26 r.trigger("init"), r._goto(r.slide), r.settings.autoplay && r.trigger("play") 27 }, 1) 28 }, _preload: function () { 29 var t, s, i; 30 for (i = 0; i < this.settings.slides.length; i++) 31 (this.settings.preload || this.settings.preloadImages) && this.settings.slides[i].src && (s = new Image, s.src = this.settings.slides[i].src), (this.settings.preload || this.settings.preloadVideos) && this.support.video && this.settings.slides[i].video && (t = this._video(this.settings.slides[i].video instanceof Array ? this.settings.slides[i].video : this.settings.slides[i].video.src)) 32 }, _random: function (t) { 33 return t[Math.floor(Math.random() * (t.length - 1))] 34 }, _slideShow: function () { 35 var t = this; 36 this.total > 1 && !this.paused && !this.noshow && (this.timeout = setTimeout(function () { 37 t.next() 38 }, this._options("delay"))) 39 }, _timer: function (t) { 40 var s = this; 41 clearTimeout(this.timeout), this.$timer && (this.$timer.removeClass("vegas-timer-running").find("div").css("transition-duration", "0ms"), this.paused || this.noshow || t && setTimeout(function () { 42 s.$timer.addClass("vegas-timer-running").find("div").css("transition-duration", s._options("delay") - 100 + "ms") 43 }, 100)) 44 }, _video: function (t) { 45 var s, e, n = t.toString(); 46 return i[n] ? i[n] : (t instanceof Array == !1 && (t = [t]), s = document.createElement("video"), s.preload = !0, t.forEach(function (t) { 47 e = document.createElement("source"), e.src = t, s.appendChild(e) 48 }), i[n] = s, s) 49 }, _fadeOutSound: function (t, s) { 50 var i = this, e = s / 10, n = t.volume - .09; 51 n > 0 ? (t.volume = n, setTimeout(function () { 52 i._fadeOutSound(t, s) 53 }, e)) : t.pause() 54 }, _fadeInSound: function (t, s) { 55 var i = this, e = s / 10, n = t.volume + .09; 56 1 > n && (t.volume = n, setTimeout(function () { 57 i._fadeInSound(t, s) 58 }, e)) 59 }, _options: function (t, s) { 60 return void 0 === s && (s = this.slide), void 0 !== this.settings.slides[s][t] ? this.settings.slides[s][t] : this.settings[t] 61 }, _goto: function (s) { 62 function i() { 63 f._timer(!0), setTimeout(function () { 64 y && (f.support.transition ? (h.css("transition", "all " + _ + "ms").addClass("vegas-transition-" + y + "-out"), h.each(function () { 65 var t = h.find("video").get(0); 66 t && (t.volume = 1, f._fadeOutSound(t, _)) 67 }), e.css("transition", "all " + _ + "ms").addClass("vegas-transition-" + y + "-in")) : e.fadeIn(_)); 68 for (var t = 0; t < h.length - 4; t++) 69 h.eq(t).remove(); 70 f.trigger("walk"), f._slideShow() 71 }, 100) 72 } 73 "undefined" == typeof this.settings.slides[s] && (s = 0), this.slide = s; 74 var e, n, o, a, r, h = this.$elmt.children(".vegas-slide"), l = this.settings.slides[s].src, d = this.settings.slides[s].video, g = this._options("delay"), u = this._options("align"), c = this._options("valign"), p = this._options("color") || this.$elmt.css("background-color"), m = this._options("cover") ? "cover" : "contain", f = this, v = h.length, y = this._options("transition"), _ = this._options("transitionDuration"), w = this._options("animation"), b = this._options("animationDuration"); 75 ("random" === y || y instanceof Array) && (y = this._random(y instanceof Array ? y : this.transitions)), ("random" === w || w instanceof Array) && (w = this._random(w instanceof Array ? w : this.animations)), ("auto" === _ || _ > g) && (_ = g), "auto" === b && (b = g), e = t('<div class="vegas-slide"></div>'), this.support.transition && y && e.addClass("vegas-transition-" + y), this.support.video && d ? (a = this._video(d instanceof Array ? d : d.src), a.loop = void 0 !== d.loop ? d.loop : !0, a.muted = void 0 !== d.mute ? d.mute : !0, a.muted === !1 ? (a.volume = 0, this._fadeInSound(a, _)) : a.pause(), o = t(a).addClass("vegas-video").css("background-color", p), this.support.objectFit ? o.css("object-position", u + " " + c).css("object-fit", m).css("width", "100%").css("height", "100%") : "contain" === m && o.css("width", "100%").css("height", "100%"), e.append(o)) : (r = new Image, n = t('<div class="vegas-slide-inner"></div>').css("background-image", "url(" + l + ")").css("background-color", p).css("background-position", u + " " + c).css("background-size", m), this.support.transition && w && n.addClass("vegas-animation-" + w).css("animation-duration", b + "ms"), e.append(n)), this.support.transition || e.css("display", "none"), v ? h.eq(v - 1).after(e) : this.$elmt.prepend(e), f._timer(!1), a ? (4 === a.readyState && (a.currentTime = 0), a.play(), i()) : (r.src = l, r.onload = i) 76 }, shuffle: function () { 77 for (var t, s, i = this.total - 1; i > 0; i--) 78 s = Math.floor(Math.random() * (i + 1)), t = this.settings.slides[i], this.settings.slides[i] = this.settings.slides[s], this.settings.slides[s] = t 79 }, play: function () { 80 this.paused && (this.paused = !1, this.next(), this.trigger("play")) 81 }, pause: function () { 82 this._timer(!1), this.paused = !0, this.trigger("pause") 83 }, toggle: function () { 84 this.paused ? this.play() : this.pause() 85 }, playing: function () { 86 return!this.paused && !this.noshow 87 }, current: function (t) { 88 return t ? {slide: this.slide, data: this.settings.slides[this.slide]} : this.slide 89 }, jump: function (t) { 90 0 > t || t > this.total - 1 || t === this.slide || (this.slide = t, this._goto(this.slide)) 91 }, next: function () { 92 this.slide++, this.slide >= this.total && (this.slide = 0), this._goto(this.slide) 93 }, previous: function () { 94 this.slide--, this.slide < 0 && (this.slide = this.total - 1), this._goto(this.slide) 95 }, trigger: function (t) { 96 var s = []; 97 s = "init" === t ? [this.settings] : [this.slide, this.settings.slides[this.slide]], this.$elmt.trigger("vegas"
97+ t, s), "function" == typeof this.settings[t] && this.settings[t].apply(this.$elmt, s) 98 }, options: function (i, e) { 99 var n = this.settings.slides.slice(); 100 if ("object" == typeof i) 101 this.settings = t.extend({}, s, t.vegas.defaults, i); 102 else { 103 if ("string" != typeof i) 104 return this.settings; 105 if (void 0 === e) 106 return this.settings[i]; 107 this.settings[i] = e 108 } 109 this.settings.slides !== n && (this.total = this.settings.slides.length, this.noshow = this.total < 2, this._preload()) 110 }, destroy: function () { 111 clearTimeout(this.timeout), this.$elmt.removeClass("vegas-container"), this.$elmt.find("> .vegas-slide").remove(), this.$elmt.find("> .vegas-wrapper").clone(!0).children().appendTo(this.$elmt), this.$elmt.find("> .vegas-wrapper").remove(), this.settings.timer && this.$timer.remove(), this.settings.overlay && this.$overlay.remove(), this.elmt._vegas = null 112 }}, t.fn.vegas = function (t) { 113 var s, i = arguments, n = !1; 114 if (void 0 === t || "object" == typeof t) 115 return this.each(function () { 116 this._vegas || (this._vegas = new e(this, t)) 117 }); 118 if ("string" == typeof t) { 119 if (this.each(function () { 120 var e = this._vegas; 121 if (!e) 122 throw new Error("No Vegas applied to this element."); 123 "function" == typeof e[t] && "_" !== t[0] ? s = e[t].apply(e, [].slice.call(i, 1)) : n = !0 124 }), n) 125 throw new Error('No method "' + t + '" in Vegas.'); 126 return void 0 !== s ? s : this 127 } 128 }, t.vegas = {}, t.vegas.defaults = s, t.vegas.isVideoCompatible = function () { 129 return!/(Android|webOS|Phone|iPad|iPod|BlackBerry|Windows Phone)/i.test(navigator.userAgent) 130 } 131}(window.jQuery || window.Zepto); 132!function (a, b, c, d) { 133 function e(b, c) { 134 this.settings = null, this.options = a.extend({}, e.Defaults, c), this.$element = a(b), this.drag = a.extend({}, m), this.state = a.extend({}, n), this.e = a.extend({}, o), this._plugins = {}, this._supress = {}, this._current = null, this._speed = null, this._coordinates = [], this._breakpoint = null, this._width = null, this._items = [], this._clones = [], this._mergers = [], this._invalidated = {}, this._pipe = [], a.each(e.Plugins, a.proxy(function (a, b) { 135 this._plugins[a[0].toLowerCase() + a.slice(1)] = new b(this) 136 }, this)), a.each(e.Pipe, a.proxy(function (b, c) { 137 this._pipe.push({filter: c.filter, run: a.proxy(c.run, this)}) 138 }, this)), this.setup(), this.initialize() 139 } 140 function f(a) { 141 if (a.touches !== d) 142 return{x: a.touches[0].pageX, y: a.touches[0].pageY}; 143 if (a.touches === d) { 144 if (a.pageX !== d) 145 return{x: a.pageX, y: a.pageY}; 146 if (a.pageX === d) 147 return{x: a.clientX, y: a.clientY} 148 } 149 } 150 function g(a) { 151 var b, d, e = c.createElement("div"), f = a; 152 for (b in f) 153 if (d = f[b], "undefined" != typeof e.style[d]) 154 return e = null, [d, b]; 155 return[!1] 156 } 157 function h() { 158 return g(["transition", "WebkitTransition", "MozTransition", "OTransition"])[1] 159 } 160 function i() { 161 return g(["transform", "WebkitTransform", "MozTransform", "OTransform", "msTransform"])[0] 162 } 163 function j() { 164 return g(["perspective", "webkitPerspective", "MozPerspective", "OPerspective", "MsPerspective"])[0] 165 } 166 function k() { 167 return"ontouchstart"in b || !!navigator.msMaxTouchPoints 168 } 169 function l() { 170 return b.navigator.msPointerEnabled 171 } 172 var m, n, o; 173 m = {start: 0, startX: 0, startY: 0, current: 0, currentX: 0, currentY: 0, offsetX: 0, offsetY: 0, distance: null, startTime: 0, endTime: 0, updatedX: 0, targetEl: null}, n = {isTouch: !1, isScrolling: !1, isSwiping: !1, direction: !1, inMotion: !1}, o = {_onDragStart: null, _onDragMove: null, _onDragEnd: null, _transitionEnd: null, _resizer: null, _responsiveCall: null, _goToLoop: null, _checkVisibile: null}, e.Defaults = {items: 3, loop: !1, center: !1, mouseDrag: !0, touchDrag: !0, pullDrag: !0, freeDrag: !1, margin: 0, stagePadding: 0, merge: !1, mergeFit: !0, autoWidth: !1, startPosition: 0, rtl: !1, smartSpeed: 250, fluidSpeed: !1, dragEndSpeed: !1, responsive: {}, responsiveRefreshRate: 200, responsiveBaseElement: b, responsiveClass: !1, fallbackEasing: "swing", info: !1, nestedItemSelector: !1, itemElement: "div", stageElement: "div", themeClass: "owl-theme", baseClass: "owl-carousel", itemClass: "owl-item", centerClass: "center", activeClass: "active"}, e.Width = {Default: "default", Inner: "inner", Outer: "outer"}, e.Plugins = {}, e.Pipe = [{filter: ["width", "items", "settings"], run: function (a) { 174 a.current = this._items && this._items[this.relative(this._current)] 175 }}, {filter: ["items", "settings"], run: function () { 176 var a = this._clones, b = this.$stage.children(".cloned"); 177 (b.length !== a.length || !this.settings.loop && a.length > 0) && (this.$stage.children(".cloned").remove(), this._clones = []) 178 }}, {filter: ["items", "settings"], run: function () { 179 var a, b, c = this._clones, d = this._items, e = this.settings.loop ? c.length - Math.max(2 * this.settings.items, 4) : 0; 180 for (a = 0, b = Math.abs(e / 2); b > a; a++) 181 e > 0 ? (this.$stage.children().eq(d.length + c.length - 1).remove(), c.pop(), this.$stage.children().eq(0).remove(), c.pop()) : (c.push(c.length / 2), this.$stage.append(d[c[c.length - 1]].clone().addClass("cloned")), c.push(d.length - 1 - (c.length - 1) / 2), this.$stage.prepend(d[c[c.length - 1]].clone().addClass("cloned"))) 182 }}, {filter: ["width", "items", "settings"], run: function () { 183 var a, b, c, d = this.settings.rtl ? 1 : -1, e = (this.width() / this.settings.items).toFixed(3), f = 0; 184 for (this._coordinates = [], b = 0, c = this._clones.length + this._items.length; c > b; b++) 185 a = this._mergers[this.relative(b)], a = this.settings.mergeFit && Math.min(a, this.settings.items) || a, f += (this.settings.autoWidth ? this._items[this.relative(b)].width() + this.settings.margin : e * a) * d, this._coordinates.push(f) 186 }}, {filter: ["width", "items", "settings"], run: function () { 187 var b, c, d = (this.width() / this.settings.items).toFixed(3), e = {width: Math.abs(this._coordinates[this._coordinates.length - 1]) + 2 * this.settings.stagePadding, "padding-left": this.settings.stagePadding || "", "padding-right": this.settings.stagePadding || ""}; 188 if (this.$stage.css(e), e = {width: this.settings.autoWidth ? "auto" : d - this.settings.margin}, e[this.settings.rtl ? "margin-left" : "margin-right"] = this.settings.margin, !this.settings.autoWidth && a.grep(this._mergers, function (a) { 189 return a > 1 190 }).length > 0) 191 for (b = 0, c = this._coordinates.length; c > b; b++)
192 e.width = Math.abs(this._coordinates[b]) - Math.abs(this._coordinates[b - 1] || 0) - this.settings.margin, this.$stage.children().eq(b).css(e); 193 else 194 this.$stage.children().css(e) 195 }}, {filter: ["width", "items", "settings"], run: function (a) { 196 a.current && this.reset(this.$stage.children().index(a.current)) 197 }}, {filter: ["position"], run: function () { 198 this.animate(this.coordinates(this._current)) 199 }}, {filter: ["width", "position", "items", "settings"], run: function () { 200 var a, b, c, d, e = this.settings.rtl ? 1 : -1, f = 2 * this.settings.stagePadding, g = this.coordinates(this.current()) + f, h = g + this.width() * e, i = []; 201 for (c = 0, d = this._coordinates.length; d > c; c++) 202 a = this._coordinates[c - 1] || 0, b = Math.abs(this._coordinates[c]) + f * e, (this.op(a, "<=", g) && this.op(a, ">", h) || this.op(b, "<", g) && this.op(b, ">", h)) && i.push(c); 203 this.$stage.children("." + this.settings.activeClass).removeClass(this.settings.activeClass), this.$stage.children(":eq(" + i.join("), :eq(") + ")").addClass(this.settings.activeClass), this.settings.center && (this.$stage.children("." + this.settings.centerClass).removeClass(this.settings.centerClass), this.$stage.children().eq(this.current()).addClass(this.settings.centerClass)) 204 }}], e.prototype.initialize = function () { 205 if (this.trigger("initialize"), this.$element.addClass(this.settings.baseClass).addClass(this.settings.themeClass).toggleClass("owl-rtl", this.settings.rtl), this.browserSupport(), this.settings.autoWidth && this.state.imagesLoaded !== !0) { 206 var b, c, e; 207 if (b = this.$element.find("img"), c = this.settings.nestedItemSelector ? "." + this.settings.nestedItemSelector : d, e = this.$element.children(c).width(), b.length && 0 >= e) 208 return this.preloadAutoWidthImages(b), !1 209 } 210 this.$element.addClass("owl-loading"), this.$stage = a("<" + this.settings.stageElement + ' class="owl-stage"/>').wrap('<div class="owl-stage-outer">'), this.$element.append(this.$stage.parent()), this.replace(this.$element.children().not(this.$stage.parent())), this._width = this.$element.width(), this.refresh(), this.$element.removeClass("owl-loading").addClass("owl-loaded"), this.eventsCall(), this.internalEvents(), this.addTriggerableEvents(), this.trigger("initialized") 211 }, e.prototype.setup = function () { 212 var b = this.viewport(), c = this.options.responsive, d = -1, e = null; 213 c ? (a.each(c, function (a) { 214 b >= a && a > d && (d = Number(a)) 215 }), e = a.extend({}, this.options, c[d]), delete e.responsive, e.responsiveClass && this.$element.attr("class", function (a, b) { 216 return b.replace(/\b owl-responsive-\S+/g, "") 217 }).addClass("owl-responsive-" + d)) : e = a.extend({}, this.options), (null === this.settings || this._breakpoint !== d) && (this.trigger("change", {property: {name: "settings", value: e}}), this._breakpoint = d, this.settings = e, this.invalidate("settings"), this.trigger("changed", {property: {name: "settings", value: this.settings}})) 218 }, e.prototype.optionsLogic = function () { 219 this.$element.toggleClass("owl-center", this.settings.center), this.settings.loop && this._items.length < this.settings.items && (this.settings.loop = !1), this.settings.autoWidth && (this.settings.stagePadding = !1, this.settings.merge = !1) 220 }, e.prototype.prepare = function (b) { 221 var c = this.trigger("prepare", {content: b}); 222 return c.data || (c.data = a("<" + this.settings.itemElement + "/>").addClass(this.settings.itemClass).append(b)), this.trigger("prepared", {content: c.data}), c.data 223 }, e.prototype.update = function () { 224 for (var b = 0, c = this._pipe.length, d = a.proxy(function (a) { 225 return this[a] 226 }, this._invalidated), e = {}; c > b; ) 227 (this._invalidated.all || a.grep(this._pipe[b].filter, d).length > 0) && this._pipe[b].run(e), b++; 228 this._invalidated = {} 229 }, e.prototype.width = function (a) { 230 switch (a = a || e.Width.Default) { 231 case e.Width.Inner: 232 case e.Width.Outer: 233 return this._width; 234 default: 235 return this._width - 2 * this.settings.stagePadding + this.settings.margin 236 } 237 }, e.prototype.refresh = function () { 238 if (0 === this._items.length) 239 return!1; 240 (new Date).getTime(); 241 this.trigger("refresh"), this.setup(), this.optionsLogic(), this.$stage.addClass("owl-refresh"), this.update(), this.$stage.removeClass("owl-refresh"), this.state.orientation = b.orientation, this.watchVisibility(), this.trigger("refreshed") 242 }, e.prototype.eventsCall = function () { 243 this.e._onDragStart = a.proxy(function (a) { 244 this.onDragStart(a) 245 }, this), this.e._onDragMove = a.proxy(function (a) { 246 this.onDragMove(a) 247 }, this), this.e._onDragEnd = a.proxy(function (a) { 248 this.onDragEnd(a) 249 }, this), this.e._onResize = a.proxy(function (a) { 250 this.onResize(a) 251 }, this), this.e._transitionEnd = a.proxy(function (a) { 252 this.transitionEnd(a) 253 }, this), this.e._preventClick = a.proxy(function (a) { 254 this.preventClick(a) 255 }, this) 256 }, e.prototype.onThrottledResize = function () { 257 b.clearTimeout(this.resizeTimer), this.resizeTimer = b.setTimeout(this.e._onResize, this.settings.responsiveRefreshRate) 258 }, e.prototype.onResize = function () { 259 return this._items.length ? this._width === this.$element.width() ? !1 : this.trigger("resize").isDefaultPrevented() ? !1 : (this._width = this.$element.width(), this.invalidate("width"), this.refresh(), void this.trigger("resized")) : !1 260 }, e.prototype.eventsRouter = function (a) { 261 var b = a.type; 262 "mousedown" === b || "touchstart" === b ? this.onDragStart(a) : "mousemove" === b || "touchmove" === b ? this.onDragMove(a) : "mouseup" === b || "touchend" === b ? this.onDragEnd(a) : "touchcancel" === b && this.onDragEnd(a) 263 }, e.prototype.internalEvents = function () { 264 var c = (k(), l()); 265 this.settings.mouseDrag ? (this.$stage.on("mousedown", a.proxy(function (a) { 266 this.eventsRouter(a) 267 }, this)), this.$stage.on("dragstart", function () { 268 return!1 269 }), this.$stage.get(0).onselectstart = function () { 270 return!1 271 }) : this.$element.addClass("owl-text-select-on"), this.settings.touchDrag && !c && this.$stage.on("touchstart touchcancel", a.proxy(function (a) { 272 this.eventsRouter(a) 273 }, this)), this.transitionEndVendor && this.on(this.$stage.get(0), this.transitionEndVendor, this.e._transitionEnd, !1), this.settings.responsive !== !1 && this.on(b, "resize", a.proxy(this.onThrottledResize, this)) 274 }, e.prototype.onDragStart = function (d) { 275 var e, g, h, i; 276 if (e = d.originalEvent || d || b.event, 3 === e.which || this.state.isTouch) 277 return!1; 278 if ("mousedown" === e.type && this.$stage.addClass("owl-grab"), this.trigger("drag"), this.drag.startTime = (new Date).getTime(), this.speed(0), this.state.isTouch = !0, this.state.isScrolling = !1, this.state.isSwiping = !1, this.drag.distance = 0, g = f(e).x, h
278= f(e).y, this.drag.offsetX = this.$stage.position().left, this.drag.offsetY = this.$stage.position().top, this.settings.rtl && (this.drag.offsetX = this.$stage.position().left + this.$stage.width() - this.width() + this.settings.margin), this.state.inMotion && this.support3d) 279 i = this.getTransformProperty(), this.drag.offsetX = i, this.animate(i), this.state.inMotion = !0; 280 else if (this.state.inMotion && !this.support3d) 281 return this.state.inMotion = !1, !1; 282 this.drag.startX = g - this.drag.offsetX, this.drag.startY = h - this.drag.offsetY, this.drag.start = g - this.drag.startX, this.drag.targetEl = e.target || e.srcElement, this.drag.updatedX = this.drag.start, ("IMG" === this.drag.targetEl.tagName || "A" === this.drag.targetEl.tagName) && (this.drag.targetEl.draggable = !1), a(c).on("mousemove.owl.dragEvents mouseup.owl.dragEvents touchmove.owl.dragEvents touchend.owl.dragEvents", a.proxy(function (a) { 283 this.eventsRouter(a) 284 }, this)) 285 }, e.prototype.onDragMove = function (a) { 286 var c, e, g, h, i, j; 287 this.state.isTouch && (this.state.isScrolling || (c = a.originalEvent || a || b.event, e = f(c).x, g = f(c).y, this.drag.currentX = e - this.drag.startX, this.drag.currentY = g - this.drag.startY, this.drag.distance = this.drag.currentX - this.drag.offsetX, this.drag.distance < 0 ? this.state.direction = this.settings.rtl ? "right" : "left" : this.drag.distance > 0 && (this.state.direction = this.settings.rtl ? "left" : "right"), this.settings.loop ? this.op(this.drag.currentX, ">", this.coordinates(this.minimum())) && "right" === this.state.direction ? this.drag.currentX -= (this.settings.center && this.coordinates(0)) - this.coordinates(this._items.length) : this.op(this.drag.currentX, "<", this.coordinates(this.maximum())) && "left" === this.state.direction && (this.drag.currentX += (this.settings.center && this.coordinates(0)) - this.coordinates(this._items.length)) : (h = this.coordinates(this.settings.rtl ? this.maximum() : this.minimum()), i = this.coordinates(this.settings.rtl ? this.minimum() : this.maximum()), j = this.settings.pullDrag ? this.drag.distance / 5 : 0, this.drag.currentX = Math.max(Math.min(this.drag.currentX, h + j), i + j)), (this.drag.distance > 8 || this.drag.distance < -8) && (c.preventDefault !== d ? c.preventDefault() : c.returnValue = !1, this.state.isSwiping = !0), this.drag.updatedX = this.drag.currentX, (this.drag.currentY > 16 || this.drag.currentY < -16) && this.state.isSwiping === !1 && (this.state.isScrolling = !0, this.drag.updatedX = this.drag.start), this.animate(this.drag.updatedX))) 288 }, e.prototype.onDragEnd = function (b) { 289 var d, e, f; 290 if (this.state.isTouch) { 291 if ("mouseup" === b.type && this.$stage.removeClass("owl-grab"), this.trigger("dragged"), this.drag.targetEl.removeAttribute("draggable"), this.state.isTouch = !1, this.state.isScrolling = !1, this.state.isSwiping = !1, 0 === this.drag.distance && this.state.inMotion !== !0) 292 return this.state.inMotion = !1, !1; 293 this.drag.endTime = (new Date).getTime(), d = this.drag.endTime - this.drag.startTime, e = Math.abs(this.drag.distance), (e > 3 || d > 300) && this.removeClick(this.drag.targetEl), f = this.closest(this.drag.updatedX), this.speed(this.settings.dragEndSpeed || this.settings.smartSpeed), this.current(f), this.invalidate("position"), this.update(), this.settings.pullDrag || this.drag.updatedX !== this.coordinates(f) || this.transitionEnd(), this.drag.distance = 0, a(c).off(".owl.dragEvents") 294 } 295 }, e.prototype.removeClick = function (c) { 296 this.drag.targetEl = c, a(c).on("click.preventClick", this.e._preventClick), b.setTimeout(function () { 297 a(c).off("click.preventClick") 298 }, 300) 299 }, e.prototype.preventClick = function (b) { 300 b.preventDefault ? b.preventDefault() : b.returnValue = !1, b.stopPropagation && b.stopPropagation(), a(b.target).off("click.preventClick") 301 }, e.prototype.getTransformProperty = function () { 302 var a, c; 303 return a = b.getComputedStyle(this.$stage.get(0), null).getPropertyValue(this.vendorName + "transform"), a = a.replace(/matrix(3d)?\(|\)/g, "").split(","), c = 16 === a.length, c !== !0 ? a[4] : a[12] 304 }, e.prototype.closest = function (b) { 305 var c = -1, d = 30, e = this.width(), f = this.coordinates(); 306 return this.settings.freeDrag || a.each(f, a.proxy(function (a, g) { 307 return b > g - d && g + d > b ? c = a : this.op(b, "<", g) && this.op(b, ">", f[a + 1] || g - e) && (c = "left" === this.state.direction ? a + 1 : a), -1 === c 308 }, this)), this.settings.loop || (this.op(b, ">", f[this.minimum()]) ? c = b = this.minimum() : this.op(b, "<", f[this.maximum()]) && (c = b = this.maximum())), c 309 }, e.prototype.animate = function (b) { 310 this.trigger("translate"), this.state.inMotion = this.speed() > 0, this.support3d ? this.$stage.css({transform: "translate3d(" + b + "px,0px, 0px)", transition: this.speed() / 1e3 + "s"}) : this.state.isTouch ? this.$stage.css({left: b + "px"}) : this.$stage.animate({left: b}, this.speed() / 1e3, this.settings.fallbackEasing, a.proxy(function () { 311 this.state.inMotion && this.transitionEnd() 312 }, this)) 313 }, e.prototype.current = function (a) { 314 if (a === d) 315 return this._current; 316 if (0 === this._items.length) 317 return d; 318 if (a = this.normalize(a), this._current !== a) { 319 var b = this.trigger("change", {property: {name: "position", value: a}}); 320 b.data !== d && (a = this.normalize(b.data)), this._current = a, this.invalidate("position"), this.trigger("changed", {property: {name: "position", value: this._current}}) 321 } 322 return this._current 323 }, e.prototype.invalidate = function (a) { 324 this._invalidated[a] = !0 325 }, e.prototype.reset = function (a) { 326 a = this.normalize(a), a !== d && (this._speed = 0, this._current = a, this.suppress(["translate", "translated"]), this.animate(this.coordinates(a)
326), this.release(["translate", "translated"])) 327 }, e.prototype.normalize = function (b, c) { 328 var e = c ? this._items.length : this._items.length + this._clones.length; 329 return!a.isNumeric(b) || 1 > e ? d : b = this._clones.length ? (b % e + e) % e : Math.max(this.minimum(c), Math.min(this.maximum(c), b)) 330 }, e.prototype.relative = function (a) { 331 return a = this.normalize(a), a -= this._clones.length / 2, this.normalize(a, !0) 332 }, e.prototype.maximum = function (a) { 333 var b, c, d, e = 0, f = this.settings; 334 if (a) 335 return this._items.length - 1; 336 if (!f.loop && f.center) 337 b = this._items.length - 1; 338 else if (f.loop || f.center) 339 if (f.loop || f.center) 340 b = this._items.length + f.items; 341 else { 342 if (!f.autoWidth && !f.merge) 343 throw"Can not detect maximum absolute position."; 344 for (revert = f.rtl?1: - 1, c = this.$stage.width() - this.$element.width(); (d = this.coordinates(e)) && !(d * revert >= c); ) 345 b = ++e 346 } 347 else 348 b = this._items.length - f.items; 349 return b 350 }, e.prototype.minimum = function (a) { 351 return a ? 0 : this._clones.length / 2 352 }, e.prototype.items = function (a) { 353 return a === d ? this._items.slice() : (a = this.normalize(a, !0), this._items[a]) 354 }, e.prototype.mergers = function (a) { 355 return a === d ? this._mergers.slice() : (a = this.normalize(a, !0), this._mergers[a]) 356 }, e.prototype.clones = function (b) { 357 var c = this._clones.length / 2, e = c + this._items.length, f = function (a) { 358 return a % 2 === 0 ? e + a / 2 : c - (a + 1) / 2 359 }; 360 return b === d ? a.map(this._clones, function (a, b) { 361 return f(b) 362 }) : a.map(this._clones, function (a, c) { 363 return a === b ? f(c) : null 364 }) 365 }, e.prototype.speed = function (a) { 366 return a !== d && (this._speed = a), this._speed 367 }, e.prototype.coordinates = function (b) { 368 var c = null; 369 return b === d ? a.map(this._coordinates, a.proxy(function (a, b) { 370 return this.coordinates(b) 371 }, this)) : (this.settings.center ? (c = this._coordinates[b], c += (this.width() - c + (this._coordinates[b - 1] || 0)) / 2 * (this.settings.rtl ? -1 : 1)) : c = this._coordinates[b - 1] || 0, c) 372 }, e.prototype.duration = function (a, b, c) { 373 return Math.min(Math.max(Math.abs(b - a), 1), 6) * Math.abs(c || this.settings.smartSpeed) 374 }, e.prototype.to = function (c, d) { 375 if (this.settings.loop) { 376 var e = c - this.relative(this.current()), f = this.current(), g = this.current(), h = this.current() + e, i = 0 > g - h ? !0 : !1, j = this._clones.length + this._items.length; 377 h < this.settings.items && i === !1 ? (f = g + this._items.length, this.reset(f)) : h >= j - this.settings.items && i === !0 && (f = g - this._items.length, this.reset(f)), b.clearTimeout(this.e._goToLoop), this.e._goToLoop = b.setTimeout(a.proxy(function () { 378 this.speed(this.duration(this.current(), f + e, d)), this.current(f + e), this.update() 379 }, this), 30) 380 } else 381 this.speed(this.duration(this.current(), c, d)), this.current(c), this.update() 382 }, e.prototype.next = function (a) { 383 a = a || !1, this.to(this.relative(this.current()) + 1, a) 384 }, e.prototype.prev = function (a) { 385 a = a || !1, this.to(this.relative(this.current()) - 1, a) 386 }, e.prototype.transitionEnd = function (a) { 387 return a !== d && (a.stopPropagation(), (a.target || a.srcElement || a.originalTarget) !== this.$stage.get(0)) ? !1 : (this.state.inMotion = !1, void this.trigger("translated")) 388 }, e.prototype.viewport = function () { 389 var d; 390 if (this.options.responsiveBaseElement !== b) 391 d = a(this.options.responsiveBaseElement).width(); 392 else if (b.innerWidth) 393 d = b.innerWidth; 394 else { 395 if (!c.documentElement || !c.documentElement.clientWidth) 396 throw"Can not detect viewport width."; 397 d = c.documentElement.clientWidth 398 } 399 return d 400 }, e.prototype.replace = function (b) { 401 this.$stage.empty(), this._items = [], b && (b = b instanceof jQuery ? b : a(b)), this.settings.nestedItemSelector && (b = b.find("." + this.settings.nestedItemSelector)), b.filter(function () { 402 return 1 === this.nodeType 403 }).each(a.proxy(function (a, b) { 404 b = this.prepare(b), this.$stage.append(b), this._items.push(b), this._mergers.push(1 * b.find("[data-merge]").andSelf("[data-merge]").attr("data-merge") || 1) 405 }, this)), this.reset(a.isNumeric(this.settings.startPosition) ? this.settings.startPosition : 0), this.invalidate("items") 406 }, e.prototype.add = function (a, b) {
407 b = b === d ? this._items.length : this.normalize(b, !0), this.trigger("add", {content: a, position: b}), 0 === this._items.length || b === this._items.length ? (this.$stage.append(a), this._items.push(a), this._mergers.push(1 * a.find("[data-merge]").andSelf("[data-merge]").attr("data-merge") || 1)) : (this._items[b].before(a), this._items.splice(b, 0, a), this._mergers.splice(b, 0, 1 * a.find("[data-merge]").andSelf("[data-merge]").attr("data-merge") || 1)), this.invalidate("items"), this.trigger("added", {content: a, position: b}) 408 }, e.prototype.remove = function (a) { 409 a = this.normalize(a, !0), a !== d && (this.trigger("remove", {content: this._items[a], position: a}), this._items[a].remove(), this._items.splice(a, 1), this._mergers.splice(a, 1), this.invalidate("items"), this.trigger("removed", {content: null, position: a})) 410 }, e.prototype.addTriggerableEvents = function () { 411 var b = a.proxy(function (b, c) { 412 return a.proxy(function (a) { 413 a.relatedTarget !== this && (this.suppress([c]), b.apply(this, [].slice.call(arguments, 1)), this.release([c])) 414 }, this) 415 }, this); 416 a.each({next: this.next, prev: this.prev, to: this.to, destroy: this.destroy, refresh: this.refresh, replace: this.replace, add: this.add, remove: this.remove}, a.proxy(function (a, c) { 417 this.$element.on(a + ".owl.carousel", b(c, a + ".owl.carousel")) 418 }, this)) 419 }, e.prototype.watchVisibility = function () { 420 function c(a) { 421 return a.offsetWidth > 0 && a.offsetHeight > 0 422 } 423 function d() { 424 c(this.$element.get(0)) && (this.$element.removeClass("owl-hidden"), this.refresh(), b.clearInterval(this.e._checkVisibile)) 425 } 426 c(this.$element.get(0)) || (this.$element.addClass("owl-hidden"), b.clearInterval(this.e._checkVisibile), this.e._checkVisibile = b.setInterval(a.proxy(d, this), 500)) 427 }, e.prototype.preloadAutoWidthImages = function (b) { 428 var c, d, e, f; 429 c = 0, d = this, b.each(function (g, h) { 430 e = a(h), f = new Image, f.onload = function () { 431 c++, e.attr("src", f.src), e.css("opacity", 1), c >= b.length && (d.state.imagesLoaded = !0, d.initialize()) 432 }, f.src = e.attr("src") || e.attr("data-src") || e.attr("data-src-retina") 433 }) 434 }, e.prototype.destroy = function () { 435 this.$element.hasClass(this.settings.themeClass) && this.$element.removeClass(this.settings.themeClass), this.settings.responsive !== !1 && a(b).off("resize.owl.carousel"), this.transitionEndVendor && this.off(this.$stage.get(0), this.transitionEndVendor, this.e._transitionEnd); 436 for (var d in this._plugins) 437 this._plugins[d].destroy(); 438 (this.settings.mouseDrag || this.settings.touchDrag) && (this.$stage.off("mousedown touchstart touchcancel"), a(c).off(".owl.dragEvents"), this.$stage.get(0).onselectstart = function () { 439 }, this.$stage.off("dragstart", function () { 440 return!1 441 })), this.$element.off(".owl"), this.$stage.children(".cloned").remove(), this.e = null, this.$element.removeData("owlCarousel"), this.$stage.children().contents().unwrap(), this.$stage.children().unwrap(), this.$stage.unwrap() 442 }, e.prototype.op = function (a, b, c) { 443 var d = this.settings.rtl; 444 switch (b) { 445 case"<": 446 return d ? a > c : c > a; 447 case">": 448 return d ? c > a : a > c; 449 case">=": 450 return d ? c >= a : a >= c; 451 case"<=": 452 return d ? a >= c : c >= a 453 } 454 }, e.prototype.on = function (a, b, c, d) { 455 a.addEventListener ? a.addEventListener(b, c, d) : a.attachEvent && a.attachEvent("on" + b, c) 456 }, e.prototype.off = function (a, b, c, d) { 457 a.removeEventListener ? a.removeEventListener(b, c, d) : a.detachEvent && a.detachEvent("on" + b, c) 458 }, e.prototype.trigger = function (b, c, d) { 459 var e = {item: {count: this._items.length, index: this.current()}}, f = a.camelCase(a.grep(["on", b, d], function (a) { 460 return a 461 }).join("-").toLowerCase()), g = a.Event([b, "owl", d || "carousel"].join(".").toLowerCase(), a.extend({relatedTarget: this}, e, c)); 462 return this._supress[b] || (a.each(this._plugins, function (a, b) { 463 b.onTrigger && b.onTrigger(g) 464 }), this.$element.trigger(g), this.settings && "function" == typeof this.settings[f] && this.settings[f].apply(this, g)), g 465 }, e.prototype.suppress = function (b) { 466 a.each(b, a.proxy(function (a, b) { 467 this._supress[b] = !0 468 }, this)) 469 }, e.prototype.release = function (b) { 470 a.each(b, a.proxy(function (a, b) { 471 delete this._supress[b] 472 }, this)) 473 }, e.prototype.browserSupport = function () { 474 if (this.support3d = j(), this.support3d) { 475 this.transformVendor = i(); 476 var a = ["transitionend", "webkitTransitionEnd", "transitionend", "oTransitionEnd"]; 477 this.transitionEndVendor = a[h()], this.vendorName = this.transformVendor.replace(/Transform/i, ""), this.vendorName = "" !== this.vendorName ? "-" + this.vendorName.toLowerCase() + "-" : "" 478 } 479 this.state.orientation = b.orientation 480 }, a.fn.owlCarousel = function (b) { 481 return this.each(function () { 482 a(this).data("owlCarousel") || a(this).data("owlCarousel", new e(this, b)) 483 }) 484 }, a.fn.owlCarousel.Constructor = e 485}(window.Zepto || window.jQuery, window, document), function (a, b) { 486 var c = function (b) { 487 this._core = b, this._loaded = [], this._handlers = {"initialized.owl.carousel change.owl.carousel": a.proxy(function (b) { 488 if (b.namespace && this._core.settings && this._core.settings.lazyLoad && (b.property && "position" == b.property.name || "initialized" == b.type)) 489 for (var c = this._core.settings, d = c.center && Math.ceil(c.items / 2) || c.items, e = c.center && -1 * d || 0, f = (b.property && b.property.value || this._core.current()) + e, g = this._core.clones().length, h
489= a.proxy(function (a, b) { 490 this.load(b) 491 }, this); e++ < d; ) 492 this.load(g / 2 + this._core.relative(f)), g && a.each(this._core.clones(this._core.relative(f++)), h) 493 }, this)}, this._core.options = a.extend({}, c.Defaults, this._core.options), this._core.$element.on(this._handlers) 494 }; 495 c.Defaults = {lazyLoad: !1}, c.prototype.load = function (c) { 496 var d = this._core.$stage.children().eq(c), e = d && d.find(".owl-lazy"); 497 !e || a.inArray(d.get(0), this._loaded) > -1 || (e.each(a.proxy(function (c, d) { 498 var e, f = a(d), g = b.devicePixelRatio > 1 && f.attr("data-src-retina") || f.attr("data-src"); 499 this._core.trigger("load", {element: f, url: g}, "lazy"), f.is("img") ? f.one("load.owl.lazy", a.proxy(function () { 500 f.css("opacity", 1), this._core.trigger("loaded", {element: f, url: g}, "lazy") 501 }, this)).attr("src", g) : (e = new Image, e.onload = a.proxy(function () { 502 f.css({"background-image": "url(" + g + ")", opacity: "1"}), this._core.trigger("loaded", {element: f, url: g}, "lazy") 503 }, this), e.src = g) 504 }, this)), this._loaded.push(d.get(0))) 505 }, c.prototype.destroy = function () { 506 var a, b; 507 for (a in this.handlers) 508 this._core.$element.off(a, this.handlers[a]); 509 for (b in Object.getOwnPropertyNames(this)) 510 "function" != typeof this[b] && (this[b] = null) 511 }, a.fn.owlCarousel.Constructor.Plugins.Lazy = c 512}(window.Zepto || window.jQuery, window, document), function (a) { 513 var b = function (c) { 514 this._core = c, this._handlers = {"initialized.owl.carousel": a.proxy(function () { 515 this._core.settings.autoHeight && this.update() 516 }, this), "changed.owl.carousel": a.proxy(function (a) { 517 this._core.settings.autoHeight && "position" == a.property.name && this.update() 518 }, this), "loaded.owl.lazy": a.proxy(function (a) { 519 this._core.settings.autoHeight && a.element.closest("." + this._core.settings.itemClass) === this._core.$stage.children().eq(this._core.current()) && this.update() 520 }, this)}, this._core.options = a.extend({}, b.Defaults, this._core.options), this._core.$element.on(this._handlers) 521 }; 522 b.Defaults = {autoHeight: !1, autoHeightClass: "owl-height"}, b.prototype.update = function () { 523 this._core.$stage.parent().height(this._core.$stage.children().eq(this._core.current()).height()).addClass(this._core.settings.autoHeightClass) 524 }, b.prototype.destroy = function () { 525 var a, b; 526 for (a in this._handlers) 527 this._core.$element.off(a, this._handlers[a]); 528 for (b in Object.getOwnPropertyNames(this)) 529 "function" != typeof this[b] && (this[b] = null) 530 }, a.fn.owlCarousel.Constructor.Plugins.AutoHeight = b 531}(window.Zepto || window.jQuery, window, document), function (a, b, c) { 532 var d = function (b) { 533 this._core = b, this._videos = {}, this._playing = null, this._fullscreen = !1, this._handlers = {"resize.owl.carousel": a.proxy(function (a) { 534 this._core.settings.video && !this.isInFullScreen() && a.preventDefault() 535 }, this), "refresh.owl.carousel changed.owl.carousel": a.proxy(function () { 536 this._playing && this.stop() 537 }, this), "prepared.owl.carousel": a.proxy(function (b) { 538 var c = a(b.content).find(".owl-video"); 539 c.length && (c.css("display", "none"), this.fetch(c, a(b.content))) 540 }, this)}, this._core.options = a.extend({}, d.Defaults, this._core.options), this._core.$element.on(this._handlers), this._core.$element.on("click.owl.video", ".owl-video-play-icon", a.proxy(function (a) { 541 this.play(a) 542 }, this)) 543 }; 544 d.Defaults = {video: !1, videoHeight: !1, videoWidth: !1}, d.prototype.fetch = function (a, b) { 545 var c = a.attr("data-vimeo-id") ? "vimeo" : "youtube", d = a.attr("data-vimeo-id") || a.attr("data-youtube-id"), e = a.attr("data-width") || this._core.settings.videoWidth, f = a.attr("data-height") || this._core.settings.videoHeight, g = a.attr("href"); 546 if (!g) 547 throw new Error("Missing video URL."); 548 if (d = g.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/), d[3].indexOf("youtu") > -1) 549 c = "youtube"; 550 else { 551 if (!(d[3].indexOf("vimeo") > -1)) 552 throw new Error("Video URL not supported."); 553 c = "vimeo" 554 } 555 d = d[6], this._videos[g] = {type: c, id: d, width: e, height: f}, b.attr("data-video", g), this.thumbnail(a, this._videos[g]) 556 }, d.prototype.thumbnail = function (b, c) { 557 var d, e, f, g = c.width && c.height ? 'style="width:' + c.width + "px;height:" + c.height + 'px;"' : "", h = b.find("img"), i = "src", j = "", k = this._core.settings, l = function (a) { 558 e = '<div class="owl-video-play-icon"></div>', d = k.lazyLoad ? '<div class="owl-video-tn ' + j + '" ' + i + '="' + a + '"></div>' : '<div class="owl-video-tn" style="opacity:1;background-image:url(' + a + ')"></div>', b.after(d), b.after(e) 559 }; 560 return b.wrap('<div class="owl-video-wrapper"' + g + "></div>"), this._core.settings.lazyLoad && (i = "data-src", j = "owl-lazy"), h.length ? (l(h.attr(i)), h.remove(), !1) : void("youtube" === c.type ? (f = "http://img.youtube.com/vi/" + c.id + "/hqdefault.jpg", l(f)) : "vimeo" === c.type && a.aja
560x({type: "GET", url: "http://vimeo.com/api/v2/video/" + c.id + ".json", jsonp: "callback", dataType: "jsonp", success: function (a) { 561 f = a[0].thumbnail_large, l(f) 562 }})) 563 }, d.prototype.stop = function () { 564 this._core.trigger("stop", null, "video"), this._playing.find(".owl-video-frame").remove(), this._playing.removeClass("owl-video-playing"), this._playing = null 565 }, d.prototype.play = function (b) { 566 this._core.trigger("play", null, "video"), this._playing && this.stop(); 567 var c, d, e = a(b.target || b.srcElement), f = e.closest("." + this._core.settings.itemClass), g = this._videos[f.attr("data-video")], h = g.width || "100%", i = g.height || this._core.$stage.height(); 568 "youtube" === g.type ? c = '<iframe width="' + h + '" height="' + i + '" src="http://www.youtube.com/embed/' + g.id + "?autoplay=1&v=" + g.id + '" frameborder="0" allowfullscreen></iframe>' : "vimeo" === g.type && (c = '<iframe src="http://player.vimeo.com/video/' + g.id + '?autoplay=1" width="' + h + '" height="' + i + '" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>'), f.addClass("owl-video-playing"), this._playing = f, d = a('<div style="height:' + i + "px; width:" + h + 'px" class="owl-video-frame">' + c + "</div>"), e.after(d) 569 }, d.prototype.isInFullScreen = function () { 570 var d = c.fullscreenElement || c.mozFullScreenElement || c.webkitFullscreenElement; 571 return d && a(d).parent().hasClass("owl-video-frame") && (this._core.speed(0), this._fullscreen = !0), d && this._fullscreen && this._playing ? !1 : this._fullscreen ? (this._fullscreen = !1, !1) : this._playing && this._core.state.orientation !== b.orientation ? (this._core.state.orientation = b.orientation, !1) : !0 572 }, d.prototype.destroy = function () { 573 var a, b; 574 this._core.$element.off("click.owl.video"); 575 for (a in this._handlers) 576 this._core.$element.off(a, this._handlers[a]); 577 for (b in Object.getOwnPropertyNames(this)) 578 "function" != typeof this[b] && (this[b] = null) 579 }, a.fn.owlCarousel.Constructor.Plugins.Video = d 580}(window.Zepto || window.jQuery, window, document), function (a, b, c, d) { 581 var e = function (b) { 582 this.core = b, this.core.options = a.extend({}, e.Defaults, this.core.options), this.swapping = !0, this.previous = d, this.next = d, this.handlers = {"change.owl.carousel": a.proxy(function (a) { 583 "position" == a.property.name && (this.previous = this.core.current(), this.next = a.property.value) 584 }, this), "drag.owl.carousel dragged.owl.carousel translated.owl.carousel": a.proxy(function (a) { 585 this.swapping = "translated" == a.type 586 }, this), "translate.owl.carousel": a.proxy(function () { 587 this.swapping && (this.core.options.animateOut || this.core.options.animateIn) && this.swap() 588 }, this)}, this.core.$element.on(this.handlers) 589 }; 590 e.Defaults = {animateOut: !1, animateIn: !1}, e.prototype.swap = function () { 591 if (1 === this.core.settings.items && this.core.support3d) { 592 this.core.speed(0); 593 var b, c = a.proxy(this.clear, this), d = this.core.$stage.children().eq(this.previous), e = this.core.$stage.children().eq(this.next), f = this.core.settings.animateIn, g = this.core.settings.animateOut; 594 this.core.current() !== this.previous && (g && (b = this.core.coordinates(this.previous) - this.core.coordinates(this.next), d.css({left: b + "px"}).addClass("animated owl-animated-out").addClass(g).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend", c)), f && e.addClass("animated owl-animated-in").addClass(f).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend", c)) 595 } 596 }, e.prototype.clear = function (b) { 597 a(b.target).css({left: ""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut), this.core.transitionEnd() 598 }, e.prototype.destroy = function () { 599 var a, b; 600 for (a in this.handlers) 601 this.core.$element.off(a, this.handlers[a]); 602 for (b in Object.getOwnPropertyNames(this)) 603 "function" != typeof this[b] && (this[b] = null) 604 }, a.fn.owlCarousel.Constructor.Plugins.Animate = e 605}(window.Zepto || window.jQuery, window, document), function (a, b, c) { 606 var d = function (b) { 607 this.core = b, this.core.options = a.extend({}, d.Defaults, this.core.options), this.handlers = {"translated.owl.carousel refreshed.owl.carousel": a.proxy(function () { 608 this.autoplay() 609 }, this), "play.owl.autoplay": a.proxy(function (a, b, c) { 610 this.play(b, c) 611 }, this), "stop.owl.autoplay": a.proxy(function () { 612 this.stop() 613 }, this), "mouseover.owl.autoplay": a.proxy(function () { 614 this.core.settings.autoplayHoverPause && this.pause() 615 }, this), "mouseleave.owl.autoplay": a.proxy(function () { 616 this.core.settings.autoplayHoverPause && this.autoplay() 617 }, this)}, this.core.$element.on(this.handlers) 618 }; 619 d.Defaults = {autoplay: !1, autoplayTimeout: 5e3, autoplayHoverPause: !1, autoplaySpeed: !1}, d.prototype.autoplay = function () { 620 this.core.settings.autoplay && !this.core.state.videoPlay ? (b.clearInterval(this.interval), this.interval = b.setInterval(a.proxy(function () { 621 this.play() 622 }, this), this.core.settings.autoplayTimeout)) : b.clearInterval(this.interval) 623 }, d.prototype.play = function () { 624 return c.hidden === !0 || this.core.state.isTouch || this.core.state.isScrolling || this.core.state.isSwiping || this.core.state.inMotion ? void 0 : this.core.settings.autoplay === !1 ? void b.clearInterval(this.interval) : void this.core.next(this.core.settings.autoplaySpeed) 625 }, d.prototype.stop = function () { 626 b.clearInterval(this.interval) 627 }, d.prototype.pause = function () { 628 b.clearInterval(this.interval) 629 }, d.prototype.destroy = function () { 630 var a, c; 631 b.clearInterval(this.interval); 632 for (a in this.handlers) 633 this.core.$element.off(a, this.handlers[a]); 634 for (c in Object.getOwnPropertyNames(this)) 635 "function" != typeof this[c] && (this[c] = null) 636 }, a.fn.owlCarousel.Constructor.Plugins.autoplay = d 637}(window.Zepto || window.jQuery, window, document), function (a) { 638 "use strict"; 639 var b = function (c) { 640 this._core = c, this._initialized = !1, this._pages = [], this._controls = {}, this._templates = [], this.$element = this._core.$element, this._overrides = {next: this._core.next, prev: this._core.prev, to: this._core.to}, this._handlers = {"prepared.owl.carousel": a.proxy(function (b) { 641 this._core.settings.dotsData && this._templates.push(a(b.content).find("[data-dot]").andSelf("[data-dot]").attr("data-dot")) 642 }, this), "add.owl.carousel": a.proxy(function (b) { 643 this._core.settings.dotsData && this._templates.splice(b.position, 0, a(b.content).find("[data-dot]").andSelf("[data-dot]").attr("data-dot")) 644 }, this), "remove.owl.carousel prepared.owl.carousel": a.proxy(function (a) { 645 this._core.settings.dotsData && this._templates.splice(a.position, 1) 646 }, this), "change.owl.carousel": a.proxy(function (a) { 647 if ("position" == a.property.name && !this._core.state.revert && !this._core.settings.loop && this._core.settings.navRewind) { 648 var b = this._core.current(), c = this._core.maximum(), d = this._core.minimum(); 649 a.data = a.property.value > c ? b >= c ? d : c : a.property.value < d ? c : a.property.value 650 } 651 }, this), "changed.owl.carousel": a.proxy(function (a) { 652 "position" == a.property.name && this.draw() 653 }, this), "refreshed.owl.carousel": a.proxy(function () { 654 this._initialized || (this.initialize(), this._initialized = !0), this._core.trigger("refresh", null, "navigation"), this.update(), this.draw(), this._core.trigger("refreshed", null, "navigation") 655 }, this)}, this._core.options = a.extend({}, b.Defaults, this._core.options), this.$element.on(this._handlers) 656 }; 657 b.Defaults = {nav: !1, navRewind: !0, navText: ["prev", "next"], navSpeed: !1, navElement: "div", navContainer: !1, navContainerClass: "owl-nav", navClass: ["owl-prev", "owl-next"], slideBy: 1, dotClass: "owl-dot", dotsClass: "owl-dots", dots: !0, dotsEach: !1, dotData: !1, dotsSpeed: !1, dotsContainer: !1, controlsClass: "owl-control
657s"}, b.prototype.initialize = function () { 658 var b, c, d = this._core.settings; 659 d.dotsData || (this._templates = [a("<div>").addClass(d.dotClass).append(a("<span>")).prop("outerHTML")]), d.navContainer && d.dotsContainer || (this._controls.$container = a("<div>").addClass(d.controlsClass).appendTo(this.$element)), this._controls.$indicators = d.dotsContainer ? a(d.dotsContainer) : a("<div>").hide().addClass(d.dotsClass).appendTo(this._controls.$container), this._controls.$indicators.on("click", "div", a.proxy(function (b) { 660 var c = a(b.target).parent().is(this._controls.$indicators) ? a(b.target).index() : a(b.target).parent().index(); 661 b.preventDefault(), this.to(c, d.dotsSpeed) 662 }, this)), b = d.navContainer ? a(d.navContainer) : a("<div>").addClass(d.navContainerClass).prependTo(this._controls.$container), this._controls.$next = a("<" + d.navElement + ">"), this._controls.$previous = this._controls.$next.clone(), this._controls.$previous.addClass(d.navClass[0]).html(d.navText[0]).hide().prependTo(b).on("click", a.proxy(function () { 663 this.prev(d.navSpeed) 664 }, this)), this._controls.$next.addClass(d.navClass[1]).html(d.navText[1]).hide().appendTo(b).on("click", a.proxy(function () { 665 this.next(d.navSpeed) 666 }, this)); 667 for (c in this._overrides) 668 this._core[c] = a.proxy(this[c], this) 669 }, b.prototype.destroy = function () { 670 var a, b, c, d; 671 for (a in this._handlers) 672 this.$element.off(a, this._handlers[a]); 673 for (b in this._controls) 674 this._controls[b].remove(); 675 for (d in this.overides) 676 this._core[d] = this._overrides[d]; 677 for (c in Object.getOwnPropertyNames(this)) 678 "function" != typeof this[c] && (this[c] = null) 679 }, b.prototype.update = function () { 680 var a, b, c, d = this._core.settings, e = this._core.clones().length / 2, f = e + this._core.items().length, g = d.center || d.autoWidth || d.dotData ? 1 : d.dotsEach || d.items; 681 if ("page" !== d.slideBy && (d.slideBy = Math.min(d.slideBy, d.items)), d.dots || "page" == d.slideBy) 682 for (this._pages = [], a = e, b = 0, c = 0; f > a; a++) 683 (b >= g || 0 === b) && (this._pages.push({start: a - e, end: a - e + g - 1}), b = 0, ++c), b += this._core.mergers(this._core.relative(a)) 684 }, b.prototype.draw = function () { 685 var b, c, d = "", e = this._core.settings, f = (this._core.$stage.children(), this._core.relative(this._core.current())); 686 if (!e.nav || e.loop || e.navRewind || (this._controls.$previous.toggleClass("disabled", 0 >= f), this._controls.$next.toggleClass("disabled", f >= this._core.maximum())), this._controls.$previous.toggle(e.nav), this._controls.$next.toggle(e.nav), e.dots) { 687 if (b = this._pages.length - this._controls.$indicators.children().length, e.dotData && 0 !== b) { 688 for (c = 0; c < this._controls.$indicators.children().length; c++) 689 d += this._templates[this._core.relative(c)]; 690 this._controls.$indicators.html(d) 691 } else 692 b > 0 ? (d = new Array(b + 1).join(this._templates[0]), this._controls.$indicators.append(d)) : 0 > b && this._controls.$indicators.children().slice(b).remove(); 693 this._controls.$indicators.find(".active").removeClass("active"), this._controls.$indicators.children().eq(a.inArray(this.current(), this._pages)).addClass("active") 694 } 695 this._controls.$indicators.toggle(e.dots) 696 }, b.prototype.onTrigger = function (b) { 697 var c = this._core.settings; 698 b.page = {index: a.inArray(this.current(), this._pages), count: this._pages.length, size: c && (c.center || c.autoWidth || c.dotData ? 1 : c.dotsEach || c.items)} 699 }, b.prototype.current = function () { 700 var b = this._core.relative(this._core.current()); 701 return a.grep(this._pages, function (a) { 702 return a.start <= b && a.end >= b 703 }).pop() 704 }, b.prototype.getPosition = function (b) { 705 var c, d, e = this._core.settings; 706 return"page" == e.slideBy ? (c = a.inArray(this.current(), this._pages), d = this._pages.length, b ? ++c : --c, c = this._pages[(c % d + d) % d].start) : (c = this._core.relative(this._core.current()), d = this._core.items().length, b ? c += e.
706slideBy : c -= e.slideBy), c 707 }, b.prototype.next = function (b) { 708 a.proxy(this._overrides.to, this._core)(this.getPosition(!0), b) 709 }, b.prototype.prev = function (b) { 710 a.proxy(this._overrides.to, this._core)(this.getPosition(!1), b) 711 }, b.prototype.to = function (b, c, d) { 712 var e; 713 d ? a.proxy(this._overrides.to, this._core)(b, c) : (e = this._pages.length, a.proxy(this._overrides.to, this._core)(this._pages[(b % e + e) % e].start, c)) 714 }, a.fn.owlCarousel.Constructor.Plugins.Navigation = b 715}(window.Zepto || window.jQuery, window, document), function (a, b) { 716 "use strict"; 717 var c = function (d) { 718 this._core = d, this._hashes = {}, this.$element = this._core.$element, this._handlers = {"initialized.owl.carousel": a.proxy(function () { 719 "URLHash" == this._core.settings.startPosition && a(b).trigger("hashchange.owl.navigation") 720 }, this), "prepared.owl.carousel": a.proxy(function (b) { 721 var c = a(b.content).find("[data-hash]").andSelf("[data-hash]").attr("data-hash"); 722 this._hashes[c] = b.content 723 }, this)}, this._core.options = a.extend({}, c.Defaults, this._core.options), this.$element.on(this._handlers), a(b).on("hashchange.owl.navigation", a.proxy(function () { 724 var a = b.location.hash.substring(1), c = this._core.$stage.children(), d = this._hashes[a] && c.index(this._hashes[a]) || 0; 725 return a ? void this._core.to(d, !1, !0) : !1 726 }, this)) 727 }; 728 c.Defaults = {URLhashListener: !1}, c.prototype.destroy = function () { 729 var c, d; 730 a(b).off("hashchange.owl.navigation"); 731 for (c in this._handlers) 732 this._core.$element.off(c, this._handlers[c]); 733 for (d in Object.getOwnPropertyNames(this)) 734 "function" != typeof this[d] && (this[d] = null) 735 }, a.fn.owlCarousel.Constructor.Plugins.Hash = c 736}(window.Zepto || window.jQuery, window, document); 737(function (e) { 738 var t = e(window); 739 var n = t.height(); 740 t.resize(function () { 741 n = t.height() 742 }); 743 e.fn.parallax = function (r, i, s) { 744 function l() { 745 var s = t.scrollTop(); 746 o.each(function () { 747 var t = e(this); 748 var f = t.offset().top; 749 var l = u(t); 750 if (f + l < s || f > s + n) { 751 return 752 } 753 o.css("backgroundPosition", r + " " + Math.round((a - s) * i) + "px") 754 }) 755 } 756 var o = e(this); 757 var u; 758 var a; 759 var f = 0; 760 o.each(function () { 761 a = o.offset().top 762 }); 763 if (s) { 764 u = function (e) { 765 return e.outerHeight(true) 766 } 767 } else { 768 u = function (e) { 769 return e.height() 770 } 771 } 772 if (arguments.length < 1 || r === null) 773 r = "50%"; 774 if (arguments.length < 2 || i === null) 775 i = .1; 776 if (arguments.length < 3 || s === null) 777 s = true; 778 t.bind("scroll", l).resize(l); 779 l() 780 } 781})(jQuery) 782 ; 783(function (window, document, $, undefined) { 784 "use strict"; 785 786 var H = $("html"), 787 W = $(window), 788 D = $(document), 789 F = $.fancybox = function () { 790 F.open.apply(this, arguments); 791 }, 792 IE = navigator.userAgent.match(/msie/i), 793 didUpdate = null, 794 isTouch = document.createTouch !== undefined, 795 isQuery = function (obj) { 796 return obj && obj.hasOwnProperty && obj instanceof $; 797 }, 798 isString = function (str) { 799 return str && $.type(str) === "string"; 800 }, 801 isPercentage = function (str) { 802 return isString(str) && str.indexOf('%') > 0; 803 }, 804 isScrollable = function (el) { 805 return (el && !(el.style.overflow && el.style.overflow === 'hidden') && ((el.clientWidth && el.scrollWidth > el.clientWidth) || (el.clientHeight && el.scrollHeight > el.clientHeight))); 806 }, 807 getScalar = function (orig, dim) { 808 var value = parseInt(orig, 10) || 0; 809 810 if (dim && isPercentage(orig)) { 811 value = F.getViewport()[ dim ] / 100 * value; 812 } 813 814 return Math.ceil(value); 815 }, 816 getValue = function (value, dim) { 817 return getScalar(value, dim) + 'px'; 818 }; 819 820 $.extend(F, { 821 // The current version of fancyBox 822 version: '2.1.5', 823 defaults: { 824 padding: 15, 825 margin: 20, 826 width: 800, 827 height: 600, 828 minWidth: 100, 829 minHeight: 100, 830 maxWidth: 9999, 831 maxHeight: 9999,
vendor: 59,717 bytes, lines 832-2597
832 pixelRatio: 1, // Set to 2 for retina display support 833 834 autoSize: true, 835 autoHeight: false, 836 autoWidth: false, 837 autoResize: true, 838 autoCenter: !isTouch, 839 fitToView: true, 840 aspectRatio: false, 841 topRatio: 0.5, 842 leftRatio: 0.5, 843 scrolling: 'auto', // 'auto', 'yes' or 'no' 844 wrapCSS: '', 845 arrows: true, 846 closeBtn: true, 847 closeClick: false, 848 nextClick: false, 849 mouseWheel: true, 850 autoPlay: false, 851 playSpeed: 3000, 852 preload: 3, 853 modal: false, 854 loop: true, 855 ajax: { 856 dataType: 'html', 857 headers: {'X-fancyBox': true} 858 }, 859 iframe: { 860 scrolling: 'auto', 861 preload: true 862 }, 863 swf: { 864 wmode: 'transparent', 865 allowfullscreen: 'true', 866 allowscriptaccess: 'always' 867 }, 868 keys: { 869 next: { 870 13: 'left', // enter 871 34: 'up', // page down 872 39: 'left', // right arrow 873 40: 'up' // down arrow 874 }, 875 prev: { 876 8: 'right', // backspace 877 33: 'down', // page up 878 37: 'right', // left arrow 879 38: 'down' // up arrow 880 }, 881 close: [27], // escape key 882 play: [32], // space - start/stop slideshow 883 toggle: [70] // letter "f" - toggle fullscreen 884 }, 885 direction: { 886 next: 'left', 887 prev: 'right' 888 }, 889 scrollOutside: true, 890 // Override some properties 891 index: 0, 892 type: null, 893 href: null, 894 content: null, 895 title: null, 896 // HTML templates 897 tpl: { 898 wrap: '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>', 899 image: '<img class="fancybox-image" src="{href}" alt="" />', 900 iframe: '<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen' + (IE ? ' allowtransparency="true"' : '') + '></iframe>', 901 error: '<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>', 902 closeBtn: '<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>', 903 next: '<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>', 904 prev: '<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>', 905 loading: '<div id="fancybox-loading"><div></div></div>' 906 }, 907 // Properties for each animation type 908 // Opening fancyBox 909 openEffect: 'fade', // 'elastic', 'fade' or 'none' 910 openSpeed: 250, 911 openEasing: 'swing', 912 openOpacity: true, 913 openMethod: 'zoomIn', 914 // Closing fancyBox 915 closeEffect: 'fade', // 'elastic', 'fade' or 'none' 916 closeSpeed: 250, 917 closeEasing: 'swing', 918 closeOpacity: true, 919 closeMethod: 'zoomOut', 920 // Changing next gallery item 921 nextEffect: 'elastic', // 'elastic', 'fade' or 'none' 922 nextSpeed: 250, 923 nextEasing: 'swing', 924 nextMethod: 'changeIn', 925 // Changing previous gallery item 926 prevEffect: 'elastic', // 'elastic', 'fade' or 'none' 927 prevSpeed: 250, 928 prevEasing: 'swing', 929 prevMethod: 'changeOut', 930 // Enable default helpers 931 helpers: { 932 overlay: true, 933 title: true 934 }, 935 // Callbacks 936 onCancel: $.noop, // If canceling 937 beforeLoad: $.noop, // Before loading 938 afterLoad: $.noop, // After loading 939 beforeShow: $.noop, // Before changing in current item 940 afterShow: $.noop, // After opening 941 beforeChange: $.noop, // Before changing gallery item 942 beforeClose: $.noop, // Before closing 943 afterClose: $.noop // After closing 944 }, 945 //Current state 946 group: {}, // Selected group 947 opts: {}, // Group options 948 previous: null, // Previous element 949 coming: null, // Element being loaded 950 current: null, // Currently loaded element 951 isActive: false, // Is activated 952 isOpen: false, // Is currently open 953 isOpened: false, // Have been fully opened at least once 954 955 wrap: null, 956 skin: null, 957 outer: null, 958 inner: null, 959 player: { 960 timer: null, 961 isActive: false 962 }, 963 // Loaders 964 ajaxLoad: null, 965 imgPreload: null, 966 // Some collections 967 transitions: {}, 968 helpers: {}, 969 /* 970 * Static methods 971 */ 972 973 open: function (group, opts) { 974 if (!group) { 975 return; 976 } 977 978 if (!$.isPlainObject(opts)) { 979 opts = {}; 980 } 981 982 // Close if already active 983 if (false === F.close(true)) { 984 return; 985 } 986 987 // Normalize group 988 if (!$.isArray(group)) { 989 group = isQuery(group) ? $(group).get() : [group]; 990 } 991 992 // Recheck if the type of each element is `object` and set content type (image, ajax, etc) 993 $.each(group, function (i, element) { 994 var obj = {}, 995 href, 996 title, 997 content, 998 type, 999 rez, 1000 hrefParts, 1001 selector; 1002 1003 if ($.type(element) === "object") { 1004 // Check if is DOM element 1005 if (element.nodeType) { 1006 element = $(element); 1007 } 1008 1009 if (isQuery(element)) { 1010 obj = { 1011 href: element.data('fancybox-href') || element.attr('href'), 1012 title: $('<div/>').text(element.data('fancybox-title') || element.attr('title') || '').html(), 1013 isDom: true, 1014 element: element 1015 }; 1016 1017 if ($.metadata) { 1018 $.extend(true, obj, element.metadata()); 1019 } 1020 1021 } else { 1022 obj = element; 1023 } 1024 } 1025 1026 href = opts.href || obj.href || (isString(element) ? element : null); 1027 title = opts.title !== undefined ? opts.title : obj.title || ''; 1028 1029 content = opts.content || obj.content; 1030 type = content ? 'html' : (opts.type || obj.type); 1031 1032 if (!type && obj.isDom) { 1033 type = element.data('fancybox-type'); 1034 1035 if (!type) { 1036 rez = element.prop('class').match(/fancybox\.(\w+)/); 1037 type = rez ? rez[1] : null; 1038 } 1039 } 1040 1041 if (isString(href)) { 1042 // Try to guess the content type 1043 if (!type) { 1044 if (F.isImage(href)) { 1045 type = 'image'; 1046 1047 } else if (F.isSWF(href)) { 1048 type = 'swf'; 1049 1050 } else if (href.charAt(0) === '#') { 1051 type = 'inline'; 1052 1053 } else if (isString(element)) { 1054 type = 'html'; 1055 content = element; 1056 } 1057 } 1058 1059 // Split url into two pieces with source url and content selector, e.g, 1060 // "/mypage.html #my_id" will load "/mypage.html" and display element having id "my_id" 1061 if (type === 'ajax') { 1062 hrefParts = href.split(/\s+/, 2); 1063 href = hrefParts.shift(); 1064 selector = hrefParts.shift(); 1065 } 1066 } 1067 1068 if (!content) { 1069 if (type === 'inline') { 1070 if (href) { 1071 content = $(isString(href) ? href.replace(/.*(?=#[^\s]+$)/, '') : href); //strip for ie7 1072 1073 } else if (obj.isDom) { 1074 content = element; 1075 } 1076 1077 } else if (type === 'html') { 1078 content = href; 1079 1080 } else if (!type && !href && obj.isDom) { 1081 type = 'inline'; 1082 content = element; 1083 } 1084 } 1085 1086 $.extend(obj, { 1087 href: href, 1088 type: type, 1089 content: content, 1090 title: title, 1091 selector: selector 1092 }); 1093 1094 group[ i ] = obj; 1095 }); 1096 1097 // Extend the defaults 1098 F.opts = $.extend(true, {}, F.defaults, opts); 1099 1100 // All options are merged recursive except keys 1101 if (opts.keys !== undefined) { 1102 F.opts.keys = opts.keys ? $.extend({}, F.defaults.keys, opts.keys) : false; 1103 } 1104 1105 F.group = group; 1106 1107 return F._start(F.opts.index); 1108 }, 1109 // Cancel image loading or abort ajax request 1110 cancel: function () { 1111 var coming = F.coming; 1112 1113 if (coming && false === F.trigger('onCancel')) { 1114 return; 1115 } 1116 1117 F.hideLoading(); 1118 1119 if (!coming) { 1120 return; 1121 } 1122 1123 if (F.ajaxLoad) { 1124 F.ajaxLoad.abort(); 1125 } 1126 1127 F.ajaxLoad = null; 1128 1129 if (F.imgPreload) { 1130 F.imgPreload.onload = F.imgPreload.onerror = null; 1131 } 1132 1133 if (coming.wrap) { 1134 coming.wrap.stop(true, true).trigger('onReset').remove(); 1135 } 1136 1137 F.coming = null; 1138 1139 // If the first item has been canceled, then clear everything 1140 if (!F.current) { 1141 F._afterZoomOut(coming); 1142 } 1143 }, 1144 // Start closing animation if is open; remove immediately if opening/closing 1145 close: function (event) { 1146 F.cancel(); 1147 1148 if (false === F.trigger('beforeClose')) { 1149 return; 1150 } 1151 1152 F.unbindEvents(); 1153 1154 if (!F.isActive) { 1155 return; 1156 } 1157 1158 if (!F.isOpen || event === true) { 1159 $('.fancybox-wrap').stop(true).trigger('onReset').remove(); 1160 1161 F._afterZoomOut(); 1162 1163 } else { 1164 F.isOpen = F.isOpened = false; 1165 F.isClosing = true; 1166 1167 $('.fancybox-item, .fancybox-nav').remove(); 1168 1169 F.wrap.stop(true, true).removeClass('fancybox-opened'); 1170 1171 F.transitions[ F.current.closeMethod ](); 1172 } 1173 }, 1174 // Manage slideshow: 1175 // $.fancybox.play(); - toggle slideshow 1176 // $.fancybox.play( true ); - start 1177 // $.fancybox.play( false ); - stop 1178 play: function (action) { 1179 var clear = function () { 1180 clearTimeout(F.player.timer); 1181 }, 1182 set = function () { 1183 clear(); 1184 1185 if (F.current && F.player.isActive) { 1186 F.player.timer = setTimeout(F.next, F.current.playSpeed); 1187 } 1188 }, 1189 stop = function () { 1190 clear(); 1191 1192 D.unbind('.player'); 1193 1194 F.player.isActive = false; 1195 1196 F.trigger('onPlayEnd'); 1197 }, 1198 start = function () { 1199 if (F.current && (F.current.loop || F.current.index < F.group.length - 1)) { 1200 F.player.isActive = true; 1201 1202 D.bind({ 1203 'onCancel.player beforeClose.player': stop, 1204 'onUpdate.player': set, 1205 'beforeLoad.player': clear 1206 }); 1207 1208 set(); 1209 1210 F.trigger('onPlayStart'); 1211 } 1212 }; 1213 1214 if (action === true || (!F.player.isActive && action !== false)) { 1215 start(); 1216 } else { 1217 stop(); 1218 } 1219 }, 1220 // Navigate to next gallery item 1221 next: function (direction) { 1222 var current = F.current; 1223 1224 if (current) { 1225 if (!isString(direction)) { 1226 direction = current.direction.next; 1227 } 1228 1229 F.jumpto(current.index + 1, direction, 'next'); 1230 } 1231 }, 1232 // Navigate to previous gallery item 1233 prev: function (direction) { 1234 var current = F.current; 1235 1236 if (current) { 1237 if (!isString(direction)) { 1238 direction = current.direction.prev; 1239 } 1240 1241 F.jumpto(current.index - 1, direction, 'prev'); 1242 } 1243 }, 1244 // Navigate to gallery item by index 1245 jumpto: function (index, direction, router) { 1246 var current = F.current; 1247 1248 if (!current) { 1249 return; 1250 } 1251 1252 index = getScalar(index); 1253 1254 F.direction = direction || current.direction[ (index >= current.index ? 'next' : 'prev') ]; 1255 F.router = router || 'jumpto'; 1256 1257 if (current.loop) { 1258 if (index < 0) { 1259 index = current.group.length + (index % current.group.length); 1260 } 1261 1262 index = index % current.group.length; 1263 } 1264 1265 if (current.group[ index ] !== undefined) { 1266 F.cancel(); 1267 1268 F._start(index); 1269 } 1270 }, 1271 // Center inside viewport and toggle position type to fixed or absolute if needed 1272 reposition: function (e, onlyAbsolute) { 1273 var current = F.current, 1274 wrap = current ? current.wrap : null, 1275 pos; 1276 1277 if (wrap) { 1278 pos = F._getPosition(onlyAbsolute); 1279 1280 if (e && e.type === 'scroll') { 1281 delete pos.position; 1282 1283 wrap.stop(true, true).animate(pos, 200); 1284 1285 } else { 1286 wrap.css(pos); 1287 1288 current.pos = $.extend({}, current.dim, pos); 1289 } 1290 } 1291 }, 1292 update: function (e) { 1293 var type = (e && e.originalEvent && e.originalEvent.type), 1294 anyway = !type || type === 'orientationchange'; 1295 1296 if (anyway) { 1297 clearTimeout(didUpdate); 1298 1299 didUpdate = null; 1300 } 1301 1302 if (!F.isOpen || didUpdate) { 1303 return; 1304 } 1305 1306 didUpdate = setTimeout(function () { 1307 var current = F.current; 1308 1309 if (!current || F.isClosing) { 1310 return; 1311 } 1312 1313 F.wrap.removeClass('fancybox-tmp'); 1314 1315 if (anyway || type === 'load' || (type === 'resize' && current.autoResize)) { 1316 F._setDimension(); 1317 } 1318 1319 if (!(type === 'scroll' && current.canShrink)) { 1320 F.reposition(e); 1321 } 1322 1323 F.trigger('onUpdate'); 1324 1325 didUpdate = null; 1326 1327 }, (anyway && !isTouch ? 0 : 300)); 1328 }, 1329 // Shrink content to fit inside viewport or restore if resized 1330 toggle: function (action) { 1331 if (F.isOpen) { 1332 F.current.fitToView = $.type(action) === "boolean" ? action : !F.current.fitToView; 1333 1334 // Help browser to restore document dimensions 1335 if (isTouch) { 1336 F.wrap.removeAttr('style').addClass('fancybox-tmp'); 1337 1338 F.trigger('onUpdate'); 1339 } 1340 1341 F.update(); 1342 } 1343 }, 1344 hideLoading: function () { 1345 D.unbind('.loading'); 1346 1347 $('#fancybox-loading').remove(); 1348 }, 1349 showLoading: function () { 1350 var el, viewport; 1351 1352 F.hideLoading(); 1353 1354 el = $(F.opts.tpl.loading).click(F.cancel).appendTo('body'); 1355 1356 // If user will press the escape-button, the request will be canceled 1357 D.bind('keydown.loading', function (e) { 1358 if ((e.which || e.keyCode) === 27) { 1359 e.preventDefault(); 1360 1361 F.cancel(); 1362 } 1363 }); 1364 1365 if (!F.defaults.fixed) { 1366 viewport = F.getViewport(); 1367 1368 el.css({ 1369 position: 'absolute', 1370 top: (viewport.h * 0.5) + viewport.y, 1371 left: (viewport.w * 0.5) + viewport.x 1372 }); 1373 } 1374 1375 F.trigger('onLoading'); 1376 }, 1377 getViewport: function () { 1378 var locked = (F.current && F.current.locked) || false, 1379 rez = { 1380 x: W.scrollLeft(), 1381 y: W.scrollTop() 1382 }; 1383 1384 if (locked && locked.length) { 1385 rez.w = locked[0].clientWidth; 1386 rez.h = locked[0].clientHeight; 1387 1388 } else { 1389 // See http://bugs.jquery.com/ticket/6724 1390 rez.w = isTouch && window.innerWidth ? window.innerWidth : W.width(); 1391 rez.h = isTouch && window.innerHeight ? window.innerHeight : W.height(); 1392 } 1393 1394 return rez; 1395 }, 1396 // Unbind the keyboard / clicking actions 1397 unbindEvents: function () { 1398 if (F.wrap && isQuery(F.wrap)) { 1399 F.wrap.unbind('.fb'); 1400 } 1401 1402 D.unbind('.fb'); 1403 W.unbind('.fb'); 1404 }, 1405 bindEvents: function () { 1406 var current = F.current, 1407 keys; 1408 1409 if (!current) { 1410 return; 1411 } 1412 1413 // Changing document height on iOS devices triggers a 'resize' event, 1414 // that can change document height... repeating infinitely 1415 W.bind('orientationchange.fb' + (isTouch ? '' : ' resize.fb') + (current.autoCenter && !current.locked ? ' scroll.fb' : ''), F.update); 1416 1417 keys = current.keys; 1418 1419 if (keys) { 1420 D.bind('keydown.fb', function (e) { 1421 var code = e.which || e.keyCode, 1422 target = e.target || e.srcElement; 1423 1424 // Skip esc key if loading, because showLoading will cancel preloading 1425 if (code === 27 && F.coming) { 1426 return false; 1427 } 1428 1429 // Ignore key combinations and key events within form elements 1430 if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && !(target && (target.type || $(target).is('[contenteditable]')))) { 1431 $.each(keys, function (i, val) { 1432 if (current.group.length > 1 && val[ code ] !== undefined) { 1433 F[ i ](val[ code ]); 1434 1435 e.preventDefault(); 1436 return false; 1437 } 1438 1439 if ($.inArray(code, val) > -1) { 1440 F[ i ](); 1441 1442 e.preventDefault(); 1443 return false; 1444 } 1445 }); 1446 } 1447 }); 1448 } 1449 1450 if ($.fn.mousewheel && current.mouseWheel) { 1451 F.wrap.bind('mousewheel.fb', function (e, delta, deltaX, deltaY) { 1452 var target = e.target || null, 1453 parent = $(target), 1454 canScroll = false; 1455 1456 while (parent.length) { 1457 if (canScroll || parent.is('.fancybox-skin') || parent.is('.fancybox-wrap')) { 1458 break; 1459 } 1460 1461 canScroll = isScrollable(parent[0]); 1462 parent = $(parent).parent(); 1463 } 1464 1465 if (delta !== 0 && !canScroll) { 1466 if (F.group.length > 1 && !current.canShrink) { 1467 if (deltaY > 0 || deltaX > 0) { 1468 F.prev(deltaY > 0 ? 'down' : 'left'); 1469 1470 } else if (deltaY < 0 || deltaX < 0) { 1471 F.next(deltaY < 0 ? 'up' : 'right'); 1472 } 1473 1474 e.preventDefault(); 1475 } 1476 } 1477 }); 1478 } 1479 }, 1480 trigger: function (event, o) { 1481 var ret, obj = o || F.coming || F.current; 1482 1483 if (obj) { 1484 if ($.isFunction(obj[event])) { 1485 ret = obj[event].apply(obj, Array.prototype.slice.call(arguments, 1)); 1486 } 1487 1488 if (ret === false) { 1489 return false; 1490 } 1491 1492 if (obj.helpers) { 1493 $.each(obj.helpers, function (helper, opts) { 1494 if (opts && F.helpers[helper] && $.isFunction(F.helpers[helper][event])) { 1495 F.helpers[helper][event]($.extend(true, {}, F.helpers[helper].defaults, opts), obj); 1496 } 1497 }); 1498 } 1499 } 1500 1501 D.trigger(event); 1502 }, 1503 isImage: function (str) { 1504 return isString(str) && str.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i); 1505 }, 1506 isSWF: function (str) { 1507 return isString(str) && str.match(/\.(swf)((\?|#).*)?$/i); 1508 }, 1509 _start: function (index) { 1510 var coming = {}, 1511 obj, 1512 href, 1513 type, 1514 margin, 1515 padding; 1516 1517 index = getScalar(index); 1518 obj = F.group[ index ] || null; 1519 1520 if (!obj) { 1521 return false; 1522 } 1523 1524 coming = $.extend(true, {}, F.opts, obj); 1525 1526 // Convert margin and padding properties to array - top, right, bottom, left 1527 margin = coming.margin; 1528 padding = coming.padding; 1529 1530 if ($.type(margin) === 'number') { 1531 coming.margin = [margin, margin, margin, margin]; 1532 } 1533 1534 if ($.type(padding) === 'number') { 1535 coming.padding = [padding, padding, padding, padding]; 1536 } 1537 1538 // 'modal' propery is just a shortcut 1539 if (coming.modal) { 1540 $.extend(true, coming, { 1541 closeBtn: false, 1542 closeClick: false, 1543 nextClick: false, 1544 arrows: false, 1545 mouseWheel: false, 1546 keys: null, 1547 helpers: { 1548 overlay: { 1549 closeClick: false 1550 } 1551 } 1552 }); 1553 } 1554 1555 // 'autoSize' property is a shortcut, too 1556 if (coming.autoSize) { 1557 coming.autoWidth = coming.autoHeight = true; 1558 } 1559 1560 if (coming.width === 'auto') { 1561 coming.autoWidth = true; 1562 } 1563 1564 if (coming.height === 'auto') { 1565 coming.autoHeight = true; 1566 } 1567 1568 /* 1569 * Add reference to the group, so it`s possible to access from callbacks, example: 1570 * afterLoad : function() { 1571 * this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : ''); 1572 * } 1573 */ 1574 1575 coming.group = F.group; 1576 coming.index = index; 1577 1578 // Give a chance for callback or helpers to update coming item (type, title, etc) 1579 F.coming = coming; 1580 1581 if (false === F.trigger('beforeLoad')) { 1582 F.coming = null; 1583 1584 return; 1585 } 1586 1587 type = coming.type; 1588 href = coming.href; 1589 1590 if (!type) { 1591 F.coming = null; 1592 1593 //If we can not determine content type then drop silently or display next/prev item if looping through gallery 1594 if (F.current && F.router && F.router !== 'jumpto') { 1595 F.current.index = index; 1596 1597 return F[ F.router ](F.direction); 1598 } 1599 1600 return false; 1601 } 1602 1603 F.isActive = true; 1604 1605 if (type === 'image' || type === 'swf') { 1606 coming.autoHeight = coming.autoWidth = false; 1607 coming.scrolling = 'visible'; 1608 } 1609 1610 if (type === 'image') { 1611 coming.aspectRatio = true; 1612 } 1613 1614 if (type === 'iframe' && isTouch) { 1615 coming.scrolling = 'scroll'; 1616 } 1617 1618 // Build the neccessary markup 1619 coming.wrap = $(coming.tpl.wrap).addClass('fancybox-' + (isTouch ? 'mobile' : 'desktop') + ' fancybox-type-' + type + ' fancybox-tmp ' + coming.wrapCSS).appendTo(coming.parent || 'body'); 1620 1621 $.extend(coming, { 1622 skin: $('.fancybox-skin', coming.wrap), 1623 outer: $('.fancybox-outer', coming.wrap), 1624 inner: $('.fancybox-inner', coming.wrap) 1625 }); 1626 1627 $.each(["Top", "Right", "Bottom", "Left"], function (i, v) { 1628 coming.skin.css('padding' + v, getValue(coming.padding[ i ])); 1629 }); 1630 1631 F.trigger('onReady'); 1632 1633 // Check before try to load; 'inline' and 'html' types need content, others - href 1634 if (type === 'inline' || type === 'html') { 1635 if (!coming.content || !coming.content.length) { 1636 return F._error('content'); 1637 } 1638 1639 } else if (!href) { 1640 return F._error('href'); 1641 } 1642 1643 if (type === 'image') { 1644 F._loadImage(); 1645 1646 } else if (type === 'ajax') { 1647 F._loadAjax(); 1648 1649 } else if (type === 'iframe') { 1650 F._loadIframe(); 1651 1652 } else { 1653 F._afterLoad(); 1654 } 1655 }, 1656 _error: function (type) { 1657 $.extend(F.coming, { 1658 type: 'html', 1659 autoWidth: true, 1660 autoHeight: true, 1661 minWidth: 0, 1662 minHeight: 0, 1663 scrolling: 'no', 1664 hasError: type, 1665 content: F.coming.tpl.error 1666 }); 1667 1668 F._afterLoad(); 1669 }, 1670 _loadImage: function () { 1671 // Reset preload image so it is later possible to check "complete" property 1672 var img = F.imgPreload = new Image(); 1673 1674 img.onload = function () { 1675 this.onload = this.onerror = null; 1676 1677 F.coming.width = this.width / F.opts.pixelRatio; 1678 F.coming.height = this.height / F.opts.pixelRatio; 1679 1680 F._afterLoad(); 1681 }; 1682 1683 img.onerror = function () { 1684 this.onload = this.onerror = null; 1685 1686 F._error('image'); 1687 }; 1688 1689 img.src = F.coming.href; 1690 1691 if (img.complete !== true) { 1692 F.showLoading(); 1693 } 1694 }, 1695 _loadAjax: function () { 1696 var coming = F.coming; 1697 1698 F.showLoading(); 1699 1700 F.ajaxLoad = $.ajax($.extend({}, coming.ajax, { 1701 url: coming.href, 1702 error: function (jqXHR, textStatus) { 1703 if (F.coming && textStatus !== 'abort') { 1704 F._error('ajax', jqXHR); 1705 1706 } else { 1707 F.hideLoading(); 1708 } 1709 }, 1710 success: function (data, textStatus) { 1711 if (textStatus === 'success') { 1712 coming.content = data; 1713 1714 F._afterLoad(); 1715 } 1716 } 1717 })); 1718 }, 1719 _loadIframe: function () { 1720 var coming = F.coming, 1721 iframe = $(coming.tpl.iframe.replace(/\{rnd\}/g, new Date().getTime())) 1722 .attr('scrolling', isTouch ? 'auto' : coming.iframe.scrolling) 1723 .attr('src', coming.href); 1724 1725 // This helps IE 1726 $(coming.wrap).bind('onReset', function () { 1727 try { 1728 $(this).find('iframe').hide().attr('src', 'http://about:blank').end().empty(); 1729 } catch (e) { 1730 } 1731 }); 1732 1733 if (coming.iframe.preload) { 1734 F.showLoading(); 1735 1736 iframe.one('load', function () { 1737 $(this).data('ready', 1); 1738 1739 // iOS will lose scrolling if we resize 1740 if (!isTouch) { 1741 $(this).bind('load.fb', F.update); 1742 } 1743 1744 // Without this trick: 1745 // - iframe won't scroll on iOS devices 1746 // - IE7 sometimes displays empty iframe 1747 $(this).parents('.fancybox-wrap').width('100%').removeClass('fancybox-tmp').show(); 1748 1749 F._afterLoad(); 1750 }); 1751 } 1752 1753 coming.content = iframe.appendTo(coming.inner); 1754 1755 if (!coming.iframe.preload) { 1756 F._afterLoad(); 1757 } 1758 }, 1759 _preloadImages: function () { 1760 var group = F.group, 1761 current = F.current, 1762 len = group.length, 1763 cnt = current.preload ? Math.min(current.preload, len - 1) : 0, 1764 item, 1765 i; 1766 1767 for (i = 1; i <= cnt; i += 1) { 1768 item = group[ (current.index + i) % len ]; 1769 1770 if (item.type === 'image' && item.href) { 1771 new Image().src = item.href; 1772 } 1773 } 1774 }, 1775 _afterLoad: function () { 1776 var coming = F.coming, 1777 previous = F.current, 1778 placeholder = 'fancybox-placeholder', 1779 current, 1780 content, 1781 type, 1782 scrolling, 1783 href, 1784 embed; 1785 1786 F.hideLoading(); 1787 1788 if (!coming || F.isActive === false) { 1789 return; 1790 } 1791 1792 if (false === F.trigger('afterLoad', coming, previous)) { 1793 coming.wrap.stop(true).trigger('onReset').remove(); 1794 1795 F.coming = null; 1796 1797 return; 1798 } 1799 1800 if (previous) { 1801 F.trigger('beforeChange', previous); 1802 1803 previous.wrap.stop(true).removeClass('fancybox-opened') 1804 .find('.fancybox-item, .fancybox-nav') 1805 .remove(); 1806 } 1807 1808 F.unbindEvents(); 1809 1810 current = coming; 1811 content = coming.content; 1812 type = coming.type; 1813 scrolling = coming.scrolling; 1814 1815 $.extend(F, { 1816 wrap: current.wrap, 1817 skin: current.skin, 1818 outer: current.outer, 1819 inner: current.inner, 1820 current: current, 1821 previous: previous 1822 }); 1823 1824 href = current.href; 1825 1826 switch (type) { 1827 case 'inline': 1828 case 'ajax': 1829 case 'html': 1830 if (current.selector) { 1831 content = $('<div>').html(content).find(current.selector); 1832 1833 } else if (isQuery(content)) { 1834 if (!content.data(placeholder)) { 1835 content.data(placeholder, $('<div class="' + placeholder + '"></div>').insertAfter(content).hide()); 1836 } 1837 1838 content = content.show().detach(); 1839 1840 current.wrap.bind('onReset', function () { 1841 if ($(this).find(content).length) { 1842 content.hide().replaceAll(content.data(placeholder)).data(placeholder, false); 1843 } 1844 }); 1845 } 1846 break; 1847 1848 case 'image': 1849 content = current.tpl.image.replace(/\{href\}/g, href); 1850 break; 1851 1852 case 'swf': 1853 content = '<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="' + href + '"></param>'; 1854 embed = ''; 1855 1856 $.each(current.swf, function (name, val) { 1857 content += '<param name="' + name + '" value="' + val + '"></param>'; 1858 embed += ' ' + name + '="' + val + '"'; 1859 }); 1860 1861 content += '<embed src="' + href + '" type="application/x-shockwave-flash" width="100%" height="100%"' + embed + '></embed></object>'; 1862 break; 1863 } 1864 1865 if (!(isQuery(content) && content.parent().is(current.inner))) { 1866 current.inner.append(content); 1867 } 1868 1869 // Give a chance for helpers or callbacks to update elements 1870 F.trigger('beforeShow'); 1871 1872 // Set scrolling before calculating dimensions 1873 current.inner.css('overflow', scrolling === 'yes' ? 'scroll' : (scrolling === 'no' ? 'hidden' : scrolling)); 1874 1875 // Set initial dimensions and start position 1876 F._setDimension(); 1877 1878 F.reposition(); 1879 1880 F.isOpen = false; 1881 F.coming = null; 1882 1883 F.bindEvents(); 1884 1885 if (!F.isOpened) { 1886 $('.fancybox-wrap').not(current.wrap).stop(true).trigger('onReset').remove(); 1887 1888 } else if (previous.prevMethod) { 1889 F.transitions[ previous.prevMethod ](); 1890 } 1891 1892 F.transitions[ F.isOpened ? current.nextMethod : current.openMethod ](); 1893 1894 F._preloadImages(); 1895 }, 1896 _setDimension: function () { 1897 var viewport = F.getViewport(), 1898 steps = 0, 1899 canShrink = false, 1900 canExpand = false, 1901 wrap = F.wrap, 1902 skin = F.skin, 1903 inner = F.inner, 1904 current = F.current, 1905 width = current.width, 1906 height = current.height, 1907 minWidth = current.minWidth, 1908 minHeight = current.minHeight, 1909 maxWidth = current.maxWidth, 1910 maxHeight = current.maxHeight, 1911 scrolling = current.scrolling, 1912 scrollOut = current.scrollOutside ? current.scrollbarWidth : 0, 1913 margin = current.margin, 1914 wMargin = getScalar(margin[1] + margin[3]), 1915 hMargin = getScalar(margin[0] + margin[2]), 1916 wPadding, 1917 hPadding, 1918 wSpace, 1919 hSpace, 1920 origWidth, 1921 origHeight, 1922 origMaxWidth, 1923 origMaxHeight, 1924 ratio, 1925 width_, 1926 height_, 1927 maxWidth_, 1928 maxHeight_, 1929 iframe, 1930 body; 1931 1932 // Reset dimensions so we could re-check actual size 1933 wrap.add(skin).add(inner).width('auto').height('auto').removeClass('fancybox-tmp'); 1934 1935 wPadding = getScalar(skin.outerWidth(true) - skin.width()); 1936 hPadding = getScalar(skin.outerHeight(true) - skin.height()); 1937 1938 // Any space between content and viewport (margin, padding, border, title) 1939 wSpace = wMargin + wPadding; 1940 hSpace = hMargin + hPadding; 1941 1942 origWidth = isPercentage(width) ? (viewport.w - wSpace) * getScalar(width) / 100 : width; 1943 origHeight = isPercentage(height) ? (viewport.h - hSpace) * getScalar(height) / 100 : height; 1944 1945 if (current.type === 'iframe') { 1946 iframe = current.content; 1947 1948 if (current.autoHeight && iframe.data('ready') === 1) { 1949 try { 1950 if (iframe[0].contentWindow.document.location) { 1951 inner.width(origWidth).height(9999); 1952 1953 body = iframe.contents().find('body'); 1954 1955 if (scrollOut) { 1956 body.css('overflow-x', 'hidden'); 1957 } 1958 1959 origHeight = body.outerHeight(true); 1960 } 1961 1962 } catch (e) { 1963 } 1964 } 1965 1966 } else if (current.autoWidth || current.autoHeight) { 1967 inner.addClass('fancybox-tmp'); 1968 1969 // Set width or height in case we need to calculate only one dimension 1970 if (!current.autoWidth) { 1971 inner.width(origWidth); 1972 } 1973 1974 if (!current.autoHeight) { 1975 inner.height(origHeight); 1976 } 1977 1978 if (current.autoWidth) { 1979 origWidth = inner.width(); 1980 } 1981 1982 if (current.autoHeight) { 1983 origHeight = inner.height(); 1984 } 1985 1986 inner.removeClass('fancybox-tmp'); 1987 } 1988 1989 width = getScalar(origWidth); 1990 height = getScalar(origHeight); 1991 1992 ratio = origWidth / origHeight; 1993 1994 // Calculations for the content 1995 minWidth = getScalar(isPercentage(minWidth) ? getScalar(minWidth, 'w') - wSpace : minWidth); 1996 maxWidth = getScalar(isPercentage(maxWidth) ? getScalar(maxWidth, 'w') - wSpace : maxWidth); 1997 1998 minHeight = getScalar(isPercentage(minHeight) ? getScalar(minHeight, 'h') - hSpace : minHeight); 1999 maxHeight = getScalar(isPercentage(maxHeight) ? getScalar(maxHeight, 'h') - hSpace : maxHeight); 2000 2001 // These will be used to determine if wrap can fit in the viewport 2002 origMaxWidth = maxWidth; 2003 origMaxHeight = maxHeight; 2004 2005 if (current.fitToView) { 2006 maxWidth = Math.min(viewport.w - wSpace, maxWidth); 2007 maxHeight = Math.min(viewport.h - hSpace, maxHeight); 2008 } 2009 2010 maxWidth_ = viewport.w - wMargin; 2011 maxHeight_ = viewport.h - hMargin; 2012 2013 if (current.aspectRatio) { 2014 if (width > maxWidth) { 2015 width = maxWidth; 2016 height = getScalar(width / ratio); 2017 } 2018 2019 if (height > maxHeight) { 2020 height = maxHeight; 2021 width = getScalar(height * ratio); 2022 } 2023 2024 if (width < minWidth) { 2025 width = minWidth; 2026 height = getScalar(width / ratio); 2027 } 2028 2029 if (height < minHeight) { 2030 height = minHeight; 2031 width = getScalar(height * ratio); 2032 } 2033 2034 } else { 2035 width = Math.max(minWidth, Math.min(width, maxWidth)); 2036 2037 if (current.autoHeight && current.type !== 'iframe') { 2038 inner.width(width); 2039 2040 height = inner.height(); 2041 } 2042 2043 height = Math.max(minHeight, Math.min(height, maxHeight)); 2044 } 2045 2046 // Try to fit inside viewport (including the title) 2047 if (current.fitToView) { 2048 inner.width(width).height(height); 2049 2050 wrap.width(width + wPadding); 2051 2052 // Real wrap dimensions 2053 width_ = wrap.width(); 2054 height_ = wrap.height(); 2055 2056 if (current.aspectRatio) { 2057 while ((width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight) { 2058 if (steps++ > 19) { 2059 break; 2060 } 2061 2062 height = Math.max(minHeight, Math.min(maxHeight, height - 10)); 2063 width = getScalar(height * ratio); 2064 2065 if (width < minWidth) { 2066 width = minWidth; 2067 height = getScalar(width / ratio); 2068 } 2069 2070 if (width > maxWidth) { 2071 width = maxWidth; 2072 height = getScalar(width / ratio); 2073 } 2074 2075 inner.width(width).height(height); 2076 2077 wrap.width(width + wPadding); 2078 2079 width_ = wrap.width(); 2080 height_ = wrap.height(); 2081 } 2082 2083 } else { 2084 width = Math.max(minWidth, Math.min(width, width - (width_ - maxWidth_))); 2085 height = Math.max(minHeight, Math.min(height, height - (height_ - maxHeight_))); 2086 } 2087 } 2088 2089 if (scrollOut && scrolling === 'auto' && height < origHeight && (width + wPadding + scrollOut) < maxWidth_) { 2090 width += scrollOut; 2091 } 2092 2093 inner.width(width).height(height); 2094 2095 wrap.width(width + wPadding); 2096 2097 width_ = wrap.width(); 2098 height_ = wrap.height(); 2099 2100 canShrink = (width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight; 2101 canExpand = current.aspectRatio ? (width < origMaxWidth && height < origMaxHeight && width < origWidth && height < origHeight) : ((width < origMaxWidth || height < origMaxHeight) && (width < origWidth || height < origHeight)); 2102 2103 $.extend(current, { 2104 dim: { 2105 width: getValue(width_), 2106 height: getValue(height_) 2107 }, 2108 origWidth: origWidth, 2109 origHeight: origHeight, 2110 canShrink: canShrink, 2111 canExpand: canExpand, 2112 wPadding: wPadding, 2113 hPadding: hPadding, 2114 wrapSpace: height_ - skin.outerHeight(true), 2115 skinSpace: skin.height() - height 2116 }); 2117 2118 if (!iframe && current.autoHeight && height > minHeight && height < maxHeight && !canExpand) { 2119 inner.height('auto'); 2120 } 2121 }, 2122 _getPosition: function (onlyAbsolute) { 2123 var current = F.current, 2124 viewport = F.getViewport(), 2125 margin = current.margin, 2126 width = F.wrap.width() + margin[1] + margin[3], 2127 height = F.wrap.height() + margin[0] + margin[2], 2128 rez = { 2129 position: 'absolute', 2130 top: margin[0], 2131 left: margin[3] 2132 }; 2133 2134 if (current.autoCenter && current.fixed && !onlyAbsolute && height <= viewport.h && width <= viewport.w) { 2135 rez.position = 'fixed'; 2136 2137 } else if (!current.locked) { 2138 rez.top += viewport.y; 2139 rez.left += viewport.x; 2140 } 2141 2142 rez.top = getValue(Math.max(rez.top, rez.top + ((viewport.h - height) * current.topRatio))); 2143 rez.left = getValue(Math.max(rez.left, rez.left + ((viewport.w - width) * current.leftRatio))); 2144 2145 return rez; 2146 }, 2147 _afterZoomIn: function () { 2148 var current = F.current; 2149 2150 if (!current) { 2151 return; 2152 } 2153 2154 F.isOpen = F.isOpened = true; 2155 2156 F.wrap.css('overflow', 'visible').addClass('fancybox-opened').hide().show(0); 2157 2158 F.update(); 2159 2160 // Assign a click event 2161 if (current.closeClick || (current.nextClick && F.group.length > 1)) { 2162 F.inner.css('cursor', 'pointer').bind('click.fb', function (e) { 2163 if (!$(e.target).is('a') && !$(e.target).parent().is('a')) { 2164 e.preventDefault(); 2165 2166 F[ current.closeClick ? 'close' : 'next' ](); 2167 } 2168 }); 2169 } 2170 2171 // Create a close button 2172 if (current.closeBtn) { 2173 $(current.tpl.closeBtn).appendTo(F.skin).bind('click.fb', function (e) { 2174 e.preventDefault(); 2175 2176 F.close(); 2177 }); 2178 } 2179 2180 // Create navigation arrows 2181 if (current.arrows && F.group.length > 1) { 2182 if (current.loop || current.index > 0) { 2183 $(current.tpl.prev).appendTo(F.outer).bind('click.fb', F.prev); 2184 } 2185 2186 if (current.loop || current.index < F.group.length - 1) { 2187 $(current.tpl.next).appendTo(F.outer).bind('click.fb', F.next); 2188 } 2189 } 2190 2191 F.trigger('afterShow'); 2192 2193 // Stop the slideshow if this is the last item 2194 if (!current.loop && current.index === current.group.length - 1) { 2195 2196 F.play(false); 2197 2198 } else if (F.opts.autoPlay && !F.player.isActive) { 2199 F.opts.autoPlay = false; 2200 2201 F.play(true); 2202 } 2203 }, 2204 _afterZoomOut: function (obj) { 2205 obj = obj || F.current; 2206 2207 $('.fancybox-wrap').trigger('onReset').remove(); 2208 2209 $.extend(F, { 2210 group: {}, 2211 opts: {}, 2212 router: false, 2213 current: null, 2214 isActive: false, 2215 isOpened: false, 2216 isOpen: false, 2217 isClosing: false, 2218 wrap: null, 2219 skin: null, 2220 outer: null, 2221 inner: null 2222 }); 2223 2224 F.trigger('afterClose', obj); 2225 } 2226 }); 2227 2228 /* 2229 * Default transitions 2230 */ 2231 2232 F.transitions = { 2233 getOrigPosition: function () { 2234 var current = F.current, 2235 element = current.element, 2236 orig = current.orig, 2237 pos = {}, 2238 width = 50, 2239 height = 50, 2240 hPadding = current.hPadding, 2241 wPadding = current.wPadding, 2242 viewport = F.getViewport(); 2243 2244 if (!orig && current.isDom && element.is(':visible')) { 2245 orig = element.find('img:first'); 2246 2247 if (!orig.length) { 2248 orig = element; 2249 } 2250 } 2251 2252 if (isQuery(orig)) { 2253 pos = orig.offset(); 2254 2255 if (orig.is('img')) { 2256 width = orig.outerWidth(); 2257 height = orig.outerHeight(); 2258 } 2259 2260 } else { 2261 pos.top = viewport.y + (viewport.h - height) * current.topRatio; 2262 pos.left = viewport.x + (viewport.w - width) * current.leftRatio; 2263 } 2264 2265 if (F.wrap.css('position') === 'fixed' || current.locked) { 2266 pos.top -= viewport.y; 2267 pos.left -= viewport.x; 2268 } 2269 2270 pos = { 2271 top: getValue(pos.top - hPadding * current.topRatio), 2272 left: getValue(pos.left - wPadding * current.leftRatio), 2273 width: getValue(width + wPadding), 2274 height: getValue(height + hPadding) 2275 }; 2276 2277 return pos; 2278 }, 2279 step: function (now, fx) { 2280 var ratio, 2281 padding, 2282 value, 2283 prop = fx.prop, 2284 current = F.current, 2285 wrapSpace = current.wrapSpace, 2286 skinSpace = current.skinSpace; 2287 2288 if (prop === 'width' || prop === 'height') { 2289 ratio = fx.end === fx.start ? 1 : (now - fx.start) / (fx.end - fx.start); 2290 2291 if (F.isClosing) { 2292 ratio = 1 - ratio; 2293 } 2294 2295 padding = prop === 'width' ? current.wPadding : current.hPadding; 2296 value = now - padding; 2297 2298 F.skin[ prop ](getScalar(prop === 'width' ? value : value - (wrapSpace * ratio))); 2299 F.inner[ prop ](getScalar(prop === 'width' ? value : value - (wrapSpace * ratio) - (skinSpace * ratio))); 2300 } 2301 }, 2302 zoomIn: function () { 2303 var current = F.current, 2304 startPos = current.pos, 2305 effect = current.openEffect, 2306 elastic = effect === 'elastic', 2307 endPos = $.extend({opacity: 1}, startPos); 2308 2309 // Remove "position" property that breaks older IE 2310 delete endPos.position; 2311 2312 if (elastic) { 2313 startPos = this.getOrigPosition(); 2314 2315 if (current.openOpacity) { 2316 startPos.opacity = 0.1; 2317 } 2318 2319 } else if (effect === 'fade') { 2320 startPos.opacity = 0.1; 2321 } 2322 2323 F.wrap.css(startPos).animate(endPos, { 2324 duration: effect === 'none' ? 0 : current.openSpeed, 2325 easing: current.openEasing, 2326 step: elastic ? this.step : null, 2327 complete: F._afterZoomIn 2328 }); 2329 }, 2330 zoomOut: function () { 2331 var current = F.current, 2332 effect = current.closeEffect, 2333 elastic = effect === 'elastic', 2334 endPos = {opacity: 0.1}; 2335 2336 if (elastic) { 2337 endPos = this.getOrigPosition(); 2338 2339 if (current.closeOpacity) { 2340 endPos.opacity = 0.1; 2341 } 2342 } 2343 2344 F.wrap.animate(endPos, { 2345 duration: effect === 'none' ? 0 : current.closeSpeed, 2346 easing: current.closeEasing, 2347 step: elastic ? this.step : null, 2348 complete: F._afterZoomOut 2349 }); 2350 }, 2351 changeIn: function () { 2352 var current = F.current, 2353 effect = current.nextEffect, 2354 startPos = current.pos, 2355 endPos = {opacity: 1}, 2356 direction = F.direction, 2357 distance = 200, 2358 field; 2359 2360 startPos.opacity = 0.1; 2361 2362 if (effect === 'elastic') { 2363 field = direction === 'down' || direction === 'up' ? 'top' : 'left'; 2364 2365 if (direction === 'down' || direction === 'right') { 2366 startPos[ field ] = getValue(getScalar(startPos[ field ]) - distance); 2367 endPos[ field ] = '+=' + distance + 'px'; 2368 2369 } else { 2370 startPos[ field ] = getValue(getScalar(startPos[ field ]) + distance); 2371 endPos[ field ] = '-=' + distance + 'px'; 2372 } 2373 } 2374 2375 // Workaround for http://bugs.jquery.com/ticket/12273 2376 if (effect === 'none') { 2377 F._afterZoomIn(); 2378 2379 } else { 2380 F.wrap.css(startPos).animate(endPos, { 2381 duration: current.nextSpeed, 2382 easing: current.nextEasing, 2383 complete: F._afterZoomIn 2384 }); 2385 } 2386 }, 2387 changeOut: function () { 2388 var previous = F.previous, 2389 effect = previous.prevEffect, 2390 endPos = {opacity: 0.1}, 2391 direction = F.direction, 2392 distance = 200; 2393 2394 if (effect === 'elastic') { 2395 endPos[ direction === 'down' || direction === 'up' ? 'top' : 'left' ] = (direction === 'up' || direction === 'left' ? '-' : '+') + '=' + distance + 'px'; 2396 } 2397 2398 previous.wrap.animate(endPos, { 2399 duration: effect === 'none' ? 0 : previous.prevSpeed, 2400 easing: previous.prevEasing, 2401 complete: function () { 2402 $(this).trigger('onReset').remove(); 2403 } 2404 }); 2405 } 2406 }; 2407 2408 /* 2409 * Overlay helper 2410 */ 2411 2412 F.helpers.overlay = { 2413 defaults: { 2414 closeClick: true, // if true, fancyBox will be closed when user clicks on the overlay 2415 speedOut: 200, // duration of fadeOut animation 2416 showEarly: true, // indicates if should be opened immediately or wait until the content is ready 2417 css: {}, // custom CSS properties 2418 locked: !isTouch, // if true, the content will be locked into overlay 2419 fixed: true // if false, the overlay CSS position property will not be set to "fixed" 2420 }, 2421 overlay: null, // current handle 2422 fixed: false, // indicates if the overlay has position "fixed" 2423 el: $('html'), // element that contains "the lock" 2424 2425 // Public methods 2426 create: function (opts) { 2427 var parent; 2428 2429 opts = $.extend({}, this.defaults, opts); 2430 2431 if (this.overlay) { 2432 this.close(); 2433 } 2434 2435 parent = F.coming ? F.coming.parent : opts.parent; 2436 2437 this.overlay = $('<div class="fancybox-overlay"></div>').appendTo(parent && parent.length ? parent : 'body'); 2438 this.fixed = false; 2439 2440 if (opts.fixed && F.defaults.fixed) { 2441 this.overlay.addClass('fancybox-overlay-fixed'); 2442 2443 this.fixed = true; 2444 } 2445 }, 2446 open: function (opts) { 2447 var that = this; 2448 2449 opts = $.extend({}, this.defaults, opts); 2450 2451 if (this.overlay) { 2452 this.overlay.unbind('.overlay').width('auto').height('auto'); 2453 2454 } else { 2455 this.create(opts); 2456 } 2457 2458 if (!this.fixed) { 2459 W.bind('resize.overlay', $.proxy(this.update, this)); 2460 2461 this.update(); 2462 } 2463 2464 if (opts.closeClick) { 2465 this.overlay.bind('click.overlay', function (e) { 2466 if ($(e.target).hasClass('fancybox-overlay')) { 2467 if (F.isActive) { 2468 F.close(); 2469 } else { 2470 that.close(); 2471 } 2472 2473 return false; 2474 } 2475 }); 2476 } 2477 2478 this.overlay.css(opts.css).show(); 2479 }, 2480 close: function () { 2481 W.unbind('resize.overlay'); 2482 2483 if (this.el.hasClass('fancybox-lock')) { 2484 $('.fancybox-margin').removeClass('fancybox-margin'); 2485 2486 this.el.removeClass('fancybox-lock'); 2487 2488 W.scrollTop(this.scrollV).scrollLeft(this.scrollH); 2489 } 2490 2491 $('.fancybox-overlay').remove().hide(); 2492 2493 $.extend(this, { 2494 overlay: null, 2495 fixed: false 2496 }); 2497 }, 2498 // Private, callbacks 2499 2500 update: function () { 2501 var width = '100%', offsetWidth; 2502 2503 // Reset width/height so it will not mess 2504 this.overlay.width(width).height('100%'); 2505 2506 // jQuery does not return reliable result for IE 2507 if (IE) { 2508 offsetWidth = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth); 2509 2510 if (D.width() > offsetWidth) { 2511 width = D.width(); 2512 } 2513 2514 } else if (D.width() > W.width()) { 2515 width = D.width(); 2516 } 2517 2518 this.overlay.width(width).height(D.height()); 2519 }, 2520 // This is where we can manipulate DOM, because later it would cause iframes to reload 2521 onReady: function (opts, obj) { 2522 var overlay = this.overlay; 2523 2524 $('.fancybox-overlay').stop(true, true); 2525 2526 if (!overlay) { 2527 this.create(opts); 2528 } 2529 2530 if (opts.locked && this.fixed && obj.fixed) { 2531 obj.locked = this.overlay.append(obj.wrap); 2532 obj.fixed = false; 2533 } 2534 2535 if (opts.showEarly === true) { 2536 this.beforeShow.apply(this, arguments); 2537 } 2538 }, 2539 beforeShow: function (opts, obj) { 2540 if (obj.locked && !this.el.hasClass('fancybox-lock')) { 2541 if (this.fixPosition !== false) { 2542 $('*').filter(function () { 2543 return ($(this).css('position') === 'fixed' && !$(this).hasClass("fancybox-overlay") && !$(this).hasClass("fancybox-wrap")); 2544 }).addClass('fancybox-margin'); 2545 } 2546 2547 this.el.addClass('fancybox-margin'); 2548 2549 this.scrollV = W.scrollTop(); 2550 this.scrollH = W.scrollLeft(); 2551 2552 this.el.addClass('fancybox-lock'); 2553 2554 W.scrollTop(this.scrollV).scrollLeft(this.scrollH); 2555 } 2556 2557 this.open(opts); 2558 }, 2559 onUpdate: function () { 2560 if (!this.fixed) { 2561 this.update(); 2562 } 2563 }, 2564 afterClose: function (opts) { 2565 // Remove overlay if exists and fancyBox is not opening 2566 // (e.g., it is not being open using afterClose callback) 2567 if (this.overlay && !F.coming) { 2568 this.overlay.fadeOut(opts.speedOut, $.proxy(this.close, this)); 2569 } 2570 } 2571 }; 2572 2573 /* 2574 * Title helper 2575 */ 2576 2577 F.helpers.title = { 2578 defaults: { 2579 type: 'float', // 'float', 'inside', 'outside' or 'over', 2580 position: 'bottom' // 'top' or 'bottom' 2581 }, 2582 beforeShow: function (opts) { 2583 var current = F.current, 2584 text = current.title, 2585 type = opts.type, 2586 title, 2587 target; 2588 2589 if ($.isFunction(text)) { 2590 text = text.call(current.element, current); 2591 } 2592 2593 if (!isString(text) || $.trim(text) === '') { 2594 return; 2595 } 2596 2597 title = $('<div class="fancybox-title fancybox-title-' + type + '-wrap">
2597' + text + '</div>'); 2598 2599 switch (type) { 2600 case 'inside': 2601 target = F.skin; 2602 break; 2603 2604 case 'outside': 2605 target = F.wrap; 2606 break; 2607 2608 case 'over': 2609 target = F.inner; 2610 break; 2611 2612 default: // 'float' 2613 target = F.skin; 2614 2615 title.appendTo('body'); 2616 2617 if (IE) { 2618 title.width(title.width()); 2619 } 2620 2621 title.wrapInner('<span class="child"></span>'); 2622 2623 //Increase bottom margin so this title will also fit into viewport 2624 F.current.margin[2] += Math.abs(getScalar(title.css('margin-bottom'))); 2625 break; 2626 } 2627 2628 title[ (opts.position === 'top' ? 'prependTo' : 'appendTo') ](target); 2629 } 2630 }; 2631 2632 // jQuery plugin initialization 2633 $.fn.fancybox = function (options) { 2634 var index, 2635 that = $(this), 2636 selector = this.selector || '', 2637 run = function (e) { 2638 var what = $(this).blur(), idx = index, relType, relVal; 2639 2640 if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !what.is('.fancybox-wrap')) { 2641 relType = options.groupAttr || 'data-fancybox-group'; 2642 relVal = what.attr(relType); 2643 2644 if (!relVal) { 2645 relType = 'rel'; 2646 relVal = what.get(0)[ relType ]; 2647 } 2648 2649 if (relVal && relVal !== '' && relVal !== 'nofollow') { 2650 what = selector.length ? $(selector) : that; 2651 what = what.filter('[' + relType + '="' + relVal + '"]'); 2652 idx = what.index(this); 2653 } 2654 2655 options.index = idx; 2656 2657 // Stop an event from bubbling if everything is fine 2658 if (F.open(what, options) !== false) { 2659 e.preventDefault(); 2660 } 2661 } 2662 }; 2663 2664 options = options || {}; 2665 index = options.index || 0; 2666 2667 if (!selector || options.live === false) { 2668 that.unbind('click.fb-start').bind('click.fb-start', run); 2669 2670 } else { 2671 D.undelegate(selector, 'click.fb-start').delegate(selector + ":not('.fancybox-item, .fancybox-nav')", 'click.fb-start', run); 2672 } 2673 2674 this.filter('[data-fancybox-start=1]').trigger('click'); 2675 2676 return this; 2677 }; 2678 2679 // Tests that need a body at doc ready 2680 D.ready(function () { 2681 var w1, w2; 2682 2683 if ($.scrollbarWidth === undefined) { 2684 // http://benalman.com/projects/jquery-misc-plugins/#scrollbarwidth 2685 $.scrollbarWidth = function () { 2686 var parent = $('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo('body'), 2687 child = parent.children(), 2688 width = child.innerWidth() - child.height(99).innerWidth(); 2689 2690 parent.remove(); 2691 2692 return width; 2693 }; 2694 } 2695 2696 if ($.support.fixedPosition === undefined) { 2697 $.support.fixedPosition = (function () { 2698 var elem = $('<div style="position:fixed;top:20px;"></div>').appendTo('body'), 2699 fixed = (elem[0].offsetTop === 20 || elem[0].offsetTop === 15); 2700 2701 elem.remove(); 2702 2703 return fixed; 2704 }()); 2705 } 2706 2707 $.extend(F.defaults, { 2708 scrollbarWidth: $.scrollbarWidth(), 2709 fixed: $.support.fixedPosition, 2710 parent: $('body') 2711 }); 2712 2713 //Get real width of page scroll-bar 2714 w1 = $(window).width(); 2715 2716 H.addClass('fancybox-lock-test'); 2717 2718 w2 = $(window).width(); 2719 2720 H.removeClass('fancybox-lock-test'); 2721 2722 $("<style type='text/css'>.fancybox-margin{margin-right:" + (w2 - w1) + "px;}</style>").appendTo("head"); 2723 }); 2724 2725}(window, document, jQuery)); 2726 2727/*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */ 2728(function (s, H, f, w) { 2729 var K = f("html"), q = f(s), p = f(H), b = f.fancybox = function () { 2730 b.open.apply(this, arguments) 2731 }, J = navigator.userAgent.match(/msie/i), C = null, t = H.createTouch !== w, u = function (a) { 2732 return a && a.hasOwnProperty && a instanceof f 2733 }, r = function (a) { 2734 return a && "string" === f.type(a) 2735 }, F = function (a) { 2736 return r(a) && 0 < a.indexOf("%") 2737 }, m = function (a, d) { 2738 var e = parseInt(a, 10) || 0; 2739 d && F(a) && (e *= b.getViewport()[d] / 100); 2740 return Math.ceil(e) 2741 }, x = function (a, b) { 2742 return m(a, b) + "px" 2743 }; 2744 f.extend(b, {version: "2.1.5", defaults: {padding: 15, margin: 20, 2745 width: 800, height: 600, minWidth: 100, minHeight: 100, maxWidth: 9999, maxHeight: 9999, pixelRatio: 1, autoSize: !0, autoHeight: !1, autoWidth: !1, autoResize: !0, autoCenter: !t, fitToView: !0, aspectRatio: !1, topRatio: 0.5, leftRatio: 0.5, scrolling: "auto", wrapCSS: "", arrows: !0, closeBtn: !0, closeClick: !1, nextClick: !1, mouseWheel: !0, autoPlay: !1, playSpeed: 3E3, preload: 3, modal: !1, loop: !0, ajax: {dataType: "html", headers: {"X-fancyBox": !0}}, iframe: {scrolling: "auto", preload: !0}, swf: {wmode: "transparent", allowfullscreen: "true", allowscriptaccess: "always"}, 2746 keys: {next: {13: "left", 34: "up", 39: "left", 40: "up"}, prev: {8: "right", 33: "down", 37: "right", 38: "down"}, close: [27], play: [32], toggle: [70]}, direction: {next: "left", prev: "right"}, scrollOutside: !0, index: 0, type: null, href: null, content: null, title: null, tpl: {wrap: '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>', image: '<img class="fancybox-image" src="{href}" alt="" />', iframe: '<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen' + 2747 (J ? ' allowtransparency="true"' : "") + "></iframe>", error: '<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>', closeBtn: '<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>', next: '<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>', prev: '<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'}, openEffect: "fade", openSpeed: 250, openEasing: "swing", openOpacity: !0, 2748 openMethod: "zoomIn", closeEffect: "fade", closeSpeed: 250, closeEasing: "swing", closeOpacity: !0, closeMethod: "zoomOut", nextEffect: "elastic", nextSpeed: 250, nextEasing: "swing", nextMethod: "changeIn", prevEffect: "elastic", prevSpeed: 250, prevEasing: "swing", prevMethod: "changeOut", helpers: {overlay: !0, title: !0}, onCancel: f.noop, beforeLoad: f.noop, afterLoad: f.noop, beforeShow: f.noop, afterShow: f.noop, beforeChange: f.noop, beforeClose: f.noop, afterClose: f.noop}, group: {}, opts: {}, previous: null, coming: null, current: null, isActive: !1, 2749 isOpen: !1, isOpened: !1, wrap: null, skin: null, outer: null, inner: null, player: {timer: null, isActive: !1}, ajaxLoad: null, imgPreload: null, transitions: {}, helpers: {}, open: function (a, d) { 2750 if (a && (f.isPlainObject(d) || (d = {}), !1 !== b.close(!0))) 2751 return f.isArray(a) || (a = u(a) ? f(a).get() : [a]), f.each(a, function (e, c) { 2752 var l = {}, g, h, k, n, m; 2753 "object" === f.type(c) && (c.nodeType && (c = f(c)), u(c) ? (l = {href: c.data("fancybox-href") || c.attr("href"), title: f("<div/>").text(c.data("fancybox-title") || c.attr("title")).html(), isDom: !0, element: c}, 2754 f.metadata && f.extend(!0, l, c.metadata())) : l = c); 2755 g = d.href || l.href || (r(c) ? c : null); 2756 h = d.title !== w ? d.title : l.title || ""; 2757 n = (k = d.content || l.content) ? "html" : d.type || l.type; 2758 !n && l.isDom && (n = c.data("fancybox-type"), n || (n = (n = c.prop("class").match(/fancybox\.(\w+)/)) ? n[1] : null)); 2759 r(g) && (n || (b.isImage(g) ? n = "image" : b.isSWF(g) ? n = "swf" : "#" === g.charAt(0) ? n = "inline" : r(c) && (n = "html", k = c)), "ajax" === n && (m = g.split(/\s+/, 2), g = m.
vendor: 29,563 bytes, lines 2759-3223
2759shift(), m = m.shift())); 2760 k || ("inline" === n ? g ? k = f(r(g) ? g.replace(/.*(?=#[^\s]+$)/, "") : g) : l.isDom && (k = c) : 2761 "html" === n ? k = g : n || g || !l.isDom || (n = "inline", k = c)); 2762 f.extend(l, {href: g, type: n, content: k, title: h, selector: m}); 2763 a[e] = l 2764 }), b.opts = f.extend(!0, {}, b.defaults, d), d.keys !== w && (b.opts.keys = d.keys ? f.extend({}, b.defaults.keys, d.keys) : !1), b.group = a, b._start(b.opts.index) 2765 }, cancel: function () { 2766 var a = b.coming; 2767 a && !1 === b.trigger("onCancel") || (b.hideLoading(), a && (b.ajaxLoad && b.ajaxLoad.abort(), b.ajaxLoad = null, b.imgPreload && (b.imgPreload.onload = b.imgPreload.onerror = null), a.wrap && a.wrap.stop(!0, !0).trigger("onReset").remove(), 2768 b.coming = null, b.current || b._afterZoomOut(a))) 2769 }, close: function (a) { 2770 b.cancel(); 2771 !1 !== b.trigger("beforeClose") && (b.unbindEvents(), b.isActive && (b.isOpen && !0 !== a ? (b.isOpen = b.isOpened = !1, b.isClosing = !0, f(".fancybox-item, .fancybox-nav").remove(), b.wrap.stop(!0, !0).removeClass("fancybox-opened"), b.transitions[b.current.closeMethod]()) : (f(".fancybox-wrap").stop(!0).trigger("onReset").remove(), b._afterZoomOut()))) 2772 }, play: function (a) { 2773 var d = function () { 2774 clearTimeout(b.player.timer) 2775 }, e = function () { 2776 d(); 2777 b.current && b.player.isActive && 2778 (b.player.timer = setTimeout(b.next, b.current.playSpeed)) 2779 }, c = function () { 2780 d(); 2781 p.unbind(".player"); 2782 b.player.isActive = !1; 2783 b.trigger("onPlayEnd") 2784 }; 2785 !0 === a || !b.player.isActive && !1 !== a ? b.current && (b.current.loop || b.current.index < b.group.length - 1) && (b.player.isActive = !0, p.bind({"onCancel.player beforeClose.player": c, "onUpdate.player": e, "beforeLoad.player": d}), e(), b.trigger("onPlayStart")) : c() 2786 }, next: function (a) { 2787 var d = b.current; 2788 d && (r(a) || (a = d.direction.next), b.jumpto(d.index + 1, a, "next")) 2789 }, prev: function (a) { 2790 var d = 2791 b.current; 2792 d && (r(a) || (a = d.direction.prev), b.jumpto(d.index - 1, a, "prev")) 2793 }, jumpto: function (a, d, e) { 2794 var c = b.current; 2795 c && (a = m(a), b.direction = d || c.direction[a >= c.index ? "next" : "prev"], b.router = e || "jumpto", c.loop && (0 > a && (a = c.group.length + a % c.group.length), a %= c.group.length), c.group[a] !== w && (b.cancel(), b._start(a))) 2796 }, reposition: function (a, d) { 2797 var e = b.current, c = e ? e.wrap : null, l; 2798 c && (l = b._getPosition(d), a && "scroll" === a.type ? (delete l.position, c.stop(!0, !0).animate(l, 200)) : (c.css(l), e.pos = f.extend({}, e.dim, l))) 2799 }, 2800 update: function (a) { 2801 var d = a && a.originalEvent && a.originalEvent.type, e = !d || "orientationchange" === d; 2802 e && (clearTimeout(C), C = null); 2803 b.isOpen && !C && (C = setTimeout(function () { 2804 var c = b.current; 2805 c && !b.isClosing && (b.wrap.removeClass("fancybox-tmp"), (e || "load" === d || "resize" === d && c.autoResize) && b._setDimension(), "scroll" === d && c.canShrink || b.reposition(a), b.trigger("onUpdate"), C = null) 2806 }, e && !t ? 0 : 300)) 2807 }, toggle: function (a) { 2808 b.isOpen && (b.current.fitToView = "boolean" === f.type(a) ? a : !b.current.fitToView, t && (b.wrap.removeAttr("style").addClass("fancybox-tmp"), 2809 b.trigger("onUpdate")), b.update()) 2810 }, hideLoading: function () { 2811 p.unbind(".loading"); 2812 f("#fancybox-loading").remove() 2813 }, showLoading: function () { 2814 var a, d; 2815 b.hideLoading(); 2816 a = f('<div id="fancybox-loading"><div></div></div>').click(b.cancel).appendTo("body"); 2817 p.bind("keydown.loading", function (a) { 2818 27 === (a.which || a.keyCode) && (a.preventDefault(), b.cancel()) 2819 }); 2820 b.defaults.fixed || (d = b.getViewport(), a.css({position: "absolute", top: 0.5 * d.h + d.y, left: 0.5 * d.w + d.x})); 2821 b.trigger("onLoading") 2822 }, getViewport: function () { 2823 var a = b.current && 2824 b.current.locked || !1, d = {x: q.scrollLeft(), y: q.scrollTop()}; 2825 a && a.length ? (d.w = a[0].clientWidth, d.h = a[0].clientHeight) : (d.w = t && s.innerWidth ? s.innerWidth : q.width(), d.h = t && s.innerHeight ? s.innerHeight : q.height()); 2826 return d 2827 }, unbindEvents: function () { 2828 b.wrap && u(b.wrap) && b.wrap.unbind(".fb"); 2829 p.unbind(".fb"); 2830 q.unbind(".fb") 2831 }, bindEvents: function () { 2832 var a = b.current, d; 2833 a && (q.bind("orientationchange.fb" + (t ? "" : " resize.fb") + (a.autoCenter && !a.locked ? " scroll.fb" : ""), b.update), (d = a.keys) && p.bind("keydown.fb", function (e) { 2834 var c = 2835 e.which || e.keyCode, l = e.target || e.srcElement; 2836 if (27 === c && b.coming) 2837 return!1; 2838 e.ctrlKey || e.altKey || e.shiftKey || e.metaKey || l && (l.type || f(l).is("[contenteditable]")) || f.each(d, function (d, l) { 2839 if (1 < a.group.length && l[c] !== w) 2840 return b[d](l[c]), e.preventDefault(), !1; 2841 if (-1 < f.inArray(c, l)) 2842 return b[d](), e.preventDefault(), !1 2843 }) 2844 }), f.fn.mousewheel && a.mouseWheel && b.wrap.bind("mousewheel.fb", function (d, c, l, g) { 2845 for (var h = f(d.target || null), k = !1; h.length && !(k || h.is(".fancybox-skin") || h.is(".fancybox-wrap")); ) 2846 k = h[0] && !(h[0].style.overflow && 2847 "hidden" === h[0].style.overflow) && (h[0].clientWidth && h[0].scrollWidth > h[0].clientWidth || h[0].clientHeight && h[0].scrollHeight > h[0].clientHeight), h = f(h).parent(); 2848 0 !== c && !k && 1 < b.group.length && !a.canShrink && (0 < g || 0 < l ? b.prev(0 < g ? "down" : "left") : (0 > g || 0 > l) && b.next(0 > g ? "up" : "right"), d.preventDefault()) 2849 })) 2850 }, trigger: function (a, d) { 2851 var e, c = d || b.coming || b.current; 2852 if (c) { 2853 f.isFunction(c[a]) && (e = c[a].apply(c, Array.prototype.slice.call(arguments, 1))); 2854 if (!1 === e) 2855 return!1; 2856 c.helpers && f.each(c.helpers, function (d, e) { 2857 if (e && 2858 b.helpers[d] && f.isFunction(b.helpers[d][a])) 2859 b.helpers[d][a](f.extend(!0, {}, b.helpers[d].defaults, e), c) 2860 }) 2861 } 2862 p.trigger(a) 2863 }, isImage: function (a) { 2864 return r(a) && a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i) 2865 }, isSWF: function (a) { 2866 return r(a) && a.match(/\.(swf)((\?|#).*)?$/i) 2867 }, _start: function (a) { 2868 var d = {}, e, c; 2869 a = m(a); 2870 e = b.group[a] || null; 2871 if (!e) 2872 return!1; 2873 d = f.extend(!0, {}, b.opts, e); 2874 e = d.margin; 2875 c = d.padding; 2876 "number" === f.type(e) && (d.margin = [e, e, e, e]); 2877 "number" === f.type(c) && (d.padding = [c, c, 2878 c, c]); 2879 d.modal && f.extend(!0, d, {closeBtn: !1, closeClick: !1, nextClick: !1, arrows: !1, mouseWheel: !1, keys: null, helpers: {overlay: {closeClick: !1}}}); 2880 d.autoSize && (d.autoWidth = d.autoHeight = !0); 2881 "auto" === d.width && (d.autoWidth = !0); 2882 "auto" === d.height && (d.autoHeight = !0); 2883 d.group = b.group; 2884 d.index = a; 2885 b.coming = d; 2886 if (!1 === b.trigger("beforeLoad")) 2887 b.coming = null; 2888 else { 2889 c = d.type; 2890 e = d.href; 2891 if (!c) 2892 return b.coming = null, b.current && b.router && "jumpto" !== b.router ? (b.current.index = a, b[b.router](b.direction)) : !1; 2893 b.isActive = !0; 2894 if ("image" === 2895 c || "swf" === c) 2896 d.autoHeight = d.autoWidth = !1, d.scrolling = "visible"; 2897 "image" === c && (d.aspectRatio = !0); 2898 "iframe" === c && t && (d.scrolling = "scroll"); 2899 d.wrap = f(d.tpl.wrap).addClass("fancybox-" + (t ? "mobile" : "desktop") + " fancybox-type-" + c + " fancybox-tmp " + d.wrapCSS).appendTo(d.parent || "body"); 2900 f.extend(d, {skin: f(".fancybox-skin", d.wrap), outer: f(".fancybox-outer", d.wrap), inner: f(".fancybox-inner", d.wrap)}); 2901 f.each(["Top", "Right", "Bottom", "Left"], function (a, b) { 2902 d.skin.css("padding" + b, x(d.padding[a])) 2903 }); 2904 b.trigger("onReady"); 2905 if ("inline" === c || "html" === c) { 2906 if (!d.content || !d.content.length) 2907 return b._error("content") 2908 } else if (!e) 2909 return b._error("href"); 2910 "image" === c ? b._loadImage() : "ajax" === c ? b._loadAjax() : "iframe" === c ? b._loadIframe() : b._afterLoad() 2911 } 2912 }, _error: function (a) { 2913 f.extend(b.coming, {type: "html", autoWidth: !0, autoHeight: !0, minWidth: 0, minHeight: 0, scrolling: "no", hasError: a, content: b.coming.tpl.error}); 2914 b._afterLoad() 2915 }, _loadImage: function () { 2916 var a = b.imgPreload = new Image; 2917 a.onload = function () { 2918 this.onload = this.onerror = null; 2919 b.coming.width = 2920 this.width / b.opts.pixelRatio; 2921 b.coming.height = this.height / b.opts.pixelRatio; 2922 b._afterLoad() 2923 }; 2924 a.onerror = function () { 2925 this.onload = this.onerror = null; 2926 b._error("image") 2927 }; 2928 a.src = b.coming.href; 2929 !0 !== a.complete && b.showLoading() 2930 }, _loadAjax: function () { 2931 var a = b.coming; 2932 b.showLoading(); 2933 b.ajaxLoad = f.ajax(f.extend({}, a.ajax, {url: a.href, error: function (a, e) { 2934 b.coming && "abort" !== e ? b._error("ajax", a) : b.hideLoading() 2935 }, success: function (d, e) { 2936 "success" === e && (a.content = d, b._afterLoad()) 2937 }})) 2938 }, _loadIframe: function () { 2939 var a = b.coming, 2940 d = f(a.tpl.iframe.replace(/\{rnd\}/g, (new Date).getTime())).attr("scrolling", t ? "auto" : a.iframe.scrolling).attr("src", a.href); 2941 f(a.wrap).bind("onReset", function () { 2942 try { 2943 f(this).find("iframe").hide().attr("src", "http://about:blank").end().empty() 2944 } catch (a) { 2945 } 2946 }); 2947 a.iframe.preload && (b.showLoading(), d.one("load", function () { 2948 f(this).data("ready", 1); 2949 t || f(this).bind("load.fb", b.update); 2950 f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show(); 2951 b._afterLoad() 2952 })); 2953 a.content = d.appendTo(a.inner); 2954 a.iframe.preload || 2955 b._afterLoad() 2956 }, _preloadImages: function () { 2957 var a = b.group, d = b.current, e = a.length, c = d.preload ? Math.min(d.preload, e - 1) : 0, f, g; 2958 for (g = 1; g <= c; g += 1) 2959 f = a[(d.index + g) % e], "image" === f.type && f.href && ((new Image).src = f.href) 2960 }, _afterLoad: function () { 2961 var a = b.coming, d = b.current, e, c, l, g, h; 2962 b.hideLoading(); 2963 if (a && !1 !== b.isActive) 2964 if (!1 === b.trigger("afterLoad", a, d)) 2965 a.wrap.stop(!0).trigger("onReset").remove(), b.coming = null; 2966 else { 2967 d && (b.trigger("beforeChange", d), d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()); 2968 b.unbindEvents(); 2969 e = a.content; 2970 c = a.type; 2971 l = a.scrolling; 2972 f.extend(b, {wrap: a.wrap, skin: a.skin, outer: a.outer, inner: a.inner, current: a, previous: d}); 2973 g = a.href; 2974 switch (c) { 2975 case "inline": 2976 case "ajax": 2977 case "html": 2978 a.selector ? e = f("<div>").html(e).find(a.selector) : u(e) && (e.data("fancybox-placeholder") || e.data("fancybox-placeholder", f('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()), e = e.show().detach(), a.wrap.bind("onReset", function () { 2979 f(this).find(e).length && e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder", 2980 !1) 2981 })); 2982 break; 2983 case "image": 2984 e = a.tpl.image.replace(/\{href\}/g, g); 2985 break; 2986 case "swf": 2987 e = '<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="' + g + '"></param>', h = "", f.each(a.swf, function (a, b) { 2988 e += '<param name="' + a + '" value="' + b + '"></param>'; 2989 h += " " + a + '="' + b + '"' 2990 }), e += '<embed src="' + g + '" type="application/x-shockwave-flash" width="100%" height="100%"' + h + "></embed></object>" 2991 } 2992 u(e) && e.parent().is(a.inner) || a.inner.append(e); 2993 b.trigger("beforeShow"); 2994 a.inner.css("overflow", "yes" === l ? "scroll" : "no" === l ? "hidden" : l); 2995 b._setDimension(); 2996 b.reposition(); 2997 b.isOpen = !1; 2998 b.coming = null; 2999 b.bindEvents(); 3000 if (!b.isOpened) 3001 f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove(); 3002 else if (d.prevMethod) 3003 b.transitions[d.prevMethod](); 3004 b.transitions[b.isOpened ? a.nextMethod : a.openMethod](); 3005 b._preloadImages() 3006 } 3007 }, _setDimension: function () { 3008 var a = b.getViewport(), d = 0, e = !1, c = !1, e = b.wrap, l = b.skin, g = b.inner, h = b.current, c = h.width, k = h.height, n = h.minWidth, v = h.minHeight, p = h.maxWidth, 3009 q = h.maxHeight, t = h.scrolling, r = h.scrollOutside ? h.scrollbarWidth : 0, y = h.margin, z = m(y[1] + y[3]), s = m(y[0] + y[2]), w, A, u, D, B, G, C, E, I; 3010 e.add(l).add(g).width("auto").height("auto").removeClass("fancybox-tmp"); 3011 y = m(l.outerWidth(!0) - l.width()); 3012 w = m(l.outerHeight(!0) - l.height()); 3013 A = z + y; 3014 u = s + w; 3015 D = F(c) ? (a.w - A) * m(c) / 100 : c; 3016 B = F(k) ? (a.h - u) * m(k) / 100 : k; 3017 if ("iframe" === h.type) { 3018 if (I = h.content, h.autoHeight && 1 === I.data("ready")) 3019 try { 3020 I[0].contentWindow.document.location && (g.width(D).height(9999), G = I.contents().find("body"), r && G.css("overflow-x", 3021 "hidden"), B = G.outerHeight(!0)) 3022 } catch (H) { 3023 } 3024 } else if (h.autoWidth || h.autoHeight) 3025 g.addClass("fancybox-tmp"), h.autoWidth || g.width(D), h.autoHeight || g.height(B), h.autoWidth && (D = g.width()), h.autoHeight && (B = g.height()), g.removeClass("fancybox-tmp"); 3026 c = m(D); 3027 k = m(B); 3028 E = D / B; 3029 n = m(F(n) ? m(n, "w") - A : n); 3030 p = m(F(p) ? m(p, "w") - A : p); 3031 v = m(F(v) ? m(v, "h") - u : v); 3032 q = m(F(q) ? m(q, "h") - u : q); 3033 G = p; 3034 C = q; 3035 h.fitToView && (p = Math.min(a.w - A, p), q = Math.min(a.h - u, q)); 3036 A = a.w - z; 3037 s = a.h - s; 3038 h.aspectRatio ? (c > p && (c = p, k = m(c / E)), k > q && (k = q, c = m(k * E)), c < n && (c = n, k = m(c / 3039 E)), k < v && (k = v, c = m(k * E))) : (c = Math.max(n, Math.min(c, p)), h.autoHeight && "iframe" !== h.type && (g.width(c), k = g.height()), k = Math.max(v, Math.min(k, q))); 3040 if (h.fitToView) 3041 if (g.width(c).height(k), e.width(c + y), a = e.width(), z = e.height(), h.aspectRatio) 3042 for (; (a > A || z > s) && c > n && k > v && !(19 < d++); ) 3043 k = Math.max(v, Math.min(q, k - 10)), c = m(k * E), c < n && (c = n, k = m(c / E)), c > p && (c = p, k = m(c / E)), g.width(c).height(k), e.width(c + y), a = e.width(), z = e.height(); 3044 else 3045 c = Math.max(n, Math.min(c, c - (a - A))), k = Math.max(v, Math.min(k, k - (z - s))); 3046 r && "auto" === t && k < B && 3047 c + y + r < A && (c += r); 3048 g.width(c).height(k); 3049 e.width(c + y); 3050 a = e.width(); 3051 z = e.height(); 3052 e = (a > A || z > s) && c > n && k > v; 3053 c = h.aspectRatio ? c < G && k < C && c < D && k < B : (c < G || k < C) && (c < D || k < B); 3054 f.extend(h, {dim: {width: x(a), height: x(z)}, origWidth: D, origHeight: B, canShrink: e, canExpand: c, wPadding: y, hPadding: w, wrapSpace: z - l.outerHeight(!0), skinSpace: l.height() - k}); 3055 !I && h.autoHeight && k > v && k < q && !c && g.height("auto") 3056 }, _getPosition: function (a) { 3057 var d = b.current, e = b.getViewport(), c = d.margin, f = b.wrap.width() + c[1] + c[3], g = b.wrap.height() + c[0] + c[2], c = {position: "absolute", 3058 top: c[0], left: c[3]}; 3059 d.autoCenter && d.fixed && !a && g <= e.h && f <= e.w ? c.position = "fixed" : d.locked || (c.top += e.y, c.left += e.x); 3060 c.top = x(Math.max(c.top, c.top + (e.h - g) * d.topRatio)); 3061 c.left = x(Math.max(c.left, c.left + (e.w - f) * d.leftRatio)); 3062 return c 3063 }, _afterZoomIn: function () { 3064 var a = b.current; 3065 a && ((b.isOpen = b.isOpened = !0, b.wrap.css("overflow", "visible").addClass("fancybox-opened"), b.update(), (a.closeClick || a.nextClick && 1 < b.group.length) && b.inner.css("cursor", "pointer").bind("click.fb", function (d) { 3066 f(d.target).is("a") || f(d.target).parent().is("a") || 3067 (d.preventDefault(), b[a.closeClick ? "close" : "next"]()) 3068 }), a.closeBtn && f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb", function (a) { 3069 a.preventDefault(); 3070 b.close() 3071 }), a.arrows && 1 < b.group.length && ((a.loop || 0 < a.index) && f(a.tpl.prev).appendTo(b.outer).bind("click.fb", b.prev), (a.loop || a.index < b.group.length - 1) && f(a.tpl.next).appendTo(b.outer).bind("click.fb", b.next)), b.trigger("afterShow"), a.loop || a.index !== a.group.length - 1) ? b.opts.autoPlay && !b.player.isActive && (b.opts.autoPlay = !1, b.play(!0)) : b.play(!1)) 3072 }, 3073 _afterZoomOut: function (a) { 3074 a = a || b.current; 3075 f(".fancybox-wrap").trigger("onReset").remove(); 3076 f.extend(b, {group: {}, opts: {}, router: !1, current: null, isActive: !1, isOpened: !1, isOpen: !1, isClosing: !1, wrap: null, skin: null, outer: null, inner: null}); 3077 b.trigger("afterClose", a) 3078 }}); 3079 b.transitions = {getOrigPosition: function () { 3080 var a = b.current, d = a.element, e = a.orig, c = {}, f = 50, g = 50, h = a.hPadding, k = a.wPadding, n = b.getViewport(); 3081 !e && a.isDom && d.is(":visible") && (e = d.find("img:first"), e.length || (e = d)); 3082 u(e) ? (c = e.offset(), e.is("img") && 3083 (f = e.outerWidth(), g = e.outerHeight())) : (c.top = n.y + (n.h - g) * a.topRatio, c.left = n.x + (n.w - f) * a.leftRatio); 3084 if ("fixed" === b.wrap.css("position") || a.locked) 3085 c.top -= n.y, c.left -= n.x; 3086 return c = {top: x(c.top - h * a.topRatio), left: x(c.left - k * a.leftRatio), width: x(f + k), height: x(g + h)} 3087 }, step: function (a, d) { 3088 var e, c, f = d.prop; 3089 c = b.current; 3090 var g = c.wrapSpace, h = c.skinSpace; 3091 if ("width" === f || "height" === f) 3092 e = d.end === d.start ? 1 : (a - d.start) / (d.end - d.start), b.isClosing && (e = 1 - e), c = "width" === f ? c.wPadding : c.hPadding, c = a - c, b.skin[f](m("width" === 3093 f ? c : c - g * e)), b.inner[f](m("width" === f ? c : c - g * e - h * e)) 3094 }, zoomIn: function () { 3095 var a = b.current, d = a.pos, e = a.openEffect, c = "elastic" === e, l = f.extend({opacity: 1}, d); 3096 delete l.position; 3097 c ? (d = this.getOrigPosition(), a.openOpacity && (d.opacity = 0.1)) : "fade" === e && (d.opacity = 0.1); 3098 b.wrap.css(d).animate(l, {duration: "none" === e ? 0 : a.openSpeed, easing: a.openEasing, step: c ? this.step : null, complete: b._afterZoomIn}) 3099 }, zoomOut: function () { 3100 var a = b.current, d = a.closeEffect, e = "elastic" === d, c = {opacity: 0.1}; 3101 e && (c = this.getOrigPosition(), a.closeOpacity && 3102 (c.opacity = 0.1)); 3103 b.wrap.animate(c, {duration: "none" === d ? 0 : a.closeSpeed, easing: a.closeEasing, step: e ? this.step : null, complete: b._afterZoomOut}) 3104 }, changeIn: function () { 3105 var a = b.current, d = a.nextEffect, e = a.pos, c = {opacity: 1}, f = b.direction, g; 3106 e.opacity = 0.1; 3107 "elastic" === d && (g = "down" === f || "up" === f ? "top" : "left", "down" === f || "right" === f ? (e[g] = x(m(e[g]) - 200), c[g] = "+=200px") : (e[g] = x(m(e[g]) + 200), c[g] = "-=200px")); 3108 "none" === d ? b._afterZoomIn() : b.wrap.css(e).animate(c, {duration: a.nextSpeed, easing: a.nextEasing, complete: b._afterZoomIn}) 3109 }, 3110 changeOut: function () { 3111 var a = b.previous, d = a.prevEffect, e = {opacity: 0.1}, c = b.direction; 3112 "elastic" === d && (e["down" === c || "up" === c ? "top" : "left"] = ("up" === c || "left" === c ? "-" : "+") + "=200px"); 3113 a.wrap.animate(e, {duration: "none" === d ? 0 : a.prevSpeed, easing: a.prevEasing, complete: function () { 3114 f(this).trigger("onReset").remove() 3115 }}) 3116 }}; 3117 b.helpers.overlay = {defaults: {closeClick: !0, speedOut: 200, showEarly: !0, css: {}, locked: !t, fixed: !0}, overlay: null, fixed: !1, el: f("html"), create: function (a) { 3118 var d; 3119 a = f.extend({}, this.defaults, a); 3120 this.overlay && 3121 this.close(); 3122 d = b.coming ? b.coming.parent : a.parent; 3123 this.overlay = f('<div class="fancybox-overlay"></div>').appendTo(d && d.lenth ? d : "body"); 3124 this.fixed = !1; 3125 a.fixed && b.defaults.fixed && (this.overlay.addClass("fancybox-overlay-fixed"), this.fixed = !0) 3126 }, open: function (a) { 3127 var d = this; 3128 a = f.extend({}, this.defaults, a); 3129 this.overlay ? this.overlay.unbind(".overlay").width("auto").height("auto") : this.create(a); 3130 this.fixed || (q.bind("resize.overlay", f.proxy(this.update, this)), this.update()); 3131 a.closeClick && this.overlay.bind("click.overlay", 3132 function (a) { 3133 if (f(a.target).hasClass("fancybox-overlay")) 3134 return b.isActive ? b.close() : d.close(), !1 3135 }); 3136 this.overlay.css(a.css).show() 3137 }, close: function () { 3138 q.unbind("resize.overlay"); 3139 this.el.hasClass("fancybox-lock") && (f(".fancybox-margin").removeClass("fancybox-margin"), this.el.removeClass("fancybox-lock"), q.scrollTop(this.scrollV).scrollLeft(this.scrollH)); 3140 f(".fancybox-overlay").remove().hide(); 3141 f.extend(this, {overlay: null, fixed: !1}) 3142 }, update: function () { 3143 var a = "100%", b; 3144 this.overlay.width(a).height("100%"); 3145 J ? (b = Math.max(H.documentElement.offsetWidth, H.body.offsetWidth), p.width() > b && (a = p.width())) : p.width() > q.width() && (a = p.width()); 3146 this.overlay.width(a).height(p.height()) 3147 }, onReady: function (a, b) { 3148 var e = this.overlay; 3149 f(".fancybox-overlay").stop(!0, !0); 3150 e || this.create(a); 3151 a.locked && this.fixed && b.fixed && (b.locked = this.overlay.append(b.wrap), b.fixed = !1); 3152 !0 === a.showEarly && this.beforeShow.apply(this, arguments) 3153 }, beforeShow: function (a, b) { 3154 b.locked && !this.el.hasClass("fancybox-lock") && (!1 !== this.fixPosition && f("*").filter(function () { 3155 return"fixed" === 3156 f(this).css("position") && !f(this).hasClass("fancybox-overlay") && !f(this).hasClass("fancybox-wrap") 3157 }).addClass("fancybox-margin"), this.el.addClass("fancybox-margin"), this.scrollV = q.scrollTop(), this.scrollH = q.scrollLeft(), this.el.addClass("fancybox-lock"), q.scrollTop(this.scrollV).scrollLeft(this.scrollH)); 3158 this.open(a) 3159 }, onUpdate: function () { 3160 this.fixed || this.update() 3161 }, afterClose: function (a) { 3162 this.overlay && !b.coming && this.overlay.fadeOut(a.speedOut, f.proxy(this.close, this)) 3163 }}; 3164 b.helpers.title = {defaults: {type: "float", 3165 position: "bottom"}, beforeShow: function (a) { 3166 var d = b.current, e = d.title, c = a.type; 3167 f.isFunction(e) && (e = e.call(d.element, d)); 3168 if (r(e) && "" !== f.trim(e)) { 3169 d = f('<div class="fancybox-title fancybox-title-' + c + '-wrap">' + e + "</div>"); 3170 switch (c) { 3171 case "inside": 3172 c = b.skin; 3173 break; 3174 case "outside": 3175 c = b.wrap; 3176 break; 3177 case "over": 3178 c = b.inner; 3179 break; 3180 default: 3181 c = b.skin, d.appendTo("body"), J && d.width(d.width()), d.wrapInner('<span class="child"></span>'), b.current.margin[2] += Math.abs(m(d.css("margin-bottom"))) 3182 } 3183 d["top" === a.position ? "prependTo" : 3184 "appendTo"](c) 3185 } 3186 }}; 3187 f.fn.fancybox = function (a) { 3188 var d, e = f(this), c = this.selector || "", l = function (g) { 3189 var h = f(this).blur(), k = d, l, m; 3190 g.ctrlKey || g.altKey || g.shiftKey || g.metaKey || h.is(".fancybox-wrap") || (l = a.groupAttr || "data-fancybox-group", m = h.attr(l), m || (l = "rel", m = h.get(0)[l]), m && "" !== m && "nofollow" !== m && (h = c.length ? f(c) : e, h = h.filter("[" + l + '="' + m + '"]'), k = h.index(this)), a.index = k, !1 !== b.open(h, a) && g.preventDefault()) 3191 }; 3192 a = a || {}; 3193 d = a.index || 0; 3194 c && !1 !== a.live ? p.undelegate(c, "click.fb-start").delegate(c + ":not('.fancybox-item, .fancybox-nav')", 3195 "click.fb-start", l) : e.unbind("click.fb-start").bind("click.fb-start", l); 3196 this.filter("[data-fancybox-start=1]").trigger("click"); 3197 return this 3198 }; 3199 p.ready(function () { 3200 var a, d; 3201 f.scrollbarWidth === w && (f.scrollbarWidth = function () { 3202 var a = f('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"), b = a.children(), b = b.innerWidth() - b.height(99).innerWidth(); 3203 a.remove(); 3204 return b 3205 }); 3206 f.support.fixedPosition === w && (f.support.fixedPosition = function () { 3207 var a = f('<div style="position:fixed;top:20px;"></div>').appendTo("body"), 3208 b = 20 === a[0].offsetTop || 15 === a[0].offsetTop; 3209 a.remove(); 3210 return b 3211 }()); 3212 f.extend(b.defaults, {scrollbarWidth: f.scrollbarWidth(), fixed: f.support.fixedPosition, parent: f("body")}); 3213 a = f(s).width(); 3214 K.addClass("fancybox-lock-test"); 3215 d = f(s).width(); 3216 K.removeClass("fancybox-lock-test"); 3217 f("<style type='text/css'>.fancybox-margin{margin-right:" + (d - a) + "px;}</style>").appendTo("head") 3218 }) 3219})(window, document, jQuery); 3220!function (a) { 3221 "use strict"; 3222 var b = "animsition", c = {init: function (d) { 3223 d = a.extend({inClass: "fade-in", outClass: "fade-out", inDuration: 1500, outDuration: 8
322300, linkElement: ".animsition-link", loading: !0, loadingParentElement: "body", loadingClass: "animsition-loading", unSupportCss: ["animation-duration", "-webkit-animation-duration", "-o-animation-duration"], overlay: !1, overlayClass: "animsition-overlay-slide", overlayParentElement: "body"}, d); 3224 var e = c.supportCheck.call(this, d); 3225 if (!e) 3226 return"console"in window || (window.console = {}, window.console.log = function (a) { 3227 return a 3228 }), console.log("Animsition does not support this browser."), c.destroy.call(this); 3229 var f = c.optionCheck.call(this, d); 3230 return f && c.addOverlay.call(this, d), d.loading && c.addLoading.call(this, d), this.each(function () { 3231 var e = this, f = a(this), g = a(window), h = f.data(b); 3232 h || (d = a.extend({}, d), f.data(b, {options: d}), g.on("load." + b + " pageshow." + b, function () { 3233 c.pageIn.call(e) 3234 }), g.on("unload." + b, function () { 3235 }), a(d.linkElement).on("click." + b, function (b) { 3236 b.preventDefault(); 3237 var d = a(this), f = d.attr("href"); 3238 2 === b.which || b.metaKey || b.shiftKey || -1 !== navigator.platform.toUpperCase().indexOf("WIN") && b.ctrlKey ? window.open(f, "_blank") : c.pageOut.call(e, d, f) 3239 })) 3240 }) 3241 }, addOverlay: function (b) { 3242 a(b.overlayParentElement).prepend('<div class="' + b.overlayClass + '"></div>') 3243 }, addLoading: function (b) { 3244 a(b.loadingParentElement).append('<div class="' + b.loadingClass + '"></div>') 3245 }, removeLoading: function () { 3246 var c = a(this), d = c.data(b).options, e = a(d.loadingParentElement).children("." + d.loadingClass); 3247 e.fadeOut().remove() 3248 }, supportCheck: function (b) { 3249 var c = a(this), d = b.unSupportCss, e = d.length, f = !1; 3250 0 === e && (f = !0); 3251 for (var g = 0; e > g; g++) 3252 if ("string" == typeof c.css(d[g])) { 3253 f = !0; 3254 break 3255 } 3256 return f 3257 }, optionCheck: function (b) { 3258 var c, d = a(this); 3259 return c = b.overlay || d.data("animsition-overlay") ? !0 : !1 3260 }, animationCheck: function (c, d, e) { 3261 var f = a(this), g = f.data(b).options, h = typeof c, i = !d && "number" === h, j = d && "string" === h && c.length > 0; 3262 return i || j ? c = c : d && e ? c = g.inClass : !d && e ? c = g.inDuration : d && !e ? c = g.outClass : d || e || (c = g.outDuration), c 3263 }, pageIn: function () { 3264 var d = this, e = a(this), f = e.data(b).options, g = e.data("animsition-in-duration"), h = e.data("animsition-in"), i = c.animationCheck.call(d, g, !1, !0), j = c.animationCheck.call(d, h, !0, !0), k = c.optionCheck.call(d, f); 3265 f.loading && c.removeLoading.call(d), k ? c.pageInOverlay.call(d, j, i) : c.pageInBasic.call(d, j, i) 3266 }, pageInBasic: function (b, c) { 3267 var d = a(this); 3268 d.trigger("animsition.start").css({"animation-duration": c / 1e3 + "s"}).addClass(b).animateCallback(function () { 3269 d.removeClass(b).css({opacity: 1}).trigger("animsition.end") 3270 }) 3271 }, pageInOverlay: function (c, d) { 3272 var e = a(this), f = e.data(b).options; 3273 e.trigger("animsition.start").css({opacity: 1}), a(f.overlayParentElement).children("." + f.overlayClass).css({"animation-duration": d / 1e3 + "s"}).addClass(c).animateCallback(function () { 3274 e.trigger("animsition.end") 3275 }) 3276 }, pageOut: function (d, e) { 3277 var f = this, g = a(this), h = g.data(b).options, i = d.data("animsition-out"), j = g.data("animsition-out"), k = d.data("animsition-out-duration"), l = g.data("animsition-out-duration"), m = i ? i : j, n = k ? k : l, o = c.animationCheck.call(f, m, !0, !1), p = c.animationCheck.call(f, n, !1, !1), q = c.optionCheck.call(f, h); 3278 q ? c.pageOutOverlay.call(f, o, p, e) : c.pageOutBasic.call(f, o, p, e) 3279 }, pageOutBasic: function (b, c, d) { 3280 var e = a(this); 3281 e.css({"animation-duration": c / 1e3 + "s"}).addClass(b).animateCallback(function () { 3282 location.href = d 3283 }) 3284 }, pageOutOverlay: function (d, e, f) { 3285 var g = this, h = a(this), i = h.data(b).options, j = h.data("animsition-in"), k = c.animationCheck.call(g, j, !0, !0); 3286 a(i.overlayParentElement).children("." + i.overlayClass).css({"animation-duration": e / 1e3 + "s"}).removeClass(k).addClass(d).animateCallback(function () { 3287 location.href = f 3288 }) 3289 }, destroy: function () { 3290 return this.each(function () { 3291 var c = a(this); 3292 a(window).unbind("." + b), c.css({opacity: 1}).removeData(b) 3293 }) 3294 }}; 3295 a.fn.animateCallback = function (b) { 3296 var c = "animationend webkitAnimationEnd mozAnimationEnd oAnimationEnd MSAnimationEnd"; 3297 return this.each(function () { 3298 a(this).bind(c, function () { 3299 return a(this).unbind(c), b.call(this) 3300 }) 3301 }) 3302 }, a.fn.animsition = function (d) { 3303 return c[d] ? c[d].apply(this, Array.prototype.slice.call(arguments, 1)) : "object" != typeof d && d ? void a.error("Method " + d + " does not exist on jQuery." + b) : c.init.apply(this, arguments) 3304 } 3305}(jQuery); 3306(function (t) { 3307 function e() { 3308 } 3309 function i(t) { 3310 function i(e) { 3311 e.prototype.option || (e.prototype.option = function (e) { 3312 t.isPlainObject(e) && (this.options = t.extend(!0, this.options, e)) 3313 }) 3314 } 3315 function n(e, i) { 3316 t.fn[e] = function (n) { 3317 if ("string" == typeof n) { 3318 for (var s = o.call(arguments, 1), a = 0, u = this.length; u > a; a++) { 3319 var p = this[a], h = t.data(p, e); 3320 if (h) 3321 if (t.isFunction(h[n]) && "_" !== n.charAt(0)) { 3322 var f = h[n].apply(h, s); 3323 if (void 0 !== f) 3324 return f 3325 } else 3326 r("no such method '" + n + "' for " + e + " instance"); 3327 else 3328 r("cannot call methods on " + e + " prior to initialization; " + "attempted to call '" + n + "'") 3329 } 3330 return this 3331 } 3332 return this.each(function () { 3333 var o = t.data(this, e); 3334 o ? (o.option(n), o._init()) : (o = new i(this, n), t.data(this, e, o)) 3335 }) 3336 } 3337 } 3338 if (t) { 3339 var r = "undefined" == typeof console ? e : function (t) { 3340 console.error(t) 3341 }; 3342 return t.bridget = function (t, e) { 3343 i(e), n(t, e) 3344 }, t.bridget 3345 } 3346 } 3347 var o = Array.prototype.slice; 3348 "function" == typeof define && define.amd ? define("jquery-bridget/jquery.bridget", ["jquery"], i) : "object" == typeof exports ? i(require("jquery")) : i(t.jQuery) 3349})(window), function (t) { 3350 function e(e) { 3351 var i = t.event; 3352 return i.target = i.target || i.srcElement || e, i 3353 } 3354 var i = document.documentElement, o = function () { 3355 }; 3356 i.addEventListener ? o = function (t, e, i) { 3357 t.addEventListener(e, i, !1) 3358 } : i.attachEvent && (o = function (t, i, o) { 3359 t[i + o] = o.handleEvent ? function () { 3360 var i = e(t); 3361 o.handleEvent.call(o, i) 3362 } : function () { 3363 var i = e(t); 3364 o.call(t, i) 3365 }, t.attachEvent("on" + i, t[i + o]) 3366 }); 3367 var n = function () { 3368 }; 3369 i.removeEventListener ? n = function (t, e, i) { 3370 t.removeEventListener(e, i, !1) 3371 } : i.detachEvent && (n = function (t, e, i) { 3372 t.detachEvent("on" + e, t[e + i]); 3373 try { 3374 delete t[e + i] 3375 } catch (o) { 3376 t[e + i] = void 0 3377 } 3378 }); 3379 var r = {bind: o, unbind: n}; 3380 "function" == typeof define && define.amd ? define("eventie/eventie", r) : "object" == typeof exports ? module.exports = r : t.eventie = r 3381}(this), function (t) { 3382 function e(t) { 3383 "function" == typeof t && (e.isReady ? t() : s.push(t)) 3384 } 3385 function i(t) { 3386 var i = "readystatechange" === t.type && "complete" !== r.readyState; 3387 e.isReady || i || o() 3388 } 3389 function o() { 3390 e.isReady = !0; 3391 for (var t = 0, i = s.length; i > t; t++) { 3392 var o = s[t]; 3393 o() 3394 } 3395 } 3396 function n(n) { 3397 return"complete" === r.readyState ? o() : (n.bind(r, "DOMContentLoaded", i), n.bind(r, "readystatechange", i), n.bind(t, "load", i)), e 3398 } 3399 var r = t.document, s = []; 3400 e.isReady = !1, "function" == typeof define && define.amd ? define("doc-ready/doc-ready", ["eventie/eventie"], n) : "object" == typeof exports ? module.exports = n(require("eventie")) : t.docReady = n(t.eventie) 3401}(window), function () { 3402 function t() { 3403 } 3404 function e(t, e) { 3405 for (var i = t.length; i--; ) 3406 if (t[i].listener === e) 3407 return i; 3408 return-1 3409 } 3410 function i(t) { 3411 return function () { 3412 return this[t].apply(this, arguments) 3413 } 3414 } 3415 var o = t.prototype, n = this, r = n.EventEmitter; 3416 o.getListeners = function (t) { 3417 var e, i, o = this._getEvents(); 3418 if (t instanceof RegExp) { 3419 e = {}; 3420 for (i in o) 3421 o.hasOwnProperty(i) && t.test(i) && (e[i] = o[i]) 3422 } else 3423 e = o[t] || (o[t] = []); 3424 return e 3425 }, o.flattenListeners = function (t) { 3426 var e, i = []; 3427 for (e = 0; t.length > e; e += 1) 3428 i.push(t[e].listener); 3429 return i 3430 }, o.getListenersAsObject = function (t) { 3431 var e, i = this.getListeners(t); 3432 return i instanceof Array && (e = {}, e[t] = i), e || i 3433 }, o.addListener = function (t, i) { 3434 var o, n = this.getListenersAsObject(t), r = "object" == typeof i; 3435 for (o in n) 3436 n.hasOwnProperty(o) && -1 === e(n[o], i) && n[o].push(r ? i : {listener: i, once: !1}); 3437 return this 3438 }, o.on = i("addListener"), o.addOnceListener = function (t, e) { 3439 return this.addListener(t, {listener: e, once: !0}) 3440 }, o.once = i("addOnceListener"), o.defineEvent = function (t) { 3441 return this.getListeners(t), this 3442 }, o.defineEvents = function (t) { 3443 for (var e = 0; t.length > e; e += 1) 3444 this.defineEvent(t[e]); 3445 return this 3446 }, o.removeListener = function (t, i) { 3447 var o, n, r = this.getListenersAsObject(t); 3448 for (n in r) 3449 r.hasOwnProperty(n) && (o = e(r[n], i), -1 !== o && r[n].splice(o, 1)); 3450 return this 3451 }, o.off = i("removeListener"), o.addListeners = function (t, e) { 3452 return this.manipulateListeners(!1, t, e) 3453 }, o.removeListeners = function (t, e) { 3454 return this.manipulateListeners(!0, t, e) 3455 }, o.manipulateListeners = function (t, e, i) { 3456 var o, n, r = t ? this.removeListener : this.addListener, s = t ? this.removeListeners : this.addListeners; 3457 if ("object" != typeof e || e instanceof RegExp) 3458 for (o = i.length; o--; ) 3459 r.call(this, e, i[o]); 3460 else 3461 for (o in e) 3462 e.hasOwnProperty(o) && (n = e[o]) && ("function" == typeof n ? r.call(this, o, n) : s.call(this, o, n)); 3463 return this 3464 }, o.removeEvent = function (t) { 3465 var e, i = typeof t, o = this._getEvents(); 3466 if ("string" === i) 3467 delete o[t]; 3468 else if (t instanceof RegExp) 3469 for (e in o) 3470 o.hasOwnProperty(e) && t.test(e) && delete o[e]; 3471 else 3472 delete this._events; 3473 return this 3474 }, o.removeAllListeners = i("removeEvent"), o.emitEvent = function (t, e) { 3475 var i, o, n, r, s = this.getListenersAsObject(t); 3476 for (n in s) 3477 if (s.hasOwnProperty(n)) 3478 for (o = s[n].length; o--; ) 3479 i = s[n][o], i.once === !0 && this.removeListener(t, i.listener), r = i.listener.apply(this, e || []), r === this._getOnceReturnValue() && this.removeListener(t, i.listener); 3480 return this 3481 }, o.trigger = i("emitEvent"), o.emit = function (t) { 3482 var e = Array.prototype.slice.call(arguments, 1); 3483 return this.emitEvent(t, e) 3484 }, o.setOnceReturnValue = function (t) { 3485 return this._onceReturnValue = t, this 3486 }, o._getOnceReturnValue = function () { 3487 return this.hasOwnProperty("_onceReturnValue") ? this._onceReturnValue : !0 3488 }, o._getEvents = function () { 3489 return this._events || (this._events = {}) 3490 }, t.noConflict = function () { 3491 return n.EventEmitter = r, t 3492 }, "function" == typeof define && define.amd ? define("eventEmitter/EventEmitter", [], function () { 3493 return t 3494 }) : "object" == typeof module && module.exports ? module.exports = t : n.EventEmitter = t 3495}.call(this), function (t) { 3496 function e(t) { 3497 if (t) { 3498 if ("string" == typeof o[t]) 3499 return t; 3500 t = t.charAt(0).toUpperCase() + t.slice(1); 3501 for (var e, n = 0, r = i.length; r > n; n++) 3502 if (e = i[n] + t, "string" == typeof o[e]) 3503 return e 3504 } 3505 } 3506 var i = "Webkit Moz ms Ms O".split(" "), o = document.documentElement.style; 3507 "function" == typeof define && define.amd ? define("get-style-property/get-style-property", [], function () { 3508 return e 3509 }) : "object" == typeof exports ? module.exports = e : t.getStyleProperty = e 3510}(window), function (t) { 3511 function e(t) { 3512 var e = parseFloat(t), i = -1 === t.indexOf("%") && !isNaN(e); 3513 return i && e 3514 } 3515 function i() { 3516 } 3517 function o() { 3518 for (var t = {width: 0, height: 0, innerWidth: 0, innerHeight: 0, outerWidth: 0, outerHeight: 0}, e = 0, i = s.length; i > e; e++) { 3519 var o = s[e]; 3520 t[o] = 0 3521 } 3522 return t 3523 } 3524 function n(i) { 3525 function n() { 3526 if (!d) { 3527 d = !0; 3528 var o = t.getComputedStyle; 3529 if (p = function () { 3530 var t = o ? function (t) { 3531 return o(t, null) 3532 } : function (t) { 3533 return t.currentStyle 3534 }; 3535 return function (e) { 3536 var i = t(e); 3537 return i || r("Style returned " + i + ". Are you running this code in a hidden iframe on Firefox? " + "See http://bit.ly/getsizebug1"), i 3538 } 3539 }(), h = i("boxSizing")) { 3540 var n = document.createElement("div"); 3541 n.style.width = "200px", n.style.padding = "1px 2px 3px 4px", n.style.borderStyle = "solid", n.style.borderWidth = "1px 2px 3px 4px", n.style[h] = "border-box"; 3542 var s = document.body || document.documentElement; 3543 s.appendChild(n); 3544 var a = p(n); 3545 f = 200 === e(a.width), s.removeChild(n) 3546 } 3547 } 3548 } 3549 function a(t) { 3550 if (n(), "string" == typeof t && (t = document.querySelector(t)), t && "object" == typeof t && t.nodeType) { 3551 var i = p(t); 3552 if ("none" === i.display) 3553 return o(); 3554 var r = {}; 3555 r.width = t.offsetWidth, r.height = t.offsetHeight; 3556 for (var a = r.isBorderBox = !(!h || !i[h] || "border-box" !== i[h]), d = 0, l = s.length; l > d; d++) { 3557 var c = s[d], y = i[c]; 3558 y = u(t, y); 3559 var m = parseFloat(y); 3560 r[c] = isNaN(m) ? 0 : m 3561 } 3562 var g = r.paddingLeft + r.paddingRight, v = r.paddingTop + r.paddingBottom, _ = r.marginLeft + r.marginRight, I =
3562r.marginTop + r.marginBottom, L = r.borderLeftWidth + r.borderRightWidth, z = r.borderTopWidth + r.borderBottomWidth, b = a && f, x = e(i.width); 3563 x !== !1 && (r.width = x + (b ? 0 : g + L)); 3564 var S = e(i.height); 3565 return S !== !1 && (r.height = S + (b ? 0 : v + z)), r.innerWidth = r.width - (g + L), r.innerHeight = r.height - (v + z), r.outerWidth = r.width + _, r.outerHeight = r.height + I, r 3566 } 3567 } 3568 function u(e, i) { 3569 if (t.getComputedStyle || -1 === i.indexOf("%")) 3570 return i; 3571 var o = e.style, n = o.left, r = e.runtimeStyle, s = r && r.left; 3572 return s && (r.left = e.currentStyle.left), o.left = i, i = o.pixelLeft, o.left = n, s && (r.left = s), i 3573 } 3574 var p, h, f, d = !1; 3575 return a 3576 } 3577 var r = "undefined" == typeof console ? i : function (t) { 3578 console.error(t) 3579 }, s = ["paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "marginLeft", "marginRight", "marginTop", "marginBottom", "borderLeftWidth", "borderRightWidth", "borderTopWidth", "borderBottomWidth"]; 3580 "function" == typeof define && define.amd ? define("get-size/get-size", ["get-style-property/get-style-property"], n) : "object" == typeof exports ? module.exports = n(require("desandro-get-style-property")) : t.getSize = n(t.getStyleProperty) 3581}(window), function (t) { 3582 function e(t, e) { 3583 return t[s](e) 3584 } 3585 function i(t) { 3586 if (!t.parentNode) { 3587 var e = document.createDocumentFragment(); 3588 e.appendChild(t) 3589 } 3590 } 3591 function o(t, e) { 3592 i(t); 3593 for (var o = t.parentNode.querySelectorAll(e), n = 0, r = o.length; r > n; n++) 3594 if (o[n] === t) 3595 return!0; 3596 return!1 3597 } 3598 function n(t, o) { 3599 return i(t), e(t, o) 3600 } 3601 var r, s = function () { 3602 if (t.matchesSelector) 3603 return"matchesSelector"; 3604 for (var e = ["webkit", "moz", "ms", "o"], i = 0, o = e.length; o > i; i++) { 3605 var n = e[i], r = n + "MatchesSelector"; 3606 if (t[r]) 3607 return r 3608 } 3609 }(); 3610 if (s) { 3611 var a = document.createElement("div"), u = e(a, "div"); 3612 r = u ? e : n 3613 } else 3614 r = o; 3615 "function" == typeof define && define.amd ? define("matches-selector/matches-selector", [], function () { 3616 return r 3617 }) : "object" == typeof exports ? module.exports = r : window.matchesSelector = r 3618}(Element.prototype), function (t) { 3619 function e(t, e) { 3620 for (var i in e) 3621 t[i] = e[i]; 3622 return t 3623 } 3624 function i(t) { 3625 for (var e in t) 3626 return!1; 3627 return e = null, !0 3628 } 3629 function o(t) { 3630 return t.replace(/([A-Z])/g, function (t) { 3631 return"-" + t.toLowerCase() 3632 }) 3633 } 3634 function n(t, n, r) { 3635 function a(t, e) { 3636 t && (this.element = t, this.layout = e, this.position = {x: 0, y: 0}, this._create()) 3637 } 3638 var u = r("transition"), p = r("transform"), h = u && p, f = !!r("perspective"), d = {WebkitTransition: "webkitTransitionEnd", MozTransition: "transitionend", OTransition: "otransitionend", transition: "transitionend"}[u], l = ["transform", "transition", "transitionDuration", "transitionProperty"], c = function () { 3639 for (var t = {}, e = 0, i = l.length; i > e; e++) { 3640 var o = l[e], n = r(o); 3641 n && n !== o && (t[o] = n) 3642 } 3643 return t 3644 }(); 3645 e(a.prototype, t.prototype), a.prototype._create = function () { 3646 this._transn = {ingProperties: {}, clean: {}, onEnd: {}}, this.css({position: "absolute"}) 3647 }, a.prototype.handleEvent = function (t) { 3648 var e = "on" + t.type; 3649 this[e] && this[e](t) 3650 }, a.prototype.getSize = function () { 3651 this.size = n(this.element) 3652 }, a.prototype.css = function (t) { 3653 var e = this.element.style; 3654 for (var i in t) { 3655 var o = c[i] || i; 3656 e[o] = t[i] 3657 } 3658 }, a.prototype.getPosition = function () { 3659 var t = s(this.element), e = this.layout.options, i = e.isOriginLeft, o = e.isOriginTop, n = parseInt(t[i ? "left" : "right"], 10), r = parseInt(t[o ? "top" : "bottom"], 10); 3660 n = isNaN(n) ? 0 : n, r = isNaN(r) ? 0 : r; 3661 var a = this.layout.size; 3662 n -= i ? a.paddingLeft : a.paddingRight, r -= o ? a.paddingTop : a.paddingBottom, this.position.x = n, this.position.y = r 3663 }, a.prototype.layoutPosition = function () { 3664 var t = this.layout.size, e = this.layout.options, i = {}; 3665 e.isOriginLeft ? (i.left = this.position.x + t.paddingLeft + "px", i.right = "") : (i.right = this.position.x + t.paddingRight + "px", i.left = ""), e.
3665isOriginTop ? (i.top = this.position.y + t.paddingTop + "px", i.bottom = "") : (i.bottom = this.position.y + t.paddingBottom + "px", i.top = ""), this.css(i), this.emitEvent("layout", [this]) 3666 }; 3667 var y = f ? function (t, e) { 3668 return"translate3d(" + t + "px, " + e + "px, 0)" 3669 } : function (t, e) { 3670 return"translate(" + t + "px, " + e + "px)" 3671 }; 3672 a.prototype._transitionTo = function (t, e) { 3673 this.getPosition(); 3674 var i = this.position.x, o = this.position.y, n = parseInt(t, 10), r = parseInt(e, 10), s = n === this.position.x && r === this.position.y; 3675 if (this.setPosition(t, e), s && !this.isTransitioning) 3676 return this.layoutPosition(), void 0; 3677 var a = t - i, u = e - o, p = {}, h = this.layout.options; 3678 a = h.isOriginLeft ? a : -a, u = h.isOriginTop ? u : -u, p.transform = y(a, u), this.transition({to: p, onTransitionEnd: {transform: this.layoutPosition}, isCleaning: !0}) 3679 }, a.prototype.goTo = function (t, e) { 3680 this.setPosition(t, e), this.layoutPosition() 3681 }, a.prototype.moveTo = h ? a.prototype._transitionTo : a.prototype.goTo, a.prototype.setPosition = function (t, e) { 3682 this.position.x = parseInt(t, 10), this.position.y = parseInt(e, 10) 3683 }, a.prototype._nonTransition = function (t) { 3684 this.css(t.to), t.isCleaning && this._removeStyles(t.to); 3685 for (var e in t.onTransitionEnd) 3686 t.onTransitionEnd[e].call(this) 3687 }, a.prototype._transition = function (t) { 3688 if (!parseFloat(this.layout.options.transitionDuration)) 3689 return this._nonTransition(t), void 0; 3690 var e = this._transn; 3691 for (var i in t.onTransitionEnd) 3692 e.onEnd[i] = t.onTransitionEnd[i]; 3693 for (i in t.to) 3694 e.ingProperties[i] = !0, t.isCleaning && (e.clean[i] = !0); 3695 if (t.from) { 3696 this.css(t.from); 3697 var o = this.element.offsetHeight; 3698 o = null 3699 } 3700 this.enableTransition(t.to), this.css(t.to), this.isTransitioning = !0 3701 }; 3702 var m = p && o(p) + ",opacity"; 3703 a.prototype.enableTransition = function () { 3704 this.isTransitioning || (this.css({transitionProperty: m, transitionDuration: this.layout.options.transitionDuration}), this.element.addEventListener(d, this, !1)) 3705 }, a.prototype.transition = a.prototype[u ? "_transition" : "_nonTransition"], a.prototype.onwebkitTransitionEnd = function (t) { 3706 this.ontransitionend(t) 3707 }, a.prototype.onotransitionend = function (t) { 3708 this.ontransitionend(t) 3709 }; 3710 var g = {"-webkit-transform": "transform", "-moz-transform": "transform", "-o-transform": "transform"}; 3711 a.prototype.ontransitionend = function (t) { 3712 if (t.target === this.element) { 3713 var e = this._transn, o = g[t.propertyName] || t.propertyName; 3714 if (delete e.ingProperties[o], i(e.ingProperties) && this.disableTransition(), o in e.clean && (this.element.style[t.propertyName] = "", delete e.clean[o]), o in e.onEnd) { 3715 var n = e.onEnd[o]; 3716 n.call(this), delete e.onEnd[o] 3717 } 3718 this.emitEvent("transitionEnd", [this]) 3719 } 3720 }, a.prototype.disableTransition = function () { 3721 this.removeTransitionStyles(), this.element.removeEventListener(d, this, !1), this.isTransitioning = !1 3722 }, a.prototype._removeStyles = function (t) { 3723 var e = {}; 3724 for (var i in t) 3725 e[i] = ""; 3726 this.css(e) 3727 }; 3728 var v = {transitionProperty: "", transitionDuration: ""}; 3729 return a.prototype.removeTransitionStyles = function () { 3730 this.css(v) 3731 }, a.prototype.removeElem = function () { 3732 this.element.parentNode.removeChild(this.element), this.emitEvent("remove", [this]) 3733 }, a.prototype.remove = function () { 3734 if (!u || !parseFloat(this.layout.options.transitionDuration)) 3735 return this.removeElem(), void 0; 3736 var t = this; 3737 this.on("transitionEnd", function () { 3738 return t.removeElem(), !0 3739 }), this.hide() 3740 }, a.prototype.reveal = function () { 3741 delete this.isHidden, this.css({display: ""}); 3742 var t = this.layout.options; 3743 this.transition({from: t.hiddenStyle, to: t.visibleStyle, isCleaning: !0}) 3744 }, a.prototype.hide = function () { 3745 this.isHidden = !0, this.css({display: ""}); 3746 var t = this.layout.options; 3747 this.transition({from: t.visibleStyle, to: t.hiddenStyle, isCleaning: !0, onTransitionEnd: {opacity: function () { 3748 this.isHidden && this.css({display: "none"}) 3749 }}}) 3750 }, a.prototype.destroy = function () { 3751 this.css({position: "", left: "", right: "", top: "", bottom: "", transition: "", transform: ""}) 3752 }, a 3753 } 3754 var r = t.getComputedStyle, s = r ? function (t) { 3755 return r(t, null) 3756 } : function (t) { 3757 return t.currentStyle 3758 }; 3759 "function" == typeof define && define.amd ? define("outlayer/item", ["eventEmitter/EventEmitter", "get-size/get-size", "get-style-property/get-style-property"], n) : "object" == typeof exports ? module.exports = n(require("wolfy87-eventemitter"), require("get-size"), require("desandro-get-style-property")) : (t.Outlayer = {}, t.Outlayer.Item = n(t.EventEmitter, t.getSize, t.getStyleProperty)) 3760}(window), function (t) { 3761 function e(t, e) { 3762 for (var i in e) 3763 t[i] = e[i]; 3764 return t 3765 } 3766 function i(t) { 3767 return"[object Array]" === f.call(t) 3768 } 3769 function o(t) { 3770 var e = []; 3771 if (i(t)) 3772 e = t; 3773 else if (t && "number" == typeof t.length) 3774 for (var o = 0, n = t.length; n > o; o++) 3775 e.push(t[o]); 3776 else 3777 e.push(t); 3778 return e 3779 } 3780 function n(t, e) { 3781 var i = l(e, t); 3782 -1 !== i && e.splice(i, 1) 3783 } 3784 function r(t) { 3785 return t.replace(/(.)([A-Z])/g, function (t, e, i) { 3786 return e + "-" + i 3787 }).toLowerCase() 3788 } 3789 function s(i, s, f, l, c, y) { 3790 function m(t, i) { 3791 if ("string" == typeof t && (t = a.querySelector(t)), !t || !d(t)) 3792 return u && u.error("Bad " + this.constructor.namespace + " element: " + t), void 0; 3793 this.element = t, this.options = e({}, this.constructor.defaults), this.option(i); 3794 var o = ++g; 3795 this.element.outlayerGUID = o, v[o] = this, this._create(), this.options.isInitLayout && this.layout() 3796 } 3797 var g = 0, v = {}; 3798 return m.namespace = "outlayer", m.Item = y, m.defaults = {c
3798ontainerStyle: {position: "relative"}, isInitLayout: !0, isOriginLeft: !0, isOriginTop: !0, isResizeBound: !0, isResizingContainer: !0, transitionDuration: "0.4s", hiddenStyle: {opacity: 0, transform: "scale(0.001)"}, visibleStyle: {opacity: 1, transform: "scale(1)"}}, e(m.prototype, f.prototype), m.prototype.option = function (t) { 3799 e(this.options, t) 3800 }, m.prototype._create = function () { 3801 this.reloadItems(), this.stamps = [], this.stamp(this.options.stamp), e(this.element.style, this.options.containerStyle), this.options.isResizeBound && this.bindResize() 3802 }, m.prototype.reloadItems = function () { 3803 this.items = this._itemize(this.element.children) 3804 }, m.prototype._itemize = function (t) { 3805 for (var e = this._filterFindItemElements(t), i = this.constructor.Item, o = [], n = 0, r = e.length; r > n; n++) { 3806 var s = e[n], a = new i(s, this); 3807 o.push(a) 3808 } 3809 return o 3810 }, m.prototype._filterFindItemElements = function (t) { 3811 t = o(t); 3812 for (var e = this.options.itemSelector, i = [], n = 0, r = t.length; r > n; n++) { 3813 var s = t[n]; 3814 if (d(s)) 3815 if (e) { 3816 c(s, e) && i.push(s); 3817 for (var a = s.querySelectorAll(e), u = 0, p = a.length; p > u; u++) 3818 i.push(a[u]) 3819 } else 3820 i.push(s) 3821 } 3822 return i 3823 }, m.prototype.getItemElements = function () { 3824 for (var t = [], e = 0, i = this.items.length; i > e; e++) 3825 t.push(this.items[e].element); 3826 return t 3827 }, m.prototype.layout = function () { 3828 this._resetLayout(), this._manageStamps(); 3829 var t = void 0 !== this.options.isLayoutInstant ? this.options.isLayoutInstant : !this._isLayoutInited; 3830 this.layoutItems(this.items, t), this._isLayoutInited = !0 3831 }, m.prototype._init = m.prototype.layout, m.prototype._resetLayout = function () {
3832 this.getSize() 3833 }, m.prototype.getSize = function () { 3834 this.size = l(this.element) 3835 }, m.prototype._getMeasurement = function (t, e) { 3836 var i, o = this.options[t]; 3837 o ? ("string" == typeof o ? i = this.element.querySelector(o) : d(o) && (i = o), this[t] = i ? l(i)[e] : o) : this[t] = 0 3838 }, m.prototype.layoutItems = function (t, e) { 3839 t = this._getItemsForLayout(t), this._layoutItems(t, e), this._postLayout() 3840 }, m.prototype._getItemsForLayout = function (t) { 3841 for (var e = [], i = 0, o = t.length; o > i; i++) { 3842 var n = t[i]; 3843 n.isIgnored || e.push(n) 3844 } 3845 return e 3846 }, m.prototype._layoutItems = function (t, e) { 3847 function i() { 3848 o.emitEvent("layoutComplete", [o, t]) 3849 } 3850 var o = this; 3851 if (!t || !t.length) 3852 return i(), void 0; 3853 this._itemsOn(t, "layout", i); 3854 for (var n = [], r = 0, s = t.length; s > r; r++) { 3855 var a = t[r], u = this._getItemLayoutPosition(a); 3856 u.item = a, u.isInstant = e || a.isLayoutInstant, n.push(u) 3857 } 3858 this._processLayoutQueue(n) 3859 }, m.prototype._getItemLayoutPosition = function () { 3860 return{x: 0, y: 0} 3861 }, m.prototype._processLayoutQueue = function (t) { 3862 for (var e = 0, i = t.length; i > e; e++) { 3863 var o = t[e]; 3864 this._positionItem(o.item, o.x, o.y, o.isInstant) 3865 } 3866 }, m.prototype._positionItem = function (t, e, i, o) { 3867 o ? t.goTo(e, i) : t.moveTo(e, i) 3868 }, m.prototype._postLayout = function () { 3869 this.resizeContainer() 3870 }, m.prototype.resizeContainer = function () { 3871 if (this.options.isResizingContainer) { 3872 var t = this._getContainerSize(); 3873 t && (this._setContainerMeasure(t.width, !0), this._setContainerMeasure(t.height, !1)) 3874 } 3875 }, m.prototype._getContainerSize = h, m.prototype._setContainerMeasure = function (t, e) { 3876 if (void 0 !== t) { 3877 var i = this.size; 3878 i.isBorderBox && (t += e ? i.paddingLeft + i.paddingRight + i.borderLeftWidth + i.borderRightWidth : i.paddingBottom + i.paddingTop + i.borderTopWidth + i.borderBottomWidth), t = Math.max(t, 0), this.element.style[e ? "width" : "height"] = t + "px" 3879 } 3880 }, m.prototype._itemsOn = function (t, e, i) { 3881 function o() { 3882 return n++, n === r && i.call(s), !0 3883 } 3884 for (var n = 0, r = t.length, s = this, a = 0, u = t.length; u > a; a++) { 3885 var p = t[a]; 3886 p.on(e, o) 3887 } 3888 }, m.prototype.ignore = function (t) { 3889 var e = this.getItem(t); 3890 e && (e.isIgnored = !0) 3891 }, m.prototype.unignore = function (t) { 3892 var e = this.getItem(t); 3893 e && delete e.isIgnored 3894 }, m.prototype.stamp = function (t) { 3895 if (t = this._find(t)) { 3896 this.stamps = this.stamps.concat(t); 3897 for (var e = 0, i = t.length; i > e; e++) { 3898 var o = t[e]; 3899 this.ignore(o) 3900 } 3901 } 3902 }, m.prototype.unstamp = function (t) { 3903 if (t = this._find(t)) 3904 for (var e = 0, i = t.length; i > e; e++) { 3905 var o = t[e]; 3906 n(o, this.stamps), this.unignore(o) 3907 } 3908 }, m.prototype._find = function (t) { 3909 return t ? ("string" == typeof t && (t = this.element.querySelectorAll(t)), t = o(t)) : void 0 3910 }, m.prototype._manageStamps = function () { 3911 if (this.stamps && this.stamps.length) { 3912 this._getBoundingRect(); 3913 for (var t = 0, e = this.stamps.length; e > t; t++) { 3914 var i = this.stamps[t]; 3915 this._manageStamp(i) 3916 } 3917 } 3918 }, m.prototype._getBoundingRect = function () { 3919 var t = this.element.getBoundingClientRect(), e = this.size;
3920 this._boundingRect = {left: t.left + e.paddingLeft + e.borderLeftWidth, top: t.top + e.paddingTop + e.borderTopWidth, right: t.right - (e.paddingRight + e.borderRightWidth), bottom: t.bottom - (e.paddingBottom + e.borderBottomWidth)} 3921 }, m.prototype._manageStamp = h, m.prototype._getElementOffset = function (t) { 3922 var e = t.getBoundingClientRect(), i = this._boundingRect, o = l(t), n = {left: e.left - i.left - o.marginLeft, top: e.top - i.top - o.marginTop, right: i.right - e.right - o.marginRight, bottom: i.bottom - e.bottom - o.marginBottom}; 3923 return n 3924 }, m.prototype.handleEvent = function (t) { 3925 var e = "on" + t.type; 3926 this[e] && this[e](t) 3927 }, m.prototype.bindResize = function () { 3928 this.isResizeBound || (i.bind(t, "resize", this), this.isResizeBound = !0) 3929 }, m.prototype.unbindResize = function () { 3930 this.isResizeBound && i.unbind(t, "resize", this), this.isResizeBound = !1 3931 }, m.prototype.onresize = function () { 3932 function t() { 3933 e.resize(), delete e.resizeTimeout 3934 } 3935 this.resizeTimeout && clearTimeout(this.resizeTimeout); 3936 var e = this; 3937 this.resizeTimeout = setTimeout(t, 100) 3938 }, m.prototype.resize = function () { 3939 this.isResizeBound && this.needsResizeLayout() && this.layout() 3940 }, m.prototype.needsResizeLayout = function () { 3941 var t = l(this.element), e = this.size && t; 3942 return e && t.innerWidth !== this.size.innerWidth 3943 }, m.prototype.addItems = function (t) { 3944 var e = this._itemize(t); 3945 return e.length && (this.items = this.items.concat(e)), e 3946 }, m.prototype.appended = function (t) { 3947 var e = this.addItems(t); 3948 e.length && (this.layoutItems(e, !0), this.reveal(e)) 3949 }, m.prototype.prepended = function (t) { 3950 var e = this._itemize(t); 3951 if (e.length) { 3952 var i = this.items.slice(0); 3953 this.items = e.concat(i), this._resetLayout(), this._manageStamps(), this.layoutItems(e, !0), this.reveal(e), this.layoutItems(i) 3954 } 3955 }, m.prototype.reveal = function (t) { 3956 var e = t && t.length; 3957 if (e) 3958 for (var i = 0; e > i; i++) { 3959 var o = t[i]; 3960 o.reveal() 3961 } 3962 }, m.prototype.hide = function (t) { 3963 var e = t && t.length; 3964 if (e) 3965 for (var i = 0; e > i; i++) { 3966 var o = t[i]; 3967 o.hide() 3968 } 3969 }, m.prototype.getItem = function (t) { 3970 for (var e = 0, i = this.items.length; i > e; e++) { 3971 var o = this.items[e]; 3972 if (o.element === t) 3973 return o 3974 } 3975 }, m.prototype.getItems = function (t) { 3976 if (t && t.length) { 3977 for (var e = [], i = 0, o = t.length; o > i; i++) { 3978 var n = t[i], r = this.getItem(n); 3979 r && e.push(r) 3980 } 3981 return e 3982 } 3983 }, m.prototype.remove = function (t) { 3984 t = o(t); 3985 var e = this.getItems(t); 3986 if (e && e.length) { 3987 this._itemsOn(e, "remove", function () { 3988 this.emitEvent("removeComplete", [this, e]) 3989 }); 3990 for (var i = 0, r = e.length; r > i; i++) { 3991 var s = e[i]; 3992 s.remove(), n(s, this.items) 3993 } 3994 } 3995 }, m.prototype.destroy = function () { 3996 var t = this.element.style; 3997 t.height = "", t.position = "", t.width = ""; 3998 for (var e = 0, i = this.items.length; i > e; e++) { 3999 var o = this.items[e]; 4000 o.destroy() 4001 } 4002 this.unbindResize(); 4003 var n = this.element.outlayerGUID; 4004 delete v[n], delete this.element.outlayerGUID, p && p.removeData(this.element, this.constructor.namespace) 4005 }, m.data = function (t) { 4006 var e = t && t.outlayerGUID; 4007 return e && v[e] 4008 }, m.create = function (t, i) { 4009 function o() { 4010 m.apply(this, arguments) 4011 } 4012 return Object.create ? o.prototype = Object.create(m.prototype) : e(o.prototype, m.prototype), o.prototype.constructor = o, o.defaults = e({}, m.defaults), e(o.defaults, i), o.prototype.settings = {}, o.namespace = t, o.data = m.data, o.Item = function () { 4013 y.apply(this, arguments) 4014 }, o.Item.prototype = new y, s(function () { 4015 for (var e = r(t), i = a.querySelectorAll(".js-" + e), n = "data-" + e + "-options", s = 0, h = i.length; h > s; s++) { 4016 var f, d = i[s], l = d.getAttribute(n); 4017 try { 4018 f = l && JSON.parse(l) 4019 } catch (c) { 4020 u && u.error("Error parsing " + n + " on " + d.nodeName.toLowerCase() + (d.id ? "#" + d.id : "") + ": " + c); 4021 continue 4022 } 4023 var y = new o(d, f); 4024 p && p.data(d, t, y) 4025 } 4026 }), p && p.bridget && p.bridget(t, o), o 4027 }, m.Item = y, m 4028 } 4029 var a = t.document, u = t.console, p = t.jQuery, h = function () { 4030 }, f = Object.prototype.toString, d = "function" == typeof HTMLElement || "object" == typeof HTMLElement ? function (t) { 4031 return t instanceof HTMLElement 4032 } : function (t) { 4033 return t && "object" == typeof t && 1 === t.nodeType && "string" == typeof t.nodeName 4034 }, l = Array.prototype.indexOf ? function (t, e) { 4035 return t.indexOf(e) 4036 } : function (t, e) { 4037 for (var i = 0, o = t.length; o > i; i++) 4038 if (t[i] === e) 4039 return i; 4040 return-1 4041 }; 4042 "function" == typeof define && define.amd ? define("outlayer/outlayer", ["eventie/eventie", "doc-ready/doc-ready", "eventEmitter/EventEmitter", "get-size/get-size", "matches-selector/matches-selector", "./item"], s) : "object" == typeof exports ? module.exports = s(require("eventie"), require("doc-ready"), require("wolfy87-eventemitter"), require("get-size"), require("desandro-matches-selector"), require("./item")) : t.Outlayer = s(t.eventie, t.docReady, t.EventEmitter, t.getSize, t.matchesSelector, t.Outlayer.Item) 4043}(window), function (t) { 4044 function e(t) { 4045 function e() { 4046 t.Item.apply(this, arguments) 4047 } 4048 e.prototype = new t.Item, e.prototype._create = function () { 4049 this.id = this.layout.itemGUID++, t.Item.prototype._create.call(this), this.sortData = {} 4050 }, e.prototype.updateSortData = function () { 4051 if (!this.isIgnored) { 4052 this.sortData.id = this.id, this.sortData["original-order"] = this.id, this.sortData.random = Math.random(); 4053 var t = this.layout.options.getSortData, e = this.layout._sorters; 4054 for (var i in t) { 4055 var o = e[i]; 4056 this.sortData[i] = o(this.element, this) 4057 } 4058 } 4059 }; 4060 var i = e.prototype.destroy; 4061 return e.prototype.destroy = function () { 4062 i.apply(this, arguments), this.css({display: ""}) 4063 }, e 4064 } 4065 "function" == typeof define && define.amd ? define("isotope/js/item", ["outlayer/outlayer"], e) : "object" == typeof exports ? module.exports = e(require("outlayer")) : (t.Isotope = t.Isotope || {}, t.Isotope.Item = e(t.Outlayer)) 4066}(window), function (t) { 4067 function e(t, e) { 4068 function i(t) { 4069 this.isotope = t, t && (this.options = t.options[this.namespace], this.element = t.element, this.items = t.filteredItems, this.size = t.size) 4070 } 4071 return function () { 4072 function t(t) { 4073 return function () { 4074 return e.prototype[t].apply(this.isotope, arguments) 4075 } 4076 } 4077 for (var o = ["_resetLayout", "_getItemLayoutPosition", "_manageStamp", "_getContainerSize", "_getElementOffset", "needsResizeLayout"], n = 0, r = o.length; r > n; n++) { 4078 var s = o[n]; 4079 i.prototype[s] = t(s) 4080 } 4081 }(), i.prototype.needsVerticalResizeLayout = function () { 4082 var e = t(this.isotope.element), i = this.isotope.size && e;
4083 return i && e.innerHeight !== this.isotope.size.innerHeight 4084 }, i.prototype._getMeasurement = function () { 4085 this.isotope._getMeasurement.apply(this, arguments) 4086 }, i.prototype.getColumnWidth = function () { 4087 this.getSegmentSize("column", "Width") 4088 }, i.prototype.getRowHeight = function () { 4089 this.getSegmentSize("row", "Height") 4090 }, i.prototype.getSegmentSize = function (t, e) { 4091 var i = t + e, o = "outer" + e; 4092 if (this._getMeasurement(i, o), !this[i]) { 4093 var n = this.getFirstItemSize(); 4094 this[i] = n && n[o] || this.isotope.size["inner" + e] 4095 } 4096 }, i.prototype.getFirstItemSize = function () { 4097 var e = this.isotope.filteredItems[0]; 4098 return e && e.element && t(e.element) 4099 }, i.prototype.layout = function () { 4100 this.isotope.layout.apply(this.isotope, arguments) 4101 }, i.prototype.getSize = function () { 4102 this.isotope.getSize(), this.size = this.isotope.size 4103 }, i.modes = {}, i.create = function (t, e) { 4104 function o() { 4105 i.apply(this, arguments) 4106 } 4107 return o.prototype = new i, e && (o.options = e), o.prototype.namespace = t, i.modes[t] = o, o 4108 }, i 4109 } 4110 "function" == typeof define && define.amd ? define("isotope/js/layout-mode", ["get-size/get-size", "outlayer/outlayer"], e) : "object" == typeof exports ? module.exports = e(require("get-size"), require("outlayer")) : (t.Isotope = t.Isotope || {}, t.Isotope.LayoutMode = e(t.getSize, t.Outlayer)) 4111}(window), function (t) { 4112 function e(t, e) { 4113 var o = t.create("masonry"); 4114 return o.prototype._resetLayout = function () {
4115 this.getSize(), this._getMeasurement("columnWidth", "outerWidth"), this._getMeasurement("gutter", "outerWidth"), this.measureColumns(); 4116 var t = this.cols; 4117 for (this.colYs = []; t--; ) 4118 this.colYs.push(0); 4119 this.maxY = 0 4120 }, o.prototype.measureColumns = function () { 4121 if (this.getContainerWidth(), !this.columnWidth) { 4122 var t = this.items[0], i = t && t.element; 4123 this.columnWidth = i && e(i).outerWidth || this.containerWidth 4124 } 4125 this.columnWidth += this.gutter, this.cols = Math.floor((this.containerWidth + this.gutter) / this.columnWidth), this.cols = Math.max(this.cols, 1) 4126 }, o.prototype.getContainerWidth = function () { 4127 var t = this.options.isFitWidth ? this.element.parentNode : this.element, i = e(t); 4128 this.containerWidth = i && i.innerWidth 4129 }, o.prototype._getItemLayoutPosition = function (t) { 4130 t.getSize(); 4131 var e = t.size.outerWidth % this.columnWidth, o = e && 1 > e ? "round" : "ceil", n = Math[o](t.size.outerWidth / this.columnWidth); 4132 n = Math.min(n, this.cols); 4133 for (var r = this._getColGroup(n), s = Math.min.apply(Math, r), a = i(r, s), u = {x: this.columnWidth * a, y: s}, p = s + t.size.outerHeight, h = this.cols + 1 - r.length, f = 0; h > f; f++) 4134 this.colYs[a + f] = p; 4135 return u 4136 }, o.prototype._getColGroup = function (t) { 4137 if (2 > t) 4138 return this.colYs; 4139 for (var e = [], i = this.cols + 1 - t, o = 0; i > o; o++) { 4140 var n = this.colYs.slice(o, o + t); 4141 e[o] = Math.max.apply(Math, n) 4142 } 4143 return e 4144 }, o.prototype._manageStamp = function (t) { 4145 var i = e(t), o = this._getElementOffset(t), n = this.options.isOriginLeft ? o.left : o.right, r = n + i.outerWidth, s = Math.floor(n / this.columnWidth); 4146 s = Math.max(0, s); 4147 var a = Math.floor(r / this.columnWidth); 4148 a -= r % this.columnWidth ? 0 : 1, a = Math.min(this.cols - 1, a); 4149 for (var u = (this.options.isOriginTop ? o.top : o.bottom) + i.outerHeight, p = s; a >= p; p++) 4150 this.colYs[p] = Math.max(u, this.colYs[p]) 4151 }, o.prototype._getContainerSize = function () { 4152 this.maxY = Math.max.apply(Math, this.colYs); 4153 var t = {height: this.maxY}; 4154 return this.options.isFitWidth && (t.width = this._getContainerFitWidth()), t 4155 }, o.prototype._getContainerFitWidth = function () { 4156 for (var t = 0, e = this.cols; --e && 0 === this.colYs[e]; ) 4157 t++; 4158 return(this.cols - t) * this.columnWidth - this.gutter 4159 }, o.prototype.needsResizeLayout = function () { 4160 var t = this.containerWidth; 4161 return this.getContainerWidth(), t !== this.containerWidth 4162 }, o 4163 } 4164 var i = Array.prototype.indexOf ? function (t, e) { 4165 return t.indexOf(e) 4166 } : function (t, e) { 4167 for (var i = 0, o = t.length; o > i; i++) { 4168 var n = t[i]; 4169 if (n === e) 4170 return i 4171 } 4172 return-1 4173 }; 4174 "function" == typeof define && define.amd ? define("masonry/masonry", ["outlayer/outlayer", "get-size/get-size"], e) : "object" == typeof exports ? module.exports = e(require("outlayer"), require("get-size")) : t.Masonry = e(t.Outlayer, t.getSize) 4175}(window), function (t) { 4176 function e(t, e) { 4177 for (var i in e) 4178 t[i] = e[i]; 4179 return t 4180 } 4181 function i(t, i) { 4182 var o = t.create("masonry"), n = o.prototype._getElementOffset, r = o.prototype.layout, s = o.prototype._getMeasurement; 4183 e(o.prototype, i.prototype), o.prototype._getElementOffset = n, o.prototype.layout = r, o.prototype._getMeasurement = s; 4184 var a = o.prototype.measureColumns; 4185 o.prototype.measureColumns = function () { 4186 this.items = this.isotope.filteredItems, a.call(this) 4187 }; 4188 var u = o.prototype._manageStamp; 4189 return o.prototype._manageStamp = function () { 4190 this.options.isOriginLeft = this.isotope.options.isOriginLeft, this.options.isOriginTop = this.isotope.options.isOriginTop, u.apply(this, arguments) 4191 }, o 4192 } 4193 "function" == typeof define && define.amd ? define("isotope/js/layout-modes/masonry", ["../layout-mode", "masonry/masonry"], i) : "object" == typeof exports ? module.exports = i(require("../layout-mode"), require("masonry-layout")) : i(t.Isotope.LayoutMode, t.Masonry) 4194}(window), function (t) { 4195 function e(t) { 4196 var e = t.create("fitRows"); 4197 return e.prototype._resetLayout = function () { 4198 this.x = 0, this.y = 0, this.maxY = 0, this._getMeasurement("gutter", "outerWidth") 4199 }, e.prototype._getItemLayoutPosition = function (t) { 4200 t.getSize(); 4201 var e = t.size.outerWidth + this.gutter, i = this.isotope.size.innerWidth + this.gutter; 4202 0 !== this.x && e + this.x > i && (this.x = 0, this.y = this.maxY); 4203 var o = {x: this.x, y: this.y}; 4204 return this.maxY = Math.max(this.maxY, this.y + t.size.outerHeight), this.x += e, o 4205 }, e.prototype._getContainerSize = function () { 4206 return{height: this.maxY} 4207 }, e 4208 } 4209 "function" == typeof define && define.amd ? define("isotope/js/layout-modes/fit-rows", ["../layout-mode"], e) : "object" == typeof exports ? module.exports = e(require("../layout-mode")) : e(t.Isotope.LayoutMode) 4210}(window), function (t) { 4211 function e(t) { 4212 var e = t.create("vertical", {horizontalAlignment: 0}); 4213 return e.prototype._resetLayout = function () { 4214 this.y = 0 4215 }, e.prototype._getItemLayoutPosition = function (t) { 4216 t.getSize(); 4217 var e = (this.isotope.size.innerWidth - t.size.outerWidth) * this.options.horizontalAlignment, i = this.y; 4218 return this.y += t.size.outerHeight, {x: e, y: i} 4219 }, e.prototype._getContainerSize = function () { 4220 return{height: this.y} 4221 }, e 4222 } 4223 "function" == typeof define && define.amd ? define("isotope/js/layout-modes/vertical", ["../layout-mode"], e) : "object" == typeof exports ? module.exports = e(require("../layout-mode")) : e(t.Isotope.LayoutMode) 4224}(window), function (t) { 4225 function e(t, e) { 4226 for (var i in e) 4227 t[i] = e[i]; 4228 return t 4229 } 4230 function i(t) { 4231 return"[object Array]" === h.call(t) 4232 } 4233 function o(t) { 4234 var e = []; 4235 if (i(t)) 4236 e = t; 4237 else if (t && "number" == typeof t.length) 4238 for (var o = 0, n = t.length; n > o; o++) 4239 e.push(t[o]); 4240 else 4241 e.push(t); 4242 return e 4243 } 4244 function n(t, e) { 4245 var i = f(e, t); 4246 -1 !== i && e.splice(i, 1) 4247 } 4248 function r(t, i, r, u, h) { 4249 function f(t, e) { 4250 return function (i, o) { 4251 for (var n = 0, r = t.length; r > n; n++) { 4252 var s = t[n], a = i.sortData[s], u = o.sortData[s]; 4253 if (a > u || u > a) { 4254 var p = void 0 !== e[s] ? e[s] : e, h = p ? 1 : -1; 4255 return(a > u ? 1 : -1) * h 4256 } 4257 } 4258 return 0 4259 } 4260 } 4261 var d = t.create("isotope", {layoutMode: "masonry", isJQueryFiltering: !0, sortAscending: !0}); 4262 d.Item = u, d.LayoutMode = h, d.prototype._create = function () { 4263 this.itemGUID = 0, this._sorters = {}, this._getSorters(), t.prototype._create.call(this), this.modes = {}, this.filteredItems = this.items, this.sortHistory = ["original-order"]; 4264 for (var e in h.modes) 4265 this._initLayoutMode(e) 4266 }, d.prototype.reloadItems = function () { 4267 this.itemGUID = 0, t.prototype.reloadItems.call(this) 4268 }, d.prototype._itemize = function () { 4269 for (var e = t.prototype._itemize.apply(this, arguments), i = 0, o = e.length; o > i; i++) { 4270 var n = e[i]; 4271 n.id = this.itemGUID++ 4272 } 4273 return this._updateItemsSortData(e), e 4274 }, d.prototype._initLayoutMode = function (t) { 4275 var i = h.modes[t], o = this.options[t] || {}; 4276 this.options[t] = i.options ? e(i.options, o) : o, this.modes[t] = new i(this) 4277 }, d.prototype.layout = function () { 4278 return!this._isLayoutInited && this.options.isInitLayout ? (this.arrange(), void 0) : (this._layout(), void 0) 4279 }, d.prototype._layout = function () { 4280 var t = this._getIsInstant(); 4281 this._resetLayout(), this._manageStamps(), this.layoutItems(this.filteredItems, t), this._isLayoutInited = !0 4282 }, d.prototype.arrange = function (t) { 4283 function e() { 4284 o.reveal(i.needReveal), o.hide(i.needHide) 4285 } 4286 this.option(t), this._getIsInstant(); 4287 var i = this._filter(this.items); 4288 this.filteredItems = i.matches; 4289 var o = this; 4290 this._isInstant ? this._noTransition(e) : e(), this._sort(), this._layout() 4291 }, d.prototype._init = d.prototype.arrange, d.prototype._getIsInstant = function () { 4292 var t = void 0 !== this.options.isLayoutInstant ? this.options.isLayoutInstant : !this._isLayoutInited; 4293 return this._isInstant = t, t 4294 }, d.prototype._filter = function (t) { 4295 var e = this.options.filter; 4296 e = e || "*"; 4297 for (var i = [], o = [], n = [], r = this._getFilterTest(e), s = 0, a = t.length; a > s; s++) { 4298 var u = t[s]; 4299 if (!u.isIgnored) { 4300 var p = r(u); 4301 p && i.push(u), p && u.isHidden ? o.push(u) : p || u.isHidden || n.push(u) 4302 } 4303 } 4304 return{matches: i, needReveal: o, needHide: n} 4305 }, d.prototype._getFilterTest = function (t) { 4306 return s && this.options.isJQueryFiltering ? function (e) { 4307 return s(e.element).is(t) 4308 } : "function" == typeof t ? function (e) { 4309 return t(e.element) 4310 } : function (e) { 4311 return r(e.element, t) 4312 } 4313 }, d.prototype.updateSortData = function (t) { 4314 var e; 4315 t ? (t = o(t), e = this.getItems(t)) : e = this.items, this._getSorters(), this._updateItemsSortData(e) 4316 }, d.prototype._getSorters = function () { 4317 var t = this.options.getSortData; 4318 for (var e in t) { 4319 var i = t[e]; 4320 this._sorters[e] = l(i) 4321 } 4322 }, d.prototype._updateItemsSortData = function (t) { 4323 for (var e = t && t.length, i = 0; e && e > i; i++) { 4324 var o = t[i]; 4325 o.updateSortData() 4326 } 4327 }; 4328 var l = function () { 4329 function t(t) { 4330 if ("string" != typeof t) 4331 return t; 4332 var i = a(t).split(" "), o = i[0], n = o.match(/^\[(.+)\]$/), r = n && n[1], s = e(r, o), u = d.sortDataParsers[i[1]]; 4333 return t = u ? function (t) { 4334 return t && u(s(t)) 4335 } : function (t) { 4336 return t && s(t) 4337 } 4338 } 4339 function e(t, e) { 4340 var i; 4341 return i = t ? function (e) { 4342 return e.getAttribute(t) 4343 } : function (t) { 4344 var i = t.querySelector(e); 4345 return i && p(i) 4346 } 4347 } 4348 return t 4349 }(); 4350 d.sortDataParsers = {parseInt: function (t) { 4351 return parseInt(t, 10) 4352 }, parseFloat: function (t) { 4353 return parseFloat(t) 4354 }}, d.prototype._sort = function () { 4355 var t = this.options.sortBy; 4356 if (t) { 4357 var e = [].concat.apply(t, this.sortHistory), i = f(e, this.options.sortAscending); 4358 this.filteredItems.sort(i), t !== this.sortHistory[0] && this.sortHistory.unshift(t) 4359 } 4360 }, d.prototype._mode = function () { 4361 var t = this.options.layoutMode, e = this.modes[t]; 4362 if (!e) 4363 throw Error("No layout mode: " + t); 4364 return e.options = this.options[t], e 4365 }, d.prototype._resetLayout = function () { 4366 t.prototype._resetLayout.call(this), this._mode()._resetLayout() 4367 }, d.prototype._getItemLayoutPosition = function (t) { 4368 return this._mode()._getItemLayoutPosition(t) 4369 }, d.prototype._manageStamp = function (t) { 4370 this._mode()._manageStamp(t) 4371 }, d.prototype._getContainerSize = function () { 4372 return this._mode()._getContainerSize() 4373 }, d.prototype.needsResizeLayout = function () { 4374 return this._mode().needsResizeLayout() 4375 }, d.prototype.appended = function (t) { 4376 var e = this.addItems(t); 4377 if (e.length) { 4378 var i = this._filterRevealAdded(e); 4379 this.filteredItems = this.filteredItems.concat(i) 4380 } 4381 }, d.prototype.prepended = function (t) { 4382 var e = this._itemize(t); 4383 if (e.length) { 4384 this._resetLayout(), this._manageStamps(); 4385 var i = this._filterRevealAdded(e); 4386 this.layoutItems(this.filteredItems), this.filteredItems = i.concat(this.filteredItems), this.items = e.concat(this.items) 4387 } 4388 }, d.prototype._filterRevealAdded = function (t) { 4389 var e = this._filter(t); 4390 return this.hide(e.needHide), this.reveal(e.matches), this.layoutItems(e.matches, !0), e.matches 4391 }, d.prototype.insert = function (t) { 4392 var e = this.addItems(t); 4393 if (e.length) { 4394 var i, o, n = e.length; 4395 for (i = 0; n > i; i++) 4396 o = e[i], this.element.appendChild(o.element); 4397 var r = this._filter(e).matches; 4398 for (i = 0; n > i; i++) 4399 e[i].isLayoutInstant = !0; 4400 for (this.arrange(), i = 0; n > i; i++) 4401 delete e[i].isLayoutInstant; 4402 this.reveal(r) 4403 } 4404 }; 4405 var c = d.prototype.remove; 4406 return d.prototype.remove = function (t) { 4407 t = o(t); 4408 var e = this.getItems(t); 4409 if (c.call(this, t), e && e.length) 4410 for (var i = 0, r = e.length; r > i; i++) { 4411 var s = e[i]; 4412 n(s, this.filteredItems) 4413 } 4414 }, d.prototype.shuffle = function () { 4415 for (var t = 0, e = this.items.length; e > t; t++) { 4416 var i = this.items[t]; 4417 i.sortData.random = Math.random() 4418 } 4419 this.options.sortBy = "random", this._sort(), this._layout() 4420 }, d.prototype._noTransition = function (t) { 4421 var e = this.options.transitionDuration; 4422 this.options.transitionDuration = 0; 4423 var i = t.call(this); 4424 return this.options.transitionDuration = e, i 4425 }, d.prototype.getFilteredItemElements = function () { 4426 for (var t = [], e = 0, i = this.filteredItems.length; i > e; e++) 4427 t.push(this.filteredItems[e].element); 4428 return t 4429 }, d 4430 } 4431 var s = t.jQuery, a = String.prototype.trim ? function (t) { 4432 return t.trim() 4433 } : function (t) { 4434 return t.replace(/^\s+|\s+$/g, "") 4435 }, u = document.documentElement, p = u.textContent ? function (t) { 4436 return t.textContent 4437 } : function (t) { 4438 return t.innerText 4439 }, h = Object.prototype.toString, f = Array.prototype.indexOf ? function (t, e) { 4440 return t.indexOf(e) 4441 } : function (t, e) { 4442 for (var i = 0, o = t.length; o > i; i++) 4443 if (t[i] === e) 4444 return i; 4445 return-1 4446 }; 4447 "function" == typeof define && define.amd ? define(["outlayer/outlayer", "get-size/get-size", "matches-selector/matches-selector", "isotope/js/item", "isotope/js/layout-mode", "isotope/js/layout-modes/masonry", "isotope/js/l
4447ayout-modes/fit-rows", "isotope/js/layout-modes/vertical"], r) : "object" == typeof exports ? module.exports = r(require("outlayer"), require("get-size"), require("desandro-matches-selector"), require("./item"), require("./layout-mode"), require("./layout-modes/masonry"), require("./layout-modes/fit-rows"), require("./layout-modes/vertical")) : t.Isotope = r(t.Outlayer, t.getSize, t.matchesSelector, t.Isotope.Item, t.Isotope.LayoutMode) 4448}(window); 4449var isMobile; 4450if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) { 4451 isMobile = true; 4452 $("html").addClass("mobile"); 4453} else { 4454 isMobile = false; 4455 $("html").addClass("no-mobile"); 4456} 4457 4458if (!isMobile) { 4459 (function () { 4460 4461 // Scroll Variables (tweakable) 4462 var defaultOptions = { 4463 // Scrolling Core 4464 frameRate: 150, // [Hz] 4465 animationTime: 600, // [px] 4466 stepSize: 150, // [px] 4467 4468 // Pulse (less tweakable) 4469 // ratio of "tail" to "acceleration" 4470 pulseAlgorithm: true, 4471 pulseScale: 6, 4472 pulseNormalize: 1, 4473 // Acceleration 4474 accelerationDelta: 20, // 20 4475 accelerationMax: 1, // 1 4476 4477 // Keyboard Settings 4478 keyboardSupport: true, // option 4479 arrowScroll: 50, // [px] 4480 4481 // Other 4482 touchpadSupport: true, 4483 fixedBackground: true, 4484 excluded: "" 4485 }; 4486 4487 var options = defaultOptions; 4488 4489 4490 // Other Variables 4491 var isExcluded = false; 4492 var isFrame = false; 4493 var direction = { 4494 x: 0, 4495 y: 0 4496 }; 4497 var initDone = false; 4498 var root = document.documentElement; 4499 var activeElement; 4500 var observer; 4501 var deltaBuffer = [120, 120, 120]; 4502 4503 var key = { 4504 left: 37, 4505 up: 38, 4506 right: 39, 4507 down: 40, 4508 spacebar: 32, 4509 pageup: 33, 4510 pagedown: 34, 4511 end: 35, 4512 home: 36 4513 }; 4514 4515 4516 /*********************************************** 4517 * SETTINGS 4518 ***********************************************/ 4519 4520 var options = defaultOptions; 4521 4522 4523 /*********************************************** 4524 * INITIALIZE 4525 ***********************************************/ 4526 4527 /** 4528 * Tests if smooth scrolling is allowed. Shuts down everything if not. 4529 */ 4530 function initTest() { 4531 4532 var disableKeyboard = false; 4533 4534 // disable keyboard support if anything above requested it 4535 if (disableKeyboard) { 4536 removeEvent("keydown", keydown); 4537 } 4538 4539 if (options.keyboardSupport && !disableKeyboard) { 4540 addEvent("keydown", keydown); 4541 } 4542 } 4543 4544 /** 4545 * Sets up scrolls array, determines if frames are involved. 4546 */ 4547 function init() { 4548 4549 if (!document.body) 4550 return; 4551 4552 var body = document.body; 4553 var html = document.documentElement; 4554 var windowHeight = window.innerHeight; 4555 var scrollHeight = body.scrollHeight; 4556 4557 // check compat mode for root element 4558 root = (document.compatMode.indexOf('CSS') >= 0) ? html : body; 4559 activeElement = body; 4560 4561 initTest(); 4562 initDone = true; 4563 4564 // Checks if this script is running in a frame 4565 if (top != self) { 4566 isFrame = true; 4567 } 4568 4569 /** 4570 * This fixes a bug where the areas left and right to 4571 * the content does not trigger the onmousewheel event 4572 * on some pages. e.g.: html, body { height: 100% } 4573 */ 4574 else if (scrollHeight > windowHeight && 4575 (body.offsetHeight <= windowHeight || 4576 html.offsetHeight <= windowHeight)) { 4577 4578 html.style.height = 'auto'; 4579 //setTimeout(refresh, 10); 4580 4581 // clearfix 4582 if (root.offsetHeight <= windowHeight) { 4583 var underlay = document.createElement("div"); 4584 underlay.style.clear = "both";
4585 body.appendChild(underlay); 4586 } 4587 } 4588 4589 // disable fixed background 4590 if (!options.fixedBackground && !isExcluded) { 4591 body.style.backgroundAttachment = "scroll"; 4592 html.style.backgroundAttachment = "scroll"; 4593 } 4594 } 4595 4596 4597 /************************************************ 4598 * SCROLLING 4599 ************************************************/ 4600 4601 var que = []; 4602 var pending = false; 4603 var lastScroll = +new Date; 4604 4605 /** 4606 * Pushes scroll actions to the scrolling queue. 4607 */ 4608 function scrollArray(elem, left, top, delay) { 4609 4610 delay || (delay = 1000); 4611 directionCheck(left, top); 4612 4613 if (options.accelerationMax != 1) { 4614 var now = +new Date; 4615 var elapsed = now - lastScroll; 4616 if (elapsed < options.accelerationDelta) { 4617 var factor = (1 + (30 / elapsed)) / 2; 4618 if (factor > 1) { 4619 factor = Math.min(factor, options.accelerationMax); 4620 left *= factor; 4621 top *= factor; 4622 } 4623 } 4624 lastScroll = +new Date; 4625 } 4626 4627 // push a scroll command 4628 que.push({ 4629 x: left, 4630 y: top, 4631 lastX: (left < 0) ? 0.99 : -0.99, 4632 lastY: (top < 0) ? 0.99 : -0.99, 4633 start: +new Date 4634 }); 4635 4636 // don't act if there's a pending queue 4637 if (pending) { 4638 return; 4639 } 4640 4641 var scrollWindow = (elem === document.body); 4642 4643 var step = function (time) { 4644 4645 var now = +new Date; 4646 var scrollX = 0; 4647 var scrollY = 0; 4648 4649 for (var i = 0; i < que.length; i++) { 4650 4651 var item = que[i]; 4652 var elapsed = now - item.start; 4653 var finished = (elapsed >= options.animationTime); 4654 4655 // scroll position: [0, 1] 4656 var position = (finished) ? 1 : elapsed / options.animationTime; 4657 4658 // easing [optional] 4659 if (options.pulseAlgorithm) { 4660 position = pulse(position); 4661 } 4662 4663 // only need the difference 4664 var x = (item.x * position - item.lastX) >> 0; 4665 var y = (item.y * position - item.lastY) >> 0; 4666 4667 // add this to the total scrolling 4668 scrollX += x; 4669 scrollY += y; 4670 4671 // update last values 4672 item.lastX += x; 4673 item.lastY += y; 4674 4675 // delete and step back if it's over 4676 if (finished) { 4677 que.splice(i, 1); 4678 i--; 4679 } 4680 } 4681 4682 // scroll left and top 4683 if (scrollWindow) { 4684 window.scrollBy(scrollX, scrollY); 4685 } else { 4686 if (scrollX) 4687 elem.scrollLeft += scrollX; 4688 if (scrollY) 4689 elem.scrollTop += scrollY; 4690 } 4691 4692 // clean up if there's nothing left to do 4693 if (!left && !top) { 4694 que = []; 4695 } 4696 4697 if (que.length) { 4698 requestFrame(step, elem, (delay / options.frameRate + 1)); 4699 } else { 4700 pending = false; 4701 } 4702 }; 4703 4704 // start a new queue of actions 4705 requestFrame(step, elem, 0); 4706 pending = true; 4707 } 4708 4709 4710 /*********************************************** 4711 * EVENTS 4712 ***********************************************/ 4713 4714 /** 4715 * Mouse wheel handler. 4716 * @param {Object} event 4717 */ 4718 function wheel(event) { 4719 4720 if (!initDone) { 4721 init(); 4722 } 4723 4724 var target = event.target; 4725 var overflowing = overflowingAncestor(target); 4726 4727 // use default if there's no overflowing 4728 // element or default action is prevented 4729 if (!overflowing || event.defaultPrevented || 4730 isNodeName(activeElement, "embed") || 4731 (isNodeName(target, "embed") && /\.pdf/i.test(target.src))) { 4732 return true; 4733 } 4734 4735 var deltaX = event.wheelDeltaX || 0; 4736 var deltaY = event.wheelDeltaY || 0; 4737 4738 // use wheelDelta if deltaX/Y is not available 4739 if (!deltaX && !deltaY) { 4740 deltaY = event.wheelDelta || 0; 4741 } 4742 4743 // check if it's a touchpad scroll that should be ignored 4744 if (!options.touchpadSupport && isTouchpad(deltaY)) { 4745 return true; 4746 } 4747 4748 // scale by step size 4749 // delta is 120 most of the time
4750 // synaptics seems to send 1 sometimes 4751 if (Math.abs(deltaX) > 1.2) { 4752 deltaX *= options.stepSize / 120; 4753 } 4754 if (Math.abs(deltaY) > 1.2) { 4755 deltaY *= options.stepSize / 120; 4756 } 4757 4758 scrollArray(overflowing, -deltaX, -deltaY); 4759 event.preventDefault(); 4760 } 4761 4762 /** 4763 * Keydown event handler. 4764 * @param {Object} event 4765 */ 4766 function keydown(event) { 4767 4768 var target = event.target; 4769 var modifier = event.ctrlKey || event.altKey || event.metaKey || 4770 (event.shiftKey && event.keyCode !== key.spacebar); 4771 4772 // do nothing if user is editing text 4773 // or using a modifier key (except shift) 4774 // or in a dropdown 4775 if (/input|textarea|select|embed/i.test(target.nodeName) || 4776 target.isContentEditable || 4777 event.defaultPrevented || 4778 modifier) { 4779 return true; 4780 } 4781 // spacebar should trigger button press 4782 if (isNodeName(target, "button") && 4783 event.keyCode === key.spacebar) { 4784 return true; 4785 } 4786 4787 var shift, x = 0, 4788 y = 0; 4789 var elem = overflowingAncestor(activeElement); 4790 var clientHeight = elem.clientHeight; 4791 4792 if (elem == document.body) { 4793 clientHeight = window.innerHeight; 4794 } 4795 4796 switch (event.keyCode) { 4797 case key.up: 4798 y = -options.arrowScroll; 4799 break; 4800 case key.down: 4801 y = options.arrowScroll; 4802 break; 4803 case key.spacebar: // (+ shift) 4804 shift = event.shiftKey ? 1 : -1; 4805 y = -shift * clientHeight * 0.9; 4806 break; 4807 case key.pageup: 4808 y = -clientHeight * 0.9; 4809 break; 4810 case key.pagedown: 4811 y = clientHeight * 0.9; 4812 break; 4813 case key.home: 4814 y = -elem.scrollTop; 4815 break; 4816 case key.end: 4817 var damt = elem.scrollHeight - elem.scrollTop - clientHeight; 4818 y = (damt > 0) ? damt + 10 : 0; 4819 break; 4820 case key.left: 4821 x = -options.arrowScroll; 4822 break; 4823 case key.right: 4824 x = options.arrowScroll; 4825 break; 4826 default: 4827 return true; // a key we don't care about 4828 } 4829 4830 scrollArray(elem, x, y); 4831 event.preventDefault(); 4832 } 4833 4834 /** 4835 * Mousedown event only for updating activeElement 4836 */ 4837 function mousedown(event) { 4838 activeElement = event.target; 4839 } 4840 4841 4842 /*********************************************** 4843 * OVERFLOW 4844 ***********************************************/ 4845 4846 var cache = {}; // cleared out every once in while 4847 setInterval(function () { 4848 cache = {}; 4849 }, 10 * 1000); 4850 4851 var uniqueID = (function () { 4852 var i = 0; 4853 return function (el) { 4854 return el.uniqueID || (el.uniqueID = i++); 4855 }; 4856 })(); 4857 4858 function setCache(elems, overflowing) { 4859 for (var i = elems.length; i--; ) 4860 cache[uniqueID(elems[i])] = overflowing; 4861 return overflowing; 4862 } 4863 4864 function overflowingAncestor(el) { 4865 var elems = []; 4866 var rootScrollHeight = root.scrollHeight; 4867 do { 4868 var cached = cache[uniqueID(el)]; 4869 if (cached) { 4870 return setCache(elems, cached); 4871 } 4872 elems.push(el); 4873 if (rootScrollHeight === el.scrollHeight) { 4874 if (!isFrame || root.clientHeight + 10 < rootScrollHeight) { 4875 return setCache(elems, document.body); // scrolling root in WebKit 4876 } 4877 } else if (el.clientHeight + 10 < el.scrollHeight) { 4878 overflow = getComputedStyle(el, "").getPropertyValue("overflow-y"); 4879 if (overflow === "scroll" || overflow === "auto") { 4880 return setCache(elems, el); 4881 } 4882 } 4883 } while (el = el.parentNode); 4884 } 4885 4886 4887 /*********************************************** 4888 * HELPERS 4889 ***********************************************/ 4890 4891 function addEvent(type, fn, bubble) { 4892 window.addEventListener(type, fn, (bubble || false)); 4893 } 4894 4895 function removeEvent(type, fn, bubble) { 4896 window.removeEventListener(type, fn, (bubble || false)); 4897 } 4898 4899 function isNodeName(el, tag) { 4900 return (el.nodeName || "").toLowerCase() === tag.toLowerCase(); 4901 } 4902 4903 function directionCheck(x, y) { 4904 x = (x > 0) ? 1 : -1; 4905 y = (y > 0) ? 1 : -1; 4906 if (direction.x !== x || direction.y !== y) { 4907 direction.x = x; 4908 direction.y = y; 4909 que = []; 4910 lastScroll = 0; 4911 } 4912 } 4913 4914 var deltaBufferTimer; 4915 4916 function isTouchpad(deltaY) { 4917 if (!deltaY) 4918 return; 4919 deltaY = Math.abs(deltaY) 4920 deltaBuffer.push(deltaY); 4921 deltaBuffer.shift(); 4922 clearTimeout(deltaBufferTimer); 4923 4924 var allEquals = (deltaBuffer[0] == deltaBuffer[1] && 4925 deltaBuffer[1] == deltaBuffer[2]); 4926 var allDivisable = (isDivisible(deltaBuffer[0], 120) && 4927 isDivisible(deltaBuffer[1], 120) && 4928 isDivisible(deltaBuffer[2], 120)); 4929 return !(allEquals || allDivisable); 4930 } 4931 4932 function isDivisible(n, divisor) { 4933 return (Math.floor(n / divisor) == n / divisor); 4934 } 4935 4936 var requestFrame = (function () { 4937 return window.requestAnimationFrame || 4938 window.webkitRequestAnimationFrame || 4939 function (callback, element, delay) { 4940 window.setTimeout(callback, delay || (1000 / 60)); 4941 }; 4942 })(); 4943 4944 4945 /*********************************************** 4946 * PULSE 4947 ***********************************************/ 4948 4949 /** 4950 * Viscous fluid with a pulse for part and decay for the rest. 4951 * - Applies a fixed force over an interval (a damped acceleration), and 4952 * - Lets the exponential bleed away the velocity over a longer interval 4953 * - Michael Herf, http://stereopsis.com/stopping/ 4954 */ 4955 function pulse_(x) { 4956 var val, start, expx; 4957 // test 4958 x = x * options.pulseScale; 4959 if (x < 1) { // acceleartion 4960 val = x - (1 - Math.exp(-x)); 4961 } else { // tail 4962 // the previous animation ended here: 4963 start = Math.exp(-1); 4964 // simple viscous drag 4965 x -= 1; 4966 expx = 1 - Math.exp(-x); 4967 val = start + (expx * (1 - start)); 4968 }
4969 return val * options.pulseNormalize; 4970 } 4971 4972 function pulse(x) { 4973 if (x >= 1) 4974 return 1; 4975 if (x <= 0) 4976 return 0; 4977 4978 if (options.pulseNormalize == 1) { 4979 options.pulseNormalize /= pulse_(1); 4980 } 4981 return pulse_(x); 4982 } 4983 4984 var isChrome = /chrome/i.test(window.navigator.userAgent); 4985 var isMouseWheelSupported = 'onmousewheel' in document; 4986 4987 if (isMouseWheelSupported && isChrome) { 4988 addEvent("mousedown", mousedown); 4989 addEvent("mousewheel", wheel); 4990 addEvent("load", init); 4991 } 4992 ; 4993 4994 })(); 4995} 4996jQuery(document).ready(function($){ 4997 //set animation timing 4998 var animationDelay = 2500, 4999 //loading bar effect 5000 barAnimationDelay = 3800, 5001 barWaiting = barAnimationDelay - 3000, //3000 is the duration of the transition on the loading bar - set in the scss/css file 5002 //letters effect 5003 lettersDelay = 50, 5004 //type effect 5005 typeLettersDelay = 150, 5006 selectionDuration = 500, 5007 typeAnimationDelay = selectionDuration + 800, 5008 //clip effect 5009 revealDuration = 600, 5010 revealAnimationDelay = 1500; 5011 5012 initHeadline(); 5013 5014 5015 function initHeadline() { 5016 //insert <i> element for each letter of a changing word 5017 singleLetters($('.cd-headline.letters').find('b')); 5018 //initialise headline animation 5019 animateHeadline($('.cd-headline')); 5020 } 5021 5022 function singleLetters($words) { 5023 $words.each(function(){ 5024 var word = $(this),
5025 letters = word.text().split(''), 5026 selected = word.hasClass('is-visible'); 5027 for (i in letters) { 5028 if(word.parents('.rotate-2').length > 0) letters[i] = '<em>' + letters[i] + '</em>'; 5029 letters[i] = (selected) ? '<i class="in">' + letters[i] + '</i>': '<i>' + letters[i] + '</i>'; 5030 } 5031 var newLetters = letters.join(''); 5032 word.html(newLetters).css('opacity', 1); 5033 }); 5034 } 5035 5036 function animateHeadline($headlines) { 5037 var duration = animationDelay; 5038 $headlines.each(function(){ 5039 var headline = $(this); 5040 5041 if(headline.hasClass('loading-bar')) { 5042 duration = barAnimationDelay; 5043 setTimeout(function(){ headline.find('.cd-words-wrapper').addClass('is-loading') }, barWaiting); 5044 } else if (headline.hasClass('clip')){ 5045 var spanWrapper = headline.find('.cd-words-wrapper'), 5046 newWidth = spanWrapper.width() + 10 5047 spanWrapper.css('width', newWidth); 5048 } else if (!headline.hasClass('type') ) { 5049 //assign to .cd-words-wrapper the width of its longest word 5050 var words = headline.find('.cd-words-wrapper b'), 5051 width = 0; 5052 words.each(function(){ 5053 var wordWidth = $(this).width(); 5054 if (wordWidth > width) width = wordWidth; 5055 }); 5056 headline.find('.cd-words-wrapper').css('width', width); 5057 }; 5058 5059 //trigger animation 5060 setTimeout(function(){ hideWord( headline.find('.is-visible').eq(0) ) }, duration); 5061 }); 5062 } 5063 5064 function hideWord($word) { 5065 var nextWord = takeNext($word); 5066 5067 if($word.parents('.cd-headline').hasClass('type')) { 5068 var parentSpan = $word.parent('.cd-words-wrapper'); 5069 parentSpan.addClass('selected').removeClass('waiting'); 5070 setTimeout(function(){ 5071 parentSpan.removeClass('selected'); 5072 $word.removeClass('is-visible').addClass('is-hidden').children('i').removeClass('in').addClass('out'); 5073 }, selectionDuration); 5074 setTimeout(function(){ showWord(nextWord, typeLettersDelay) }, typeAnimationDelay); 5075 5076 } else if($word.parents('.cd-headline').hasClass('letters')) { 5077 var bool = ($word.children('i').length >= nextWord.children('i').length) ? true : false; 5078 hideLetter($word.find('i').eq(0), $word, bool, lettersDelay); 5079 showLetter(nextWord.find('i').eq(0), nextWord, bool, lettersDelay); 5080 5081 } else if($word.parents('.cd-headline').hasClass('clip')) { 5082 $word.parents('.cd-words-wrapper').animate({ width : '2px' }, revealDuration, function(){ 5083 switchWord($word, nextWord); 5084 showWord(nextWord); 5085 }); 5086 5087 } else if ($word.parents('.cd-headline').hasClass('loading-bar')){ 5088 $word.parents('.cd-words-wrapper').removeClass('is-loading'); 5089 switchWord($word, nextWord); 5090 setTimeout(function(){ hideWord(nextWord) }, barAnimationDelay); 5091 setTimeout(function(){ $word.parents('.cd-words-wrapper').addClass('is-loading') }, barWaiting); 5092 5093 } else { 5094 switchWord($word, nextWord); 5095 setTimeout(function(){ hideWord(nextWord) }, animationDelay); 5096 } 5097 } 5098 5099 function showWord($word, $duration) { 5100 if($word.parents('.cd-headline').hasClass('type')) { 5101 showLetter($word.find('i').eq(0), $word, false, $duration); 5102 $word.addClass('is-visible').removeClass('is-hidden'); 5103 5104 } else if($word.parents('.cd-headline').hasClass('clip')) { 5105 $word.parents('.cd-words-wrapper').animate({ 'width' : $word.width() + 10 }, revealDuration, function(){ 5106 setTimeout(function(){ hideWord($word) }, revealAnimationDelay); 5107 }); 5108 } 5109 } 5110 5111 function hideLetter($letter, $word, $bool, $duration) { 5112 $letter.removeClass('in').addClass('out'); 5113 5114 if(!$letter.is(':last-child')) { 5115 setTimeout(function(){ hideLetter($letter.next(), $word, $bool, $duration); }, $duration); 5116 } else if($bool) { 5117 setTimeout(function(){ hideWord(takeNext($word)) }, animationDelay); 5118 } 5119 5120 if($letter.is(':last-child') && $('html').hasClass('no-csstransitions')) { 5121 var nextWord = takeNext($word); 5122 switchWord($word, nextWord); 5123 } 5124 } 5125 5126 function showLetter($letter, $word, $bool, $duration) { 5127 $letter.addClass('in').removeClass('out'); 5128 5129 if(!$letter.is(':last-child')) { 5130 setTimeout(function(){ showLetter($letter.next(), $word, $bool, $duration); }, $duration); 5131 } else { 5132 if($word.parents('.cd-headline').hasClass('type')) { setTimeout(function(){ $word.parents('.cd-words-wrapper').addClass('waiting'); }, 200);} 5133 if(!$bool) { setTimeout(function(){ hideWord($word) }, animationDelay) } 5134 } 5135 } 5136 5137 function takeNext($word) { 5138 return (!$word.is(':last-child')) ? $word.next() : $word.parent().children().eq(0); 5139 } 5140 5141 function takePrev($word) { 5142 return (!$word.is(':first-child')) ? $word.prev() : $word.parent().children().last(
5142); 5143 } 5144 5145 function switchWord($oldWord, $newWord) { 5146 $oldWord.removeClass('is-visible').addClass('is-hidden'); 5147 $newWord.removeClass('is-hidden').addClass('is-visible'); 5148 } 5149}); 5150 5151 5152}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.