PageSourceSearch

https://globallegalmedia.com/js/plugins.js

js globallegalmedia.com collected 2026-10-07 00:16:49 UTC 353,358 bytes, 5,501 lines download raw bytes

vendor: 4,361 bytes, line 1
1;window.Modernizr=function(a,b,c){function x(a){j.cssText=a}function y(a,b){return x(prefixes.join(a+";")+(b||""))}function z(a,b){return typeof a===b}function A(a,b){return!!~(""+a).indexOf(b)}function B(a,b){for(var d in a){var e=a[d];if(!A(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function C(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:z(f,"function")?f.bind(d||b):f}return!1}function D(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+n.join(d+" ")+d).split(" ");return z(b,"string")||z(b,"undefined")?B(e,b):(e=(a+" "+o.join(d+" ")+d).split(" "),C(e,b,c))}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m="Webkit Moz O ms",n=m.split(" "),o=m.toLowerCase().split(" "),p={},q={},r={},s=[],t=s.slice,u,v={}.hasOwnProperty,w;!z(v,"undefined")&&!z(v.call,"undefined")?w=function(a,b){return v.call(a,b)}:w=function(a,b){return b in a&&z(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=t.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(t.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(t.call(arguments)))};return e}),p.csstransitions=function(){return D("transition")};for(var E in p)w(p,E)&&(u=E.toLowerCase(),e[u]=p[E](),s.push((e[u]?"":"no-")+u));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)w(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},x(""),i=k=null,function(a,b){function k(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 l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function p(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return r.shivMethods?n(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+l().join().replace(/\w+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(r,b.frag)}function q(a){a||(a=b);var c=m(a);return r.shivCSS&&!f&&!c.hasCSS&&(c.hasCSS=!!k(a,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),j||p(a,c),a}var c=a.html5||{},d=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,e=/^(?: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,f,g="_html5shiv",h=0,i={},j;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",f="hidden"in a,j=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){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._domPrefixes=o,e._cssomPrefixes=n,e.testProp=function(a){return B([a])},e.testAllProps=D,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+s.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(){}
1function 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))};
2jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}});
3
4
5if(/chrom(e|ium)/.test(navigator.userAgent.toLowerCase())){
6
7(function(){var defaultOptions={frameRate:150,animationTime:800,stepSize:120,pulseAlgorithm:true,pulseScale:4,pulseNormalize:1,accelerationDelta:20,accelerationMax:1,keyboardSupport:true,arrowScroll:50,touchpadSupport:true,fixedBackgroun
7d:true,excluded:''};var options=defaultOptions;var isExcluded=false;var isFrame=false;var direction={x:0,y:0};var initDone=false;var root=document.documentElement;var activeElement;var observer;var deltaBuffer=[];var isMac=/^Mac/.test(navigator.platform);var key={left:37,up:38,right:39,down:40,spacebar:32,pageup:33,pagedown:34,end:35,home:36};var options=defaultOptions;function initTest(){if(options.keyboardSupport){addEvent('keydown',keydown);}}
8function init(){if(initDone||!document.body)return;initDone=true;var body=document.body;var html=document.documentElement;var windowHeight=window.innerHeight;var scrollHeight=body.scrollHeight;root=(document.compatMode.indexOf('CSS')>=0)?html:body;activeElement=body;initTest();if(top!=self){isFrame=true;}
9else if(scrollHeight>windowHeight&&(body.offsetHeight<=windowHeight||html.offsetHeight<=windowHeight)){var fullPageElem=document.createElement('div');fullPageElem.style.cssText='position:absolute; z-index:-10000; '+'top:0; left:0; right:0; height:'+
10root.scrollHeight+'px';document.body.appendChild(fullPageElem);var pendingRefresh;var refresh=function(){if(pendingRefresh)return;pendingRefresh=setTimeout(function(){if(isExcluded)return;fullPageElem.style.height='0';fullPageElem.style.height=root.scrollHeight+'px';pendingRefresh=null;},500);};setTimeout(refresh,10);var config={attributes:true,childList:true,characterData:false};observer=new MutationObserver(refresh);observer.observe(body,config);if(root.offsetHeight<=windowHeight){var clearfix=document.createElement('div');clearfix.style.clear='both';body.appendChild(clearfix);}}
11if(!options.fixedBackground&&!isExcluded){body.style.backgroundAttachment='scroll';html.style.backgroundAttachment='scroll';}}
12function cleanup(){observer&&observer.disconnect();removeEvent(wheelEvent,wheel);removeEvent('mousedown',mousedown);removeEvent('keydown',keydown);}
13var que=[];var pending=false;var lastScroll=Date.now();function scrollArray(elem,left,top){directionCheck(left,top);if(options.accelerationMax!=1){var now=Date.now();var elapsed=now- lastScroll;if(elapsed<options.accelerationDelta){var factor=(1+(50/elapsed))/ 2;
14if(factor>1){factor=Math.min(factor,options.accelerationMax);left*=factor;top*=factor;}}
15lastScroll=Date.now();}
16que.push({x:left,y:top,lastX:(left<0)?0.99:-0.99,lastY:(top<0)?0.99:-0.99,start:Date.now()});if(pending){return;}
17var scrollWindow=(elem===document.body);var step=function(time){var now=Date.now();var scrollX=0;var scrollY=0;for(var i=0;i<que.length;i++){var item=que[i];var elapsed=now- item.start;var finished=(elapsed>=options.animationTime);var position=(finished)?1:elapsed/options.animationTime;if(options.pulseAlgorithm){position=pulse(position);}
18var x=(item.x*position- item.lastX)>>0;var y=(item.y*position- item.lastY)>>0;scrollX+=x;scrollY+=y;item.lastX+=x;item.lastY+=y;if(finished){que.splice(i,1);i--;}}
19if(scrollWindow){window.scrollBy(scrollX,scrollY);}else{if(scrollX)elem.scrollLeft+=scrollX;if(scrollY)elem.scrollTop+=scrollY;}
20if(!left&&!top){que=[];}
21if(que.length){requestFrame(step,elem,(1000/options.frameRate+ 1));}
21else{pending=false;}};requestFrame(step,elem,0);pending=true;}
22function wheel(event){if(!initDone){init();}
23var target=event.target;var overflowing=overflowingAncestor(target);if(!overflowing||event.defaultPrevented||event.ctrlKey){return true;}
24if(isNodeName(activeElement,'embed')||(isNodeName(target,'embed')&&/\.pdf/i.test(target.src))||isNodeName(activeElement,'object')){return true;}
25var deltaX=-event.wheelDeltaX||event.deltaX||0;var deltaY=-event.wheelDeltaY||event.deltaY||0;if(isMac){if(event.wheelDeltaX&&isDivisible(event.wheelDeltaX,120)){deltaX=-120*(event.wheelDeltaX/Math.abs(event.wheelDeltaX));}
26if(event.wheelDeltaY&&isDivisible(event.wheelDeltaY,120)){deltaY=-120*(event.wheelDeltaY/Math.abs(event.wheelDeltaY));}}
27if(!deltaX&&!deltaY){deltaY=-event.wheelDelta||0;}
28if(event.deltaMode===1){deltaX*=40;deltaY*=40;}
29if(!options.touchpadSupport&&isTouchpad(deltaY)){return true;}
30if(Math.abs(deltaX)>1.2){deltaX*=options.stepSize/120;}
31if(Math.abs(deltaY)>1.2){deltaY*=options.stepSize/120;}
32scrollArray(overflowing,deltaX,deltaY);event.preventDefault();scheduleClearCache();}
33function keydown(event){var target=event.target;var modifier=event.ctrlKey||event.altKey||event.metaKey||(event.shiftKey&&event.keyCode!==key.spacebar);if(!document.contains(activeElement)){activeElement=document.activeElement;}
34var inputNodeNames=/^(textarea|select|embed|object)$/i;var buttonTypes=/^(button|submit|radio|checkbox|file|color|image)$/i;if(inputNodeNames.test(target.nodeName)||isNodeName(target,'input')&&!buttonTypes.test(target.type)||isNodeName(activeElement,'video')||isInsideYoutubeVideo(event)||target.isContentEditable||event.defaultPrevented||modifier){return true;}
35if((isNodeName(target,'button')||isNodeName(target,'input')&&buttonTypes.test(target.type))&&event.keyCode===key.spacebar){return true;}
36var shift,x=0,y=0;var elem=overflowingAncestor(activeElement);var clientHeight=elem.clientHeight;if(elem==document.body){clientHeight=window.innerHeight;}
37switch(event.keyCode){case key.up:y=-options.arrowScroll;break;case key.down:y=options.arrowScroll;break;case key.spacebar:shift=event.shiftKey?1:-1;y=-shift*clientHeight*0.9;break;case key.pageup:y=-clientHeight*0.9;break;case key.pagedown:y=clientHeight*0.9;break;case key.home:y=-elem.scrollTop;break;case key.end:var damt=elem.scrollHeight- elem.scrollTop- clientHeight;y=(damt>0)?damt+ 10:0;break;case key.left:x=-options.arrowScroll;break;case key.right:x=options.arrowScroll;break;default:return true;}
38scrollArray(elem,x,y);event.preventDefault();scheduleClearCache();}
39function mousedown(event){activeElement=event.target;}
40var uniqueID=(function(){var i=0;return function(el){return el.uniqueID||(el.uniqueID=i++);};})();var cache={};var clearCacheTimer;function scheduleClearCache(){clearTimeout(clearCacheTimer);clearCacheTimer=setInterval(function(){cache={};},1*1000);}
41function setCache(elems,overflowing){for(var i=elems.length;i--;)
42cache[uniqueID(elems[i])]=overflowing;return overflowing;}
43function overflowingAncestor(el){var elems=[];var body=document.body;var rootScrollHeight=root.scrollHeight;do{var cached=cache[uniqueID(el)];if(cached){return setCache(elems,cached);}
44elems.push(el);if(rootScrollHeight===el.scrollHeight){var topOverflowsNotHidden=overflowNotHidden(root)&&overflowNotHidden(body);var isOverflowCSS=topOverflowsNotHidden||overflowAutoOrScroll(root);if(isFrame&&isContentOverflowing(root)||!isFrame&&isOverflowCSS){return setCache(elems,getScrollRoot());}}else if(isContentOverflowing(el)&&overflowAutoOrScroll(el)){return setCache(elems,el);}}while(el=el.parentElement);}
45function isContentOverflowing(el){return(el.clientHeight+ 10<el.scrollHeight);}
46function overflowNotHidden(el){var overflow=getComputedStyle(el,'').getPropertyValue('overflow-y');return(overflow!=='hidden');}
47function overflowAutoOrScroll(el){var overflow=getComputedStyle(el,'').getPropertyValue('overflow-y');return(overflow==='scroll'||overflow==='auto');}
48function addEvent(type,fn){window.addEventListener(type,fn,false);}
49function removeEvent(type,fn){window.removeEventListener(type,fn,false);}
50function isNodeName(el,tag){return(el.nodeName||'').toLowerCase()===tag.toLowerCase();}
51function directionCheck(x,y){x=(x>0)?1:-1;y=(y>0)?1:-1;
51if(direction.x!==x||direction.y!==y){direction.x=x;direction.y=y;que=[];lastScroll=0;}}
52var deltaBufferTimer;if(window.localStorage&&localStorage.SS_deltaBuffer){deltaBuffer=localStorage.SS_deltaBuffer.split(',');}
53function isTouchpad(deltaY){if(!deltaY)return;if(!deltaBuffer.length){deltaBuffer=[deltaY,deltaY,deltaY];}
54deltaY=Math.abs(deltaY)
55deltaBuffer.push(deltaY);deltaBuffer.shift();clearTimeout(deltaBufferTimer);deltaBufferTimer=setTimeout(function(){if(window.localStorage){localStorage.SS_deltaBuffer=deltaBuffer.join(',');}},1000);return!allDeltasDivisableBy(120)&&!allDeltasDivisableBy(100);}
56function isDivisible(n,divisor){return(Math.floor(n/divisor)==n/divisor);}
57function allDeltasDivisableBy(divisor){return(isDivisible(deltaBuffer[0],divisor)&&isDivisible(deltaBuffer[1],divisor)&&isDivisible(deltaBuffer[2],divisor));}
58function isInsideYoutubeVideo(event){var elem=event.target;var isControl=false;if(document.URL.indexOf('www.youtube.com/watch')!=-1){do{isControl=(elem.classList&&elem.classList.contains('html5-video-controls'));if(isControl)break;}while(elem=elem.parentNode);}
59return isControl;}
60var requestFrame=(function(){return(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(callback,element,delay){window.setTimeout(callback,delay||(1000/60));});})();var MutationObserver=(window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver);var getScrollRoot=(function(){var SCROLL_ROOT;return function(){if(!SCROLL_ROOT){var dummy=document.createElement('div');dummy.style.cssText='height:10000px;width:1px;';document.body.appendChild(dummy);var bodyScrollTop=document.body.scrollTop;var docElScrollTop=document.documentElement.scrollTop;window.scrollBy(0,1);if(document.body.scrollTop!=bodyScrollTop)
61(SCROLL_ROOT=document.body);else
62(SCROLL_ROOT=document.documentElement);window.scrollBy(0,-1);document.body.removeChild(dummy);}
63return SCROLL_ROOT;};})();function pulse_(x){var val,start,expx;x=x*options.pulseScale;if(x<1){val=x-(1- Math.exp(-x));}else{start=Math.exp(-1);x-=1;expx=1- Math.exp(-x);val=start+(expx*(1- start));}
64return val*options.pulseNormalize;}
65function pulse(x){if(x>=1)return 1;if(x<=0)return 0;if(options.pulseNormalize==1){options.pulseNormalize/=pulse_(1);}
66return pulse_(x);}
67var wheelEvent;if('onwheel'in document.createElement('div'))
68wheelEvent='wheel';else if('onmousewheel'in document.createElement('div'))
69wheelEvent='mousewheel';if(wheelEvent){addEvent(wheelEvent,wheel);addEvent('mousedown',mousedown);addEvent('load',init);}})();
70}
71
72
73
74/*!
75 * Isotope PACKAGED v2.2.2
76 *
77 * Licensed GPLv3 for open source use
78 * or Isotope Commercial License for commercial use
79 *
80 * http://isotope.metafizzy.co
81 * Copyright 2015 Metafizzy
82 */
83
84!function(a){function b(){}function c(a){function c(b){b.prototype.option||(b.prototype.option=function(b){a.isPlainObject(b)&&(this.options=a.extend(!0,this.options,b))})}function e(b,c){a.fn[b]=function(e){if("string"==typeof e){for(var g=d.call(arguments,1),h=0,i=this.length;i>h;h++){var j=this[h],k=a.data(j,b);if(k)if(a.isFunction(k[e])&&"_"!==e.charAt(0)){var l=k[e].apply(k,g);if(void 0!==l)return l}else f("no such method '"+e+"' for "+b+" instance");else f("cannot call methods on "+b+" prior to initialization; attempted to call '"+e+"'")}return this}return this.each(function(){var d=a.data(this,b);d?(d.option(e),d._init()):(d=new c(this,e),a.data(this,b,d))})}}if(a){var f="undefined"==typeof console?b:function(a){console.error(a)};return a.bridget=function(a,b){c(b),e(a,b)},a.bridget}}var d=Array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],c):c("object"==typeof exports?require("jquery"):a.jQuery)}(window),function(a){function b(b){var c=a.event;return c.target=c.target||c.srcElement||b,c}var c=document.documentElement,d=function(){};c.addEventListener?d=function(a,b,c){a.addEventListener(b,c,!1)}:c.attachEvent&&(d=function(a,c,d){a[c+d]=d.handleEvent?function(){var c=b(a);d.handleEvent.call(d,c)}:function(){var c=b(a);d.call(a,c)},a.attachEvent("on"+c,a[c+d])});var e=function(){};c.removeEventListener?e=function(a,b,c){a.removeEventListener(b,c,!1)}:c.detachEvent&&(e=function(a,b,c){a.detachEvent("on"+b,a[b+c]);try{delete a[b+c]}catch(d){a[b+c]=void 0}});var f={bind:d,unbind:e};"function"==typeof define&&define.amd?define("eventie/eventie",f):"object"==typeof exports?module.exports=f:a.eventie=f}(window),function(){"use strict";function a(){}function b(a,b){for(var c=a.length;c--;)if(a[c].listener===b)return c;return-1}function c(a){return function(){return this[a].apply(this,arguments)}}var d=a.prototype,e=this,f=e.EventEmitter;d.getListeners=function(a){var b,c,d=this._getEvents();if(a instanceof RegExp){b={};for(c in d)d.hasOwnProperty(c)&&a.test(c)&&(b[c]=d[c])}else b=d[a]||(d[a]=[]);return b},d.flattenListeners=function(a){var b,c=[];for(b=0;b<a.length;b+=1)c.push(a[b].listener);return c},d.getListenersAsObject=function(a){var b,c=this.getListeners(a);return c instanceof Array&&(b={},b[a]=c),b||c},d.addListener=function(a,c){var d,e=this.getListenersAsObject(a),f="object"==typeof c;for(d in e)e.hasOwnProperty(d)&&-1===b(e[d],c)&&e[d].push(f?c:{listener:c,once:!1});return this},d.on=c("addListener"),d.addOnceListener=function(a,b){return this.addListener(a,{listener:b,once:!0})},d.once=c("addOnceListener"),d.defineEvent=function(a){return this.getListeners(a),this},d.defineEvents=function(a){for(var b=0;b<a.length;b+=1)this.defineEvent(a[b]);return this},d.removeListener=function(a,c){var d,e,f=this.getListenersAsObject(a);for(e in f)f.hasOwnProperty(e)&&(d=b(f[e],c),-1!==d&&f[e].splice(d,1));return this},d.off=c("removeListener"),d.addListeners=function(a,b){return this.manipulateListeners(!1,a,b)},d.removeListeners=function(a,b){return this.manipulateListeners(!0,a,b)},d.manipulateListeners=function(a,b,c){var d,e,f=a?this.removeListener:this.addListener,g=a?this.removeListeners:this.addListeners;if("object"!=typeof b||b instanceof RegExp)for(d=c.length;d--;)f.call(this,b,c[d]);
84else for(d in b)b.hasOwnProperty(d)&&(e=b[d])&&("function"==typeof e?f.call(this,d,e):g.call(this,d,e));return this},d.removeEvent=function(a){var b,c=typeof a,d=this._getEvents();if("string"===c)delete d[a];else if(a instanceof RegExp)for(b in d)d.hasOwnProperty(b)&&a.test(b)&&delete d[b];else delete this._events;return this},d.removeAllListeners=c("removeEvent"),d.emitEvent=function(a,b){var c,d,e,f,g=this.getListenersAsObject(a);for(e in g)if(g.hasOwnProperty(e))for(d=g[e].length;d--;)c=g[e][d],c.once===!0&&this.removeListener(a,c.listener),f=c.listener.apply(this,b||[]),f===this._getOnceReturnValue()&&this.removeListener(a,c.listener);return this},d.trigger=c("emitEvent"),d.emit=function(a){var b=Array.prototype.slice.call(arguments,1);return this.emitEvent(a,b)},d.setOnceReturnValue=function(a){return this._onceReturnValue=a,this},d._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},d._getEvents=function(){return this._events||(this._events={})},a.noConflict=function(){return e.EventEmitter=f,a},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return a}):"object"==typeof module&&module.exports?module.exports=a:e.EventEmitter=a}.call(this),function(a){function b(a){if(a){if("string"==typeof d[a])return a;a=a.charAt(0).toUpperCase()+a.slice(1);for(var b,e=0,f=c.length;f>e;e++)if(b=c[e]+a,"string"==typeof d[b])return b}}var c="Webkit Moz ms Ms O".split(" "),d=document.documentElement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return b}):"object"==typeof exports?module.exports=b:a.getStyleProperty=b}(window),function(a,b){function c(a){var b=parseFloat(a),c=-1===a.indexOf("%")&&!isNaN(b);return c&&b}function d(){}function e(){for(var a={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},b=0,c=h.length;c>b;b++){var d=h[b];a[d]=0}return a}function f(b){function d(){if(!m){m=!0;var d=a.getComputedStyle;if(j=function(){var a=d?function(a){return d(a,null)}:function(a){return a.currentStyle};return function(b){var c=a(b);return c||g("Style returned "+c+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),c}}(),k=b("boxSizing")){var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style[k]="border-box";var f=document.body||document.documentElement;f.appendChild(e);var h=j(e);l=200===c(h.width),f.removeChild(e)}}}function f(a){if(d(),"string"==typeof a&&(a=document.querySelector(a)),a&&"object"==typeof a&&a.nodeType){var b=j(a);if("none"===b.display)return e();var f={};f.width=a.offsetWidth,f.height=a.offsetHeight;for(var g=f.isBorderBox=!(!k||!b[k]||"border-box"!==b[k]),m=0,n=h.length;n>m;m++){var o=h[m],p=b[o];p=i(a,p);var q=parseFloat(p);f[o]=isNaN(q)?0:q}var r=f.paddingLeft+f.paddingRight,s=f.paddingTop+f.paddingBottom,t=f.marginLeft+f.marginRight,u=f.marginTop+f.marginBottom,v=f.borderLeftWidth+f.borderRightWidth,w=f.borderTopWidth+f.borderBottomWidth,x=g&&l,y=c(b.width);y!==!1&&(f.width=y+(x?0:r+v));var z=c(b.height);return z!==!1&&(f.height=z+(x?0:s+w)),f.innerWidth=f.width-(r+v),f.innerHeight=f.height-(s+w),f.outerWidth=f.width+t,f.outerHeight=f.height+u,f}}function i(b,c){if(a.getComputedStyle||-1===c.indexOf("%"))return c;var d=b.style,e=d.left,f=b.runtimeStyle,g=f&&f.left;return g&&(f.left=b.currentStyle.left),d.left=c,c=d.pixelLeft,d.left=e,g&&(f.left=g),c}var j,k,l,m=!1;return f}var g="undefined"==typeof console?d:function(a){console.error(a)},h=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],f):"object"==typeof exports?module.exports=f(require("desandro-get-style-property")):a.getSize=f(a.getStyleProperty)}(window),function(a){function b(a){"function"==typeof a&&(b.isReady?a():g.push(a))}function c(a){var c="readystatechange"===a.type&&"complete"!==f.readyState;b.isReady||c||d()}function d(){b.isReady=!0;for(var a=0,c=g.length;c>a;a++){var d=g[a];d()}}function e(e){return"complete"===f.readyState?d():(e.bind(f,"DOMContentLoaded",c),e.bind(f,"readystatechange",c),e.bind(a,"load",c)
84),b}var f=a.document,g=[];b.isReady=!1,"function"==typeof define&&define.amd?define("doc-ready/doc-ready",["eventie/eventie"],e):"object"==typeof exports?module.exports=e(require("eventie")):a.docReady=e(a.eventie)}(window),function(a){"use strict";function b(a,b){return a[g](b)}function c(a){if(!a.parentNode){var b=document.createDocumentFragment();b.appendChild(a)}}function d(a,b){c(a);for(var d=a.parentNode.querySelectorAll(b),e=0,f=d.length;f>e;e++)if(d[e]===a)return!0;return!1}function e(a,d){return c(a),b(a,d)}var f,g=function(){if(a.matches)return"matches";if(a.matchesSelector)return"matchesSelector";for(var b=["webkit","moz","ms","o"],c=0,d=b.length;d>c;c++){var e=b[c],f=e+"MatchesSelector";if(a[f])return f}}();if(g){var h=document.createElement("div"),i=b(h,"div");f=i?b:e}else f=d;"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return f}):"object"==typeof exports?module.exports=f:window.matchesSelector=f}(Element.prototype),function(a,b){"use strict";"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["doc-ready/doc-ready","matches-selector/matches-selector"],function(c,d){return b(a,c,d)}):"object"==typeof exports?module.exports=b(a,require("doc-ready"),require("desandro-matches-selector")):a.fizzyUIUtils=b(a,a.docReady,a.matchesSelector)}(window,function(a,b,c){var d={};d.extend=function(a,b){for(var c in b)a[c]=b[c];return a},d.modulo=function(a,b){return(a%b+b)%b};var e=Object.prototype.toString;d.isArray=function(a){return"[object Array]"==e.call(a)},d.makeArray=function(a){var b=[];if(d.isArray(a))b=a;else if(a&&"number"==typeof a.length)for(var c=0,e=a.length;e>c;c++)b.push(a[c]);else b.push(a);return b},d.indexOf=Array.prototype.indexOf?function(a,b){return a.indexOf(b)}:function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},d.removeFrom=function(a,b){var c=d.indexOf(a,b);-1!=c&&a.splice(c,1)},d.isElement="function"==typeof HTMLElement||"object"==typeof HTMLElement?function(a){return a instanceof HTMLElement}:function(a){return a&&"object"==typeof a&&1==a.nodeType&&"string"==typeof a.nodeName},d.setText=function(){function a(a,c){b=b||(void 0!==document.documentElement.textContent?"textContent":"innerText"),a[b]=c}var b;return a}(),d.getParent=function(a,b){for(;a!=document.body;)if(a=a.parentNode,c(a,b))return a},d.getQueryElement=function(a){return"string"==typeof a?document.querySelector(a):a},d.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},d.filterFindElements=function(a,b){a=d.makeArray(a);for(var e=[],f=0,g=a.length;g>f;f++){var h=a[f];if(d.isElement(h))if(b){c(h,b)&&e.push(h);for(var i=h.querySelectorAll(b),j=0,k=i.length;k>j;j++)e.push(i[j])}else e.push(h)}return e},d.debounceMethod=function(a,b,c){var d=a.prototype[b],e=b+"Timeout";a.prototype[b]=function(){var a=this[e];a&&clearTimeout(a);var b=arguments,f=this;this[e]=setTimeout(function(){d.apply(f,b),delete f[e]},c||100)}},d.toDashed=function(a){return a.replace(/(.)([A-Z])/g,function(a,b,c){return b+"-"+c}).toLowerCase()};var f=a.console;return d.htmlInit=function(c,e){b(function(){for(var b=d.toDashed(e),g=document.querySelectorAll(".js-"+b),h="data-"+b+"-options",i=0,j=g.length;j>i;i++){var k,l=g[i],m=l.getAttribute(h);try{k=m&&JSON.parse(m)}catch(n){f&&f.error("Error parsing "+h+" on "+l.nodeName.toLowerCase()+(l.id?"#"+l.id:"")+": "+n);continue}var o=new c(l,k),p=a.jQuery;p&&p.data(l,e,o)}})},d}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("outlayer/item",["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property","fizzy-ui-utils/utils"],function(c,d,e,f){return b(a,c,d,e,f)}):"object"==typeof exports?module.exports=b(a,require("wolfy87-eventemitter"),require("get-size"),require("desandro-get-style-property"),require("fizzy-ui-utils")):(a.Outlayer={},a.Outlayer.Item=b(a,a.EventEmitter,a.getSize,a.getStyleProperty,a.fizzyUIUtils))}(window,function(a,b,c,d,e){"use strict";function f(a){for(var b in a)return!1;return b=null,!0}function g(a,b){a&&(this.element=a,this.layout=b,this.position={x:0,y:0},this._create())}function h(a){return a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})}var i=a.getComputedStyle,j=i?function(a){return i(a,null)}:function(a){return a.currentStyle},k=d("transition"),l=d("transform"),m=k&&l,n=!!d("perspective"),o={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[k],p=["transform","transition","transitionDuration","transitionProperty"],q=function(){for(var a={},b=0,c=p.length;c>b;b++){var e=p[b],f=d(e);f&&f!==e&&(a[e]=f)}return a}();e.extend(g.prototype,b.prototype),g.prototype._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},g.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},g.prototype.getSize=function(){this.size=c(this.element)},g.prototype.css=function(a){var b=this.element.style;for(var c in a){var d=q[c]||c;b[d]=a[c]}},g.prototype.getPosition=function(){var a=j(this.element),b=this.layout.options,c=b.isOriginLeft,d=b.isOriginTop,e=a[c?"left":"right"],f=a[d?"top":"bottom"],g=this.layout.size,h=-1!=e.indexOf("%")?parseFloat(e)/100*g.width:parseInt(e,10),i=-1!=f.indexOf("%")?parseFloat(f)/100*g.height:parseInt(f,10);h=isNaN(h)?0:h,i=isNaN(i)?0:i,h-=c?g.paddingLeft:g.paddingRight,i-=d?g.paddingTop:g.paddingBottom,this.position.x=h,this.position.y=i},g.prototype.layoutPosition=function(){var a=this.layout.size,b=this.layout.options,c={},d=b.isOriginLeft?"paddingLeft":"paddingRight",e=b.isOriginLeft?"left"
84:"right",f=b.isOriginLeft?"right":"left",g=this.position.x+a[d];c[e]=this.getXValue(g),c[f]="";var h=b.isOriginTop?"paddingTop":"paddingBottom",i=b.isOriginTop?"top":"bottom",j=b.isOriginTop?"bottom":"top",k=this.position.y+a[h];c[i]=this.getYValue(k),c[j]="",this.css(c),this.emitEvent("layout",[this])},g.prototype.getXValue=function(a){var b=this.layout.options;return b.percentPosition&&!b.isHorizontal?a/this.layout.size.width*100+"%":a+"px"},g.prototype.getYValue=function(a){var b=this.layout.options;return b.percentPosition&&b.isHorizontal?a/this.layout.size.height*100+"%":a+"px"},g.prototype._transitionTo=function(a,b){this.getPosition();var c=this.position.x,d=this.position.y,e=parseInt(a,10),f=parseInt(b,10),g=e===this.position.x&&f===this.position.y;if(this.setPosition(a,b),g&&!this.isTransitioning)return void this.layoutPosition();var h=a-c,i=b-d,j={};j.transform=this.getTranslate(h,i),this.transition({to:j,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},g.prototype.getTranslate=function(a,b){var c=this.layout.options;return a=c.isOriginLeft?a:-a,b=c.isOriginTop?b:-b,n?"translate3d("+a+"px, "+b+"px, 0)":"translate("+a+"px, "+b+"px)"},g.prototype.goTo=function(a,b){this.setPosition(a,b),this.layoutPosition()},g.prototype.moveTo=m?g.prototype._transitionTo:g.prototype.goTo,g.prototype.setPosition=function(a,b){this.position.x=parseInt(a,10),this.position.y=parseInt(b,10)},g.prototype._nonTransition=function(a){this.css(a.to),a.isCleaning&&this._removeStyles(a.to);for(var b in a.onTransitionEnd)a.onTransitionEnd[b].call(this)},g.prototype._transition=function(a){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(a);var b=this._transn;for(var c in a.onTransitionEnd)b.onEnd[c]=a.onTransitionEnd[c];for(c in a.to)b.ingProperties[c]=!0,a.isCleaning&&(b.clean[c]=!0);if(a.from){this.css(a.from);var d=this.element.offsetHeight;d=null}this.enableTransition(a.to),this.css(a.to),this.isTransitioning=!0};var r="opacity,"+h(q.transform||"transform");g.prototype.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:r,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(o,this,!1))},g.prototype.transition=g.prototype[k?"_transition":"_nonTransition"],g.prototype.onwebkitTransitionEnd=function(a){this.ontransitionend(a)},g.prototype.onotransitionend=function(a){this.ontransitionend(a)};var s={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};g.prototype.ontransitionend=function(a){if(a.target===this.element){var b=this._transn,c=s[a.propertyName]||a.propertyName;if(delete b.ingProperties[c],f(b.ingProperties)&&this.disableTransition(),c in b.clean&&(this.element.style[a.propertyName]="",delete b.clean[c]),c in b.onEnd){var d=b.onEnd[c];d.call(this),delete b.onEnd[c]}this.emitEvent("transitionEnd",[this])}},g.prototype.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(o,this,!1),this.isTransitioning=!1},g.prototype._removeStyles=function(a){var b={};for(var c in a)b[c]="";this.css(b)};var t={transitionProperty:"",transitionDuration:""};return g.prototype.removeTransitionStyles=function(){this.css(t)},g.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},g.prototype.remove=function(){if(!k||!parseFloat(this.layout.options.transitionDuration))return void this.removeElem();var a=this;this.once("transitionEnd",function(){a.removeElem()}),this.hide()},g.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var a=this.layout.options,b={},c=this.getHideRevealTransitionEndProperty("visibleStyle");b[c]=this.onRevealTransitionEnd,this.transition({from:a.hiddenStyle,to:a.visibleStyle,isCleaning:!0,onTransitionEnd:b})},g.prototype.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},g.prototype.getHideRevealTransitionEndProperty=function(a){var b=this.layout.options[a];if(b.opacity)return"opacity";for(var c in b)return c},g.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var a=this.layout.options,b={}
84,c=this.getHideRevealTransitionEndProperty("hiddenStyle");b[c]=this.onHideTransitionEnd,this.transition({from:a.visibleStyle,to:a.hiddenStyle,isCleaning:!0,onTransitionEnd:b})},g.prototype.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},g.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},g}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","eventEmitter/EventEmitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(c,d,e,f,g){return b(a,c,d,e,f,g)}):"object"==typeof exports?module.exports=b(a,require("eventie"),require("wolfy87-eventemitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):a.Outlayer=b(a,a.eventie,a.EventEmitter,a.getSize,a.fizzyUIUtils,a.Outlayer.Item)}(window,function(a,b,c,d,e,f){"use strict";function g(a,b){var c=e.getQueryElement(a);if(!c)return void(h&&h.error("Bad element for "+this.constructor.namespace+": "+(c||a)));this.element=c,i&&(this.$element=i(this.element)),this.options=e.extend({},this.constructor.defaults),this.option(b);var d=++k;this.element.outlayerGUID=d,l[d]=this,this._create(),this.options.isInitLayout&&this.layout()}var h=a.console,i=a.jQuery,j=function(){},k=0,l={};return g.namespace="outlayer",g.Item=f,g.defaults={containerStyle:{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.extend(g.prototype,c.prototype),g.prototype.option=function(a){e.extend(this.options,a)},g.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),e.extend(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},g.prototype.reloadItems=function(){this.items=this._itemize(this.element.children)},g.prototype._itemize=function(a){for(var b=this._filterFindItemElements(a),c=this.constructor.Item,d=[],e=0,f=b.length;f>e;e++){var g=b[e],h=new c(g,this);d.push(h)}return d},g.prototype._filterFindItemElements=function(a){return e.filterFindElements(a,this.options.itemSelector)},g.prototype.getItemElements=function(){for(var a=[],b=0,c=this.items.length;c>b;b++)a.push(this.items[b].element);return a},g.prototype.layout=function(){this._resetLayout(),this._manageStamps();var a=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,a),this._isLayoutInited=!0},g.prototype._init=g.prototype.layout,g.prototype._resetLayout=function(){this.getSize()},g.prototype.getSize=function(){this.size=d(this.element)},g.prototype._getMeasurement=function(a,b){var c,f=this.options[a];f?("string"==typeof f?c=this.element.querySelector(f):e.isElement(f)&&(c=f),this[a]=c?d(c)[b]:f):this[a]=0},g.prototype.layoutItems=function(a,b){a=this._getItemsForLayout(a),this._layoutItems(a,b),this._postLayout()},g.prototype._getItemsForLayout=function(a){for(var b=[],c=0,d=a.length;d>c;c++){var e=a[c];e.isIgnored||b.push(e)}return b},g.prototype._layoutItems=function(a,b){if(this._emitCompleteOnItems("layout",a),a&&a.length){for(var c=[],d=0,e=a.length;e>d;d++){var f=a[d],g=this._getItemLayoutPosition(f);g.item=f,g.isInstant=b||f.isLayoutInstant,c.push(g)}this._processLayoutQueue(c)}},g.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},g.prototype._processLayoutQueue=function(a){for(var b=0,c=a.length;c>b;b++){var d=a[b];this._positionItem(d.item,d.x,d.y,d.isInstant)}},g.prototype._positionItem=function(a,b,c,d){d?a.goTo(b,c):a.moveTo(b,c)},g.prototype._postLayout=function(){this.resizeContainer()},g.prototype.resizeContainer=function(){if(this.options.isResizingContainer){var a=this._getContainerSize();a&&(this._setContainerMeasure(a.width,!0),this._setContainerMeasure(a.height,!1))}},g.prototype._getContainerSize=j,g.prototype._setContainerMeasure=function(a,b){if(void 0!==a){var c=this.size;c.isBorderBox&&(a+=b?c.paddingLeft+c.paddingRight+c.borderLeftWidth+c.borderRightWidth:c.paddingBottom+c.paddingTop+c.borderTopWidth+c.borderBottomWidth),a=Math.max(a,0),this.element.style[b?"width":"height"]=a+"px"}},g.prototype._emitCompleteOnItems=function(a,b){function c(){e.dispatchEvent(a+"Complete",null,[b])}function d(){g++,g===f&&c()}var e=this,f=b.length;if(!b||!f)return void c();for(var g=0,h=0,i=b.length;i>h;h++){var j=b[h];j.once(a,d)}},g.prototype.dispatchEvent=function(a,b,c){var d=b?[b].concat(c):c;if(this.emitEvent(a,d),i)if(this.$element=this.$element||i(this.element),b){var e=i.Event(b);e.type=a,this.$element.trigger(e,c)}else this.$element.trigger(a,c)},g.prototype.ignore=function(a){var b=this.getItem(a);b&&(b.isIgnored=!0)},g.prototype.unignore=function(a){var b=this.getItem(a);b&&delete b.isIgnored}
84,g.prototype.stamp=function(a){if(a=this._find(a)){this.stamps=this.stamps.concat(a);for(var b=0,c=a.length;c>b;b++){var d=a[b];this.ignore(d)}}},g.prototype.unstamp=function(a){if(a=this._find(a))for(var b=0,c=a.length;c>b;b++){var d=a[b];e.removeFrom(this.stamps,d),this.unignore(d)}},g.prototype._find=function(a){return a?("string"==typeof a&&(a=this.element.querySelectorAll(a)),a=e.makeArray(a)):void 0},g.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var a=0,b=this.stamps.length;b>a;a++){var c=this.stamps[a];this._manageStamp(c)}}},g.prototype._getBoundingRect=function(){var a=this.element.getBoundingClientRect(),b=this.size;this._boundingRect={left:a.left+b.paddingLeft+b.borderLeftWidth,top:a.top+b.paddingTop+b.borderTopWidth,right:a.right-(b.paddingRight+b.borderRightWidth),bottom:a.bottom-(b.paddingBottom+b.borderBottomWidth)}},g.prototype._manageStamp=j,g.prototype._getElementOffset=function(a){var b=a.getBoundingClientRect(),c=this._boundingRect,e=d(a),f={left:b.left-c.left-e.marginLeft,top:b.top-c.top-e.marginTop,right:c.right-b.right-e.marginRight,bottom:c.bottom-b.bottom-e.marginBottom};return f},g.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},g.prototype.bindResize=function(){this.isResizeBound||(b.bind(a,"resize",this),this.isResizeBound=!0)},g.prototype.unbindResize=function(){this.isResizeBound&&b.unbind(a,"resize",this),this.isResizeBound=!1},g.prototype.onresize=function(){function a(){b.resize(),delete b.resizeTimeout}this.resizeTimeout&&clearTimeout(this.resizeTimeout);var b=this;this.resizeTimeout=setTimeout(a,100)},g.prototype.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},g.prototype.needsResizeLayout=function(){var a=d(this.element),b=this.size&&a;return b&&a.innerWidth!==this.size.innerWidth},g.prototype.addItems=function(a){var b=this._itemize(a);return b.length&&(this.items=this.items.concat(b)),b},g.prototype.appended=function(a){var b=this.addItems(a);b.length&&(this.layoutItems(b,!0),this.reveal(b))},g.prototype.prepended=function(a){var b=this._itemize(a);if(b.length){var c=this.items.slice(0);this.items=b.concat(c),this._resetLayout(),this._manageStamps(),this.layoutItems(b,!0),this.reveal(b),this.layoutItems(c)}},g.prototype.reveal=function(a){this._emitCompleteOnItems("reveal",a);for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.reveal()}},g.prototype.hide=function(a){this._emitCompleteOnItems("hide",a);for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.hide()}},g.prototype.revealItemElements=function(a){var b=this.getItems(a);this.reveal(b)},g.prototype.hideItemElements=function(a){var b=this.getItems(a);this.hide(b)},g.prototype.getItem=function(a){for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];if(d.element===a)return d}},g.prototype.getItems=function(a){a=e.makeArray(a);for(var b=[],c=0,d=a.length;d>c;c++){var f=a[c],g=this.getItem(f);g&&b.push(g)}return b},g.prototype.remove=function(a){var b=this.getItems(a);if(this._emitCompleteOnItems("remove",b),b&&b.length)for(var c=0,d=b.length;d>c;c++){var f=b[c];f.remove(),e.removeFrom(this.items,f)}},g.prototype.destroy=function(){var a=this.element.style;a.height="",a.position="",a.width="";for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];d.destroy()}this.unbindResize();var e=this.element.outlayerGUID;delete l[e],delete this.element.outlayerGUID,i&&i.removeData(this.element,this.constructor.namespace)},g.data=function(a){a=e.getQueryElement(a);var b=a&&a.outlayerGUID;return b&&l[b]}
84,g.create=function(a,b){function c(){g.apply(this,arguments)}return Object.create?c.prototype=Object.create(g.prototype):e.extend(c.prototype,g.prototype),c.prototype.constructor=c,c.defaults=e.extend({},g.defaults),e.extend(c.defaults,b),c.prototype.settings={},c.namespace=a,c.data=g.data,c.Item=function(){f.apply(this,arguments)},c.Item.prototype=new f,e.htmlInit(c,a),i&&i.bridget&&i.bridget(a,c),c},g.Item=f,g}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("isotope/js/item",["outlayer/outlayer"],b):"object"==typeof exports?module.exports=b(require("outlayer")):(a.Isotope=a.Isotope||{},a.Isotope.Item=b(a.Outlayer))}(window,function(a){"use strict";function b(){a.Item.apply(this,arguments)}b.prototype=new a.Item,b.prototype._create=function(){this.id=this.layout.itemGUID++,a.Item.prototype._create.call(this),this.sortData={}},b.prototype.updateSortData=function(){if(!this.isIgnored){this.sortData.id=this.id,this.sortData["original-order"]=this.id,this.sortData.random=Math.random();var a=this.layout.options.getSortData,b=this.layout._sorters;for(var c in a){var d=b[c];this.sortData[c]=d(this.element,this)}}};var c=b.prototype.destroy;return b.prototype.destroy=function(){c.apply(this,arguments),this.css({display:""})},b}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("isotope/js/layout-mode",["get-size/get-size","outlayer/outlayer"],b):"object"==typeof exports?module.exports=b(require("get-size"),require("outlayer")):(a.Isotope=a.Isotope||{},a.Isotope.LayoutMode=b(a.getSize,a.Outlayer))}(window,function(a,b){"use strict";function c(a){this.isotope=a,a&&(this.options=a.options[this.namespace],this.element=a.element,this.items=a.filteredItems,this.size=a.size)}return function(){function a(a){return function(){return b.prototype[a].apply(this.isotope,arguments)}}for(var d=["_resetLayout","_getItemLayoutPosition","_manageStamp","_getContainerSize","_getElementOffset","needsResizeLayout"],e=0,f=d.length;f>e;e++){var g=d[e];c.prototype[g]=a(g)}}(),c.prototype.needsVerticalResizeLayout=function(){var b=a(this.isotope.element),c=this.isotope.size&&b;return c&&b.innerHeight!=this.isotope.size.innerHeight},c.prototype._getMeasurement=function(){this.isotope._getMeasurement.apply(this,arguments)},c.prototype.getColumnWidth=function(){this.getSegmentSize("column","Width")},c.prototype.getRowHeight=function(){this.getSegmentSize("row","Height")},c.prototype.getSegmentSize=function(a,b){var c=a+b,d="outer"+b;if(this._getMeasurement(c,d),!this[c]){var e=this.getFirstItemSize();this[c]=e&&e[d]||this.isotope.size["inner"+b]}},c.prototype.getFirstItemSize=function(){var b=this.isotope.filteredItems[0];return b&&b.element&&a(b.element)},c.prototype.layout=function(){this.isotope.layout.apply(this.isotope,arguments)},c.prototype.getSize=function(){this.isotope.getSize(),this.size=this.isotope.size},c.modes={},c.create=function(a,b){function d(){c.apply(this,arguments)}return d.prototype=new c,b&&(d.options=b),d.prototype.namespace=a,c.modes[a]=d,d},c}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("masonry/masonry",["outlayer/outlayer","get-size/get-size","fizzy-ui-utils/utils"],b):"object"==typeof exports?module.exports=b(require("outlayer"),require("get-size"),require("fizzy-ui-utils")):a.Masonry=b(a.Outlayer,a.getSize,a.fizzyUIUtils)}(window,function(a,b,c){var d=a.create("masonry");return d.prototype._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns();var a=this.cols;for(this.colYs=[];a--;)this.colYs.push(0);this.maxY=0},d.prototype.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var a=this.items[0],c=a&&a.element;this.columnWidth=c&&b(c).outerWidth||this.containerWidth}var d=this.columnWidth+=this.gutter,e=this.containerWidth+this.gutter,f=e/d,g=d-e%d,h=g&&1>g?"round":"floor";f=Math[h](f),this.cols=Math.max(f,1)},d.prototype.getContainerWidth=function(){var a=this.options.isFitWidth?this.element.parentNode:this.element,c=b(a);
84this.containerWidth=c&&c.innerWidth},d.prototype._getItemLayoutPosition=function(a){a.getSize();var b=a.size.outerWidth%this.columnWidth,d=b&&1>b?"round":"ceil",e=Math[d](a.size.outerWidth/this.columnWidth);e=Math.min(e,this.cols);for(var f=this._getColGroup(e),g=Math.min.apply(Math,f),h=c.indexOf(f,g),i={x:this.columnWidth*h,y:g},j=g+a.size.outerHeight,k=this.cols+1-f.length,l=0;k>l;l++)this.colYs[h+l]=j;return i},d.prototype._getColGroup=function(a){if(2>a)return this.colYs;for(var b=[],c=this.cols+1-a,d=0;c>d;d++){var e=this.colYs.slice(d,d+a);b[d]=Math.max.apply(Math,e)}return b},d.prototype._manageStamp=function(a){var c=b(a),d=this._getElementOffset(a),e=this.options.isOriginLeft?d.left:d.right,f=e+c.outerWidth,g=Math.floor(e/this.columnWidth);g=Math.max(0,g);var h=Math.floor(f/this.columnWidth);h-=f%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var i=(this.options.isOriginTop?d.top:d.bottom)+c.outerHeight,j=g;h>=j;j++)this.colYs[j]=Math.max(i,this.colYs[j])},d.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var a={height:this.maxY};return this.options.isFitWidth&&(a.width=this._getContainerFitWidth()),a},d.prototype._getContainerFitWidth=function(){for(var a=0,b=this.cols;--b&&0===this.colYs[b];)a++;return(this.cols-a)*this.columnWidth-this.gutter},d.prototype.needsResizeLayout=function(){var a=this.containerWidth;return this.getContainerWidth(),a!==this.containerWidth},d}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("isotope/js/layout-modes/masonry",["../layout-mode","masonry/masonry"],b):"object"==typeof exports?module.exports=b(require("../layout-mode"),require("masonry-layout")):b(
84a.Isotope.LayoutMode,a.Masonry)}(window,function(a,b){"use strict";function c(a,b){for(var c in b)a[c]=b[c];return a}var d=a.create("masonry"),e=d.prototype._getElementOffset,f=d.prototype.layout,g=d.prototype._getMeasurement;
85c(d.prototype,b.prototype),d.prototype._getElementOffset=e,d.prototype.layout=f,d.prototype._getMeasurement=g;var h=d.prototype.measureColumns;d.prototype.measureColumns=function(){this.items=this.isotope.filteredItems,h.call(this)};var i=d.prototype._manageStamp;return d.prototype._manageStamp=function(){this.options.isOriginLeft=this.isotope.options.isOriginLeft,this.options.isOriginTop=this.isotope.options.isOriginTop,i.apply(this,arguments)},d}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("isotope/js/layout-modes/fit-rows",["../layout-mode"],b):"object"==typeof exports?module.exports=b(require("../layout-mode")):b(a.Isotope.LayoutMode)}(window,function(a){"use strict";var b=a.create("fitRows");return b.prototype._resetLayout=function(){this.x=0,this.y=0,this.maxY=0,this._getMeasurement("gutter","outerWidth")},b.prototype._getItemLayoutPosition=function(a){a.getSize();var b=a.size.outerWidth+this.gutter,c=this.isotope.size.innerWidth+this.gutter;0!==this.x&&b+this.x>c&&(this.x=0,this.y=this.maxY);var d={x:this.x,y:this.y};return this.maxY=Math.max(this.maxY,this.y+a.size.outerHeight),this.x+=b,d},b.prototype._getContainerSize=function(){return{height:this.maxY}},b}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("isotope/js/layout-modes/vertical",["../layout-mode"],b):"object"==typeof exports?module.exports=b(require("../layout-mode")):b(a.Isotope.LayoutMode)}(window,function(a){"use strict";var b=a.create("vertical",{horizontalAlignment:0});return b.prototype._resetLayout=function(){this.y=0},b.prototype._getItemLayoutPosition=function(a){a.getSize();var b=(this.isotope.size.innerWidth-a.size.outerWidth)*this.options.horizontalAlignment,c=this.y;return this.y+=a.size.outerHeight,{x:b,y:c}},b.prototype._getContainerSize=function(){return{height:this.y}},b}),function(a,b){"use strict";"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","matches-selector/matches-selector","fizzy-ui-utils/utils","isotope/js/item","isotope/js/layout-mode","isotope/js/layout-modes/masonry","isotope/js/layout-modes/fit-rows","isotope/js/layout-modes/vertical"],function(c,d,e,f,g,h){return b(a,c,d,e,f,g,h)}):"object"==typeof exports?module.exports=b(a,require("outlayer"),require("get-size"),require("desandro-matches-selector"),require("fizzy-ui-utils"),require("./item"),require("./layout-mode"),require("./layout-modes/masonry"),require("./layout-modes/fit-rows"),require("./layout-modes/vertical")):a.Isotope=b(a,a.Outlayer,a.getSize,a.matchesSelector,a.fizzyUIUtils,a.Isotope.Item,a.Isotope.LayoutMode)}(window,function(a,b,c,d,e,f,g){function h(a,b){return function(c,d){for(var e=0,f=a.length;f>e;e++){var g=a[e],h=c.sortData[g],i=d.sortData[g];if(h>i||i>h){var j=void 0!==b[g]?b[g]:b,k=j?1:-1;return(h>i?1:-1)*k}}return 0}}var i=a.jQuery,j=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^\s+|\s+$/g,"")},k=document.documentElement,l=k.textContent?function(a){return a.textContent}:function(a){return a.innerText},m=b.create("isotope",{layoutMode:"masonry",isJQueryFiltering:!0,sortAscending:!0});m.Item=f,m.LayoutMode=g,m.prototype._create=function(){this.itemGUID=0,this._sorters={},this._getSorters(),b.prototype._create.call(this),this.modes={},this.filteredItems=this.items,this.sortHistory=["original-order"];for(var a in g.modes)this._initLayoutMode(a)},m.prototype.reloadItems=function(){this.itemGUID=0,b.prototype.reloadItems.call(this)},m.prototype._itemize=function(){for(var a=b.prototype._itemize.apply(this,arguments),c=0,d=a.length;d>c;c++){var e=a[c];e.id=this.itemGUID++}return this._updateItemsSortData(a),a},m.prototype._initLayoutMode=function(a){var b=g.modes[a],c=this.options[a]||{};this.options[a]=b.options?e.extend(b.options,c):c,this.modes[a]=new b(this)},m.prototype.layout=function(){return!this._isLayoutInited&&this.options.isInitLayout?void this.arrange():void this._layout()},m.prototype._layout=function(){var a=this._getIsInstant();this._resetLayout(),this._manageStamps(),this.layoutItems(this.filteredItems,a),this._isLayoutInited=!0},m.prototype.arrange=function(a){function b(){d.reveal(c.needReveal),d.hide(c.needHide)}this.option(a),this._getIsInstant();var c=this._filter(this.items);this.filteredItems=c.matches;var d=this;this._bindArrangeComplete(),this._isInstant?this._noTransition(b):b(),this._sort(),this._layout()},m.prototype._init=m.prototype.arrange,m.prototype._getIsInstant=function(){var a=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;return this._isInstant=a,a},m.prototype._bindArrangeComplete=function(){function a(){b&&c&&d&&e.dispatchEvent("arrangeComplete",null,[e.filteredItems])}var b,c,d,e=this;this.once("layoutComplete",function(){b=!0,a()}),this.once("hideComplete",function(){c=!0,a()}),this.once("revealComplete",function(){d=!0,a()})},m.prototype._filter=function(a){var b=this.options.filter;b=b||"*";for(var c=[],d=[],e=[],f=this._getFilterTest(b),g=0,h=a.length;h>g;g++){var i=a[g];if(!i.isIgnored){var j=f(i);j&&c.push(i),j&&i.isHidden?d.push(i):j||i.isHidden||e.push(i)}}return{matches:c,needReveal:d,needHide:e}},m.prototype._getFilterTest=function(a){return i&&this.options.isJQueryFiltering?function(b){return i(b.element).is(a)}:"function"==typeof a?function(b){return a(b.element)}:function(b){return d(b.element,a)}},m.prototype.updateSortData=function(a){var b;a?(a=e.makeArray(a),b=this.getItems(a)):b=this.items,this._getSorters(),this._updateItemsSortData(b)},m.prototype._getSorters=function(){var a=this.options.getSortData;for(var b in a){var c=a[b];this._sorters[b]=n(c)}},m.prototype._updateItemsSortData=function(a){for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.updateSortData()}};var n=function(){function a(a){if("string"!=typeof a)return a;var c=j(a).split(" "),d=c[0],e=d.match(/^\[(.+)\]$/),f=e&&e[1],g=b(f,d),h=m.sortDataParsers[c[1]];return a=h?function(a){return a&&h(g(a))}:function(a){return a&&g(a)}}function b(a,b){var c;return c=a?function(b){return b.getAttribute(a)}:function(a){var c=a.querySelector(b);return c&&l(c)}}return a}();m.sortDataParsers={parseInt:function(a){return parseInt(a,10)},parseFloat:function(a){return parseFloat(a)}},m.prototype._sort=function(){var a=this.options.sortBy;if(a){var b=[].concat.apply(a,this.sortHistory),c=h(b,this.options.sortAscending);this.filteredItems.sort(c),a!=this.sortHistory[0]&&this.sortHistory.unshift(a)}},m.prototype._mode=function(){var a=this.options.layoutMode,b=this.modes[a];if(!b)throw new Error("No layout mode: "+a);return b.options=this.options[a],b},m.prototype._resetLayout=function(){b.prototype._resetLayout.call(this),this._mode()._resetLayout()},m.prototype._getItemLayoutPosition=function(a){return this._mode()._getItemLayoutPosition(a)},m.prototype._manageStamp=function(a){this._mode()._manageStamp(a)},m.prototype._getContainerSize=function(){return this._mode()._getContainerSize()},m.prototype.needsResizeLayout=function(){return this._mode().needsResizeLayout()},m.prototype.appended=function(a){var b=this.addItems(a);if(b.length){var c=this._filterRevealAdded(b);this.filteredItems=this.filteredItems.concat(c)}},m.prototype.prepended=function(a){var b=this._itemize(a);if(b.length){this._resetLayout(),this._manageStamps();var c=this._filterRevealAdded(b);this.layoutItems(this.filteredItems),this.filteredItems=c.concat(this.filteredItems),this.items=b.concat(this.items)}},m.prototype._filterRevealAdded=function(a){var b=this._filter(a);return this.hide(b.needHide),this.reveal(b.matches),this.layoutItems(b.matches,!0),b.matches},m.prototype.insert=function(a){var b=this.addItems(a);if(b.length){var c,d,e=b.length;for(c=0;e>c;c++)d=b[c],this.element.appendChild(d.element);var f=this._filter(b).matches;for(c=0;e>c;c++)b[c].isLayoutInstant=!0;for(this.arrange(),c=0;e>c;c++)delete b[c].isLayoutInstant;this.reveal(f)}};var o=m.prototype.remove;return m.prototype.remove=function(a){a=e.makeArray(a);var b=this.getItems(a);o.call(this,a);var c=b&&b.length;if(c)for(var d=0;c>d;d++){var f=b[d];e.removeFrom(this.filteredItems,f)}},m.prototype.shuffle=function(){for(var a=0,b=this.items.length;b>a;a++){var c=this.items[a];c.sortData.random=Math.random()}this.options.sortBy="random",this._sort(),this._layout()},m.prototype._noTransition=function(a){var b=this.options.transitionDuration;this.options.transitionDuration=0;var c=a.call(this);return this.options.transitionDuration=b,c},m.prototype.getFilteredItemElements=function(){for(var a=[],b=0,c=this.filteredItems.length;c>b;b++)a.push(this.filteredItems[b].element);return a},m});
86
87(function(){function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,o=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1
87);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=o,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e,t){"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){return t(e,n,i)}):"object"==typeof exports?module.exports=t(e,require("wolfy87-eventemitter"),require("eventie")):e.imagesLoaded=t(e,e.EventEmitter,e.eventie)}(window,function(e,t,n){function i(e,t){for(var n in t)e[n]=t[n];return e}function r(e){return"[object Array]"===d.call(e)}function o(e){var t=[];if(r(e))t=e;else if("number"==typeof e.length)for(var n=0,i=e.length;i>n;n++)t.push(e[n]);else t.push(e);return t}function s(e,t,n){if(!(this instanceof s))return new s(e,t);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=o(e),this.options=i({},this.options),"function"==typeof t?n=t:i(this.options,t),n&&this.on("always",n),this.getImages(),a&&(this.jqDeferred=new a.Deferred);var r=this;setTimeout(function(){r.check()})}function f(e){this.img=e}function c(e){this.src=e,v[e]=this}var a=e.jQuery,u=e.console,h=u!==void 0,d=Object.prototype.toString;s.prototype=new t,s.prototype.options={},s.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);var i=n.nodeType;if(i&&(1===i||9===i||11===i))for(var r=n.querySelectorAll("img"),o=0,s=r.length;s>o;o++){var f=r[o];this.addImage(f)}}},s.prototype.addImage=function(e){var t=new f(e);this.images.push(t)},s.prototype.check=function(){function e(e,r){return t.options.debug&&h&&u.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},s.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify&&t.jqDeferred.notify(t,e)})},s.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},a&&(a.fn.imagesLoaded=function(e,t){var n=new s(this,e,t);return n.jqDeferred.promise(a(this))}),f.prototype=new t,f.prototype.check=function(){var e=v[this.img.src]||new c(this.img.src);if(e.isConfirmed)return this.confirm(e.isLoaded,"cached was confirmed"),void 0;if(this.img.complete&&void 0!==this.img.naturalWidth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this;e.on("confirm",function(e,n){return t.confirm(e.isLoaded,n),!0}),e.check()},f.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};var v={};return c.prototype=new t,c.prototype.check=function(){if(!this.isChecked){var e=new Image;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},c.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},c.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},c.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},c.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit
87("confirm",this,t)},c.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},s});
88
89
90
91
92
93
94
95 (function($, window, document, undefined) {
96
97    'use strict';
98
99    var defaults = {
100
101        mode: 'lg-slide',
102
103        // Ex : 'ease'
104        cssEasing: 'ease',
105
106        //'for jquery animation'
107        easing: 'linear',
108        speed: 600,
109        height: '100%',
110        width: '100%',
111        addClass: '',
112        startClass: 'lg-start-zoom',
113        backdropDuration: 150,
114        hideBarsDelay: 6000,
115
116        useLeft: false,
117
118        closable: true,
119        loop: true,
120        escKey: true,
121        keyPress: true,
122        controls: true,
123        slideEndAnimatoin: true,
124        hideControlOnEnd: false,
125        mousewheel: true,
126
127        // .lg-item || '.lg-sub-html'
128        appendSubHtmlTo: '.lg-sub-html',
129
130        /**
131         * @desc number of preload slides
132         * will exicute only after the current slide is fully loaded.
133         *
134         * @ex you clicked on 4th image and if preload = 1 then 3rd slide and 5th
135         * slide will be loaded in the background after the 4th slide is fully loaded..
136         * if preload is 2 then 2nd 3rd 5th 6th slides will be preloaded.. ... ...
137         *
138         */
139        preload: 1,
140        showAfterLoad: true,
141        selector: '',
142        selectWithin: '',
143        nextHtml: '',
144        prevHtml: '',
145
146        // 0, 1
147        index: false,
148
149        iframeMaxWidth: '100%',
150
151        download: true,
152        counter: true,
153        appendCounterTo: '.lg-toolbar',
154
155        swipeThreshold: 50,
156        enableSwipe: true,
157        enableDrag: true,
158
159        dynamic: false,
160        dynamicEl: [],
161        galleryId: 1
162    };
163
164    function Plugin(element, options) {
165
166        // Current lightGallery element
167        this.el = element;
168
169        // Current jquery element
170        this.$el = $(element);
171
172        // lightGallery settings
173        this.s = $.extend({}, defaults, options);
174
175        // When using dynamic mode, ensure dynamicEl is an array
176        if (this.s.dynamic && this.s.dynamicEl !== 'undefined' && this.s.dynamicEl.constructor === Array && !this.s.dynamicEl.length) {
177            throw ('When using dynamic mode, you must also define dynamicEl as an Array.');
178        }
179
180        // lightGallery modules
181        this.modules = {};
182
183        // false when lightgallery complete first slide;
184        this.lGalleryOn = false;
185
186        this.lgBusy = false;
187
188        // Timeout function for hiding controls;
189        this.hideBartimeout = false;
190
191        // To determine browser supports for touch events;
192        this.isTouch = ('ontouchstart' in document.documentElement);
193
194        // Disable hideControlOnEnd if sildeEndAnimation is true
195        if (this.s.slideEndAnimatoin) {
196            this.s.hideControlOnEnd = false;
197        }
198
199        // Gallery items
200        if (this.s.dynamic) {
201            this.$items = this.s.dynamicEl;
202        } else {
203            if (this.s.selector === 'this') {
204                this.$items = this.$el;
205            } else if (this.s.selector !== '') {
206                if (this.s.selectWithin) {
207                    this.$items = $(this.s.selectWithin).find(this.s.selector);
208                } else {
209                    this.$items = this.$el.find($(this.s.selector));
210                }
211            } else {
212                this.$items = this.$el.children();
213            }
214        }
215
216        // .lg-item
217        this.$slide = '';
218
219        // .lg-outer
220        this.$outer = '';
221
222        this.init();
223
224        return this;
225    }
226
227    Plugin.prototype.init = function() {
228
229        var _this = this;
230
231        // s.preload should not be more than $item.length
232        if (_this.s.preload > _this.$items.length) {
233            _this.s.preload = _this.$items.length;
234        }
235
236        // if dynamic option is enabled execute immediately
237        var _hash = window.location.hash;
238        if (_hash.indexOf('lg=' + this.s.galleryId) > 0) {
239
240            _this.index = parseInt(_hash.split('&slide=')[1], 10);
241
242            $('body').addClass('lg-from-hash');
243            if (!$('body').hasClass('lg-on')) {
244                setTimeout(function() {
245                    _this.build(_this.index);
246                    $('body').addClass('lg-on');
247                });
248            }
249        }
250
251        if (_this.s.dynamic) {
252
253            _this.$el.trigger('onBeforeOpen.lg');
254
255            _this.index = _this.s.index || 0;
256
257            // prevent accidental double execution
258            if (!$('body').hasClass('lg-on')) {
259                setTimeout(function() {
260                    _this.build(_this.index);
261                    $('body').addClass('lg-on');
262                });
263            }
264        } else {
265
266            // Using different namespace for click because click event should not unbind if selector is same object('this')
267            _this.$items.on('click.lgcustom', function(event) {
268
269                // For IE8
270                try {
271                    event.preventDefault();
272                    event.preventDefault();
273                } catch (er) {
274                    event.returnValue = false;
275                }
276
277                _this.$el.trigger('onBeforeOpen.lg');
278
279                _this.index = _this.s.index || _this.$items.index(this);
280
281                // prevent accidental double execution
282                if (!$('body').hasClass('lg-on')) {
283                    _this.build(_this.index);
284                    $('body').addClass('lg-on');
285                }
286            });
287        }
288
289    };
290
291    Plugin.prototype.build = function(index) {
292
293        var _this = this;
294
295        _this.structure();
296
297        // module constructor
298        $.each($.fn.lightGallery.modules, function(key) {
299            _this.modules[key] = new $.fn.lightGallery.modules[key](_this.el);
300        });
301
302        // initiate slide function
303        _this.slide(index, false, false);
304
305        if (_this.s.keyPress) {
306            _this.keyPress();
307        }
308
309        if (_this.$items.length > 1) {
310
311            _this.arrow();
312
313            setTimeout(function() {
314                _this.enableDrag();
315                _this.enableSwipe();
316            }, 50);
317
318            if (_this.s.mousewheel) {
319                _this.mousewheel();
320            }
321        }
322
323        _this.counter();
324
325        _this.closeGallery();
326
327        _this.$el.trigger('onAfterOpen.lg');
328
329        // Hide controllers if mouse doesn't move for some period
330        _this.$outer.on('mousemove.lg click.lg touchstart.lg', function() {
331
332            _this.$outer.removeClass('lg-hide-items');
333
334            clearTimeout(_this.hideBartimeout);
335
336            // Timeout will be cleared on each slide movement also
337            _this.hideBartimeout = setTimeout(function() {
338                _this.$outer.addClass('lg-hide-items');
339            }, _this.s.hideBarsDelay);
340
341        });
342
343    };
344
345    Plugin.prototype.structure = function() {
346        var list = '';
347        var controls = '';
348        var i = 0;
349        var subHtmlCont = '';
350        var template;
351        var _this = this;
352
353        $('body').append('<div class="lg-backdrop"></div>');
354        $('.lg-backdrop').css('transition-duration', this.s.backdropDuration + 'ms');
355
356        // Create gallery items
357        for (i = 0; i < this.$items.length; i++) {
358            list += '<div class="lg-item"></div>';
359        }
360
361        // Create controlls
362        if (this.s.controls && this.$items.length > 1) {
363            controls = '<div class="lg-actions">' +
364                '<div class="lg-prev lg-icon">' + this.s.prevHtml + '</div>' +
365                '<div class="lg-next lg-icon">' + this.s.nextHtml + '</div>' +
366                '</div>';
367        }
368
369        if (this.s.appendSubHtmlTo === '.lg-sub-html') {
370            subHtmlCont = '<div class="lg-sub-html"></div>';
371        }
372
373        template = '<div class="lg-outer ' + this.s.addClass + ' ' + this.s.startClass + '">' +
374            '<div class="lg" style="width:' + this.s.width + '; height:' + this.s.height + '">' +
375            '<div class="lg-inner">' + list + '</div>' +
376            '<div class="lg-toolbar group">' +
377            '<span class="lg-close lg-icon"></span>' +
378            '</div>' +
379            controls +
380            subHtmlCont +
381            '</div>' +
382            '</div>';
383
384        $('body').append(template);
385        this.$outer = $('.lg-outer');
386        this.$slide = this.$outer.find('.lg-item');
387
388        if (this.s.useLeft) {
389            this.$outer.addClass('lg-use-left');
390
391            // Set mode lg-slide if use left is true;
392            this.s.mode = 'lg-slide';
393        } else {
394            this.$outer.addClass('lg-use-css3');
395        }
396
397        // For fixed height gallery
398        _this.setTop();
399        $(window).on('resize.lg orientationchange.lg', function() {
400            setTimeout(function() {
401                _this.setTop();
402            }, 100);
403        });
404
405        // add class lg-current to remove initial transition
406        this.$slide.eq(this.index).addClass('lg-current');
407
408        // add Class for css support and transition mode
409        if (this.doCss()) {
410            this.$outer.addClass('lg-css3');
411        } else {
412            this.$outer.addClass('lg-css');
413
414            // Set speed 0 because no animation will happen if browser doesn't support css3
415            this.s.speed = 0;
416        }
417
418        this.$outer.addClass(this.s.mode);
419
420        if (this.s.enableDrag && this.$items.length > 1) {
421            this.$outer.addClass('lg-grab');
422        }
423
424        if (this.s.showAfterLoad) {
425            this.$outer.addClass('lg-show-after-load');
426        }
427
428        if (this.doCss()) {
429            var $inner = this.$outer.find('.lg-inner');
430            $inner.css('transition-timing-function', this.s.cssEasing);
431            $inner.css('transition-duration', this.s.speed + 'ms');
432        }
433
434        $('.lg-backdrop').addClass('in');
435
436        setTimeout(function() {
437            _this.$outer.addClass('lg-visible');
438        }, this.s.backdropDuration);
439
440        if (this.s.download) {
441            this.$outer.find('.lg-toolbar').append('<a id="lg-download" target="_blank" download class="lg-download lg-icon"></a>');
442        }
443
444        // Store the current scroll top value to scroll back after closing the gallery..
445        this.prevScrollTop = $(window).scrollTop();
446
447    };
448
449    // For fixed height gallery
450    Plugin.prototype.setTop = function() {
451        if (this.s.height !== '100%') {
452            var wH = $(window).height();
453            var top = (wH - parseInt(this.s.height, 10)) / 2;
454            var $lGallery = this.$outer.find('.lg');
455            if (wH >= parseInt(this.s.height, 10)) {
456                $lGallery.css('top', top + 'px');
457            } else {
458                $lGallery.css('top', '0px');
459            }
460        }
461    };
462
463    // Find css3 support
464    Plugin.prototype.doCss = function() {
465        // check for css animation support
466        var support = function() {
467            var transition = ['transition', 'MozTransition', 'WebkitTransition', 'OTransition', 'msTransition', 'KhtmlTransition'];
468            var root = document.documentElement;
469            var i = 0;
470            for (i = 0; i < transition.length; i++) {
471                if (transition[i] in root.style) {
472                    return true;
473                }
474            }
475        };
476
477        if (support()) {
478            return true;
479        }
480
481        return false;
482    };
483
484    /**
485     *  @desc Check the given src is video
486     *  @param {String} src
487     *  @return {Object} video type
488     *  Ex:{ youtube  :  ["//www.youtube.com/watch?v=c0asJgSyxcY", "c0asJgSyxcY"] }
489     */
490    Plugin.prototype.isVideo = function(src, index) {
491
492        var html;
493        if (this.s.dynamic) {
494            html = this.s.dynamicEl[index].html;
495        } else {
496            html = this.$items.eq(index).attr('data-html');
497        }
498
499        if (!src && html) {
500            return {
501                html5: true
502            };
503        }
504
505        var youtube = src.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i);
506        var vimeo = src.match(/\/\/(?:www\.)?vimeo.com\/([0-9a-z\-_]+)/i);
507        var dailymotion = src.match(/\/\/(?:www\.)?dai.ly\/([0-9a-z\-_]+)/i);
508
509        if (youtube) {
510            return {
511                youtube: youtube
512            };
513        } else if (vimeo) {
514            return {
515                vimeo: vimeo
516            };
517        } else if (dailymotion) {
518            return {
519                dailymotion: dailymotion
520            };
521        }
522    };
523
524    /**
525     *  @desc Create image counter
526     *  Ex: 1/10
527     */
528    Plugin.prototype.counter = function() {
529        if (this.s.counter) {
530            $(this.s.appendCounterTo).append('<div id="lg-counter"><span id="lg-counter-current">' + (parseInt(this.index, 10) + 1) + '</span> / <span id="lg-counter-all">' + this.$items.length + '</span></div>');
531        }
532    };
533
534    /**
535     *  @desc add sub-html into the slide
536     *  @param {Number} index - index of the slide
537     */
538    Plugin.prototype.addHtml = function(index) {
539        var subHtml = null;
540        var subHtmlUrl;
541        if (this.s.dynamic) {
542            if (this.s.dynamicEl[index].subHtmlUrl) {
543                subHtmlUrl = this.s.dynamicEl[index].subHtmlUrl;
544            } else {
545                subHtml = this.s.dynamicEl[index].subHtml;
546            }
547        } else {
548            if (this.$items.eq(index).attr('data-sub-html-url')) {
549                subHtmlUrl = this.$items.eq(index).attr('data-sub-html-url');
550            } else {
551                subHtml = this.$items.eq(index).attr('data-sub-html');
552            }
553        }
554
555        if (!subHtmlUrl) {
556            if (typeof subHtml !== 'undefined' && subHtml !== null) {
557
558                // get first letter of subhtml
559                // if first letter starts with . or # get the html form the jQuery object
560                var fL = subHtml.substring(0, 1);
561                if (fL === '.' || fL === '#') {
562                    subHtml = $(subHtml).html();
563                } else {
564                    subHtml = subHtml;
565                }
566            } else {
567                subHtml = '';
568            }
569        }
570
571        if (this.s.appendSubHtmlTo === '.lg-sub-html') {
572
573            if (subHtmlUrl) {
574                this.$outer.find(this.s.appendSubHtmlTo).load(subHtmlUrl);
575            } else {
576                this.$outer.find(this.s.appendSubHtmlTo).html(subHtml);
577            }
578
579        } else {
580
581            if (subHtmlUrl) {
582                this.$slide.eq(index).load(subHtmlUrl);
583            } else {
584                this.$slide.eq(index).append(subHtml);
585            }
586        }
587
588        // Add lg-empty-html class if title doesn't exist
589        if (typeof subHtml !== 'undefined' && subHtml !== null) {
590            if (subHtml === '') {
591                this.$outer.find(this.s.appendSubHtmlTo).addClass('lg-empty-html');
592            } else {
593                this.$outer.find(this.s.appendSubHtmlTo).removeClass('lg-empty-html');
594            }
595        }
596
597        this.$el.trigger('onAfterAppendSubHtml.lg', [index]);
598    };
599
600    /**
601     *  @desc Preload slides
602     *  @param {Number} index - index of the slide
603     */
604    Plugin.prototype.preload = function(index) {
605        var i = 1;
606        var j = 1;
607        for (i = 1; i <= this.s.preload; i++) {
608            if (i >= this.$items.length - index) {
609                break;
610            }
611
612            this.loadContent(index + i, false, 0);
613        }
614
615        for (j = 1; j <= this.s.preload; j++) {
616            if (index - j < 0) {
617                break;
618            }
619
620            this.loadContent(index - j, false, 0);
621        }
622    };
623
624    /**
625     *  @desc Load slide content into slide.
626     *  @param {Number} index - index of the slide.
627     *  @param {Boolean} rec - if true call loadcontent() function again.
628     *  @param {Boolean} delay - delay for adding complete class. it is 0 except first time.
629     */
630    Plugin.prototype.loadContent = function(index, rec, delay) {
631
632        var _this = this;
633        var _hasPoster = false;
634        var _$img;
635        var _src;
636        var _poster;
637        var _srcset;
638        var _sizes;
639        var _html;
640        var getResponsiveSrc = function(srcItms) {
641            var rsWidth = [];
642            var rsSrc = [];
643            for (var i = 0; i < srcItms.length; i++) {
644                var __src = srcItms[i].split(' ');
645
646                // Manage empty space
647                if (__src[0] === '') {
648                    __src.splice(0, 1);
649                }
650
651                rsSrc.push(__src[0]);
652                rsWidth.push(__src[1]);
653            }
654
655            var wWidth = $(window).width();
656            for (var j = 0; j < rsWidth.length; j++) {
657                if (parseInt(rsWidth[j], 10) > wWidth) {
658                    _src = rsSrc[j];
659                    break;
660                }
661            }
662        };
663
664        if (_this.s.dynamic) {
665
666            if (_this.s.dynamicEl[index].poster) {
667                _hasPoster = true;
668                _poster = _this.s.dynamicEl[index].poster;
669            }
670
671            _html = _this.s.dynamicEl[index].html;
672            _src = _this.s.dynamicEl[index].src;
673
674            if (_this.s.dynamicEl[index].responsive) {
675                var srcDyItms = _this.s.dynamicEl[index].responsive.split(',');
676                getResponsiveSrc(srcDyItms);
677            }
678
679            _srcset = _this.s.dynamicEl[index].srcset;
680            _sizes = _this.s.dynamicEl[index].sizes;
681
682        } else {
683
684            if (_this.$items.eq(index).attr('data-poster')) {
685                _hasPoster = true;
686                _poster = _this.$items.eq(index).attr('data-poster');
687            }
688
689            _html = _this.$items.eq(index).attr('data-html');
690            _src = _this.$items.eq(index).attr('href') || _this.$items.eq(index).attr('data-src');
691
692            if (_this.$items.eq(index).attr('data-responsive')) {
693                var srcItms = _this.$items.eq(index).attr('data-responsive').split(',');
694                getResponsiveSrc(srcItms);
695            }
696
697            _srcset = _this.$items.eq(index).attr('data-srcset');
698            _sizes = _this.$items.eq(index).attr('data-sizes');
699
700        }
701
702        //if (_src || _srcset || _sizes || _poster) {
703
704        var iframe = false;
705        if (_this.s.dynamic) {
706            if (_this.s.dynamicEl[index].iframe) {
707                iframe = true;
708            }
709        } else {
710            if (_this.$items.eq(index).attr('data-iframe') === 'true') {
711                iframe = true;
712            }
713        }
714
715        var _isVideo = _this.isVideo(_src, index);
716        if (!_this.$slide.eq(index).hasClass('lg-loaded')) {
717            if (iframe) {
718                _this.$slide.eq(index).prepend('<div class="lg-video-cont" style="max-width:' + _this.s.iframeMaxWidth + '"><div class="lg-video"><iframe class="lg-object" frameborder="0" src="' + _src + '"  allowfullscreen="true"></iframe></div></div>');
719            } else if (_hasPoster) {
720                var videoClass = '';
721                if (_isVideo && _isVideo.youtube) {
722                    videoClass = 'lg-has-youtube';
723                } else if (_isVideo && _isVideo.vimeo) {
724                    videoClass = 'lg-has-vimeo';
725                } else {
726                    videoClass = 'lg-has-html5';
727                }
728
729                _this.$slide.eq(index).prepend('<div class="lg-video-cont ' + videoClass + ' "><div class="lg-video"><span class="lg-video-play"></span><img class="lg-object lg-has-poster" src="' + _poster + '" /></div></div>');
730
731            } else if (_isVideo) {
732                _this.$slide.eq(index).prepend('<div class="lg-video-cont "><div class="lg-video"></div></div>');
733                _this.$el.trigger('hasVideo.lg', [index, _src, _html]);
734            } else {
735                _this.$slide.eq(index).prepend('<div class="lg-img-wrap"><img class="lg-object lg-image" src="' + _src + '" /></div>');
736            }
737
738            _this.$el.trigger('onAferAppendSlide.lg', [index]);
739
740            _$img = _this.$slide.eq(index).find('.lg-object');
741            if (_sizes) {
742                _$img.attr('sizes', _sizes);
743            }
744
745            if (_srcset) {
746                _$img.attr('srcset', _srcset);
747                try {
748                    picturefill({
749                        elements: [_$img[0]]
750                    });
751                } catch (e) {
752                    console.error('Make sure you have included Picturefill version 2');
753                }
754            }
755
756            if (this.s.appendSubHtmlTo !== '.lg-sub-html') {
757                _this.addHtml(index);
758            }
759
760            _this.$slide.eq(index).addClass('lg-loaded');
761        }
762
763        _this.$slide.eq(index).find('.lg-object').on('load.lg error.lg', function() {
764
765            // For first time add some delay for displaying the start animation.
766            var _speed = 0;
767
768            // Do not change the delay value because it is required for zoom plugin.
769            // If gallery opened from direct url (hash) speed value should be 0
770            if (delay && !$('body').hasClass('lg-from-hash')) {
771                _speed = delay;
772            }
773
774            setTimeout(function() {
775                _this.$slide.eq(index).addClass('lg-complete');
776                _this.$el.trigger('onSlideItemLoad.lg', [index, delay || 0]);
777            }, _speed);
778
779        });
780
781        // @todo check load state for html5 videos
782        if (_isVideo && _isVideo.html5 && !_hasPoster) {
783            _this.$slide.eq(index).addClass('lg-complete');
784        }
785
786        if (rec === true) {
787            if (!_this.$slide.eq(index).hasClass('lg-complete')) {
788                _this.$slide.eq(index).find('.lg-object').on('load.lg error.lg', function() {
789                    _this.preload(index);
790                });
791            } else {
792                _this.preload(index);
793            }
794        }
795
796        //}
797    };
798
799    /**
800    *   @desc slide function for lightgallery
801        ** Slide() gets call on start
802        ** ** Set lg.on true once slide() function gets called.
803        ** Call loadContent() on slide() function inside setTimeout
804        ** ** On first slide we do not want any animation like slide of fade
805        ** ** So on first slide( if lg.on if false that is first slide) loadContent() should start loading immediately
806        ** ** Else loadContent() should wait for the transition to complete.
807        ** ** So set timeout s.speed + 50
808    <=> ** loadContent() will load slide content in to the particular slide
809        ** ** It has recursion (rec) parameter. if rec === true loadContent() will call preload() function.
810        ** ** preload will execute only when the previous slide is fully loaded (images iframe)
811        ** ** avoid simultaneous image load
812    <=> ** Preload() will check for s.preload value and call loadContent() again accoring to preload value
813        ** loadContent()  <====> Preload();
814
815    *   @param {Number} index - index of the slide
816    *   @param {Boolean} fromTouch - true if slide function called via touch event or mouse drag
817    *   @param {Boolean} fromThumb - true if slide function called via thumbnail click
818    */
819    Plugin.prototype.slide = function(index, fromTouch, fromThumb) {
820
821        var _prevIndex = this.$outer.find('.lg-current').index();
822        var _this = this;
823
824        // Prevent if multiple call
825        // Required for hsh plugin
826        if (_this.lGalleryOn && (_prevIndex === index)) {
827            return;
828        }
829
830        var _length = this.$slide.length;
831        var _time = _this.lGalleryOn ? this.s.speed : 0;
832        var _next = false;
833        var _prev = false;
834
835        if (!_this.lgBusy) {
836
837            if (this.s.download) {
838                var _src;
839                if (_this.s.dynamic) {
840                    _src = _this.s.dynamicEl[index].downloadUrl !== false && (_this.s.dynamicEl[index].downloadUrl || _this.s.dynamicEl[index].src);
841                } else {
842                    _src = _this.$items.eq(index).attr('data-download-url') !== 'false' && (_this.$items.eq(index).attr('data-download-url') || _this.$items.eq(index).attr('href') || _this.$items.eq(index).attr('data-src'));
843
844                }
845
846                if (_src) {
847                    $('#lg-download').attr('href', _src);
848                    _this.$outer.removeClass('lg-hide-download');
849                } else {
850                    _this.$outer.addClass('lg-hide-download');
851                }
852            }
853
854            this.$el.trigger('onBeforeSlide.lg', [_prevIndex, index, fromTouch, fromThumb]);
855
856            _this.lgBusy = true;
857
858            clearTimeout(_this.hideBartimeout);
859
860            // Add title if this.s.appendSubHtmlTo === lg-sub-html
861            if (this.s.appendSubHtmlTo === '.lg-sub-html') {
862
863                // wait for slide animation to complete
864                setTimeout(function() {
865                    _this.addHtml(index);
866                }, _time);
867            }
868
869            this.arrowDisable(index);
870
871            if (!fromTouch) {
872
873                // remove all transitions
874                _this.$outer.addClass('lg-no-trans');
875
876                this.$slide.removeClass('lg-prev-slide lg-next-slide');
877
878                if (index < _prevIndex) {
879                    _prev = true;
880                    if ((index === 0) && (_prevIndex === _length - 1) && !fromThumb) {
881                        _prev = false;
882                        _next = true;
883                    }
884                } else if (index > _prevIndex) {
885                    _next = true;
886                    if ((index === _length - 1) && (_prevIndex === 0) && !fromThumb) {
887                        _prev = true;
888                        _next = false;
889                    }
890                }
891
892                if (_prev) {
893
894                    //prevslide
895                    this.$slide.eq(index).addClass('lg-prev-slide');
896                    this.$slide.eq(_prevIndex).addClass('lg-next-slide');
897                } else if (_next) {
898
899                    // next slide
900                    this.$slide.eq(index).addClass('lg-next-slide');
901                    this.$slide.eq(_prevIndex).addClass('lg-prev-slide');
902                }
903
904                // give 50 ms for browser to add/remove class
905                setTimeout(function() {
906                    _this.$slide.removeClass('lg-current');
907
908                    //_this.$slide.eq(_prevIndex).removeClass('lg-current');
909                    _this.$slide.eq(index).addClass('lg-current');
910
911                    // reset all transitions
912                    _this.$outer.removeClass('lg-no-trans');
913                }, 50);
914            } else {
915
916                var touchPrev = index - 1;
917                var touchNext = index + 1;
918
919                if ((index === 0) && (_prevIndex === _length - 1)) {
920
921                    // next slide
922                    touchNext = 0;
923                    touchPrev = _length - 1;
924                } else if ((index === _length - 1) && (_prevIndex === 0)) {
925
926                    // prev slide
927                    touchNext = 0;
928                    touchPrev = _length - 1;
929                }
930
931                this.$slide.removeClass('lg-prev-slide lg-current lg-next-slide');
932                _this.$slide.eq(touchPrev).addClass('lg-prev-slide');
933                _this.$slide.eq(touchNext).addClass('lg-next-slide');
934                _this.$slide.eq(index).addClass('lg-current');
935            }
936
937            if (_this.lGalleryOn) {
938                setTimeout(function() {
939                    _this.loadContent(index, true, 0);
940                }, this.s.speed + 50);
941
942                setTimeout(function() {
943                    _this.lgBusy = false;
944                    _this.$el.trigger('onAfterSlide.lg', [_prevIndex, index, fromTouch, fromThumb]);
945                }, this.s.speed);
946
947            } else {
948                _this.loadContent(index, true, _this.s.backdropDuration);
949
950                _this.lgBusy = false;
951                _this.$el.trigger('onAfterSlide.lg', [_prevIndex, index, fromTouch, fromThumb]);
952            }
953
954            _this.lGalleryOn = true;
955
956            if (this.s.counter) {
957                $('#lg-counter-current').text(index + 1);
958            }
959
960        }
961
962    };
963
964    /**
965     *  @desc Go to next slide
966     *  @param {Boolean} fromTouch - true if slide function called via touch event
967     */
968    Plugin.prototype.goToNextSlide = function(fromTouch) {
969        var _this = this;
970        if (!_this.lgBusy) {
971            if ((_this.index + 1) < _this.$slide.length) {
972                _this.index++;
973                _this.$el.trigger('onBeforeNextSlide.lg', [_this.index]);
974                _this.slide(_this.index, fromTouch, false);
975            } else {
976                if (_this.s.loop) {
977                    _this.index = 0;
978                    _this.$el.trigger('onBeforeNextSlide.lg', [_this.index]);
979                    _this.slide(_this.index, fromTouch, false);
980                } else if (_this.s.slideEndAnimatoin) {
981                    _this.$outer.addClass('lg-right-end');
982                    setTimeout(function() {
983                        _this.$outer.removeClass('lg-right-end');
984                    }, 400);
985                }
986            }
987        }
988    };
989
990    /**
991     *  @desc Go to previous slide
992     *  @param {Boolean} fromTouch - true if slide function called via touch event
993     */
994    Plugin.prototype.goToPrevSlide = function(fromTouch) {
995        var _this = this;
996        if (!_this.lgBusy) {
997            if (_this.index > 0) {
998                _this.index--;
999                _this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]);
1000                _this.slide(_this.index, fromTouch, false);
1001            } else {
1002                if (_this.s.loop) {
1003                    _this.index = _this.$items.length - 1;
1004                    _this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]);
1005                    _this.slide(_this.index, fromTouch, false);
1006                } else if (_this.s.slideEndAnimatoin) {
1007                    _this.$outer.addClass('lg-left-end');
1008                    setTimeout(function() {
1009                        _this.$outer.removeClass('lg-left-end');
1010                    }, 400);
1011                }
1012            }
1013        }
1014    };
1015
1016    Plugin.prototype.keyPress = function() {
1017        var _this = this;
1018        if (this.$items.length > 1) {
1019            $(window).on('keyup.lg', function(e) {
1020                if (_this.$items.length > 1) {
1021                    if (e.keyCode === 37) {
1022                        e.preventDefault();
1023                        _this.goToPrevSlide();
1024                    }
1025
1026                    if (e.keyCode === 39) {
1027                        e.preventDefault();
1028                        _this.goToNextSlide();
1029                    }
1030                }
1031            });
1032        }
1033
1034        $(window).on('keydown.lg', function(e) {
1035            if (_this.s.escKey === true && e.keyCode === 27) {
1036                e.preventDefault();
1037                if (!_this.$outer.hasClass('lg-thumb-open')) {
1038                    _this.destroy();
1039                } else {
1040                    _this.$outer.removeClass('lg-thumb-open');
1041                }
1042            }
1043        });
1044    };
1045
1046    Plugin.prototype.arrow = function() {
1047        var _this = this;
1048        this.$outer.find('.lg-prev').on('click.lg', function() {
1049            _this.goToPrevSlide();
1050        });
1051
1052        this.$outer.find('.lg-next').on('click.lg', function() {
1053            _this.goToNextSlide();
1054        });
1055    };
1056
1057    Plugin.prototype.arrowDisable = function(index) {
1058
1059        // Disable arrows if s.hideControlOnEnd is true
1060        if (!this.s.loop && this.s.hideControlOnEnd) {
1061            if ((index + 1) < this.$slide.length) {
1062                this.$outer.find('.lg-next').removeAttr('disabled').removeClass('disabled');
1063            } else {
1064                this.$outer.find('.lg-next').attr('disabled', 'disabled').addClass('disabled');
1065            }
1066
1067            if (index > 0) {
1068                this.$outer.find('.lg-prev').removeAttr('disabled').removeClass('disabled');
1069            } else {
1070                this.$outer.find('.lg-prev').attr('disabled', 'disabled').addClass('disabled');
1071            }
1072        }
1073    };
1074
1075    Plugin.prototype.setTranslate = function($el, xValue, yValue) {
1076        // jQuery supports Automatic CSS prefixing since jQuery 1.8.0
1077        if (this.s.useLeft) {
1078            $el.css('left', xValue);
1079        } else {
1080            $el.css({
1081                transform: 'translate3d(' + (xValue) + 'px, ' + yValue + 'px, 0px)'
1082            });
1083        }
1084    };
1085
1086    Plugin.prototype.touchMove = function(startCoords, endCoords) {
1087
1088        var distance = endCoords - startCoords;
1089
1090        if (Math.abs(distance) > 15) {
1091            // reset opacity and transition duration
1092            this.$outer.addClass('lg-dragging');
1093
1094            // move current slide
1095            this.setTranslate(this.$slide.eq(this.index), distance, 0);
1096
1097            // move next and prev slide with current slide
1098            this.setTranslate($('.lg-prev-slide'), -this.$slide.eq(this.index).width() + distance, 0);
1099            this.setTranslate($('.lg-next-slide'), this.$slide.eq(this.index).width() + distance, 0);
1100        }
1101    };
1102
1103    Plugin.prototype.touchEnd = function(distance) {
1104        var _this = this;
1105
1106        // keep slide animation for any mode while dragg/swipe
1107        if (_this.s.mode !== 'lg-slide') {
1108            _this.$outer.addClass('lg-slide');
1109        }
1110
1111        this.$slide.not('.lg-current, .lg-prev-slide, .lg-next-slide').css('opacity', '0');
1112
1113        // set transition duration
1114        setTimeout(function() {
1115            _this.$outer.removeClass('lg-dragging');
1116            if ((distance < 0) && (Math.abs(distance) > _this.s.swipeThreshold)) {
1117                _this.goToNextSlide(true);
1118            } else if ((distance > 0) && (Math.abs(distance) > _this.s.swipeThreshold)) {
1119                _this.goToPrevSlide(true);
1120            } else if (Math.abs(distance) < 5) {
1121
1122                // Trigger click if distance is less than 5 pix
1123                _this.$el.trigger('onSlideClick.lg');
1124            }
1125
1126            _this.$slide.removeAttr('style');
1127        });
1128
1129        // remove slide class once drag/swipe is completed if mode is not slide
1130        setTimeout(function() {
1131            if (!_this.$outer.hasClass('lg-dragging') && _this.s.mode !== 'lg-slide') {
1132                _this.$outer.removeClass('lg-slide');
1133            }
1134        }, _this.s.speed + 100);
1135
1136    };
1137
1138    Plugin.prototype.enableSwipe = function() {
1139        var _this = this;
1140        var startCoords = 0;
1141        var endCoords = 0;
1142        var isMoved = false;
1143
1144        if (_this.s.enableSwipe && _this.isTouch && _this.doCss()) {
1145
1146            _this.$slide.on('touchstart.lg', function(e) {
1147                if (!_this.$outer.hasClass('lg-zoomed') && !_this.lgBusy) {
1148                    e.preventDefault();
1149                    _this.manageSwipeClass();
1150                    startCoords = e.originalEvent.targetTouches[0].pageX;
1151                }
1152            });
1153
1154            _this.$slide.on('touchmove.lg', function(e) {
1155                if (!_this.$outer.hasClass('lg-zoomed')) {
1156                    e.preventDefault();
1157                    endCoords = e.originalEvent.targetTouches[0].pageX;
1158                    _this.touchMove(startCoords, endCoords);
1159                    isMoved = true;
1160                }
1161            });
1162
1163            _this.$slide.on('touchend.lg', function() {
1164                if (!_this.$outer.hasClass('lg-zoomed')) {
1165                    if (isMoved) {
1166                        isMoved = false;
1167                        _this.touchEnd(endCoords - startCoords);
1168                    } else {
1169                        _this.$el.trigger('onSlideClick.lg');
1170                    }
1171                }
1172            });
1173        }
1174
1175    };
1176
1177    Plugin.prototype.enableDrag = function() {
1178        var _this = this;
1179        var startCoords = 0;
1180        var endCoords = 0;
1181        var isDraging = false;
1182        var isMoved = false;
1183        if (_this.s.enableDrag && !_this.isTouch && _this.doCss()) {
1184            _this.$slide.on('mousedown.lg', function(e) {
1185                // execute only on .lg-object
1186                if (!_this.$outer.hasClass('lg-zoomed')) {
1187                    if ($(e.target).hasClass('lg-object') || $(e.target).hasClass('lg-video-play')) {
1188                        e.preventDefault();
1189
1190                        if (!_this.lgBusy) {
1191                            _this.manageSwipeClass();
1192                            startCoords = e.pageX;
1193                            isDraging = true;
1194
1195                            // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723
1196                            _this.$outer.scrollLeft += 1;
1197                            _this.$outer.scrollLeft -= 1;
1198
1199                            // *
1200
1201                            _this.$outer.removeClass('lg-grab').addClass('lg-grabbing');
1202
1203                            _this.$el.trigger('onDragstart.lg');
1204                        }
1205
1206                    }
1207                }
1208            });
1209
1210            $(window).on('mousemove.lg', function(e) {
1211                if (isDraging) {
1212                    isMoved = true;
1213                    endCoords = e.pageX;
1214                    _this.touchMove(startCoords, endCoords);
1215                    _this.$el.trigger('onDragmove.lg');
1216                }
1217            });
1218
1219            $(window).on('mouseup.lg', function(e) {
1220                if (isMoved) {
1221                    isMoved = false;
1222                    _this.touchEnd(endCoords - startCoords);
1223                    _this.$el.trigger('onDragend.lg');
1224                } else if ($(e.target).hasClass('lg-object') || $(e.target).hasClass('lg-video-play')) {
1225                    _this.$el.trigger('onSlideClick.lg');
1226                }
1227
1228                // Prevent execution on click
1229                if (isDraging) {
1230                    isDraging = false;
1231                    _this.$outer.removeClass('lg-grabbing').addClass('lg-grab');
1232                }
1233            });
1234
1235        }
1236    };
1237
1238    Plugin.prototype.manageSwipeClass = function() {
1239        var touchNext = this.index + 1;
1240        var touchPrev = this.index - 1;
1241        var length = this.$slide.length;
1242        if (this.s.loop) {
1243            if (this.index === 0) {
1244                touchPrev = length - 1;
1245            } else if (this.index === length - 1) {
1246                touchNext = 0;
1247            }
1248        }
1249
1250        this.$slide.removeClass('lg-next-slide lg-prev-slide');
1251        if (touchPrev > -1) {
1252            this.$slide.eq(touchPrev).addClass('lg-prev-slide');
1253        }
1254
1255        this.$slide.eq(touchNext).addClass('lg-next-slide');
1256    };
1257
1258    Plugin.prototype.mousewheel = function() {
1259        var _this = this;
1260        _this.$outer.on('mousewheel.lg', function(e) {
1261
1262            if (!e.deltaY) {
1263                return;
1264            }
1265
1266            if (e.deltaY > 0) {
1267                _this.goToPrevSlide();
1268            } else {
1269                _this.goToNextSlide();
1270            }
1271
1272            e.preventDefault();
1273        });
1274
1275    };
1276
1277    Plugin.prototype.closeGallery = function() {
1278
1279        var _this = this;
1280        var mousedown = false;
1281        this.$outer.find('.lg-close').on('click.lg', function() {
1282            _this.destroy();
1283        });
1284
1285        if (_this.s.closable) {
1286
1287            // If you drag the slide and release outside gallery gets close on chrome
1288            // for preventing this check mousedown and mouseup happened on .lg-item or lg-outer
1289            _this.$outer.on('mousedown.lg', function(e) {
1290
1291                if ($(e.target).is('.lg-outer') || $(e.target).is('.lg-item ') || $(e.target).is('.lg-img-wrap')) {
1292                    mousedown = true;
1293                } else {
1294                    mousedown = false;
1295
1296                }
1297
1298            });
1299
1300            _this.$outer.on('mouseup.lg', function(e) {
1301
1302                if ($(e.target).is('.lg-outer') || $(e.target).is('.lg-item ') || $(e.target).is('.lg-img-wrap') && mousedown) {
1303                    if (!_this.$outer.hasClass('lg-dragging')) {
1304                        _this.destroy();
1305                    }
1306                }
1307
1308            });
1309
1310        }
1311
1312    };
1313
1314    Plugin.prototype.destroy = function(d) {
1315
1316        var _this = this;
1317
1318        if (!d) {
1319            _this.$el.trigger('onBeforeClose.lg');
1320        }
1321
1322        $(window).scrollTop(_this.prevScrollTop);
1323
1324        /**
1325         * if d is false or undefined destroy will only close the gallery
1326         * plugins instance remains with the element
1327         *
1328         * if d is true destroy will completely remove the plugin
1329         */
1330
1331        if (d) {
1332            if (!_this.s.dynamic) {
1333                // only when not using dynamic mode is $items a jquery collection
1334                this.$items.off('click.lg click.lgcustom');
1335            }
1336
1337            $.removeData(_this.el, 'lightGallery');
1338        }
1339
1340        // Unbind all events added by lightGallery
1341        this.$el.off('.lg.tm');
1342
1343        // Distroy all lightGallery modules
1344        $.each($.fn.lightGallery.modules, function(key) {
1345            if (_this.modules[key]) {
1346                _this.modules[key].destroy();
1347            }
1348        });
1349
1350        this.lGalleryOn = false;
1351
1352        clearTimeout(_this.hideBartimeout);
1353        this.hideBartimeout = false;
1354        $(window).off('.lg');
1355        $('body').removeClass('lg-on lg-from-hash');
1356
1357        if (_this.$outer) {
1358            _this.$outer.removeClass('lg-visible');
1359        }
1360
1361        $('.lg-backdrop').removeClass('in');
1362
1363        setTimeout(function() {
1364            if (_this.$outer) {
1365                _this.$outer.remove();
1366            }
1367
1368            $('.lg-backdrop').remove();
1369
1370            if (!d) {
1371                _this.$el.trigger('onCloseAfter.lg');
1372            }
1373
1374        }, _this.s.backdropDuration + 50);
1375    };
1376
1377    $.fn.lightGallery = function(options) {
1378        return this.each(function() {
1379            if (!$.data(this, 'lightGallery')) {
1380                $.data(this, 'lightGallery', new Plugin(this, options));
1381            } else {
1382                try {
1383                    $(this).data('lightGallery').init();
1384                } catch (err) {
1385                    console.error('lightGallery has not initiated properly');
1386                }
1387            }
1388        });
1389    };
1390
1391    $.fn.lightGallery.modules = {};
1392
1393})(jQuery, window, document);
1394(function($, window, document, undefined) {
1395
1396    'use strict';
1397
1398    var defaults = {
1399        scale: 1,
1400        zoom: true,
1401        enableZoomAfter: 300
1402    };
1403
1404    var Zoom = function(element) {
1405
1406        this.core = $(element).data('lightGallery');
1407
1408        this.core.s = $.extend({}, defaults, this.core.s);
1409
1410        if (this.core.s.zoom && this.core.doCss()) {
1411            this.init();
1412
1413            // Store the zoomable timeout value just to clear it while closing
1414            this.zoomabletimeout = false;
1415
1416            // Set the initial value center
1417            this.pageX = $(window).width() / 2;
1418            this.pageY = ($(window).height() / 2) + $(window).scrollTop();
1419        }
1420
1421        return this;
1422    };
1423
1424    Zoom.prototype.init = function() {
1425
1426        var _this = this;
1427        var zoomIcons = '<span id="lg-zoom-in" class="lg-icon"></span><span id="lg-zoom-out" class="lg-icon"></span>';
1428
1429        this.core.$outer.find('.lg-toolbar').append(zoomIcons);
1430
1431        // Add zoomable class
1432        _this.core.$el.on('onSlideItemLoad.lg.tm.zoom', function(event, index, delay) {
1433
1434            // delay will be 0 except first time
1435            var _speed = _this.core.s.enableZoomAfter + delay;
1436
1437            // set _speed value 0 if gallery opened from direct url and if it is first slide
1438            if ($('body').hasClass('lg-from-hash') && delay) {
1439
1440                // will execute only once
1441                _speed = 0;
1442            } else {
1443
1444                // Remove lg-from-hash to enable starting animation.
1445                $('body').removeClass('lg-from-hash');
1446            }
1447
1448            _this.zoomabletimeout = setTimeout(function() {
1449                _this.core.$slide.eq(index).addClass('lg-zoomable');
1450            }, _speed + 30);
1451        });
1452
1453        var scale = 1;
1454        /**
1455         * @desc Image zoom
1456         * Translate the wrap and scale the image to get better user experience
1457         *
1458         * @param {String} scaleVal - Zoom decrement/increment value
1459         */
1460        var zoom = function(scaleVal) {
1461
1462            var $image = _this.core.$outer.find('.lg-current .lg-image');
1463            var _x;
1464            var _y;
1465
1466            // Find offset manually to avoid issue after zoom
1467            var offsetX = ($(window).width() - $image.width()) / 2;
1468            var offsetY = (($(window).height() - $image.height()) / 2) + $(window).scrollTop();
1469
1470            _x = _this.pageX - offsetX;
1471            _y = _this.pageY - offsetY;
1472
1473            var x = (scaleVal - 1) * (_x);
1474            var y = (scaleVal - 1) * (_y);
1475
1476            $image.css('transform', 'scale3d(' + scaleVal + ', ' + scaleVal + ', 1)').attr('data-scale', scaleVal);
1477
1478            $image.parent().css('transform', 'translate3d(-' + x + 'px, -' + y + 'px, 0)').attr('data-x', x).attr('data-y', y);
1479        };
1480
1481        var callScale = function() {
1482            if (scale > 1) {
1483                _this.core.$outer.addClass('lg-zoomed');
1484            } else {
1485                _this.resetZoom();
1486            }
1487
1488            if (scale < 1) {
1489                scale = 1;
1490            }
1491
1492            zoom(scale);
1493        };
1494
1495        var actualSize = function(event, $image, index) {
1496            var w = $image.width();
1497            var nw;
1498            if (_this.core.s.dynamic) {
1499                nw = _this.core.s.dynamicEl[index].width || $image[0].naturalWidth || w;
1500            } else {
1501                nw = _this.core.$items.eq(index).attr('data-width') || $image[0].naturalWidth || w;
1502            }
1503
1504            var _scale;
1505
1506            if (_this.core.$outer.hasClass('lg-zoomed')) {
1507                scale = 1;
1508            } else {
1509                if (nw > w) {
1510                    _scale = nw / w;
1511                    scale = _scale || 2;
1512                }
1513            }
1514
1515            _this.pageX = event.pageX || event.originalEvent.targetTouches[0].pageX;
1516            _this.pageY = event.pageY || event.originalEvent.targetTouches[0].pageY;
1517            callScale();
1518            setTimeout(function() {
1519                _this.core.$outer.removeClass('lg-grabbing').addClass('lg-grab');
1520            }, 10);
1521        };
1522
1523        var tapped = false;
1524
1525        // event triggered after appending slide content
1526        _this.core.$el.on('onAferAppendSlide.lg.tm.zoom', function(event, index) {
1527
1528            // Get the current element
1529            var $image = _this.core.$slide.eq(index).find('.lg-image');
1530
1531            $image.on('dblclick', function(event) {
1532                actualSize(event, $image, index);
1533            });
1534
1535            $image.on('touchstart', function(event) {
1536                if (!tapped) {
1537                    tapped = setTimeout(function() {
1538                        tapped = null;
1539                    }, 300);
1540                } else {
1541                    clearTimeout(tapped);
1542                    tapped = null;
1543                    actualSize(event, $image, index);
1544                }
1545
1546                event.preventDefault();
1547            });
1548
1549        });
1550
1551        // Update zoom on resize and orientationchange
1552        $(window).on('resize.lg.zoom scroll.lg.zoom orientationchange.lg.zoom', function() {
1553            _this.pageX = $(window).width() / 2;
1554            _this.pageY = ($(window).height() / 2) + $(window).scrollTop();
1555            zoom(scale);
1556        });
1557
1558        $('#lg-zoom-out').on('click.lg', function() {
1559            if (_this.core.$outer.find('.lg-current .lg-image').length) {
1560                scale -= _this.core.s.scale;
1561                callScale();
1562            }
1563        });
1564
1565        $('#lg-zoom-in').on('click.lg', function() {
1566            if (_this.core.$outer.find('.lg-current .lg-image').length) {
1567                scale += _this.core.s.scale;
1568                callScale();
1569            }
1570        });
1571
1572        // Reset zoom on slide change
1573        _this.core.$el.on('onBeforeSlide.lg.tm', function() {
1574            scale = 1;
1575            _this.resetZoom();
1576        });
1577
1578        // Drag option after zoom
1579        if (!_this.core.isTouch) {
1580            _this.zoomDrag();
1581        }
1582
1583        if (_this.core.isTouch) {
1584            _this.zoomSwipe();
1585        }
1586
1587    };
1588
1589    // Reset zoom effect
1590    Zoom.prototype.resetZoom = function() {
1591        this.core.$outer.removeClass('lg-zoomed');
1592        this.core.$slide.find('.lg-img-wrap').removeAttr('style data-x data-y');
1593        this.core.$slide.find('.lg-image').removeAttr('style data-scale');
1594
1595        // Reset pagx pagy values to center
1596        this.pageX = $(window).width() / 2;
1597        this.pageY = ($(window).height() / 2) + $(window).scrollTop();
1598    };
1599
1600    Zoom.prototype.zoomSwipe = function() {
1601        var _this = this;
1602        var startCoords = {};
1603        var endCoords = {};
1604        var isMoved = false;
1605
1606        // Allow x direction drag
1607        var allowX = false;
1608
1609        // Allow Y direction drag
1610        var allowY = false;
1611
1612        _this.core.$slide.on('touchstart.lg', function(e) {
1613
1614            if (_this.core.$outer.hasClass('lg-zoomed')) {
1615                var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object');
1616
1617                allowY = $image.outerHeight() * $image.attr('data-scale') > _this.core.$outer.find('.lg').height();
1618                allowX = $image.outerWidth() * $image.attr('data-scale') > _this.core.$outer.find('.lg').width();
1619                if ((allowX || allowY)) {
1620                    e.preventDefault();
1621                    startCoords = {
1622                        x: e.originalEvent.targetTouches[0].pageX,
1623                        y: e.originalEvent.targetTouches[0].pageY
1624                    };
1625                }
1626            }
1627
1628        });
1629
1630        _this.core.$slide.on('touchmove.lg', function(e) {
1631
1632            if (_this.core.$outer.hasClass('lg-zoomed')) {
1633
1634                var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap');
1635                var distanceX;
1636                var distanceY;
1637
1638                e.preventDefault();
1639                isMoved = true;
1640
1641                endCoords = {
1642                    x: e.originalEvent.targetTouches[0].pageX,
1643                    y: e.originalEvent.targetTouches[0].pageY
1644                };
1645
1646                // reset opacity and transition duration
1647                _this.core.$outer.addClass('lg-zoom-dragging');
1648
1649                if (allowY) {
1650                    distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y);
1651                } else {
1652                    distanceY = -Math.abs(_$el.attr('data-y'));
1653                }
1654
1655                if (allowX) {
1656                    distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x);
1657                } else {
1658                    distanceX = -Math.abs(_$el.attr('data-x'));
1659                }
1660
1661                _$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)');
1662
1663            }
1664
1665        });
1666
1667        _this.core.$slide.on('touchend.lg', function() {
1668            if (_this.core.$outer.hasClass('lg-zoomed')) {
1669                if (isMoved) {
1670                    isMoved = false;
1671                    _this.core.$outer.removeClass('lg-zoom-dragging');
1672                    _this.touchendZoom(startCoords, endCoords, allowX, allowY);
1673
1674                }
1675            }
1676        });
1677
1678    };
1679
1680    Zoom.prototype.zoomDrag = function() {
1681
1682        var _this = this;
1683        var startCoords = {};
1684        var endCoords = {};
1685        var isDraging = false;
1686        var isMoved = false;
1687
1688        // Allow x direction drag
1689        var allowX = false;
1690
1691        // Allow Y direction drag
1692        var allowY = false;
1693
1694        _this.core.$slide.on('mousedown.lg.zoom', function(e) {
1695
1696            // execute only on .lg-object
1697            var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object');
1698
1699            allowY = $image.outerHeight() * $image.attr('data-scale') > _this.core.$outer.find('.lg').height();
1700            allowX = $image.outerWidth() * $image.attr('data-scale') > _this.core.$outer.find('.lg').width();
1701
1702            if (_this.core.$outer.hasClass('lg-zoomed')) {
1703                if ($(e.target).hasClass('lg-object') && (allowX || allowY)) {
1704                    e.preventDefault();
1705                    startCoords = {
1706                        x: e.pageX,
1707                        y: e.pageY
1708                    };
1709
1710                    isDraging = true;
1711
1712                    // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723
1713                    _this.core.$outer.scrollLeft += 1;
1714                    _this.core.$outer.scrollLeft -= 1;
1715
1716                    _this.core.$outer.removeClass('lg-grab').addClass('lg-grabbing');
1717                }
1718            }
1719        });
1720
1721        $(window).on('mousemove.lg.zoom', function(e) {
1722            if (isDraging) {
1723                var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap');
1724                var distanceX;
1725                var distanceY;
1726
1727                isMoved = true;
1728                endCoords = {
1729                    x: e.pageX,
1730                    y: e.pageY
1731                };
1732
1733                // reset opacity and transition duration
1734                _this.core.$outer.addClass('lg-zoom-dragging');
1735
1736                if (allowY) {
1737                    distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y);
1738                } else {
1739                    distanceY = -Math.abs(_$el.attr('data-y'));
1740                }
1741
1742                if (allowX) {
1743                    distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x);
1744                } else {
1745                    distanceX = -Math.abs(_$el.attr('data-x'));
1746                }
1747
1748                _$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)');
1749            }
1750        });
1751
1752        $(window).on('mouseup.lg.zoom', function(e) {
1753
1754            if (isDraging) {
1755                isDraging = false;
1756                _this.core.$outer.removeClass('lg-zoom-dragging');
1757
1758                // Fix for chrome mouse move on click
1759                if (isMoved && ((startCoords.x !== endCoords.x) || (startCoords.y !== endCoords.y))) {
1760                    endCoords = {
1761                        x: e.pageX,
1762                        y: e.pageY
1763                    };
1764                    _this.touchendZoom(startCoords, endCoords, allowX, allowY);
1765
1766                }
1767
1768                isMoved = false;
1769            }
1770
1771            _this.core.$outer.removeClass('lg-grabbing').addClass('lg-grab');
1772
1773        });
1774    };
1775
1776    Zoom.prototype.touchendZoom = function(startCoords, endCoords, allowX, allowY) {
1777
1778        var _this = this;
1779        var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap');
1780        var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object');
1781        var distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x);
1782        var distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y);
1783        var minY = (_this.core.$outer.find('.lg').height() - $image.outerHeight()) / 2;
1784        var maxY = Math.abs(($image.outerHeight() * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').height() + minY);
1785        var minX = (_this.core.$outer.find('.lg').width() - $image.outerWidth()) / 2;
1786        var maxX = Math.abs(($image.outerWidth() * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').width() + minX);
1787
1788        if (allowY) {
1789            if (distanceY <= -maxY) {
1790                distanceY = -maxY;
1791            } else if (distanceY >= -minY) {
1792                distanceY = -minY;
1793            }
1794        }
1795
1796        if (allowX) {
1797            if (distanceX <= -maxX) {
1798                distanceX = -maxX;
1799            } else if (distanceX >= -minX) {
1800                distanceX = -minX;
1801            }
1802        }
1803
1804        if (allowY) {
1805            _$el.attr('data-y', Math.abs(distanceY));
1806        } else {
1807            distanceY = -Math.abs(_$el.attr('data-y'));
1808        }
1809
1810        if (allowX) {
1811            _$el.attr('data-x', Math.abs(distanceX));
1812        } else {
1813            distanceX = -Math.abs(_$el.attr('data-x'));
1814        }
1815
1816        _$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)');
1817    };
1818
1819    Zoom.prototype.destroy = function() {
1820
1821        var _this = this;
1822
1823        // Unbind all events added by lightGallery zoom plugin
1824        _this.core.$el.off('.lg.zoom');
1825        $(window).off('.lg.zoom');
1826        _this.core.$slide.off('.lg.zoom');
1827        _this.core.$el.off('.lg.tm.zoom');
1828        _this.resetZoom();
1829        clearTimeout(_this.zoomabletimeout);
1830        _this.zoomabletimeout = false;
1831    };
1832
1833    $.fn.lightGallery.modules.zoom = Zoom;
1834
1835})(jQuery, window, document);
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845/**
1846 * Owl carousel
1847 * @version 2.0.0
1848 * @author Bartosz Wojciechowski
1849 * @license The MIT License (MIT)
1850 * @todo Lazy Load Icon
1851 * @todo prevent animationend bubling
1852 * @todo itemsScaleUp
1853 * @todo Test Zepto
1854 * @todo stagePadding calculate wrong active classes
1855 */
1856;(function($, window, document, undefined) {
1857
1858	var drag, state, e;
1859
1860	/**
1861	 * Template for status information about drag and touch events.
1862	 * @private
1863	 */
1864	drag = {
1865		start: 0,
1866		startX: 0,
1867		startY: 0,
1868		current: 0,
1869		currentX: 0,
1870		currentY: 0,
1871		offsetX: 0,
1872		offsetY: 0,
1873		distance: null,
1874		startTime: 0,
1875		endTime: 0,
1876		updatedX: 0,
1877		targetEl: null
1878	};
1879
1880	/**
1881	 * Template for some status informations.
1882	 * @private
1883	 */
1884	state = {
1885		isTouch: false,
1886		isScrolling: false,
1887		isSwiping: false,
1888		direction: false,
1889		inMotion: false
1890	};
1891
1892	/**
1893	 * Event functions references.
1894	 * @private
1895	 */
1896	e = {
1897		_onDragStart: null,
1898		_onDragMove: null,
1899		_onDragEnd: null,
1900		_transitionEnd: null,
1901		_resizer: null,
1902		_responsiveCall: null,
1903		_goToLoop: null,
1904		_checkVisibile: null
1905	};
1906
1907	/**
1908	 * Creates a carousel.
1909	 * @class The Owl Carousel.
1910	 * @public
1911	 * @param {HTMLElement|jQuery} element - The element to create the carousel for.
1912	 * @param {Object} [options] - The options
1913	 */
1914	function Owl(element, options) {
1915
1916		/**
1917		 * Current settings for the carousel.
1918		 * @public
1919		 */
1920		this.settings = null;
1921
1922		/**
1923		 * Current options set by the caller including defaults.
1924		 * @public
1925		 */
1926		this.options = $.extend({}, Owl.Defaults, options);
1927
1928		/**
1929		 * Plugin element.
1930		 * @public
1931		 */
1932		this.$element = $(element);
1933
1934		/**
1935		 * Caches informations about drag and touch events.
1936		 */
1937		this.drag = $.extend({}, drag);
1938
1939		/**
1940		 * Caches some status informations.
1941		 * @protected
1942		 */
1943		this.state = $.extend({}, state);
1944
1945		/**
1946		 * @protected
1947		 * @todo Must be documented
1948		 */
1949		this.e = $.extend({}, e);
1950
1951		/**
1952		 * References to the running plugins of this carousel.
1953		 * @protected
1954		 */
1955		this._plugins = {};
1956
1957		/**
1958		 * Currently suppressed events to prevent them from beeing retriggered.
1959		 * @protected
1960		 */
1961		this._supress = {};
1962
1963		/**
1964		 * Absolute current position.
1965		 * @protected
1966		 */
1967		this._current = null;
1968
1969		/**
1970		 * Animation speed in milliseconds.
1971		 * @protected
1972		 */
1973		this._speed = null;
1974
1975		/**
1976		 * Coordinates of all items in pixel.
1977		 * @todo The name of this member is missleading.
1978		 * @protected
1979		 */
1980		this._coordinates = [];
1981
1982		/**
1983		 * Current breakpoint.
1984		 * @todo Real media queries would be nice.
1985		 * @protected
1986		 */
1987		this._breakpoint = null;
1988
1989		/**
1990		 * Current width of the plugin element.
1991		 */
1992		this._width = null;
1993
1994		/**
1995		 * All real items.
1996		 * @protected
1997		 */
1998		this._items = [];
1999
2000		/**
2001		 * All cloned items.
2002		 * @protected
2003		 */
2004		this._clones = [];
2005
2006		/**
2007		 * Merge values of all items.
2008		 * @todo Maybe this could be part of a plugin.
2009		 * @protected
2010		 */
2011		this._mergers = [];
2012
2013		/**
2014		 * Invalidated parts within the update process.
2015		 * @protected
2016		 */
2017		this._invalidated = {};
2018
2019		/**
2020		 * Ordered list of workers for the update process.
2021		 * @protected
2022		 */
2023		this._pipe = [];
2024
2025		$.each(Owl.Plugins, $.proxy(function(key, plugin) {
2026			this._plugins[key[0].toLowerCase() + key.slice(1)]
2027				= new plugin(this);
2028		}, this));
2029
2030		$.each(Owl.Pipe, $.proxy(function(priority, worker) {
2031			this._pipe.push({
2032				'filter': worker.filter,
2033				'run': $.proxy(worker.run, this)
2034			});
2035		}, this));
2036
2037		this.setup();
2038		this.initialize();
2039	}
2040
2041	/**
2042	 * Default options for the carousel.
2043	 * @public
2044	 */
2045	Owl.Defaults = {
2046		items: 3,
2047		loop: false,
2048		center: false,
2049
2050		mouseDrag: true,
2051		touchDrag: true,
2052		pullDrag: true,
2053		freeDrag: false,
2054
2055		margin: 0,
2056		stagePadding: 0,
2057
2058		merge: false,
2059		mergeFit: true,
2060		autoWidth: false,
2061
2062		startPosition: 0,
2063		rtl: false,
2064
2065		smartSpeed: 250,
2066		fluidSpeed: false,
2067		dragEndSpeed: false,
2068
2069		responsive: {},
2070		responsiveRefreshRate: 200,
2071		responsiveBaseElement: window,
2072		responsiveClass: false,
2073
2074		fallbackEasing: 'swing',
2075
2076		info: false,
2077
2078		nestedItemSelector: false,
2079		itemElement: 'div',
2080		stageElement: 'div',
2081
2082		// Classes and Names
2083		themeClass: 'owl-theme',
2084		baseClass: 'owl-carousel',
2085		itemClass: 'owl-item',
2086		centerClass: 'center',
2087		activeClass: 'active'
2088	};
2089
2090	/**
2091	 * Enumeration for width.
2092	 * @public
2093	 * @readonly
2094	 * @enum {String}
2095	 */
2096	Owl.Width = {
2097		Default: 'default',
2098		Inner: 'inner',
2099		Outer: 'outer'
2100	};
2101
2102	/**
2103	 * Contains all registered plugins.
2104	 * @public
2105	 */
2106	Owl.Plugins = {};
2107
2108	/**
2109	 * Update pipe.
2110	 */
2111	Owl.Pipe = [ {
2112		filter: [ 'width', 'items', 'settings' ],
2113		run: function(cache) {
2114			cache.current = this._items && this._items[this.relative(this._current)];
2115		}
2116	}, {
2117		filter: [ 'items', 'settings' ],
2118		run: function() {
2119			var cached = this._clones,
2120				clones = this.$stage.children('.cloned');
2121
2122			if (clones.length !== cached.length || (!this.settings.loop && cached.length > 0)) {
2123				this.$stage.children('.cloned').remove();
2124				this._clones = [];
2125			}
2126		}
2127	}, {
2128		filter: [ 'items', 'settings' ],
2129		run: function() {
2130			var i, n,
2131				clones = this._clones,
2132				items = this._items,
2133				delta = this.settings.loop ? clones.length - Math.max(this.settings.items * 2, 4) : 0;
2134
2135			for (i = 0, n = Math.abs(delta / 2); i < n; i++) {
2136				if (delta > 0) {
2137					this.$stage.children().eq(items.length + clones.length - 1).remove();
2138					clones.pop();
2139					this.$stage.children().eq(0).remove();
2140					clones.pop();
2141				} else {
2142					clones.push(clones.length / 2);
2143					this.$stage.append(items[clones[clones.length - 1]].clone().addClass('cloned'));
2144					clones.push(items.length - 1 - (clones.length - 1) / 2);
2145					this.$stage.prepend(items[clones[clones.length - 1]].clone().addClass('cloned'));
2146				}
2147			}
2148		}
2149	}, {
2150		filter: [ 'width', 'items', 'settings' ],
2151		run: function() {
2152			var rtl = (this.settings.rtl ? 1 : -1),
2153				width = (this.width() / this.settings.items).toFixed(3),
2154				coordinate = 0, merge, i, n;
2155
2156			this._coordinates = [];
2157			for (i = 0, n = this._clones.length + this._items.length; i < n; i++) {
2158				merge = this._mergers[this.relative(i)];
2159				merge = (this.settings.mergeFit && Math.min(merge, this.settings.items)) || merge;
2160				coordinate += (this.settings.autoWidth ? this._items[this.relative(i)].width() + this.settings.margin : width * merge) * rtl;
2161
2162				this._coordinates.push(coordinate);
2163			}
2164		}
2165	}, {
2166		filter: [ 'width', 'items', 'settings' ],
2167		run: function() {
2168			var i, n, width = (this.width() / this.settings.items).toFixed(3), css = {
2169				'width': Math.abs(this._coordinates[this._coordinates.length - 1]) + this.settings.stagePadding * 2,
2170				'padding-left': this.settings.stagePadding || '',
2171				'padding-right': this.settings.stagePadding || ''
2172			};
2173
2174			this.$stage.css(css);
2175
2176			css = { 'width': this.settings.autoWidth ? 'auto' : width - this.settings.margin };
2177			css[this.settings.rtl ? 'margin-left' : 'margin-right'] = this.settings.margin;
2178
2179			if (!this.settings.autoWidth && $.grep(this._mergers, function(v) { return v > 1 }).length > 0) {
2180				for (i = 0, n = this._coordinates.length; i < n; i++) {
2181					css.width = Math.abs(this._coordinates[i]) - Math.abs(this._coordinates[i - 1] || 0) - this.settings.margin;
2182					this.$stage.children().eq(i).css(css);
2183				}
2184			} else {
2185				this.$stage.children().css(css);
2186			}
2187		}
2188	}, {
2189		filter: [ 'width', 'items', 'settings' ],
2190		run: function(cache) {
2191			cache.current && this.reset(this.$stage.children().index(cache.current));
2192		}
2193	}, {
2194		filter: [ 'position' ],
2195		run: function() {
2196			this.animate(this.coordinates(this._current));
2197		}
2198	}, {
2199		filter: [ 'width', 'position', 'items', 'settings' ],
2200		run: function() {
2201			var rtl = this.settings.rtl ? 1 : -1,
2202				padding = this.settings.stagePadding * 2,
2203				begin = this.coordinates(this.current()) + padding,
2204				end = begin + this.width() * rtl,
2205				inner, outer, matches = [], i, n;
2206
2207			for (i = 0, n = this._coordinates.length; i < n; i++) {
2208				inner = this._coordinates[i - 1] || 0;
2209				outer = Math.abs(this._coordinates[i]) + padding * rtl;
2210
2211				if ((this.op(inner, '<=', begin) && (this.op(inner, '>', end)))
2212					|| (this.op(outer, '<', begin) && this.op(outer, '>', end))) {
2213					matches.push(i);
2214				}
2215			}
2216
2217			this.$stage.children('.' + this.settings.activeClass).removeClass(this.settings.activeClass);
2218			this.$stage.children(':eq(' + matches.join('), :eq(') + ')').addClass(this.settings.activeClass);
2219
2220			if (this.settings.center) {
2221				this.$stage.children('.' + this.settings.centerClass).removeClass(this.settings.centerClass);
2222				this.$stage.children().eq(this.current()).addClass(this.settings.centerClass);
2223			}
2224		}
2225	} ];
2226
2227	/**
2228	 * Initializes the carousel.
2229	 * @protected
2230	 */
2231	Owl.prototype.initialize = function() {
2232		this.trigger('initialize');
2233
2234		this.$element
2235			.addClass(this.settings.baseClass)
2236			.addClass(this.settings.themeClass)
2237			.toggleClass('owl-rtl', this.settings.rtl);
2238
2239		// check support
2240		this.browserSupport();
2241
2242		if (this.settings.autoWidth && this.state.imagesLoaded !== true) {
2243			var imgs, nestedSelector, width;
2244			imgs = this.$element.find('img');
2245			nestedSelector = this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector : undefined;
2246			width = this.$element.children(nestedSelector).width();
2247
2248			if (imgs.length && width <= 0) {
2249				this.preloadAutoWidthImages(imgs);
2250				return false;
2251			}
2252		}
2253
2254		this.$element.addClass('owl-loading');
2255
2256		// create stage
2257		this.$stage = $('<' + this.settings.stageElement + ' class="owl-stage"/>')
2258			.wrap('<div class="owl-stage-outer">');
2259
2260		// append stage
2261		this.$element.append(this.$stage.parent());
2262
2263		// append content
2264		this.replace(this.$element.children().not(this.$stage.parent()));
2265
2266		// set view width
2267		this._width = this.$element.width();
2268
2269		// update view
2270		this.refresh();
2271
2272		this.$element.removeClass('owl-loading').addClass('owl-loaded');
2273
2274		// attach generic events
2275		this.eventsCall();
2276
2277		// attach generic events
2278		this.internalEvents();
2279
2280		// attach custom control events
2281		this.addTriggerableEvents();
2282
2283		this.trigger('initialized');
2284	};
2285
2286	/**
2287	 * Setups the current settings.
2288	 * @todo Remove responsive classes. Why should adaptive designs be brought into IE8?
2289	 * @todo Support for media queries by using `matchMedia` would be nice.
2290	 * @public
2291	 */
2292	Owl.prototype.setup = function() {
2293		var viewport = this.viewport(),
2294			overwrites = this.options.responsive,
2295			match = -1,
2296			settings = null;
2297
2298		if (!overwrites) {
2299			settings = $.extend({}, this.options);
2300		} else {
2301			$.each(overwrites, function(breakpoint) {
2302				if (breakpoint <= viewport && breakpoint > match) {
2303					match = Number(breakpoint);
2304				}
2305			});
2306
2307			settings = $.extend({}, this.options, overwrites[match]);
2308			delete settings.responsive;
2309
2310			// responsive class
2311			if (settings.responsiveClass) {
2312				this.$element.attr('class', function(i, c) {
2313					return c.replace(/\b owl-responsive-\S+/g, '');
2314				}).addClass('owl-responsive-' + match);
2315			}
2316		}
2317
2318		if (this.settings === null || this._breakpoint !== match) {
2319			this.trigger('change', { property: { name: 'settings', value: settings } });
2320			this._breakpoint = match;
2321			this.settings = settings;
2322			this.invalidate('settings');
2323			this.trigger('changed', { property: { name: 'settings', value: this.settings } });
2324		}
2325	};
2326
2327	/**
2328	 * Updates option logic if necessery.
2329	 * @protected
2330	 */
2331	Owl.prototype.optionsLogic = function() {
2332		// Toggle Center class
2333		this.$element.toggleClass('owl-center', this.settings.center);
2334
2335		// if items number is less than in body
2336		if (this.settings.loop && this._items.length < this.settings.items) {
2337			this.settings.loop = false;
2338		}
2339
2340		if (this.settings.autoWidth) {
2341			this.settings.stagePadding = false;
2342			this.settings.merge = false;
2343		}
2344	};
2345
2346	/**
2347	 * Prepares an item before add.
2348	 * @todo Rename event parameter `content` to `item`.
2349	 * @protected
2350	 * @returns {jQuery|HTMLElement} - The item container.
2351	 */
2352	Owl.prototype.prepare = function(item) {
2353		var event = this.trigger('prepare', { content: item });
2354
2355		if (!event.data) {
2356			event.data = $('<' + this.settings.itemElement + '/>')
2357				.addClass(this.settings.itemClass).append(item)
2358		}
2359
2360		this.trigger('prepared', { content: event.data });
2361
2362		return event.data;
2363	};
2364
2365	/**
2366	 * Updates the view.
2367	 * @public
2368	 */
2369	Owl.prototype.update = function() {
2370		var i = 0,
2371			n = this._pipe.length,
2372			filter = $.proxy(function(p) { return this[p] }, this._invalidated),
2373			cache = {};
2374
2375		while (i < n) {
2376			if (this._invalidated.all || $.grep(this._pipe[i].filter, filter).length > 0) {
2377				this._pipe[i].run(cache);
2378			}
2379			i++;
2380		}
2381
2382		this._invalidated = {};
2383	};
2384
2385	/**
2386	 * Gets the width of the view.
2387	 * @public
2388	 * @param {Owl.Width} [dimension=Owl.Width.Default] - The dimension to return.
2389	 * @returns {Number} - The width of the view in pixel.
2390	 */
2391	Owl.prototype.width = function(dimension) {
2392		dimension = dimension || Owl.Width.Default;
2393		switch (dimension) {
2394			case Owl.Width.Inner:
2395			case Owl.Width.Outer:
2396				return this._width;
2397			default:
2398				return this._width - this.settings.stagePadding * 2 + this.settings.margin;
2399		}
2400	};
2401
2402	/**
2403	 * Refreshes the carousel primarily for adaptive purposes.
2404	 * @public
2405	 */
2406	Owl.prototype.refresh = function() {
2407		if (this._items.length === 0) {
2408			return false;
2409		}
2410
2411		var start = new Date().getTime();
2412
2413		this.trigger('refresh');
2414
2415		this.setup();
2416
2417		this.optionsLogic();
2418
2419		// hide and show methods helps here to set a proper widths,
2420		// this prevents scrollbar to be calculated in stage width
2421		this.$stage.addClass('owl-refresh');
2422
2423		this.update();
2424
2425		this.$stage.removeClass('owl-refresh');
2426
2427		this.state.orientation = window.orientation;
2428
2429		this.watchVisibility();
2430
2431		this.trigger('refreshed');
2432	};
2433
2434	/**
2435	 * Save internal event references and add event based functions.
2436	 * @protected
2437	 */
2438	Owl.prototype.eventsCall = function() {
2439		// Save events references
2440		this.e._onDragStart = $.proxy(function(e) {
2441			this.onDragStart(e);
2442		}, this);
2443		this.e._onDragMove = $.proxy(function(e) {
2444			this.onDragMove(e);
2445		}, this);
2446		this.e._onDragEnd = $.proxy(function(e) {
2447			this.onDragEnd(e);
2448		}, this);
2449		this.e._onResize = $.proxy(function(e) {
2450			this.onResize(e);
2451		}, this);
2452		this.e._transitionEnd = $.proxy(function(e) {
2453			this.transitionEnd(e);
2454		}, this);
2455		this.e._preventClick = $.proxy(function(e) {
2456			this.preventClick(e);
2457		}, this);
2458	};
2459
2460	/**
2461	 * Checks window `resize` event.
2462	 * @protected
2463	 */
2464	Owl.prototype.onThrottledResize = function() {
2465		window.clearTimeout(this.resizeTimer);
2466		this.resizeTimer = window.setTimeout(this.e._onResize, this.settings.responsiveRefreshRate);
2467	};
2468
2469	/**
2470	 * Checks window `resize` event.
2471	 * @protected
2472	 */
2473	Owl.prototype.onResize = function() {
2474		if (!this._items.length) {
2475			return false;
2476		}
2477
2478		if (this._width === this.$element.width()) {
2479			return false;
2480		}
2481
2482		if (this.trigger('resize').isDefaultPrevented()) {
2483			return false;
2484		}
2485
2486		this._width = this.$element.width();
2487
2488		this.invalidate('width');
2489
2490		this.refresh();
2491
2492		this.trigger('resized');
2493	};
2494
2495	/**
2496	 * Checks for touch/mouse drag event type and add run event handlers.
2497	 * @protected
2498	 */
2499	Owl.prototype.eventsRouter = function(event) {
2500		var type = event.type;
2501
2502		if (type === "mousedown" || type === "touchstart") {
2503			this.onDragStart(event);
2504		} else if (type === "mousemove" || type === "touchmove") {
2505			this.onDragMove(event);
2506		} else if (type === "mouseup" || type === "touchend") {
2507			this.onDragEnd(event);
2508		} else if (type === "touchcancel") {
2509			this.onDragEnd(event);
2510		}
2511	};
2512
2513	/**
2514	 * Checks for touch/mouse drag options and add necessery event handlers.
2515	 * @protected
2516	 */
2517	Owl.prototype.internalEvents = function() {
2518		var isTouch = isTouchSupport(),
2519			isTouchIE = isTouchSupportIE();
2520
2521		if (this.settings.mouseDrag){
2522			this.$stage.on('mousedown', $.proxy(function(event) { this.eventsRouter(event) }, this));
2523			this.$stage.on('dragstart', function() { return false });
2524			this.$stage.get(0).onselectstart = function() { return false };
2525		} else {
2526			this.$element.addClass('owl-text-select-on');
2527		}
2528
2529		if (this.settings.touchDrag && !isTouchIE){
2530			this.$stage.on('touchstart touchcancel', $.proxy(function(event) { this.eventsRouter(event) }, this));
2531		}
2532
2533		// catch transitionEnd event
2534		if (this.transitionEndVendor) {
2535			this.on(this.$stage.get(0), this.transitionEndVendor, this.e._transitionEnd, false);
2536		}
2537
2538		// responsive
2539		if (this.settings.responsive !== false) {
2540			this.on(window, 'resize', $.proxy(this.onThrottledResize, this));
2541		}
2542	};
2543
2544	/**
2545	 * Handles touchstart/mousedown event.
2546	 * @protected
2547	 * @param {Event} event - The event arguments.
2548	 */
2549	Owl.prototype.onDragStart = function(event) {
2550		var ev, isTouchEvent, pageX, pageY, animatedPos;
2551
2552		ev = event.originalEvent || event || window.event;
2553
2554		// prevent right click
2555		if (ev.which === 3 || this.state.isTouch) {
2556			return false;
2557		}
2558
2559		if (ev.type === 'mousedown') {
2560			this.$stage.addClass('owl-grab');
2561		}
2562
2563		this.trigger('drag');
2564		this.drag.startTime = new Date().getTime();
2565		this.speed(0);
2566		this.state.isTouch = true;
2567		this.state.isScrolling = false;
2568		this.state.isSwiping = false;
2569		this.drag.distance = 0;
2570
2571		pageX = getTouches(ev).x;
2572		pageY = getTouches(ev).y;
2573
2574		// get stage position left
2575		this.drag.offsetX = this.$stage.position().left;
2576		this.drag.offsetY = this.$stage.position().top;
2577
2578		if (this.settings.rtl) {
2579			this.drag.offsetX = this.$stage.position().left + this.$stage.width() - this.width()
2580				+ this.settings.margin;
2581		}
2582
2583		// catch position // ie to fix
2584		if (this.state.inMotion && this.support3d) {
2585			animatedPos = this.getTransformProperty();
2586			this.drag.offsetX = animatedPos;
2587			this.animate(animatedPos);
2588			this.state.inMotion = true;
2589		} else if (this.state.inMotion && !this.support3d) {
2590			this.state.inMotion = false;
2591			return false;
2592		}
2593
2594		this.drag.startX = pageX - this.drag.offsetX;
2595		this.drag.startY = pageY - this.drag.offsetY;
2596
2597		this.drag.start = pageX - this.drag.startX;
2598		this.drag.targetEl = ev.target || ev.srcElement;
2599		this.drag.updatedX = this.drag.start;
2600
2601		// to do/check
2602		// prevent links and images dragging;
2603		if (this.drag.targetEl.tagName === "IMG" || this.drag.targetEl.tagName === "A") {
2604			this.drag.targetEl.draggable = false;
2605		}
2606
2607		$(document).on('mousemove.owl.dragEvents mouseup.owl.dragEvents touchmove.owl.dragEvents touchend.owl.dragEvents', $.proxy(function(event) {this.eventsRouter(event)},this));
2608	};
2609
2610	/**
2611	 * Handles the touchmove/mousemove events.
2612	 * @todo Simplify
2613	 * @protected
2614	 * @param {Event} event - The event arguments.
2615	 */
2616	Owl.prototype.onDragMove = function(event) {
2617		var ev, isTouchEvent, pageX, pageY, minValue, maxValue, pull;
2618
2619		if (!this.state.isTouch) {
2620			return;
2621		}
2622
2623		if (this.state.isScrolling) {
2624			return;
2625		}
2626
2627		ev = event.originalEvent || event || window.event;
2628
2629		pageX = getTouches(ev).x;
2630		pageY = getTouches(ev).y;
2631
2632		// Drag Direction
2633		this.drag.currentX = pageX - this.drag.startX;
2634		this.drag.currentY = pageY - this.drag.startY;
2635		this.drag.distance = this.drag.currentX - this.drag.offsetX;
2636
2637		// Check move direction
2638		if (this.drag.distance < 0) {
2639			this.state.direction = this.settings.rtl ? 'right' : 'left';
2640		} else if (this.drag.distance > 0) {
2641			this.state.direction = this.settings.rtl ? 'left' : 'right';
2642		}
2643		// Loop
2644		if (this.settings.loop) {
2645			if (this.op(this.drag.currentX, '>', this.coordinates(this.minimum())) && this.state.direction === 'right') {
2646				this.drag.currentX -= (this.settings.center && this.coordinates(0)) - this.coordinates(this._items.length);
2647			} else if (this.op(this.drag.currentX, '<', this.coordinates(this.maximum())) && this.state.direction === 'left') {
2648				this.drag.currentX += (this.settings.center && this.coordinates(0)) - this.coordinates(this._items.length);
2649			}
2650		} else {
2651			// pull
2652			minValue = this.settings.rtl ? this.coordinates(this.maximum()) : this.coordinates(this.minimum());
2653			maxValue = this.settings.rtl ? this.coordinates(this.minimum()) : this.coordinates(this.maximum());
2654			pull = this.settings.pullDrag ? this.drag.distance / 5 : 0;
2655			this.drag.currentX = Math.max(Math.min(this.drag.currentX, minValue + pull), maxValue + pull);
2656		}
2657
2658		// Lock browser if swiping horizontal
2659
2660		if ((this.drag.distance > 8 || this.drag.distance < -8)) {
2661			if (ev.preventDefault !== undefined) {
2662				ev.preventDefault();
2663			} else {
2664				ev.returnValue = false;
2665			}
2666			this.state.isSwiping = true;
2667		}
2668
2669		this.drag.updatedX = this.drag.currentX;
2670
2671		// Lock Owl if scrolling
2672		if ((this.drag.currentY > 16 || this.drag.currentY < -16) && this.state.isSwiping === false) {
2673			this.state.isScrolling = true;
2674			this.drag.updatedX = this.drag.start;
2675		}
2676
2677		this.animate(this.drag.updatedX);
2678	};
2679
2680	/**
2681	 * Handles the touchend/mouseup events.
2682	 * @protected
2683	 */
2684	Owl.prototype.onDragEnd = function(event) {
2685		var compareTimes, distanceAbs, closest;
2686
2687		if (!this.state.isTouch) {
2688			return;
2689		}
2690
2691		if (event.type === 'mouseup') {
2692			this.$stage.removeClass('owl-grab');
2693		}
2694
2695		this.trigger('dragged');
2696
2697		// prevent links and images dragging;
2698		this.drag.targetEl.removeAttribute("draggable");
2699
2700		// remove drag event listeners
2701
2702		this.state.isTouch = false;
2703		this.state.isScrolling = false;
2704		this.state.isSwiping = false;
2705
2706		// to check
2707		if (this.drag.distance === 0 && this.state.inMotion !== true) {
2708			this.state.inMotion = false;
2709			return false;
2710		}
2711
2712		// prevent clicks while scrolling
2713
2714		this.drag.endTime = new Date().getTime();
2715		compareTimes = this.drag.endTime - this.drag.startTime;
2716		distanceAbs = Math.abs(this.drag.distance);
2717
2718		// to test
2719		if (distanceAbs > 3 || compareTimes > 300) {
2720			this.removeClick(this.drag.targetEl);
2721		}
2722
2723		closest = this.closest(this.drag.updatedX);
2724
2725		this.speed(this.settings.dragEndSpeed || this.settings.smartSpeed);
2726		this.current(closest);
2727		this.invalidate('position');
2728		this.update();
2729
2730		// if pullDrag is off then fire transitionEnd event manually when stick
2731		// to border
2732		if (!this.settings.pullDrag && this.drag.updatedX === this.coordinates(closest)) {
2733			this.transitionEnd();
2734		}
2735
2736		this.drag.distance = 0;
2737
2738		$(document).off('.owl.dragEvents');
2739	};
2740
2741	/**
2742	 * Attaches `preventClick` to disable link while swipping.
2743	 * @protected
2744	 * @param {HTMLElement} [target] - The target of the `click` event.
2745	 */
2746	Owl.prototype.removeClick = function(target) {
2747		this.drag.targetEl = target;
2748		$(target).on('click.preventClick', this.e._preventClick);
2749		// to make sure click is removed:
2750		window.setTimeout(function() {
2751			$(target).off('click.preventClick');
2752		}, 300);
2753	};
2754
2755	/**
2756	 * Suppresses click event.
2757	 * @protected
2758	 * @param {Event} ev - The event arguments.
2759	 */
2760	Owl.prototype.preventClick = function(ev) {
2761		if (ev.preventDefault) {
2762			ev.preventDefault();
2763		} else {
2764			ev.returnValue = false;
2765		}
2766		if (ev.stopPropagation) {
2767			ev.stopPropagation();
2768		}
2769		$(ev.target).off('click.preventClick');
2770	};
2771
2772	/**
2773	 * Catches stage position while animate (only CSS3).
2774	 * @protected
2775	 * @returns
2776	 */
2777	Owl.prototype.getTransformProperty = function() {
2778		var transform, matrix3d;
2779
2780		transform = window.getComputedStyle(this.$stage.get(0), null).getPropertyValue(this.vendorName + 'transform');
2781		// var transform = this.$stage.css(this.vendorName + 'transform')
2782		transform = transform.replace(/matrix(3d)?\(|\)/g, '').split(',');
2783		matrix3d = transform.length === 16;
2784
2785		return matrix3d !== true ? transform[4] : transform[12];
2786	};
2787
2788	/**
2789	 * Gets absolute position of the closest item for a coordinate.
2790	 * @todo Setting `freeDrag` makes `closest` not reusable. See #165.
2791	 * @protected
2792	 * @param {Number} coordinate - The coordinate in pixel.
2793	 * @return {Number} - The absolute position of the closest item.
2794	 */
2795	Owl.prototype.closest = function(coordinate) {
2796		var position = -1, pull = 30, width = this.width(), coordinates = this.coordinates();
2797
2798		if (!this.settings.freeDrag) {
2799			// check closest item
2800			$.each(coordinates, $.proxy(function(index, value) {
2801				if (coordinate > value - pull && coordinate < value + pull) {
2802					position = index;
2803				} else if (this.op(coordinate, '<', value)
2804					&& this.op(coordinate, '>', coordinates[index + 1] || value - width)) {
2805					position = this.state.direction === 'left' ? index + 1 : index;
2806				}
2807				return position === -1;
2808			}, this));
2809		}
2810
2811		if (!this.settings.loop) {
2812			// non loop boundries
2813			if (this.op(coordinate, '>', coordinates[this.minimum()])) {
2814				position = coordinate = this.minimum();
2815			} else if (this.op(coordinate, '<', coordinates[this.maximum()])) {
2816				position = coordinate = this.maximum();
2817			}
2818		}
2819
2820		return position;
2821	};
2822
2823	/**
2824	 * Animates the stage.
2825	 * @public
2826	 * @param {Number} coordinate - The coordinate in pixels.
2827	 */
2828	Owl.prototype.animate = function(coordinate) {
2829		this.trigger('translate');
2830		this.state.inMotion = this.speed() > 0;
2831
2832		if (this.support3d) {
2833			this.$stage.css({
2834				transform: 'translate3d(' + coordinate + 'px' + ',0px, 0px)',
2835				transition: (this.speed() / 1000) + 's'
2836			});
2837		} else if (this.state.isTouch) {
2838			this.$stage.css({
2839				left: coordinate + 'px'
2840			});
2841		} else {
2842			this.$stage.animate({
2843				left: coordinate
2844			}, this.speed() / 1000, this.settings.fallbackEasing, $.proxy(function() {
2845				if (this.state.inMotion) {
2846					this.transitionEnd();
2847				}
2848			}, this));
2849		}
2850	};
2851
2852	/**
2853	 * Sets the absolute position of the current item.
2854	 * @public
2855	 * @param {Number} [position] - The new absolute position or nothing to leave it unchanged.
2856	 * @returns {Number} - The absolute position of the current item.
2857	 */
2858	Owl.prototype.current = function(position) {
2859		if (position === undefined) {
2860			return this._current;
2861		}
2862
2863		if (this._items.length === 0) {
2864			return undefined;
2865		}
2866
2867		position = this.normalize(position);
2868
2869		if (this._current !== position) {
2870			var event = this.trigger('change', { property: { name: 'position', value: position } });
2871
2872			if (event.data !== undefined) {
2873				position = this.normalize(event.data);
2874			}
2875
2876			this._current = position;
2877
2878			this.invalidate('position');
2879
2880			this.trigger('changed', { property: { name: 'position', value: this._current } });
2881		}
2882
2883		return this._current;
2884	};
2885
2886	/**
2887	 * Invalidates the given part of the update routine.
2888	 * @param {String}
2888 part - The part to invalidate.
2889	 */
2890	Owl.prototype.invalidate = function(part) {
2891		this._invalidated[part] = true;
2892	}
2893
2894	/**
2895	 * Resets the absolute position of the current item.
2896	 * @public
2897	 * @param {Number} position - The absolute position of the new item.
2898	 */
2899	Owl.prototype.reset = function(position) {
2900		position = this.normalize(position);
2901
2902		if (position === undefined) {
2903			return;
2904		}
2905
2906		this._speed = 0;
2907		this._current = position;
2908
2909		this.suppress([ 'translate', 'translated' ]);
2910
2911		this.animate(this.coordinates(position));
2912
2913		this.release([ 'translate', 'translated' ]);
2914	};
2915
2916	/**
2917	 * Normalizes an absolute or a relative position for an item.
2918	 * @public
2919	 * @param {Number} position - The absolute or relative position to normalize.
2920	 * @param {Boolean} [relative=false] - Whether the given position is relative or not.
2921	 * @returns {Number} - The normalized position.
2922	 */
2923	Owl.prototype.normalize = function(position, relative) {
2924		var n = (relative ? this._items.length : this._items.length + this._clones.length);
2925
2926		if (!$.isNumeric(position) || n < 1) {
2927			return undefined;
2928		}
2929
2930		if (this._clones.length) {
2931			position = ((position % n) + n) % n;
2932		} else {
2933			position = Math.max(this.minimum(relative), Math.min(this.maximum(relative), position));
2934		}
2935
2936		return position;
2937	};
2938
2939	/**
2940	 * Converts an absolute position for an item into a relative position.
2941
2942
2943	 * @public
2944	 * @param {Number} position - The absolute position to convert.
2945	 * @returns {Number} - The converted position.
2946	 */
2947	Owl.prototype.relative = function(position) {
2948		position = this.normalize(position);
2949		position = position - this._clones.length / 2;
2950		return this.normalize(position, true);
2951	};
2952
2953	/**
2954	 * Gets the maximum position for an item.
2955	 * @public
2956	 * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position.
2957	 * @returns {Number}
2958	 */
2959	Owl.prototype.maximum = function(relative) {
2960		var maximum, width, i = 0, coordinate,
2961			settings = this.settings;
2962
2963		if (relative) {
2964			return this._items.length - 1;
2965		}
2966
2967		if (!settings.loop && settings.center) {
2968			maximum = this._items.length - 1;
2969		} else if (!settings.loop && !settings.center) {
2970			maximum = this._items.length - settings.items;
2971		} else if (settings.loop || settings.center) {
2972			maximum = this._items.length + settings.items;
2973		} else if (settings.autoWidth || settings.merge) {
2974			revert = settings.rtl ? 1 : -1;
2975			width = this.$stage.width() - this.$element.width();
2976			while (coordinate = this.coordinates(i)) {
2977				if (coordinate * revert >= width) {
2978					break;
2979				}
2980				maximum = ++i;
2981			}
2982		} else {
2983			throw 'Can not detect maximum absolute position.'
2984		}
2985
2986		return maximum;
2987	};
2988
2989	/**
2990	 * Gets the minimum position for an item.
2991	 * @public
2992	 * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position.
2993	 * @returns {Number}
2994	 */
2995	Owl.prototype.minimum = function(relative) {
2996		if (relative) {
2997			return 0;
2998		}
2999
3000		return this._clones.length / 2;
3001	};
3002
3003	/**
3004	 * Gets an item at the specified relative position.
3005	 * @public
3006	 * @param {Number} [position] - The relative position of the item.
3007	 * @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given.
3008	 */
3009	Owl.prototype.items = function(position) {
3010		if (position === undefined) {
3011			return this._items.slice();
3012		}
3013
3014		position = this.normalize(position, true);
3015		return this._items[position];
3016	};
3017
3018	/**
3019	 * Gets an item at the specified relative position.
3020	 * @public
3021	 * @param {Number} [position] - The relative position of the item.
3022	 * @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given.
3023	 */
3024	Owl.prototype.mergers = function(position) {
3025		if (position === undefined) {
3026			return this._mergers.slice();
3027		}
3028
3029		position = this.normalize(position, true);
3030		return this._mergers[position];
3031	};
3032
3033	/**
3034	 * Gets the absolute positions of clones for an item.
3035	 * @public
3036	 * @param {Number} [position] - The relative position of the item.
3037	 * @returns {Array.<Number>} - The absolute positions of clones for the item or all if no position was given.
3038	 */
3039	Owl.prototype.clones = function(position) {
3040		var odd = this._clones.length / 2,
3041			even = odd + this._items.length,
3042			map = function(index) { return index % 2 === 0 ? even + index / 2 : odd 
3042- (index + 1) / 2 };
3043
3044		if (position === undefined) {
3045			return $.map(this._clones, function(v, i) { return map(i) });
3046		}
3047
3048		return $.map(this._clones, function(v, i) { return v === position ? map(i) : null });
3049	};
3050
3051	/**
3052	 * Sets the current animation speed.
3053	 * @public
3054	 * @param {Number} [speed] - The animation speed in milliseconds or nothing to leave it unchanged.
3055	 * @returns {Number} - The current animation speed in milliseconds.
3056	 */
3057	Owl.prototype.speed = function(speed) {
3058		if (speed !== undefined) {
3059			this._speed = speed;
3060		}
3061
3062		return this._speed;
3063	};
3064
3065	/**
3066	 * Gets the coordinate of an item.
3067	 * @todo The name of this method is missleanding.
3068	 * @public
3069	 * @param {Number} position - The absolute position of the item within `minimum()` and `maximum()`.
3070	 * @returns {Number|Array.<Number>} - The coordinate of the item in pixel or all coordinates.
3071	 */
3072	Owl.prototype.coordinates = function(position) {
3073		var coordinate = null;
3074
3075		if (position === undefined) {
3076			return $.map(this._coordinates, $.proxy(function(coordinate, index) {
3077				return this.coordinates(index);
3078			}, this));
3079		}
3080
3081		if (this.settings.center) {
3082			coordinate = this._coordinates[position];
3083			coordinate += (this.width() - coordinate + (this._coordinates[position - 1] || 0)) / 2 * (this.settings.rtl ? -1 : 1);
3084		} else {
3085			coordinate = this._coordinates[position - 1] || 0;
3086		}
3087
3088		return coordinate;
3089	};
3090
3091	/**
3092	 * Calculates the speed for a translation.
3093	 * @protected
3094	 * @param {Number} from - The absolute position of the start item.
3095	 * @param {Number} to - The absolute position of the target item.
3096	 * @param {Number} [factor=undefined] - The time factor in milliseconds.
3097	 * @returns {Number} - The time in milliseconds for the translation.
3098	 */
3099	Owl.prototype.duration = function(from, to, factor) {
3100		return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs((factor || this.settings.smartSpeed));
3101	};
3102
3103	/**
3104	 * Slides to the specified item.
3105	 * @public
3106	 * @param {Number} position - The position of the item.
3107	 * @param {Number} [speed] - The time in milliseconds for the transition.
3108	 */
3109	Owl.prototype.to = function(position, speed) {
3110		if (this.settings.loop) {
3111			var distance = position - this.relative(this.current()),
3112				revert = this.current(),
3113				before = this.current(),
3114				after = this.current() + distance,
3115				direction = before - after < 0 ? true : false,
3116				items = this._clones.length + this._items.length;
3117
3118			if (after < this.settings.items && direction === false) {
3119				revert = before + this._items.length;
3120				this.reset(revert);
3121			} else if (after >= items - this.settings.items && direction === true) {
3122				revert = before - this._items.length;
3123				this.reset(revert);
3124			}
3125			window.clearTimeout(this.e._goToLoop);
3126			this.e._goToLoop = window.setTimeout($.proxy(function() {
3127				this.speed(this.duration(this.current(), revert + distance, speed));
3128				this.current(revert + distance);
3129				this.update();
3130			}, this), 30);
3131		} else {
3132			this.speed(this.duration(this.current(), position, speed));
3133			this.current(position);
3134			this.update();
3135		}
3136	};
3137
3138	/**
3139	 * Slides to the next item.
3140	 * @public
3141	 * @param {Number} [speed] - The time in milliseconds for the transition.
3142	 */
3143	Owl.prototype.next = function(speed) {
3144		speed = speed || false;
3145		this.to(this.relative(this.current()) + 1, speed);
3146	};
3147
3148	/**
3149	 * Slides to the previous item.
3150	 * @public
3151	 * @param {Number} [speed] - The time in milliseconds for the transition.
3152	 */
3153	Owl.prototype.prev = function(speed) {
3154		speed = speed || false;
3155		this.to(this.relative(this.current()) - 1, speed);
3156	};
3157
3158	/**
3159	 * Handles the end of an animation.
3160	 * @protected
3161	 * @param {Event} event - The event arguments.
3162	 */
3163	Owl.prototype.transitionEnd = function(event) {
3164
3165		// if css2 animation then event object is undefined
3166		if (event !== undefined) {
3167			event.stopPropagation();
3168
3169			// Catch only owl-stage transitionEnd event
3170			if ((event.target || event.srcElement || event.originalTarget) !== this.$stage.get(0)) {
3171				return false;
3172			}
3173		}
3174
3175		this.state.inMotion = false;
3176		this.trigger('translated');
3177	};
3178
3179	/**
3180	 * Gets viewport width.
3181	 * @protected
3182	 * @return {Number} - The width in pixel.
3183	 */
3184	Owl.prototype.viewport = function() {
3185		var width;
3186		if (this.options.responsiveBaseElement !== window) {
3187			width = $(this.options.responsiveBaseElement).width();
3188		} else if (window.innerWidth) {
3189			width = window.innerWidth;
3190		} else if (document.documentElement && document.documentElement.clientWidth) {
3191			width = document.documentElement.clientWidth;
3192		} else {
3193			throw 'Can not detect viewport width.';
3194		}
3195		return width;
3196	};
3197
3198	/**
3199	 * Replaces the current content.
3200	 * @public
3201	 * @param {HTMLElement|jQuery|String} content - The new content.
3202	 */
3203	Owl.prototype.replace = function(content) {
3204		this.$stage.empty();
3205		this._items = [];
3206
3207		if (content) {
3208			content = (content instanceof jQuery) ? content : $(content);
3209		}
3210
3211		if (this.settings.nestedItemSelector) {
3212			content = content.find('.' + this.settings.nestedItemSelector);
3213		}
3214
3215		content.filter(function() {
3216			return this.nodeType === 1;
3217		}).each($.proxy(function(index, item) {
3218			item = this.prepare(item);
3219			this.$stage.append(item);
3220			this._items.push(item);
3221			this._mergers.push(item.find('[data-merge]').andSelf('[data-merge]').attr('data-merge') * 1 || 1);
3222		}, this));
3223
3224		this.reset($.isNumeric(this.settings.startPosition) ? this.settings.startPosition : 0);
3225
3226		this.invalidate('items');
3227	};
3228
3229	/**
3230	 * Adds an item.
3231	 * @todo Use `item` instead of `content` for the event arguments.
3232	 * @public
3233	 * @param {HTMLElement|jQuery|String} content - The item content to add.
3234	 * @param {Number} [position] - The relative position at which to insert the item otherwise the item will be added to the end.
3235	 */
3236	Owl.prototype.add = function(content, position) {
3237		position = position === undefined ? this._items.length : this.normalize(position, true);
3238
3239		this.trigger('add', { content: content, position: position });
3240
3241		if (this._items.length === 0 || position === this._items.length) {
3242			this.$stage.append(content);
3243			this._items.push(content);
3244			this._mergers.push(content.find('[data-merge]').andSelf('[data-merge]').attr('data-merge') * 1 || 1);
3245		} else {
3246			this._items[position].before(content);
3247			this._items.splice(position, 0, content);
3248			this._mergers.splice(position, 0, content.find('[data-merge]').andSelf('[data-merge]').attr('data-merge') * 1 || 1);
3249		}
3250
3251		this.invalidate('items');
3252
3253		this.trigger('added', { content: content, position: position });
3254	};
3255
3256	/**
3257	 * Removes an item by its position.
3258	 * @todo Use `item` instead of `content` for the event arguments.
3259	 * @public
3260	 * @param {Number} position - The relative position of the item to remove.
3261	 */
3262	Owl.prototype.remove = function(position) {
3263		position = this.normalize(position, true);
3264
3265		if (position === undefined) {
3266			return;
3267		}
3268
3269		this.trigger('remove', { content: this._items[position], position: position });
3270
3271		this._items[position].remove();
3272		this._items.splice(position, 1);
3273		this._mergers.splice(position, 1);
3274
3275		this.invalidate('items');
3276
3277		this.trigger('removed', { content: null, position: position });
3278	};
3279
3280	/**
3281	 * Adds triggerable events.
3282	 * @protected
3283	 */
3284	Owl.prototype.addTriggerableEvents = function() {
3285		var handler = $.proxy(function(callback, event) {
3286			return $.proxy(function(e) {
3287				if (e.relatedTarget !== this) {
3288					this.suppress([ event ]);
3289					callback.apply(this, [].slice.call(arguments, 1));
3290					this.release([ event ]);
3291				}
3292			}, this);
3293		}, this);
3294
3295		$.each({
3296			'next': this.next,
3297			'prev': this.prev,
3298			'to': this.to,
3299			'destroy': this.destroy,
3300			'refresh': this.refresh,
3301			'replace': this.replace,
3302			'add': this.add,
3303			'remove': this.remove
3304		}, $.proxy(function(event, callback) {
3305			this.$element.on(event + '.owl.carousel', handler(callback, event + '.owl.carousel'));
3306		}, this));
3307
3308	};
3309
3310	/**
3311	 * Watches the visibility of the carousel element.
3312	 * @protected
3313	 */
3314	Owl.prototype.watchVisibility = function() {
3315
3316		// test on zepto
3317		if (!isElVisible(this.$element.get(0))) {
3318			this.$element.addClass('owl-hidden');
3319			window.clearInterval(this.e._checkVisibile);
3320			this.e._checkVisibile = window.setInterval($.proxy(checkVisible, this), 500);
3321		}
3322
3323		function isElVisible(el) {
3324			return el.offsetWidth > 0 && el.offsetHeight > 0;
3325		}
3326
3327		function checkVisible() {
3328			if (isElVisible(this.$element.get(0))) {
3329				this.$element.removeClass('owl-hidden');
3330				this.refresh();
3331				window.clearInterval(this.e._checkVisibile);
3332			}
3333		}
3334	};
3335
3336	/**
3337	 * Preloads images with auto width.
3338	 * @protected
3339	 * @todo Still to test
3340	 */
3341	Owl.prototype.preloadAutoWidthImages = function(imgs) {
3342		var loaded, that, $el, img;
3343
3344		loaded = 0;
3345		that = this;
3346		imgs.each(function(i, el) {
3347			$el = $(el);
3348			img = new Image();
3349
3350			img.onload = function() {
3351				loaded++;
3352				$el.attr('src', img.src);
3353				$el.css('opacity', 1);
3354				if (loaded >= imgs.length) {
3355					that.state.imagesLoaded = true;
3356					that.initialize();
3357				}
3358			};
3359
3360			img.src = $el.attr('src') || $el.attr('data-src') || $el.attr('data-src-retina');
3361		});
3362	};
3363
3364	/**
3365	 * Destroys the carousel.
3366	 * @public
3367	 */
3368	Owl.prototype.destroy = function() {
3369
3370		if (this.$element.hasClass(this.settings.themeClass)) {
3371			this.$element.removeClass(this.settings.themeClass);
3372		}
3373
3374		if (this.settings.responsive !== false) {
3375			$(window).off('resize.owl.carousel');
3376		}
3377
3378		if (this.transitionEndVendor) {
3379			this.off(this.$stage.get(0), this.transitionEndVendor, this.e._transitionEnd);
3380		}
3381
3382		for ( var i in this._plugins) {
3383			this._plugins[i].destroy();
3384		}
3385
3386		if (this.settings.mouseDrag || this.settings.touchDrag) {
3387			this.$stage.off('mousedown touchstart touchcancel');
3388			$(document).off('.owl.dragEvents');
3389			this.$stage.get(0).onselectstart = function() {};
3390			this.$stage.off('dragstart', function() { return false });
3391		}
3392
3393		// remove event handlers in the ".owl.carousel" namespace
3394		this.$element.off('.owl');
3395
3396		this.$stage.children('.cloned').remove();
3397		this.e = null;
3398		this.$element.removeData('owlCarousel');
3399
3400		this.$stage.children().contents().unwrap();
3401		this.$stage.children().unwrap();
3402		this.$stage.unwrap();
3403	};
3404
3405	/**
3406	 * Operators to calculate right-to-left and left-to-right.
3407	 * @protected
3408	 * @param {Number} [a] - The left side operand.
3409	 * @param {String} [o] - The operator.
3410	 * @param {Number} [b] - The right side operand.
3411	 */
3412	Owl.prototype.op = function(a, o, b) {
3413		var rtl = this.settings.rtl;
3414		switch (o) {
3415			case '<':
3416				return rtl ? a > b : a < b;
3417			case '>':
3418				return rtl ? a < b : a > b;
3419			case '>=':
3420				return rtl ? a <= b : a >= b;
3421			case '<=':
3422				return rtl ? a >= b : a <= b;
3423			default:
3424				break;
3425		}
3426	};
3427
3428	/**
3429	 * Attaches to an internal event.
3430	 * @protected
3431	 * @param {HTMLElement} element - The event source.
3432	 * @param {String} event - The event name.
3433	 * @param {Function} listener - The event handler to attach.
3434	 * @param {Boolean} capture - Wether the event should be handled at the capturing p
3434hase or not.
3435	 */
3436	Owl.prototype.on = function(element, event, listener, capture) {
3437		if (element.addEventListener) {
3438			element.addEventListener(event, listener, capture);
3439		} else if (element.attachEvent) {
3440			element.attachEvent('on' + event, listener);
3441		}
3442	};
3443
3444	/**
3445	 * Detaches from an internal event.
3446	 * @protected
3447	 * @param {HTMLElement} element - The event source.
3448	 * @param {String} event - The event name.
3449	 * @param {Function} listener - The attached event handler to detach.
3450	 * @param {Boolean} capture - Wether the attached event handler was registered as a capturing listener or not.
3451	 */
3452	Owl.prototype.off = function(element, event, listener, capture) {
3453		if (element.removeEventListener) {
3454			element.removeEventListener(event, listener, capture);
3455		} else if (element.detachEvent) {
3456			element.detachEvent('on' + event, listener);
3457		}
3458	};
3459
3460	/**
3461	 * Triggers an public event.
3462	 * @protected
3463	 * @param {String} name - The event name.
3464	 * @param {*} [data=null] - The event data.
3465	 * @param {String} [namespace=.owl.carousel] - The event namespace.
3466	 * @returns {Event} - The event arguments.
3467	 */
3468	Owl.prototype.trigger = function(name, data, namespace) {
3469		var status = {
3470			item: { count: this._items.length, index: this.current() }
3471		}, handler = $.camelCase(
3472			$.grep([ 'on', name, namespace ], function(v) { return v })
3473				.join('-').toLowerCase()
3474		), event = $.Event(
3475			[ name, 'owl', namespace || 'carousel' ].join('.').toLowerCase(),
3476			$.extend({ relatedTarget: this }, status, data)
3477		);
3478
3479		if (!this._supress[name]) {
3480			$.each(this._plugins, function(name, plugin) {
3481				if (plugin.onTrigger) {
3482					plugin.onTrigger(event);
3483				}
3484			});
3485
3486			this.$element.trigger(event);
3487
3488			if (this.settings && typeof this.settings[handler] === 'function') {
3489				this.settings[handler].apply(this, event);
3490
3491
3492			}
3493		}
3494
3495		return event;
3496	};
3497
3498	/**
3499	 * Suppresses events.
3500	 * @protected
3501	 * @param {Array.<String>} events - The events to suppress.
3502	 */
3503	Owl.prototype.suppress = function(events) {
3504		$.each(events, $.proxy(function(index, event) {
3505			this._supress[event] = true;
3506		}, this));
3507	}
3508
3509	/**
3510	 * Releases suppressed events.
3511	 * @protected
3512	 * @param {Array.<String>} events - The events to release.
3513	 */
3514	Owl.prototype.release = function(events) {
3515		$.each(events, $.proxy(function(index, event) {
3516			delete this._supress[event];
3517		}, this));
3518	}
3519
3520	/**
3521	 * Checks the availability of some browser features.
3522	 * @protected
3523	 */
3524	Owl.prototype.browserSupport = function() {
3525		this.support3d = isPerspective();
3526
3527		if (this.support3d) {
3528			this.transformVendor = isTransform();
3529
3530			// take transitionend event name by detecting transition
3531			var endVendors = [ 'transitionend', 'webkitTransitionEnd', 'transitionend', 'oTransitionEnd' ];
3532			this.transitionEndVendor = endVendors[isTransition()];
3533
3534			// take vendor name from transform name
3535			this.vendorName = this.transformVendor.replace(/Transform/i, '');
3536			this.vendorName = this.vendorName !== '' ? '-' + this.vendorName.toLowerCase() + '-' : '';
3537		}
3538
3539		this.state.orientation = window.orientation;
3540	};
3541
3542	/**
3543	 * Get touch/drag coordinats.
3544	 * @private
3545	 * @param {event} - mousedown/touchstart event
3546	 * @returns {object} - Contains X and Y of current mouse/touch position
3547	 */
3548
3549	function getTouches(event) {
3550		if (event.touches !== undefined) {
3551			return {
3552				x: event.touches[0].pageX,
3553				y: event.touches[0].pageY
3554			};
3555		}
3556
3557		if (event.touches === undefined) {
3558			if (event.pageX !== undefined) {
3559				return {
3560					x: event.pageX,
3561					y: event.pageY
3562				};
3563			}
3564
3565		if (event.pageX === undefined) {
3566			return {
3567					x: event.clientX,
3568					y: event.clientY
3569				};
3570			}
3571		}
3572	}
3573
3574	/**
3575	 * Checks for CSS support.
3576	 * @private
3577	 * @param {Array} array - The CSS properties to check for.
3578	 * @returns {Array} - Contains the supported CSS property name and its index or `false`.
3579	 */
3580	function isStyleSupported(array) {
3581		var p, s, fake = document.createElement('div'), list = array;
3582		for (p in list) {
3583			s = list[p];
3584			if (typeof fake.style[s] !== 'undefined') {
3585				fake = null;
3586				return [ s, p ];
3587			}
3588		}
3589		return [ false ];
3590	}
3591
3592	/**
3593	 * Checks for CSS transition support.
3594	 * @private
3595	 * @todo Realy bad design
3596	 * @returns {Number}
3597	 */
3598	function isTransition() {
3599		return isStyleSupported([ 'transition', 'WebkitTransition', 'MozTransition', 'OTransition' ])[1];
3600	}
3601
3602	/**
3603	 * Checks for CSS transform support.
3604	 * @private
3605	 * @returns {String} The supported property name or false.
3606	 */
3607	function isTransform() {
3608		return isStyleSupported([ 'transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform' ])[0];
3609	}
3610
3611	/**
3612	 * Checks for CSS perspective support.
3613	 * @private
3614	 * @returns {String} The supported property name or false.
3615	 */
3616	function isPerspective() {
3617		return isStyleSupported([ 'perspective', 'webkitPerspective', 'MozPerspective', 'OPerspective', 'MsPerspective' ])[0];
3618	}
3619
3620	/**
3621	 * Checks wether touch is supported or not.
3622	 * @private
3623	 * @returns {Boolean}
3624	 */
3625	function isTouchSupport() {
3626		return 'ontouchstart' in window || !!(navigator.msMaxTouchPoints);
3627	}
3628
3629	/**
3630	 * Checks wether touch is supported or not for IE.
3631	 * @private
3632	 * @returns {Boolean}
3633	 */
3634	function isTouchSupportIE() {
3635		return window.navigator.msPointerEnabled;
3636	}
3637
3638	/**
3639	 * The jQuery Plugin for the Owl Carousel
3640	 * @public
3641	 */
3642	$.fn.owlCarousel = function(options) {
3643		return this.each(function() {
3644			if (!$(this).data('owlCarousel')) {
3645				$(this).data('owlCarousel', new Owl(this, options));
3646			}
3647		});
3648	};
3649
3650	/**
3651	 * The constructor for the jQuery Plugin
3652	 * @public
3653	 */
3654	$.fn.owlCarousel.Constructor = Owl;
3655
3656})(window.Zepto || window.jQuery, window, document);
3657
3658/**
3659 * Lazy Plugin
3660 * @version 2.0.0
3661 * @author Bartosz Wojciechowski
3662 * @license The MIT License (MIT)
3663 */
3664;(function($, window, document, undefined) {
3665
3666	/**
3667	 * Creates the lazy plugin.
3668	 * @class The Lazy Plugin
3669	 * @param {Owl} carousel - The Owl Carousel
3670	 */
3671	var Lazy = function(carousel) {
3672
3673		/**
3674		 * Reference to the core.
3675		 * @protected
3676		 * @type {Owl}
3677		 */
3678		this._core = carousel;
3679
3680		/**
3681		 * Already loaded items.
3682		 * @protected
3683		 * @type {Array.<jQuery>}
3684		 */
3685		this._loaded = [];
3686
3687		/**
3688		 * Event handlers.
3689		 * @protected
3690		 * @type {Object}
3691		 */
3692		this._handlers = {
3693			'initialized.owl.carousel change.owl.carousel': $.proxy(function(e) {
3694				if (!e.namespace) {
3695					return;
3696				}
3697
3698				if (!this._core.settings || !this._core.settings.lazyLoad) {
3699					return;
3700				}
3701
3702				if ((e.property && e.property.name == 'position') || e.type == 'initialized') {
3703					var settings = this._core.settings,
3704						n = (settings.center && Math.ceil(settings.items / 2) || settings.items),
3705						i = ((settings.center && n * -1) || 0),
3706						position = ((e.property && e.property.value) || this._core.current()) + i,
3707						clones = this._core.clones().length,
3708						load = $.proxy(function(i, v) { this.load(v) }, this);
3709
3710					while (i++ < n) {
3711						this.load(clones / 2 + this._core.relative(position));
3712						clones && $.each(this._core.clones(this._core.relative(position++)), load);
3713					}
3714				}
3715			}, this)
3716		};
3717
3718		// set the default options
3719		this._core.options = $.extend({}, Lazy.Defaults, this._core.options);
3720
3721		// register event handler
3722		this._core.$element.on(this._handlers);
3723	}
3724
3725	/**
3726	 * Default options.
3727	 * @public
3728	 */
3729	Lazy.Defaults = {
3730		lazyLoad: false
3731	}
3732
3733	/**
3734	 * Loads all resources of an item at the specified position.
3735	 * @param {Number} position - The absolute position of the item.
3736	 * @protected
3737	 */
3738	Lazy.prototype.load = function(position) {
3739		var $item = this._core.$stage.children().eq(position),
3740			$elements = $item && $item.find('.owl-lazy');
3741
3742		if (!$elements || $.inArray($item.get(0), this._loaded) > -1) {
3743			return;
3744		}
3745
3746		$elements.each($.proxy(function(index, element) {
3747			var $element = $(element), image,
3748				url = (window.devicePixelRatio > 1 && $element.attr('data-src-retina')) || $element.attr('data-src');
3749
3750			this._core.trigger('load', { element: $element, url: url }, 'lazy');
3751
3752			if ($element.is('img')) {
3753				$element.one('load.owl.lazy', $.proxy(function() {
3754					$element.css('opacity', 1);
3755					this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
3756				}, this)).attr('src', url);
3757			} else {
3758				image = new Image();
3759				image.onload = $.proxy(function() {
3760					$element.css({
3761						'background-image': 'url(' + url + ')',
3762						'opacity': '1'
3763					});
3764					this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
3765				}, this);
3766				image.src = url;
3767			}
3768		}, this));
3769
3770		this._loaded.push($item.get(0));
3771	}
3772
3773	/**
3774	 * Destroys the plugin.
3775	 * @public
3776	 */
3777	Lazy.prototype.destroy = function() {
3778		var handler, property;
3779
3780		for (handler in this.handlers) {
3781			this._core.$element.off(handler, this.handlers[handler]);
3782		}
3783		for (property in Object.getOwnPropertyNames(this)) {
3784			typeof this[property] != 'function' && (this[property] = null);
3785		}
3786	}
3787
3788	$.fn.owlCarousel.Constructor.Plugins.Lazy = Lazy;
3789
3790})(window.Zepto || window.jQuery, window, document);
3791
3792/**
3793 * AutoHeight Plugin
3794 * @version 2.0.0
3795 * @author Bartosz Wojciechowski
3796 * @license The MIT License (MIT)
3797 */
3798;(function($, window, document, undefined) {
3799
3800	/**
3801	 * Creates the auto height plugin.
3802	 * @class The Auto Height Plugin
3803	 * @param {Owl} carousel - The Owl Carousel
3804	 */
3805	var AutoHeight = function(carousel) {
3806		/**
3807		 * Reference to the core.
3808		 * @protected
3809		 * @type {Owl}
3810		 */
3811		this._core = carousel;
3812
3813		/**
3814		 * All event handlers.
3815		 * @protected
3816		 * @type {Object}
3817		 */
3818		this._handlers = {
3819			'initialized.owl.carousel': $.proxy(function() {
3820				if (this._core.settings.autoHeight) {
3821					this.update();
3822				}
3823			}, this),
3824			'changed.owl.carousel': $.proxy(function(e) {
3825				if (this._core.settings.autoHeight && e.property.name == 'position'){
3826					this.update();
3827				}
3828			}, this),
3829			'loaded.owl.lazy': $.proxy(function(e) {
3830				if (this._core.settings.autoHeight && e.element.closest('.' + this._core.settings.itemClass)
3831					=== this._core.$stage.children().eq(this._core.current())) {
3832					this.update();
3833				}
3834			}, this)
3835		};
3836
3837		// set default options
3838		this._core.options = $.extend({}, AutoHeight.Defaults, this._core.options);
3839
3840		// register event handlers
3841		this._core.$element.on(this._handlers);
3842	};
3843
3844	/**
3845	 * Default options.
3846	 * @public
3847	 */
3848	AutoHeight.Defaults = {
3849		autoHeight: false,
3850		autoHeightClass: 'owl-height'
3851	};
3852
3853	/**
3854	 * Updates the view.
3855	 */
3856	AutoHeight.prototype.update = function() {
3857		this._core.$stage.parent()
3858			.height(this._core.$stage.children().eq(this._core.current()).height())
3859			.addClass(this._core.settings.autoHeightClass);
3860	};
3861
3862	AutoHeight.prototype.destroy = function() {
3863		var handler, property;
3864
3865		for (handler in this._handlers) {
3866			this._core.$element.off(handler, this._handlers[handler]);
3867		}
3868		for (property in Object.getOwnPropertyNames(this)) {
3869			typeof this[property] != 'function' && (this[property] = null);
3870		}
3871	};
3872
3873	$.fn.owlCarousel.Constructor.Plugins.AutoHeight = AutoHeight;
3874
3875})(window.Zepto || window.jQuery, window, document);
3876
3877
3878/**
3879 * Animate Plugin
3880 * @version 2.0.0
3881 * @author Bartosz Wojciechowski
3882 * @license The MIT License (MIT)
3883 */
3884;(function($, window, document, undefined) {
3885
3886	/**
3887	 * Creates the animate plugin.
3888	 * @class The Navigation Plugin
3889	 * @param {Owl} scope - The Owl Carousel
3890	 */
3891	var Animate = function(scope) {
3892		this.core = scope;
3893		this.core.options = $.extend({}, Animate.Defaults, this.core.options);
3894		this.swapping = true;
3895		this.previous = undefined;
3896		this.next = undefined;
3897
3898		this.handlers = {
3899			'change.owl.carousel': $.proxy(function(e) {
3900				if (e.property.name == 'position') {
3901					this.previous = this.core.current();
3902					this.next = e.property.value;
3903				}
3904			}, this),
3905			'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function(e) {
3906				this.swapping = e.type == 'translated';
3907			}, this),
3908			'translate.owl.carousel': $.proxy(function(e) {
3909				if (this.swapping && (this.core.options.animateOut || this.core.options.animateIn)) {
3910					this.swap();
3911				}
3912			}, this)
3913		};
3914
3915		this.core.$element.on(this.handlers);
3916	};
3917
3918	/**
3919	 * Default options.
3920	 * @public
3921	 */
3922	Animate.Defaults = {
3923		animateOut: false,
3924		animateIn: false
3925	};
3926
3927	/**
3928	 * Toggles the animation classes whenever an translations starts.
3929	 * @protected
3930	 * @returns {Boolean|undefined}
3931	 */
3932	Animate.prototype.swap = function() {
3933
3934		if (this.core.settings.items !== 1 || !this.core.support3d) {
3935			return;
3936		}
3937
3938		this.core.speed(0);
3939
3940		var left,
3941			clear = $.proxy(this.clear, this),
3942			previous = this.core.$stage.children().eq(this.previous),
3943			next = this.core.$stage.children().eq(this.next),
3944			incoming = this.core.settings.animateIn,
3945			outgoing = this.core.settings.animateOut;
3946
3947		if (this.core.current() === this.previous) {
3948			return;
3949		}
3950
3951		if (outgoing) {
3952			left = this.core.coordinates(this.previous) - this.core.coordinates(this.next);
3953			previous.css( { 'left': left + 'px' } )
3954				.addClass('animated owl-animated-out')
3955				.addClass(outgoing)
3956				.one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', clear);
3957		}
3958
3959		if (incoming) {
3960			next.addClass('animated owl-animated-in')
3961				.addClass(incoming)
3962				.one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', clear);
3963		}
3964	};
3965
3966	Animate.prototype.clear = function(e) {
3967		$(e.target).css( { 'left': '' } )
3968			.removeClass('animated owl-animated-out owl-animated-in')
3969			.removeClass(this.core.settings.animateIn)
3970			.removeClass(this.core.settings.animateOut);
3971		this.core.transitionEnd();
3972	}
3973
3974	/**
3975	 * Destroys the plugin.
3976	 * @public
3977	 */
3978	Animate.prototype.destroy = function() {
3979		var handler, property;
3980
3981		for (handler in this.handlers) {
3982			this.core.$element.off(handler, this.handlers[handler]);
3983		}
3984		for (property in Object.getOwnPropertyNames(this)) {
3985			typeof this[property] != 'function' && (this[property] = null);
3986		}
3987	};
3988
3989	$.fn.owlCarousel.Constructor.Plugins.Animate = Animate;
3990
3991})(window.Zepto || window.jQuery, window, document);
3992
3993/**
3994 * Autoplay Plugin
3995 * @version 2.0.0
3996 * @author Bartosz Wojciechowski
3997 * @license The MIT License (MIT)
3998 */
3999;(function($, window, document, undefined) {
4000
4001	/**
4002	 * Creates the autoplay plugin.
4003	 * @class The Autoplay Plugin
4004	 * @param {Owl} scope - The Owl Carousel
4005	 */
4006	var Autoplay = function(scope) {
4007		this.core = scope;
4008		this.core.options = $.extend({}, Autoplay.Defaults, this.core.options);
4009
4010		this.handlers = {
4011			'translated.owl.carousel refreshed.owl.carousel': $.proxy(function() {
4012				this.autoplay();
4013			}, this),
4014			'play.owl.autoplay': $.proxy(function(e, t, s) {
4015				this.play(t, s);
4016			}, this),
4017			'stop.owl.autoplay': $.proxy(function() {
4018				this.stop();
4019			}, this),
4020			'mouseover.owl.autoplay': $.proxy(function() {
4021				if (this.core.settings.autoplayHoverPause) {
4022					this.pause();
4023				}
4024			}, this),
4025			'mouseleave.owl.autoplay': $.proxy(function() {
4026				if (this.core.settings.autoplayHoverPause) {
4027					this.autoplay();
4028				}
4029			}, this)
4030		};
4031
4032		this.core.$element.on(this.handlers);
4033	};
4034
4035	/**
4036	 * Default options.
4037	 * @public
4038	 */
4039	Autoplay.Defaults = {
4040		autoplay: false,
4041		autoplayTimeout: 5000,
4042		autoplayHoverPause: false,
4043		autoplaySpeed: false
4044	};
4045
4046	/**
4047	 * @protected
4048	 * @todo Must be documented.
4049	 */
4050	Autoplay.prototype.autoplay = function() {
4051		if (this.core.settings.autoplay && !this.core.state.videoPlay) {
4052			window.clearInterval(this.interval);
4053
4054			this.interval = window.setInterval($.proxy(function() {
4055				this.play();
4056			}, this), this.core.settings.autoplayTimeout);
4057		} else {
4058			window.clearInterval(this.interval);
4059		}
4060	};
4061
4062	/**
4063	 * Starts the autoplay.
4064	 * @public
4065	 * @param {Number} [timeout] - ...
4066	 * @param {Number}
4066 [speed] - ...
4067	 * @returns {Boolean|undefined} - ...
4068	 * @todo Must be documented.
4069	 */
4070	Autoplay.prototype.play = function(timeout, speed) {
4071		// if tab is inactive - doesnt work in <IE10
4072		if (document.hidden === true) {
4073			return;
4074		}
4075
4076		if (this.core.state.isTouch || this.core.state.isScrolling
4077			|| this.core.state.isSwiping || this.core.state.inMotion) {
4078			return;
4079		}
4080
4081		if (this.core.settings.autoplay === false) {
4082			window.clearInterval(this.interval);
4083			return;
4084		}
4085
4086		this.core.next(this.core.settings.autoplaySpeed);
4087	};
4088
4089	/**
4090	 * Stops the autoplay.
4091	 * @public
4092	 */
4093	Autoplay.prototype.stop = function() {
4094		window.clearInterval(this.interval);
4095	};
4096
4097	/**
4098	 * Pauses the autoplay.
4099	 * @public
4100	 */
4101	Autoplay.prototype.pause = function() {
4102		window.clearInterval(this.interval);
4103	};
4104
4105	/**
4106	 * Destroys the plugin.
4107	 */
4108	Autoplay.prototype.destroy = function() {
4109		var handler, property;
4110
4111		window.clearInterval(this.interval);
4112
4113		for (handler in this.handlers) {
4114			this.core.$element.off(handler, this.handlers[handler]);
4115		}
4116		for (property in Object.getOwnPropertyNames(this)) {
4117			typeof this[property] != 'function' && (this[property] = null);
4118		}
4119	};
4120
4121	$.fn.owlCarousel.Constructor.Plugins.autoplay = Autoplay;
4122
4123})(window.Zepto || window.jQuery, window, document);
4124
4125/**
4126 * Navigation Plugin
4127 * @version 2.0.0
4128 * @author Artus Kolanowski
4129 * @license The MIT License (MIT)
4130 */
4131;(function($, window, document, undefined) {
4132	'use strict';
4133
4134	/**
4135	 * Creates the navigation plugin.
4136	 * @class The Navigation Plugin
4137	 * @param {Owl} carousel - The Owl Carousel.
4138	 */
4139	var Navigation = function(carousel) {
4140		/**
4141		 * Reference to the core.
4142		 * @protected
4143		 * @type {Owl}
4144		 */
4145		this._core = carousel;
4146
4147		/**
4148		 * Indicates whether the plugin is initialized or not.
4149		 * @protected
4150		 * @type {Boolean}
4151		 */
4152		this._initialized = false;
4153
4154		/**
4155		 * The current paging indexes.
4156		 * @protected
4157		 * @type {Array}
4158		 */
4159		this._pages = [];
4160
4161		/**
4162		 * All DOM elements of the user interface.
4163		 * @protected
4164		 * @type {Object}
4165		 */
4166		this._controls = {};
4167
4168		/**
4169		 * Markup for an indicator.
4170		 * @protected
4171		 * @type {Array.<String>}
4172		 */
4173		this._templates = [];
4174
4175		/**
4176		 * The carousel element.
4177
4178		 * @type {jQuery}
4179		 */
4180		this.$element = this._core.$element;
4181
4182		/**
4183		 * Overridden methods of the carousel.
4184		 * @protected
4185		 * @type {Object}
4186		 */
4187		this._overrides = {
4188			next: this._core.next,
4189			prev: this._core.prev,
4190			to: this._core.to
4191		};
4192
4193		/**
4194		 * All event handlers.
4195		 * @protected
4196		 * @type {Object}
4197		 */
4198		this._handlers = {
4199			'prepared.owl.carousel': $.proxy(function(e) {
4200				if (this._core.settings.dotsData) {
4201					this._templates.push($(e.content).find('[data-dot]').andSelf('[data-dot]').attr('data-dot'));
4202				}
4203			}, this),
4204			'add.owl.carousel': $.proxy(function(e) {
4205				if (this._core.settings.dotsData) {
4206					this._templates.splice(e.position, 0, $(e.content).find('[data-dot]').andSelf('[data-dot]').attr('data-dot'));
4207				}
4208			}, this),
4209			'remove.owl.carousel prepared.owl.carousel': $.proxy(function(e) {
4210				if (this._core.settings.dotsData) {
4211					this._templates.splice(e.position, 1);
4212				}
4213			}, this),
4214			'change.owl.carousel': $.proxy(function(e) {
4215				if (e.property.name == 'position') {
4216					if (!this._core.state.revert && !this._core.settings.loop && this._core.settings.navRewind) {
4217						var current = this._core.current(),
4218							maximum = this._core.maximum(),
4219							minimum = this._core.minimum();
4220						e.data = e.property.value > maximum
4221							? current >= maximum ? minimum : maximum
4222							: e.property.value < minimum ? maximum : e.property.value;
4223					}
4224				}
4225			}, this),
4226			'changed.owl.carousel': $.proxy(function(e) {
4227				if (e.property.name == 'position') {
4228					this.draw();
4229				}
4230			}, this),
4231			'refreshed.owl.carousel': $.proxy(function() {
4232				if (!this._initialized) {
4233					this.initialize();
4234					this._initialized = true;
4235				}
4236				this._core.trigger('refresh', null, 'navigation');
4237				this.update();
4238				this.draw();
4239				this._core.trigger('refreshed', null, 'navigation');
4240			}, this)
4241		};
4242
4243		// set default options
4244		this._core.options = $.extend({}, Navigation.Defaults, this._core.options);
4245
4246		// register event handlers
4247		this.$element.on(this._handlers);
4248	}
4249
4250	/**
4251	 * Default options.
4252	 * @public
4253	 * @todo Rename `slideBy` to `navBy`
4254	 */
4255	Navigation.Defaults = {
4256		nav: false,
4257		navRewind: true,
4258		navText: [ 'prev', 'next' ],
4259		navSpeed: false,
4260		navElement: 'div',
4261		navContainer: false,
4262		navContainerClass: 'owl-nav',
4263		navClass: [ 'owl-prev', 'owl-next' ],
4264		slideBy: 1,
4265		dotClass: 'owl-dot',
4266		dotsClass: 'owl-dots',
4267		dots: true,
4268		dotsEach: false,
4269		dotData: false,
4270		dotsSpeed: false,
4271		dotsContainer: false,
4272		controlsClass: 'owl-controls'
4273	}
4274
4275	/**
4276	 * Initializes the layout of the plugin and extends the carousel.
4277	 * @protected
4278	 */
4279	Navigation.prototype.initialize = function() {
4280		var $container, override,
4281			options = this._core.settings;
4282
4283		// create the indicator template
4284		if (!options.dotsData) {
4285			this._templates = [ $('<div>')
4286				.addClass(options.dotClass)
4287				.append($('<span>'))
4288				.prop('outerHTML') ];
4289		}
4290
4291		// create controls container if needed
4292		if (!options.navContainer || !options.dotsContainer) {
4293			this._controls.$container = $('<div>')
4294				.addClass(options.controlsClass)
4295				.appendTo(this.$element);
4296		}
4297
4298		// create DOM structure for absolute navigation
4299		this._controls.$indicators = options.dotsContainer ? $(options.dotsContainer)
4300			: $('<div>').hide().addClass(options.dotsClass).appendTo(this._controls.$container);
4301
4302		this._controls.$indicators.on('click', 'div', $.proxy(function(e) {
4303			var index = $(e.target).parent().is(this._controls.$indicators)
4304				? $(e.target).index() : $(e.target).parent().index();
4305
4306			e.preventDefault();
4307
4308			this.to(index, options.dotsSpeed);
4309		}, this));
4310
4311		// create DOM structure for relative navigation
4312		$container = options.navContainer ? $(options.navContainer)
4313			: $('<div>').addClass(options.navContainerClass).prependTo(this._controls.$container);
4314
4315		this._controls.$next = $('<' + options.navElement + '>');
4316		this._controls.$previous = this._controls.$next.clone();
4317
4318		this._controls.$previous
4319			.addClass(options.navClass[0])
4320			.html(options.navText[0])
4321			.hide()
4322			.prependTo($container)
4323			.on('click', $.proxy(function(e) {
4324				this.prev(options.navSpeed);
4325			}, this));
4326		this._controls.$next
4327			.addClass(options.navClass[1])
4328			.html(options.navText[1])
4329			.hide()
4330			.appendTo($container)
4331			.on('click', $.proxy(function(e) {
4332				this.next(options.navSpeed);
4333			}, this));
4334
4335		// override public methods of the carousel
4336		for (override in this._overrides) {
4337			this._core[override] = $.proxy(this[override], this);
4338		}
4339	}
4340
4341	/**
4342	 * Destroys the plugin.
4343	 * @protected
4344	 */
4345	Navigation.prototype.destroy = function() {
4346		var handler, control, property, override;
4347
4348		for (handler in this._handlers) {
4349			this.$element.off(handler, this._handlers[handler]);
4350		}
4351		for (control in this._controls) {
4352			this._controls[control].remove();
4353		}
4354		for (override in this.overides) {
4355			this._core[override] = this._overrides[override];
4356		}
4357		for (property in Object.getOwnPropertyNames(this)) {
4358			typeof this[property] != 'function' && (this[property] = null);
4359		}
4360	}
4361
4362	/**
4363	 * Updates the internal state.
4364	 * @protected
4365	 */
4366	Navigation.prototype.update = function() {
4367		var i, j, k,
4368			options = this._core.settings,
4369			lower = this._core.clones().length / 2,
4370			upper = lower + this._core.items().length,
4371			size = options.center || options.autoWidth || options.dotData
4372				? 1 : options.dotsEach || options.items;
4373
4374		if (options.slideBy !== 'page') {
4375			options.slideBy = Math.min(options.slideBy, options.items);
4376		}
4377
4378		if (options.dots || options.slideBy == 'page') {
4379			this._pages = [];
4380
4381			for (i = lower, j = 0, k = 0; i < upper; i++) {
4382				if (j >= size || j === 0) {
4383					this._pages.push({
4384						start: i - lower,
4385						end: i - lower + size - 1
4386					});
4387					j = 0, ++k;
4388				}
4389				j += this._core.mergers(this._core.relative(i));
4390			}
4391		}
4392	}
4393
4394	/**
4395	 * Draws the user interface.
4396	 * @todo The option `dotData` wont work.
4397	 * @protected
4398	 */
4399	Navigation.prototype.draw = function() {
4400		var difference, i, html = '',
4401			options = this._core.settings,
4402			$items = this._core.$stage.children(),
4403			index = this._core.relative(this._core.current());
4404
4405		if (options.nav && !options.loop && !options.navRewind) {
4406			this._controls.$previous.toggleClass('disabled', index <= 0);
4407			this._controls.$next.toggleClass('disabled', index >= this._core.maximum());
4408		}
4409
4410		this._controls.$previous.toggle(options.nav);
4411		this._controls.$next.toggle(options.nav);
4412
4413		if (options.dots) {
4414			difference = this._pages.length - this._controls.$indicators.children().length;
4415
4416			if (options.dotData && difference !== 0) {
4417				for (i = 0; i < this._controls.$indicators.children().length; i++) {
4418					html += this._templates[this._core.relative(i)];
4419				}
4420				this._controls.$indicators.html(html);
4421			} else if (difference > 0) {
4422				html = new Array(difference + 1).join(this._templates[0]);
4423				this._controls.$indicators.append(html);
4424			} else if (difference < 0) {
4425				this._controls.$indicators.children().slice(difference).remove();
4426			}
4427
4428			this._controls.$indicators.find('.active').removeClass('active');
4429			this._controls.$indicators.children().eq($.inArray(this.current(), this._pages)).addClass('active');
4430		}
4431
4432		this._controls.$indicators.toggle(options.dots);
4433	}
4434
4435	/**
4436	 * Extends event data.
4437	 * @protected
4438	 * @param {Event} event - The event object which gets thrown.
4439	 */
4440	Navigation.prototype.onTrigger = function(event) {
4441		var settings = this._core.settings;
4442
4443		event.page = {
4444			index: $.inArray(this.current(), this._pages),
4445			count: this._pages.length,
4446			size: settings && (settings.center || settings.autoWidth || settings.dotData
4447				? 1 : settings.dotsEach || settings.items)
4448		};
4449	}
4450
4451	/**
4452	 * Gets the current page position of the carousel.
4453	 * @protected
4454	 * @returns {Number}
4455	 */
4456	Navigation.prototype.current = function() {
4457		var index = this._core.relative(this._core.current());
4458		return $.grep(this._pages, function(o) {
4459			return o.start <= index && o.end >= index;
4460		}).pop();
4461	}
4462
4463	/**
4464	 * Gets the current succesor/predecessor position.
4465	 * @protected
4466	 * @returns {Number}
4467	 */
4468	Navigation.prototype.getPosition = function(successor) {
4469		var position, length,
4470			options = this._core.settings;
4471
4472		if (options.slideBy == 'page') {
4473			position = $.inArray(this.current(), this._pages);
4474			length = this._pages.length;
4475			successor ? ++position : --position;
4476			position = this._pages[((position % length) + length) % length].start;
4477		} else {
4478			position = this._core.relative(this._core.current());
4479			length = this._core.items().length;
4480			successor ? position += options.slideBy : position -= options.slideBy;
4481		}
4482		return position;
4483	}
4484
4485	/**
4486	 * Slides to the next item or page.
4487	 * @public
4488	 * @param {Number} [speed=false] - The time in milliseconds for the transition.
4489	 */
4490	Navigation.prototype.next = function(speed) {
4491		$.proxy(this._overrides.to, this._core)(this.getPosition(true), speed);
4492	}
4493
4494	/**
4495	 * Slides to the previous item or page.
4496	 * @public
4497	 * @param {Number} [speed=false] - The time in milliseconds for the transition.
4498	 */
4499	Navigation.prototype.prev = function(speed) {
4500		$.proxy(this._overrides.to, this._core)(this.getPosition(false), speed);
4501	}
4502
4503	/**
4504	 * Slides to the specified item or page.
4505	 * @public
4506	 * @param {Number} position - The position of the item or page.
4507	 * @param {Number} [speed] - The time in milliseconds for the transition.
4508	 * @param {Boolean} [standard=false] - Whether to use the standard behaviour or not.
4509	 */
4510	Navigation.prototype.to = function(position, speed, standard) {
4511		var length;
4512
4513		if (!standard) {
4514			length = this._pages.length;
4515			$.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed);
4516		} else {
4517			$.proxy(this._overrides.to, this._core)(position, speed);
4518		}
4519	}
4520
4521	$.fn.owlCarousel.Constructor.Plugins.Navigation = Navigation;
4522
4523})(window.Zepto || window.jQuery, window, document);
4524
4525/**
4526 * Hash Plugin
4527 * @version 2.0.0
4528 * @author Artus Kolanowski
4529 * @license The MIT License (MIT)
4530 */
4531;(function($, window, document, undefined) {
4532	'use strict';
4533
4534	/**
4535	 * Creates the hash plugin.
4536	 * @class The Hash Plugin
4537	 * @param {Owl} carousel - The Owl Carousel
4538	 */
4539	var Hash = function(carousel) {
4540		/**
4541		 * Reference to the core.
4542		 * @protected
4543		 * @type {Owl}
4544		 */
4545		this._core = carousel;
4546
4547		/**
4548		 * Hash table for the hashes.
4549		 * @protected
4550		 * @type {Object}
4551		 */
4552		this._hashes = {};
4553
4554		/**
4555		 * The carousel element.
4556		 * @type {jQuery}
4557		 */
4558		this.$element = this._core.$element;
4559
4560		/**
4561		 * All event handlers.
4562		 * @protected
4563		 * @type {Object}
4564		 */
4565		this._handlers = {
4566			'initialized.owl.carousel': $.proxy(function() {
4567				if (this._core.settings.startPosition == 'URLHash') {
4568					$(window).trigger('hashchange.owl.navigation');
4569				}
4570			}, this),
4571			'prepared.owl.carousel': $.proxy(function(e) {
4572				var hash = $(e.content).find('[data-hash]').andSelf('[data-hash]').attr('data-hash');
4573				this._hashes[hash] = e.content;
4574			}, this)
4575		};
4576
4577		// set default options
4578		this._core.options = $.extend({}, Hash.Defaults, this._core.options);
4579
4580		// register the event handlers
4581		this.$element.on(this._handlers);
4582
4583		// register event listener for hash navigation
4584		$(window).on('hashchange.owl.navigation', $.proxy(function() {
4585			var hash = window.location.hash.substring(1),
4586				items = this._core.$stage.children(),
4587				position = this._hashes[hash] && items.index(this._hashes[hash]) || 0;
4588
4589			if (!hash) {
4590				return false;
4591			}
4592
4593			this._core.to(position, false, true);
4594		}, this));
4595	}
4596
4597	/**
4598	 * Default options.
4599	 * @public
4600	 */
4601	Hash.Defaults = {
4602		URLhashListener: false
4603	}
4604
4605	/**
4606	 * Destroys the plugin.
4607	 * @public
4608	 */
4609	Hash.prototype.destroy = function() {
4610		var handler, property;
4611
4612		$(window).off('hashchange.owl.navigation');
4613
4614		for (handler in this._handlers) {
4615			this._core.$element.off(handler, this._handlers[handler]);
4616		}
4617		for (property in Object.getOwnPropertyNames(this)) {
4618			typeof this[property] != 'function' && (this[property] = null);
4619		}
4620	}
4621
4622	$.fn.owlCarousel.Constructor.Plugins.Hash = Hash;
4623
4624})(window.Zepto || window.jQuery, window, document);
4625
4626
4627
4628/*!
4629 * Packery layout mode PACKAGED v1.1.3
4630 * sub-classes Packery
4631 * http://packery.metafizzy.co
4632 */
4633
4634!function(a){function b(a){return new RegExp("(^|\\s+)"+a+"(\\s+|$)")}function c(a,b){var c=d(a,b)?f:e;c(a,b)}var d,e,f;"classList"in document.documentElement?(d=function(a,b){return a.classList.contains(b)}
4634,e=function(a,b){a.classList.add(b)},f=function(a,b){a.classList.remove(b)}):(d=function(a,c){return b(c).test(a.className)},e=function(a,b){d(a,b)||(a.className=a.className+" "+b)},f=function(a,c){a.className=a.className.replace(b(c)," ")});var g={hasClass:d,addClass:e,removeClass:f,toggleClass:c,has:d,add:e,remove:f,toggle:c};"function"==typeof define&&define.amd?define("classie/classie",g):"object"==typeof exports?module.exports=g:a.classie=g}(window),function(a,b){"function"==typeof define&&define.amd?define("packery/js/rect",b):"object"==typeof exports?module.exports=b():(a.Packery=a.Packery||{},a.Packery.Rect=b())}(window,function(){function a(b){for(var c in a.defaults)this[c]=a.defaults[c];for(c in b)this[c]=b[c]}var b=window.Packery=function(){};return b.Rect=a,a.defaults={x:0,y:0,width:0,height:0},a.prototype.contains=function(a){var b=a.width||0,c=a.height||0;return this.x<=a.x&&this.y<=a.y&&this.x+this.width>=a.x+b&&this.y+this.height>=a.y+c},a.prototype.overlaps=function(a){var b=this.x+this.width,c=this.y+this.height,d=a.x+a.width,e=a.y+a.height;return this.x<d&&b>a.x&&this.y<e&&c>a.y},a.prototype.getMaximalFreeRects=function(b){if(!this.overlaps(b))return!1;var c,d=[],e=this.x+this.width,f=this.y+this.height,g=b.x+b.width,h=b.y+b.height;return this.y<b.y&&(c=new a({x:this.x,y:this.y,width:this.width,height:b.y-this.y}),d.push(c)),e>g&&(c=new a({x:g,y:this.y,width:e-g,height:this.height}),d.push(c)),f>h&&(c=new a({x:this.x,y:h,width:this.width,height:f-h}),d.push(c)),this.x<b.x&&(c=new a({x:this.x,y:this.y,width:b.x-this.x,height:this.height}),d.push(c)),d},a.prototype.canFit=function(a){return this.width>=a.width&&this.height>=a.height},a}),function(a,b){if("function"==typeof define&&define.amd)define("packery/js/packer",["./rect"],b);else if("object"==typeof exports)module.exports=b(require("./rect"));else{var c=a.Packery=a.Packery||{};c.Packer=b(c.Rect)}}(window,function(a){function b(a,b,c){this.width=a||0,this.height=b||0,this.sortDirection=c||"downwardLeftToRight",this.reset()}b.prototype.reset=function(){this.spaces=[],this.newSpaces=[];var b=new a({x:0,y:0,width:this.width,height:this.height});this.spaces.push(b),this.sorter=c[this.sortDirection]||c.downwardLeftToRight},b.prototype.pack=function(a){for(var b=0,c=this.spaces.length;c>b;b++){var d=this.spaces[b];if(d.canFit(a)){this.placeInSpace(a,d);break}}},b.prototype.placeInSpace=function(a,b){a.x=b.x,a.y=b.y,this.placed(a)},b.prototype.placed=function(a){for(var b=[],c=0,d=this.spaces.length;d>c;c++){var e=this.spaces[c],f=e.getMaximalFreeRects(a);f?b.push.apply(b,f):b.push(e)}this.spaces=b,this.mergeSortSpaces()},b.prototype.mergeSortSpaces=function(){b.mergeRects(this.spaces),this.spaces.sort(this.sorter)},b.prototype.addSpace=function(a){this.spaces.push(a),this.mergeSortSpaces()},b.mergeRects=function(a){for(var b=0,c=a.length;c>b;b++){var d=a[b];if(d){var e=a.slice(0);e.splice(b,1);for(var f=0,g=0,h=e.length;h>g;g++){var i=e[g],j=b>g?0:1;d.contains(i)&&(a.splice(g+j-f,1),f++)}}}return a};var c={downwardLeftToRight:function(a,b){return a.y-b.y||a.x-b.x},rightwardTopToBottom:function(a,b){return a.x-b.x||a.y-b.y}};return b}),function(a,b){"function"==typeof define&&define.amd?define("packery/js/item",["get-style-property/get-style-property","outlayer/outlayer","./rect"],b):"object"==typeof exports?module.exports=b(require("desandro-get-style-property"),require("outlayer"),require("./rect")):a.Packery.Item=b(a.getStyleProperty,a.Outlayer,a.Packery.Rect)}(window,function(a,b,c){var d=a("transform"),e=function(){b.Item.apply(this,arguments)};e.prototype=new b.Item;var f=e.prototype._create;return e.prototype._create=function(){f.call(this),this.rect=new c,this.placeRect=new c},e.prototype.dragStart=function(){this.getPosition(),this.removeTransitionStyles(),this.isTransitioning&&d&&(this.element.style[d]="none"),this.getSize(),this.isPlacing=!0,this.needsPositioning=!1,this.positionPlaceRect(this.position.x,this.position.y),this.isTransitioning=!1,this.didDrag=!1},e.prototype.dragMove=function(a,b){this.didDrag=!0;var c=this.layout.size;a-=c.paddingLeft,b-=c.paddingTop,this.positionPlaceRect(a,b)},e.prototype.dragStop=function(){this.getPosition();var a=this.position.x!=this.placeRect.x,b=this.position.y!=this.placeRect.y;this.needsPositioning=a||b,this.didDrag=!1},e.prototype.positionPlaceRect=function(a,b,c){this.placeRect.x=this.getPlaceRectCoord(a,!0),this.placeRect.y=this.getPlaceRectCoord(b,!1,c)},e.prototype.getPlaceRectCoord=function(a,b,c){var d=b?"Width":"Height",e=this.size["outer"+d],f=this.layout[b?"columnWidth":"rowHeight"],g=this.layout.size["inner"+d];b||(g=Math.max(g,this.layout.maxY),this.layout.rowHeight||(g-=this.layout.gutter));var h;if(f){f+=this.layout.gutter,g+=b?this.layout.gutter:0,a=Math.round(a/f);var i;i=this.layout.options.isHorizontal?b?"ceil":"floor":b?"floor":"ceil";var j=Math[i](g/f);j-=Math.ceil(e/f),h=j}else h=g-e;return a=c?a:Math.min(a,h),a*=f||1,Math.max(0,a)},e.prototype.copyPlaceRectPosition=function(){this.rect.x=this.placeRect.x,this.rect.y=this.placeRect.y},e.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.layout.packer.addSpace(this.rect),this.emitEvent("remove",[this])},e}),function(a,b){"function"==typeof define&&define.amd?define("packery/js/packery",["classie/classie","get-size/get-size","outlayer/outlayer","./rect","./packer","./item"],b):"object"==typeof exports?module.exports=b(require("desandro-classie"),require("get-size"),require("outlayer"),require("./rect"),require("./packer"),require("./item")):a.Packery=b(a.classie,a.getSize,a.Outlayer,a.Packery.Rect,a.Packery.Packer,a.Packery.Item)}(window,function(a,b,c,d,e,f){function g(a,b){return a.position.y-b.position.y||a.position.x-b.position.x}function h(a,b){return a.position.x-b.position.x||a.position.y-b.position.y}d.prototype.canFit=function(a){return this.width>=a.width-1&&this.height>=a.height-1};var i=c.create("packery");return i.Item=f,i.prototype._create=function(){c.prototype._create.call(this),this.packer=new e,this.stamp(this.options.stamped);var a=this;this.handleDraggabilly={dragStart:function(){a.itemDragStart(this.element)},dragMove:function(){a.itemDragMove(this.element,this.position.x,this.position.y)},dragEnd:function(){a.itemDragEnd(this.element)}},this.handleUIDraggable={start:function(b){a.itemDragStart(b.currentTarget)},drag:function(b,c){a.itemDragMove(b.currentTarget,c.position.left,c.position.top)},stop:function(b){a.itemDragEnd(b.currentTarget)}}}
4634,i.prototype._resetLayout=function(){this.getSize(),this._getMeasurements();var a=this.packer;this.options.isHorizontal?(a.width=Number.POSITIVE_INFINITY,a.height=this.size.innerHeight+this.gutter,a.sortDirection="rightwardTopToBottom"):(a.width=this.size.innerWidth+this.gutter,a.height=Number.POSITIVE_INFINITY,a.sortDirection="downwardLeftToRight"),a.reset(),this.maxY=0,this.maxX=0},i.prototype._getMeasurements=function(){this._getMeasurement("columnWidth","width"),this._getMeasurement("rowHeight","height"),this._getMeasurement("gutter","width")},i.prototype._getItemLayoutPosition=function(a){return this._packItem(a),a.rect},i.prototype._packItem=function(a){this._setRectSize(a.element,a.rect),this.packer.pack(a.rect),this._setMaxXY(a.rect)},i.prototype._setMaxXY=function(a){this.maxX=Math.max(a.x+a.width,this.maxX),this.maxY=Math.max(a.y+a.height,this.maxY)},i.prototype._setRectSize=function(a,c){var d=b(a),e=d.outerWidth,f=d.outerHeight;(e||f)&&(e=this._applyGridGutter(e,this.columnWidth),f=this._applyGridGutter(f,this.rowHeight)),c.width=Math.min(e,this.packer.width),c.height=Math.min(f,this.packer.height)},i.prototype._applyGridGutter=function(a,b){if(!b)return a+this.gutter;b+=this.gutter;var c=a%b,d=c&&1>c?"round":"ceil";return a=Math[d](a/b)*b},i.prototype._getContainerSize=function(){return this.options.isHorizontal?{width:this.maxX-this.gutter}:{height:this.maxY-this.gutter}},i.prototype._manageStamp=function(a){var b,c=this.getItem(a);if(c&&c.isPlacing)b=c.placeRect;else{var e=this._getElementOffset(a);b=new d({x:this.options.isOriginLeft?e.left:e.right,y:this.options.isOriginTop?e.top:e.bottom})}this._setRectSize(a,b),this.packer.placed(b),this._setMaxXY(b)},i.prototype.sortItemsByPosition=function(){var a=this.options.isHorizontal?h:g;this.items.sort(a)},i.prototype.fit=function(a,b,c){var d=this.getItem(a);d&&(this._getMeasurements(),this.stamp(d.element),d.getSize(),d.isPlacing=!0,b=void 0===b?d.rect.x:b,c=void 0===c?d.rect.y:c,d.positionPlaceRect(b,c,!0),this._bindFitEvents(d),d.moveTo(d.placeRect.x,d.placeRect.y),this.layout(),this.unstamp(d.element),this.sortItemsByPosition(),d.isPlacing=!1,d.copyPlaceRectPosition())},i.prototype._bindFitEvents=function(a){function b(){d++,2==d&&c.emitEvent("fitComplete",[a])}var c=this,d=0;a.on("layout",function(){return b(),!0}),this.on("layoutComplete",function(){return b(),!0})},i.prototype.resize=function(){var a=b(this.element),c=this.size&&a,d=this.options.isHorizontal?"innerHeight":"innerWidth";c&&a[d]==this.size[d]||this.layout()},i.prototype.itemDragStart=function(a){this.stamp(a);var b=this.getItem(a);b&&b.dragStart()},i.prototype.itemDragMove=function(a,b,c){function d(){f.layout(),delete f.dragTimeout}var e=this.getItem(a);e&&e.dragMove(b,c);var f=this;this.clearDragTimeout(),this.dragTimeout=setTimeout(d,40)},i.prototype.clearDragTimeout=function(){this.dragTimeout&&clearTimeout(this.dragTimeout)},i.prototype.itemDragEnd=function(b){var c,d=this.getItem(b);if(d&&(c=d.didDrag,d.dragStop()),!d||!c&&!d.needsPositioning)return void this.unstamp(b);a.add(d.element,"is-positioning-post-drag");var e=this._getDragEndLayoutComplete(b,d);d.needsPositioning?(d.on("layout",e),d.moveTo(d.placeRect.x,d.placeRect.y)):d&&d.copyPlaceRectPosition(),this.clearDragTimeout(),this.on("layoutComplete",e),this.layout()},i.prototype._getDragEndLayoutComplete=function(b,c){var d=c&&c.needsPositioning,e=0,f=d?2:1,g=this;return function(){return e++,e!=f?!0:(c&&(a.remove(c.element,"is-positioning-post-drag"),c.isPlacing=!1,
4634c.copyPlaceRectPosition()),g.unstamp(b),g.sortItemsByPosition(),d&&g.emitEvent("dragItemPositioned",[c]),!0)}},i.prototype.bindDraggabillyEvents=function(a){a.on("dragStart",this.handleDraggabilly.dragStart),a.on("dragMove",this.handleDraggabilly.dragMove),a.on("dragEnd",this.handleDraggabilly.dragEnd)},i.prototype.bindUIDraggableEvents=function(a){a.on("dragstart",this.handleUIDraggable.start).on("drag",this.handleUIDraggable.drag).on("dragstop",this.handleUIDraggable.stop)},i.Rect=d,i.Packer=e,i}),function(a,b){"function"==typeof define&&define.amd?define(["isotope/js/layout-mode","packery/js/packery","get-size/get-size"],b):"object"==typeof exports?module.exports=b(require("isotope-layout/js/layout-mode"),require("packery"),require("get-size")):b(a.Isotope.LayoutMode,a.Packery,a.getSize)}(window,function(a,b,c){function d(a,b){for(var c in b)a[c]=b[c];return a}var e=a.create("packery"),f=e.prototype._getElementOffset,g=e.prototype._getMeasurement;d(e.prototype,b.prototype),e.prototype._getElementOffset=f,e.prototype._getMeasurement=g;var h=e.prototype._resetLayout;e.prototype._resetLayout=function(){this.packer=this.packer||new b.Packer,h.apply(this,arguments)};var i=e.prototype._getItemLayoutPosition;e.prototype._getItemLayoutPosition=function(a){return a.rect=a.rect||new b.Rect,i.call(this,a)};var j=e.prototype._manageStamp;return e.prototype._manageStamp=function(){this.options.isOriginLeft=this.isotope.options.isOriginLeft,this.options.isOriginTop=this.isotope.options.isOriginTop,j.apply(this,arguments)},e.prototype.needsResizeLayout=function(){var a=c(this.element),b=this.size&&a,d=this.options.isHorizontal?"innerHeight":"innerWidth";return b&&a[d]!=this.size[d]},e});
4635
4636/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh)
4637 * Licensed under the MIT License (LICENSE.txt).
4638 *
4639 * Version: 3.1.11
4640 *
4641 * Requires: jQuery 1.2.2+
4642 */
4643!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.11",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b)["offsetParent"in a.fn?"offsetParent":"parent"]();return c.length||(c=a("body")),parseInt(c.css("fontSize"),10)},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
4644 /*!
4645 *  GMAP3 Plugin for jQuery
4646 *  Version   : 6.0.0
4647 *  Date      : 2014-04-25
4648 *  Author    : DEMONTE Jean-Baptiste
4649 *  Contact   : [email protected]
4650 *  Web site  : http://gmap3.net
4651 *  Licence   : GPL v3 : http://www.gnu.org/licenses/gpl.html
4652 *
4653 *  Copyright (c) 2010-2014 Jean-Baptiste DEMONTE
4654 *  All rights reserved.
4655 */
4656!function(t,n){function e(t){return"object"==typeof t}function o(t){return"string"==typeof t}function i(t){return"number"==typeof t}function a(t){return t===n}function r(){q=google.maps,A||(A={verbose:!1,queryLimit:{attempt:5,delay:250,random:250},classes:function(){var n={};return t.each("Map Marker InfoWindow Circle Rectangle OverlayView StreetViewPanorama KmlLayer TrafficLayer BicyclingLayer GroundOverlay StyledMapType ImageMapType".split(" "),function(t,e){n[e]=q[e]}),n}(),map:{mapTypeId:q.MapTypeId.ROADMAP,center:[46.578498,2.457275],zoom:2},overlay:{pane:"floatPane",content:"",offset:{x:0,y:0}},geoloc:{getCurrentPosition:{maximumAge:6e4,timeout:5e3}}})}function s(t,n){return a(t)?"gmap3_"+(n?Z+1:++Z):t}function u(t){var n,e=q.version.split(".");for(t=t.split("."),n=0;n<e.length;n++)e[n]=parseInt(e[n],10);for(n=0;n<t.length;n++){if(t[n]=parseInt(t[n],10),!e.hasOwnProperty(n))return!1;if(e[n]<t[n])return!1}return!0}function l(n,e,o,i,a){function r(e,i){e&&t.each(e,function(t,e){var r=n,s=e;R(e)&&(r=e[0],s=e[1]),i(o,t,function(t){s.apply(r,[a||o,t,u])})})}var s=e.td||{},u={id:i,data:s.data,tag:s.tag};r(s.events,q.event.addListener),r(s.onces,q.event.addListenerOnce)}function d(t){var n,e=[];for(n in t)t.hasOwnProperty(n)&&e.push(n);return e}function c(t,n){var e,o=arguments;for(e=2;e<o.length;e++)if(n in o[e]&&o[e].hasOwnProperty(n))return void(t[n]=o[e][n])}function p(n,e){var o,i,a=["data","tag","id","events","onces"],r={};if(n.td)for(o in n.td)n.td.hasOwnProperty(o)&&"options"!==o&&"values"!==o&&(r[o]=n.td[o]);for(i=0;i<a.length;i++)c(r,a[i],e,n.td);return r.options=t.extend({},n.opts||{},e.options||{}),r}function f(){if(A.verbose){var t,n=[];if(window.console&&z(console.error)){for(t=0;t<arguments.length;t++)n.push(arguments[t]);console.error.apply(console,n)}else{for(n="",t=0;t<arguments.length;t++)n+=arguments[t].toString()+" ";alert(n)}}}function g(t){return(i(t)||o(t))&&""!==t&&!isNaN(t)}function h(t){var n,o=[];if(!a(t))if(e(t))if(i(t.length))o=t;else for(n in t)o.push(t[n]);else o.push(t);return o}function v(n){return n?z(n)?n:(n=h(n),function(o){var i;if(a(o))return!1;if(e(o)){for(i=0;i<o.length;i++)if(t.inArray(o[i],n)>=0)return!0;return!1}return t.inArray(o,n)>=0}
4656):void 0}function m(t,n,e){var i=n?t:null;return!t||o(t)?i:t.latLng?m(t.latLng):t instanceof q.LatLng?t:g(t.lat)?new q.LatLng(t.lat,t.lng):!e&&R(t)&&g(t[0])&&g(t[1])?new q.LatLng(t[0],t[1]):i}function y(t){var n,e;return!t||t instanceof q.LatLngBounds?t||null:(R(t)?2===t.length?(n=m(t[0]),e=m(t[1])):4===t.length&&(n=m([t[0],t[1]]),e=m([t[2],t[3]])):"ne"in t&&"sw"in t?(n=m(t.ne),e=m(t.sw)):"n"in t&&"e"in t&&"s"in t&&"w"in t&&(n=m([t.n,t.e]),e=m([t.s,t.w])),n&&e?new q.LatLngBounds(e,n):null)}function w(t,n,e,i,a){var r=e?m(i.td,!1,!0):!1,s=r?{latLng:r}:i.td.address?o(i.td.address)?{address:i.td.address}:i.td.address:!1,u=s?G.get(s):!1,l=this;s?(a=a||0,u?(i.latLng=u.results[0].geometry.location,i.results=u.results,i.status=u.status,n.apply(t,[i])):(s.location&&(s.location=m(s.location)),s.bounds&&(s.bounds=y(s.bounds)),M().geocode(s,function(o,r){r===q.GeocoderStatus.OK?(G.store(s,{results:o,status:r}),i.latLng=o[0].geometry.location,i.results=o,i.status=r,n.apply(t,[i])):r===q.GeocoderStatus.OVER_QUERY_LIMIT&&a<A.queryLimit.attempt?setTimeout(function(){w.apply(l,[t,n,e,i,a+1])},A.queryLimit.delay+Math.floor(Math.random()*A.queryLimit.random)):(f("geocode failed",r,s),i.latLng=i.results=!1,i.status=r,n.apply(t,[i]))}))):(i.latLng=m(i.td,!1,!0),n.apply(t,[i]))}function L(n,e,o,i){function a(){do s++;while(s<n.length&&!("address"in n[s]));return s>=n.length?void o.apply(e,[i]):void w(r,function(e){delete e.td,t.extend(n[s],e),a.apply(r,[])},!0,{td:n[s]})}var r=this,s=-1;a()}function b(t,n,e){var o=!1;navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition(function(i){o||(o=!0,e.latLng=new q.LatLng(i.coords.latitude,i.coords.longitude),n.apply(t,[e]))},function(){o||(o=!0,e.latLng=!1,n.apply(t,[e]))},e.opts.getCurrentPosition):(e.latLng=!1,n.apply(t,[e]))}function x(t){var n,o=!1;if(e(t)&&t.hasOwnProperty("get")){for(n in t)if("get"!==n)return!1;o=!t.get.hasOwnProperty("callback")}return o}function M(){return V.geocoder||(V.geocoder=new q.Geocoder),V.geocoder}function I(){var t=[];this.get=function(n){if(t.length){var o,i,a,r,s,u=d(n);for(o=0;o<t.length;o++){for(r=t[o],s=u.length===r.keys.length,i=0;i<u.length&&s;i++)a=u[i],s=a in r.request,s&&(s=e(n[a])&&"equals"in n[a]&&z(n[a])?n[a].equals(r.request[a]):n[a]===r.request[a]);if(s)return r.results}}},this.store=function(n,e){t.push({request:n,keys:d(n),results:e})}}function P(){var t=[],n=this;n.empty=function(){return!t.length},n.add=function(n){t.push(n)},n.get=function(){return t.length?t[0]:!1},n.ack=function(){t.shift()}}function k(){function n(t){return{id:t.id,name:t.name,object:t.obj,tag:t.tag,data:t.data}}function e(t){z(t.setMap)&&t.setMap(null),z(t.remove)&&t.remove(),z(t.free)&&t.free(),t=null}var o={},i={},r=this;r.add=function(t,n,e,a){var u=t.td||{},l=s(u.id);return o[n]||(o[n]=[]),l in i&&r.clearById(l),i[l]={obj:e,sub:a,name:n,id:l,tag:u.tag,data:u.data},o[n].push(l),l},r.getById=function(t,e,o){var a=!1;return t in i&&(a=e?i[t].sub:o?n(i[t]):i[t].obj),a},r.get=function(t,e,a,r){var s,u,l=v(a);if(!o[t]||!o[t].length)return null;for(s=o[t].length;s;)if(s--,u=o[t][e?s:o[t].length-s-1],u&&i[u]){if(l&&!l(i[u].tag))continue;return r?n(i[u]):i[u].obj}return null},r.all=function(t,e,r){var s=[],u=v(e),l=function(t){var e,a;for(e=0;e<o[t].length;e++)if(a=o[t][e],a&&i[a]){if(u&&!u(i[a].tag))continue;s.push(r?n(i[a]):i[a].obj)}};if(t in o)l(t);else if(a(t))for(t in o)l(t);return s},r.rm=function(t,n,e){var a,s;if(!o[t])return!1;if(n)if(e)for(a=o[t].length-1;a>=0&&(s=o[t][a],!n(i[s].tag));a--);else for(a=0;a<o[t].length&&(s=o[t][a],!n(i[s].tag));a++);else a=e?o[t].length-1:0;return a in o[t]?r.clearById(o[t][a],a):!1},r.clearById=function(t,n){if(t in i){var r,s=i[t].name;for(r=0;a(n)&&r<o[s].length;r++)t===o[s][r]&&(n=r);return e(i[t].obj),i[t].sub&&e(i[t].sub),delete i[t],o[s].splice(n,1),!0}return!1},r.objGetById=function(t){var n,e;if(o.clusterer)for(e in o.clusterer)if((n=i[o.clusterer[e]].obj.getById(t))!==!1)return n;return!1},r.objClearById=function(t){var n;if(o.clusterer)for(n in o.clusterer)if(i[o.clusterer[n]].obj.clearById(t))return!0;return null},r.clear=function(t,n,e,i){var a,s,u,l=v(i);if(t&&t.length)t=h(t);else{t=[];for(a in o)t.push(a)}for(s=0;s<t.length;s++)if(u=t[s],n)r.rm(u,l,!0);else if(e)r.rm(u,l,!1);else for(;r.rm(u,l,!1););},r.objClear=function(n,e,a,r){var s;if(o.clusterer&&(t.inArray("marker",n)>=0||!n.length))for(s in o.clusterer)i[o.clusterer[s]].obj.clear(e,a,r)}}function B(n,e,i){function a(t){var n={};return n[t]={},n}function r(){var t;for(t in i)if(i.hasOwnProperty(t)&&!u.hasOwnProperty(t))return t}var s,u={},l=this,d={latLng:{map:!1,marker:!1,infowindow:!1,circle:!1,overlay:!1,getlatlng:!1,getmaxzoom:!1,getelevation:!1,streetviewpanorama:!1,getaddress:!0},geoloc:{getgeoloc:!0}};o(i)&&(i=a(i)),l.run=function(){for(var o,a;o=r();){if(z(n[o]))return s=o,a=t.extend(!0,{},A[o]||{},i[o].options||{}),void(o in d.latLng?i[o].values?L(i[o].values,n,n[o],{td:i[o],opts:a,session:u}):w(n,n[o],d.latLng[o],{td:i[o],opts:a,session:u}):o in d.geoloc?b(n,n[o],{td:i[o],opts:a,session:u}):n[o].apply(n,[{td:i[o],opts:a,session:u}]));u[o]=null}e.apply(n,[i,u])},l.ack=function(t){u[s]=t,l.run.apply(l,[])}}function j(){return V.ds||(V.ds=new q.DirectionsService),V.ds}function O(){return V.dms||(V.dms=new q.DistanceMatrixService),V.dms}function C(){return V.mzs||(V.mzs=new q.MaxZoomService),V.mzs}function E(){return V.es||(V.es=new q.ElevationService),V.es}function S(t){function n(){var t=this;return t.onAdd=function(){},t.onRemove=function(){},t.draw=function(){},A.classes.OverlayView.apply(t,[])}n.prototype=A.classes.OverlayView.prototype;var e=new n;return e.setMap(t),e}function T(n,o,i){function a(t){T[t]||(delete _[t].options.map,T[t]=new A.classes.Marker(_[t].options),l(n,{td:_[t]},T[t],_[t].id))}function r(){return(y=U.getProjection())?(P=!0,j.push(q.event.addListener(o,"zoom_changed",f)),j.push(q.event.addListener(o,"bounds_changed",f)),void h()):void setTimeout(function(){r.apply(B,[])},25)}function u(t){e(O[t])?(z(O[t].obj.setMap)&&O[t].obj.setMap(null),z(O[t].obj.remove)&&O[t].obj.remove(),z(O[t].shadow.remove)&&O[t].obj.remove(),z(O[t].shadow.setMap)&&O[t].shadow.setMap(null),delete O[t].obj,delete O[t].shadow):T[t]&&T[t].setMap(null),delete O[t]}function d(){var t,n,e,o,i,a,r,s,u=Math.cos,l=Math.sin,d=arguments;return d[0]instanceof q.LatLng?(t=d[0].lat(),e=d[0].lng(),d[1]instanceof q.LatLng?(n=d[1].lat(),o=d[1].lng()):(n=d[1],o=d[2])):(t=d[0],e=d[1],d[2]instanceof q.LatLng?(n=d[2].lat(),o=d[2].lng()):(n=d[2],o=d[3])),i=Math.PI*t/180,a=Math.PI*e/180,r=Math.PI*n/180,s=Math.PI*o/180,6371e3*Math.acos(Math.min(u(i)*u(r)*u(a)*u(s)+u(i)*l(a)*u(r)*l(s)+l(i)*l(r),1))}function c(){var t=d(o.getCenter(),o.getBounds().getNorthEast()),n=new q.Circle({center:o.getCenter(),radius:1.25*t});return n.getBounds()}function p(){var t,n={};for(t in O)n[t]=!0;return n}function f(){clearTimeout(m),m=setTimeout(h,25)}function g(t){var n=y.fromLatLngToDivPixel(t),e=y.fromDivPixelToLatLng(new q.Point(n.x+i.radius,n.y-i.radius)),o=y.fromDivPixelToLatLng(new q.Point(n.x-i.radius,n.y+i.radius));return new q.LatLngBounds(o,e)}function h(){if(!x&&!I&&P){var n,e,a,r,s,l,d,f,h,v,m,y=!1,b=[],B={}
4656,j=o.getZoom(),C="maxZoom"in i&&j>i.maxZoom,E=p();for(M=!1,j>3&&(s=c(),y=s.getSouthWest().lng()<s.getNorthEast().lng()),n=0;n<_.length;n++)!_[n]||y&&!s.contains(_[n].options.position)||w&&!w(D[n])||b.push(n);for(;;){for(n=0;B[n]&&n<b.length;)n++;if(n===b.length)break;if(r=[],k&&!C){m=10;do for(f=r,r=[],m--,d=f.length?s.getCenter():_[b[n]].options.position,s=g(d),e=n;e<b.length;e++)B[e]||s.contains(_[b[e]].options.position)&&r.push(e);while(f.length<r.length&&r.length>1&&m)}else for(e=n;e<b.length;e++)if(!B[e]){r.push(e);break}for(l={indexes:[],ref:[]},h=v=0,a=0;a<r.length;a++)B[r[a]]=!0,l.indexes.push(b[r[a]]),l.ref.push(b[r[a]]),h+=_[b[r[a]]].options.position.lat(),v+=_[b[r[a]]].options.position.lng();h/=r.length,v/=r.length,l.latLng=new q.LatLng(h,v),l.ref=l.ref.join("-"),l.ref in E?delete E[l.ref]:(1===r.length&&(O[l.ref]=!0),L(l))}t.each(E,function(t){u(t)}),I=!1}}var m,y,w,L,b,x=!1,M=!1,I=!1,P=!1,k=!0,B=this,j=[],O={},C={},E={},T=[],_=[],D=[],U=S(o,i.radius);r(),B.getById=function(t){return t in C?(a(C[t]),T[C[t]]):!1},B.rm=function(t){var n=C[t];T[n]&&T[n].setMap(null),delete T[n],T[n]=!1,delete _[n],_[n]=!1,delete D[n],D[n]=!1,delete C[t],delete E[n],M=!0},B.clearById=function(t){return t in C?(B.rm(t),!0):void 0},B.clear=function(t,n,e){var o,i,a,r,s,u=[],l=v(e);for(t?(o=_.length-1,i=-1,a=-1):(o=0,i=_.length,a=1),r=o;r!==i&&(!_[r]||l&&!l(_[r].tag)||(u.push(E[r]),!n&&!t));r+=a);for(s=0;s<u.length;s++)B.rm(u[s])},B.add=function(t,n){t.id=s(t.id),B.clearById(t.id),C[t.id]=T.length,E[T.length]=t.id,T.push(null),_.push(t),D.push(n),M=!0},B.addMarker=function(t,e){e=e||{},e.id=s(e.id),B.clearById(e.id),e.options||(e.options={}),e.options.position=t.getPosition(),l(n,{td:e},t,e.id),C[e.id]=T.length,E[T.length]=e.id,T.push(t),_.push(e),D.push(e.data||{}),M=!0},B.td=function(t){return _[t]},B.value=function(t){return D[t]},B.marker=function(t){return t in T?(a(t),T[t]):!1},B.markerIsSet=function(t){return Boolean(T[t])},B.setMarker=function(t,n){T[t]=n},B.store=function(t,n,e){O[t.ref]={obj:n,shadow:e}},B.free=function(){var n;for(n=0;n<j.length;n++)q.event.removeListener(j[n]);j=[],t.each(O,function(t){u(t)}),O={},t.each(_,function(t){_[t]=null}),_=[],t.each(T,function(t){T[t]&&(T[t].setMap(null),delete T[t])}),T=[],t.each(D,function(t){delete D[t]}),D=[],C={},E={}},B.filter=function(t){w=t,h()},B.enable=function(t){k!==t&&(k=t,h())},B.display=function(t){L=t},B.error=function(t){b=t},B.beginUpdate=function(){x=!0},B.endUpdate=function(){x=!1,M&&h()},B.autofit=function(t){var n;for(n=0;n<_.length;n++)_[n]&&t.extend(_[n].options.position)}}function _(t,n){var e=this;e.id=function(){return t},e.filter=function(t){n.filter(t)},e.enable=function(){n.enable(!0)},e.disable=function(){n.enable(!1)},e.add=function(t,e,o){o||n.beginUpdate(),n.addMarker(t,e),o||n.endUpdate()},e.getById=function(t){return n.getById(t)},e.clearById=function(t,e){var o;return e||n.beginUpdate(),o=n.clearById(t),e||n.endUpdate(),o},e.clear=function(t,e,o,i){i||n.beginUpdate(),n.clear(t,e,o),i||n.endUpdate()}}function D(n,e,o,i){var a=this,r=[];A.classes.OverlayView.call(a),a.setMap(n),a.onAdd=function(){var n=a.getPanes();e.pane in n&&t(n[e.pane]).append(i),t.each("dblclick click mouseover mousemove mouseout mouseup mousedown".split(" "),function(n,e){r.push(q.event.addDomListener(i[0],e,function(n){t.Event(n).stopPropagation(),q.event.trigger(a,e,[n]),a.draw()}))}),r.push(q.event.addDomListener(i[0],"contextmenu",function(n){t.Event(n).stopPropagation(),q.event.trigger(a,"rightclick",[n]),a.draw()}))},a.getPosition=function(){return o},a.setPosition=function(t){o=t,a.draw()},a.draw=function(){var t=a.getProjection().fromLatLngToDivPixel(o);i.css("left",t.x+e.offset.x+"px").css("top",t.y+e.offset.y+"px")},a.onRemove=function(){var t;for(t=0;t<r.length;t++)q.event.removeListener(r[t]);i.remove()},a.hide=function(){i.hide()},a.show=function(){i.show()},a.toggle=function(){i&&(i.is(":visible")?a.show():a.hide())},a.toggleDOM=function(){a.setMap(a.getMap()?null:n)},a.getDOMElement=function(){return i[0]}}function U(i){function r(){!b&&(b=M.get())&&b.run()}function d(){b=null,M.ack(),r.call(x)}function c(t){var n,e=t.td.callback;
4656e&&(n=Array.prototype.slice.call(arguments,1),z(e)?e.apply(i,n):R(e)&&z(e[1])&&e[1].apply(e[0],n))}function g(t,n,e){e&&l(i,t,n,e),c(t,n),b.ack(n)}function v(n,e){e=e||{};var o=e.td&&e.td.options?e.td.options:0;S?o&&(o.center&&(o.center=m(o.center)),S.setOptions(o)):(o=e.opts||t.extend(!0,{},A.map,o||{}),o.center=n||m(o.center),S=new A.classes.Map(i.get(0),o))}function w(e){var o,a,r=new T(i,S,e),s={},u={},d=[],c=/^[0-9]+$/;for(a in e)c.test(a)?(d.push(1*a),u[a]=e[a],u[a].width=u[a].width||0,u[a].height=u[a].height||0):s[a]=e[a];return d.sort(function(t,n){return t>n}),o=s.calculator?function(n){var e=[];return t.each(n,function(t,n){e.push(r.value(n))}),s.calculator.apply(i,[e])}:function(t){return t.length},r.error(function(){f.apply(x,arguments)}),r.display(function(a){var c,p,f,g,h,v,y=o(a.indexes);if(e.force||y>1)for(c=0;c<d.length;c++)d[c]<=y&&(p=u[d[c]]);p?(h=p.offset||[-p.width/2,-p.height/2],f=t.extend({},s),f.options=t.extend({pane:"overlayLayer",content:p.content?p.content.replace("CLUSTER_COUNT",y):"",offset:{x:("x"in h?h.x:h[0])||0,y:("y"in h?h.y:h[1])||0}},s.options||{}),g=x.overlay({td:f,opts:f.options,latLng:m(a)},!0),f.options.pane="floatShadow",f.options.content=t(document.createElement("div")).width(p.width+"px").height(p.height+"px").css({cursor:"pointer"}),v=x.overlay({td:f,opts:f.options,latLng:m(a)},!0),s.data={latLng:m(a),markers:[]},t.each(a.indexes,function(t,n){s.data.markers.push(r.value(n)),r.markerIsSet(n)&&r.marker(n).setMap(null)}),l(i,{td:s},v,n,{main:g,shadow:v}),r.store(a,g,v)):t.each(a.indexes,function(t,n){r.marker(n).setMap(S)})}),r}function L(n,e,o){var a=[],r="values"in n.td;return r||(n.td.values=[{options:n.opts}]),n.td.values.length?(v(),t.each(n.td.values,function(t,r){var s,u,d,c,f=p(n,r);if(f.options[o])if(f.options[o][0][0]&&R(f.options[o][0][0]))for(u=0;u<f.options[o].length;u++)for(d=0;d<f.options[o][u].length;d++)f.options[o][u][d]=m(f.options[o][u][d]);else for(u=0;u<f.options[o].length;u++)f.options[o][u]=m(f.options[o][u]);f.options.map=S,c=new q[e](f.options),a.push(c),s=I.add({td:f},e.toLowerCase(),c),l(i,{td:f},c,s)}),void g(n,r?a:a[0])):void g(n,!1)}var b,x=this,M=new P,I=new k,S=null;x._plan=function(t){var n;for(n=0;n<t.length;n++)M.add(new B(x,d,t[n]));r()},x.map=function(t){v(t.latLng,t),l(i,t,S),g(t,S)},x.destroy=function(t){I.clear(),i.empty(),S&&(S=null),g(t,!0)},x.overlay=function(n,e){var o=[],a="values"in n.td;return a||(n.td.values=[{latLng:n.latLng,options:n.opts}]),n.td.values.length?(D.__initialised||(D.prototype=new A.classes.OverlayView,D.__initialised=!0),t.each(n.td.values,function(a,r){var s,u,d=p(n,r),c=t(document.createElement("div")).css({border:"none",borderWidth:0,position:"absolute"});c.append(d.options.content),u=new D(S,d.options,m(d)||m(r),c),o.push(u),c=null,e||(s=I.add(n,"overlay",u),l(i,{td:d},u,s))}),e?o[0]:void g(n,a?o:o[0])):void g(n,!1)},x.marker=function(n){var e,o,a,r="values"in n.td,u=!S;return r||(n.opts.position=n.latLng||m(n.opts.position),n.td.values=[{options:n.opts}]),n.td.values.length?(u&&v(),n.td.cluster&&!S.getBounds()?void q.event.addListenerOnce(S,"bounds_changed",function(){x.marker.apply(x,[n])}):void(n.td.cluster?(n.td.cluster instanceof _?(o=n.td.cluster,a=I.getById(o.id(),!0)):(a=w(n.td.cluster),o=new _(s(n.td.id,!0),a),I.add(n,"clusterer",o,a)),a.beginUpdate(),t.each(n.td.values,function(t,e){var o=p(n,e);o.options.position=m(o.options.position?o.options.position:e),o.options.position&&(o.options.map=S,u&&(S.setCenter(o.options.position),u=!1),a.add(o,e))}),a.endUpdate(),g(n,o)):(e=[],t.each(n.td.values,function(t,o){var a,r,s=p(n,o);s.options.position=m(s.options.position?s.options.position:o),s.options.position&&(s.options.map=S,u&&(S.setCenter(s.options.position),u=!1),r=new A.classes.Marker(s.options),e.push(r),a=I.add({td:s},"marker",r),l(i,{td:s},r,a))}),g(n,r?e:e[0])))):void g(n,!1)},x.getroute=function(t){t.opts.origin=m(t.opts.origin,!0),t.opts.destination=m(t.opts.destination,!0),j().route(t.opts,function(n,e){c(t,e===q.DirectionsStatus.OK?n:!1,e),b.ack()})},x.getdistance=function(t){var n;for(t.opts.origins=h(t.opts.origins),n=0;n<t.opts.origins.length;n++)t.opts.origins[n]=m(t.opts.origins[n],!0);for(t.opts.destinations=h(t.opts.destinations),n=0;n<t.opts.destinations.length;n++)t.opts.destinations[n]=m(t.opts.destinations[n],!0);O().getDistanceMatrix(t.opts,function(n,e){c(t,e===q.DistanceMatrixStatus.OK?n:!1,e),b.ack()})},x.infowindow=function(e){var o=[],r="values"in e.td;r||(e.latLng&&(e.opts.position=e.latLng),e.td.values=[{options:e.opts}]),t.each(e.td.values,function(t,s){var u,d,c=p(e,s);c.options.position=m(c.options.position?c.options.position:s.latLng),S||v(c.options.position),d=new A.classes.InfoWindow(c.options),d&&(a(c.open
4656)||c.open)&&(r?d.open(S,c.anchor||n):d.open(S,c.anchor||(e.latLng?n:e.session.marker?e.session.marker:n))),o.push(d),u=I.add({td:c},"infowindow",d),l(i,{td:c},d,u)}),g(e,r?o:o[0])},x.circle=function(n){var e=[],o="values"in n.td;return o||(n.opts.center=n.latLng||m(n.opts.center),n.td.values=[{options:n.opts}]),n.td.values.length?(t.each(n.td.values,function(t,o){var a,r,s=p(n,o);s.options.center=m(s.options.center?s.options.center:o),S||v(s.options.center),s.options.map=S,r=new A.classes.Circle(s.options),e.push(r),a=I.add({td:s},"circle",r),l(i,{td:s},r,a)}),void g(n,o?e:e[0])):void g(n,!1)},x.getaddress=function(t){c(t,t.results,t.status),b.ack()},x.getlatlng=function(t){c(t,t.results,t.status),b.ack()},x.getmaxzoom=function(t){C().getMaxZoomAtLatLng(t.latLng,function(n){c(t,n.status===q.MaxZoomStatus.OK?n.zoom:!1,status),b.ack()})},x.getelevation=function(t){var n,e=[],o=function(n,e){c(t,e===q.ElevationStatus.OK?n:!1,e),b.ack()};if(t.latLng)e.push(t.latLng);else for(e=h(t.td.locations||[]),n=0;n<e.length;n++)e[n]=m(e[n]);if(e.length)E().getElevationForLocations({locations:e},o);else{if(t.td.path&&t.td.path.length)for(n=0;n<t.td.path.length;n++)e.push(m(t.td.path[n]));e.length?E().getElevationAlongPath({path:e,samples:t.td.samples},o):b.ack()}},x.defaults=function(n){t.each(n.td,function(n,o){A[n]=e(A[n])?t.extend({},A[n],o):o}),b.ack(!0)},x.rectangle=function(n){var e=[],o="values"in n.td;return o||(n.td.values=[{options:n.opts}]),n.td.values.length?(t.each(n.td.values,function(t,o){var a,r,s=p(n,o);s.options.bounds=y(s.options.bounds?s.options.bounds:o),S||v(s.options.bounds.getCenter()),s.options.map=S,r=new A.classes.Rectangle(s.options),e.push(r),a=I.add({td:s},"rectangle",r),l(i,{td:s},r,a)}),void g(n,o?e:e[0])):void g(n,!1)},x.polyline=function(t){L(t,"Polyline","path")},x.polygon=function(t){L(t,"Polygon","paths")},x.trafficlayer=function(t){v();var n=I.get("trafficlayer");n||(n=new A.classes.TrafficLayer,n.setMap(S),I.add(t,"trafficlayer",n)),g(t,n)},x.bicyclinglayer=function(t){v();var n=I.get("bicyclinglayer");n||(n=new A.classes.BicyclingLayer,n.setMap(S),I.add(t,"bicyclinglayer",n)),g(t,n)},x.groundoverlay=function(t){t.opts.bounds=y(t.opts.bounds),t.opts.bounds&&v(t.opts.bounds.getCenter());var n,e=new A.classes.GroundOverlay(t.opts.url,t.opts.bounds,t.opts.opts);e.setMap(S),n=I.add(t,"groundoverlay",e),g(t,e,n)},x.streetviewpanorama=function(n){n.opts.opts||(n.opts.opts={}),n.latLng?n.opts.opts.position=n.latLng:n.opts.opts.position&&(n.opts.opts.position=m(n.opts.opts.position)),n.td.divId?n.opts.container=document.getElementById(n.td.divId):n.opts.container&&(n.opts.container=t(n.opts.container).get(0));var e,o=new A.classes.StreetViewPanorama(n.opts.container,n.opts.opts);o&&S.setStreetView(o),e=I.add(n,"streetviewpanorama",o),g(n,o,e)},x.kmllayer=function(n){var e=[],o="values"in n.td;return o||(n.td.values=[{options:n.opts}]),n.td.values.length?(t.each(n.td.values,function(t,o){var a,r,s,d=p(n,o);S||v(),s=d.options,d.options.opts&&(s=d.options.opts,d.options.url&&(s.url=d.options.url)),s.map=S,r=u("3.10")?new A.classes.KmlLayer(s):new A.classes.KmlLayer(s.url,s),e.push(r),a=I.add({td:d},"kmllayer",r),l(i,{td:d},r,a)}),void g(n,o?e:e[0])):void g(n,!1)},x.panel=function(n){v();var e,o,r=0,s=0,u=t(document.createElement("div"));u.css({position:"absolute",zIndex:1e3,visibility:"hidden"}),n.opts.content&&(o=t(n.opts.content),u.append(o),i.first().prepend(u),a(n.opts.left)?a(n.opts.right)?n.opts.center&&(r=(i.width()-o.width())/2):r=i.width()-o.width()-n.opts.right:r=n.opts.left,a(n.opts.top)?a(n.opts.bottom)?n.opts.middle&&(s=(i.height()-o.height())/2):s=i.height()-o.height()-n.opts.bottom:s=n.opts.top,u.css({top:s,left:r,visibility:"visible"})),e=I.add(n,"panel",u),g(n,u,e),u=null},x.directionsrenderer=function(n){n.opts.map=S;var e,o=new q.DirectionsRenderer(n.opts);n.td.divId?o.setPanel(document.getElementById(n.td.divId)):n.td.container&&o.setPanel(t(n.td.container).get(0)),e=I.add(n,"directionsrenderer",o),g(n,o,e)},x.getgeoloc=function(t){g(t,t.latLng)},x.styledmaptype=function(t){v();var n=new A.classes.StyledMapType(t.td.styles,t.opts);S.mapTypes.set(t.td.id,n),g(t,n)},x.imagemaptype=function(t){v();var n=new A.classes.ImageMapType(t.opts);S.mapTypes.set(t.td.id,n),g(t,n)},x.autofit=function(n){var e=new q.LatLngBounds;t.each(I.all(),function(t,n){n.getPosition?e.extend(n.getPosition()):n.getBounds?(e.extend(n.getBounds().getNorthEast()),e.extend(n.getBounds().getSouthWest
4656())):n.getPaths?n.getPaths().forEach(function(t){t.forEach(function(t){e.extend(t)})}):n.getPath?n.getPath().forEach(function(t){e.extend(t)}):n.getCenter?e.extend(n.getCenter()):"function"==typeof _&&n instanceof _&&(n=I.getById(n.id(),!0),n&&n.autofit(e))}),e.isEmpty()||S.getBounds()&&S.getBounds().equals(e)||("maxZoom"in n.td&&q.event.addListenerOnce(S,"bounds_changed",function(){this.getZoom()>n.td.maxZoom&&this.setZoom(n.td.maxZoom)}),S.fitBounds(e)),g(n,!0)},x.clear=function(n){if(o(n.td)){if(I.clearById(n.td)||I.objClearById(n.td))return void g(n,!0);n.td={name:n.td}}n.td.id?t.each(h(n.td.id),function(t,n){I.clearById(n)||I.objClearById(n)}):(I.clear(h(n.td.name),n.td.last,n.td.first,n.td.tag),I.objClear(h(n.td.name),n.td.last,n.td.first,n.td.tag)),g(n,!0)},x.get=function(e,i,a){var r,s,u=i?e:e.td;return i||(a=u.full),o(u)?(s=I.getById(u,!1,a)||I.objGetById(u),s===!1&&(r=u,u={})):r=u.name,"map"===r&&(s=S),s||(s=[],u.id?(t.each(h(u.id),function(t,n){s.push(I.getById(n,!1,a)||I.objGetById(n))}),R(u.id)||(s=s[0])):(t.each(r?h(r):[n],function(n,e){var o;u.first?(o=I.get(e,!1,u.tag,a),o&&s.push(o)):u.all?t.each(I.all(e,u.tag,a),function(t,n){s.push(n)}):(o=I.get(e,!0,u.tag,a),o&&s.push(o))}),u.all||R(r)||(s=s[0]))),s=R(s)||!u.all?s:[s],i?s:void g(e,s)},x.exec=function(n){t.each(h(n.td.func),function(e,o){t.each(x.get(n.td,!0,n.td.hasOwnProperty("full")?n.td.full:!0),function(t,n){o.call(i,n)})}),g(n,!0)},x.trigger=function(n){if(o(n.td))q.event.trigger(S,n.td);else{var e=[S,n.td.eventName];n.td.var_args&&t.each(n.td.var_args,function(t,n){e.push(n)}),q.event.trigger.apply(q.event,e)}c(n),b.ack()}}var A,q,Z=0,z=t.isFunction,R=t.isArray,V={},G=new I;t.fn.gmap3=function(){var n,e=[],o=!0,i=[];for(r(),n=0;n<arguments.length;n++)arguments[n]&&e.push(arguments[n]);return e.length||e.push("map"),t.each(this,function(){var n=t(this),a=n.data("gmap3");o=!1,a||(a=new U(n),n.data("gmap3",a)),1!==e.length||"get"!==e[0]&&!x(e[0])?a._plan(e):i.push("get"===e[0]?a.get("map",!0):a.get(e[0].get,!0,e[0].get.full))}),i.length?1===i.length?i[0]:i:this}}(jQuery);
4657;(function($){var eventNamespace='waitForImages';$.waitForImages={hasImageProperties:['backgroundImage','listStyleImage','borderImage','borderCornerImage','cursor'],hasImageAttributes:['srcset']};$.expr[':'].uncached=function(obj){if(!$(obj).is('img[src][src!=""]')){return false}var img=new Image();img.src=obj.src;return!img.complete};$.fn.waitForImages=function(){var allImgsLength=0;var allImgsLoaded=0;var deferred=$.Deferred();var finishedCallback;var eachCallback;var waitForAll;if($.isPlainObject(arguments[0])){waitForAll=arguments[0].waitForAll;eachCallback=arguments[0].each;finishedCallback=arguments[0].finished}else{if(arguments.length===1&&$.type(arguments[0])==='boolean'){waitForAll=arguments[0]}else{finishedCallback=arguments[0];eachCallback=arguments[1];waitForAll=arguments[2]}}finishedCallback=finishedCallback||$.noop;eachCallback=eachCallback||$.noop;waitForAll=!!waitForAll;if(!$.isFunction(finishedCallback)||!$.isFunction(eachCallback)){throw new TypeError('An invalid callback was supplied.');}this.each(function(){var obj=$(this);var allImgs=[];var hasImgProperties=$.waitForImages.hasImageProperties||[];var hasImageAttributes=$.waitForImages.hasImageAttributes||[];var matchUrl=/url\(\s*(['"]?)(.*?)\1\s*\)/g;if(waitForAll){obj.find('*').addBack().each(function(){var element=$(this);if(element.is('img:uncached')){allImgs.push({src:element.attr('src'),element:element[0]})}$.each(hasImgProperties,function(i,property){var propertyValue=element.css(property);var match;if(!propertyValue){return true}while(match=matchUrl.exec(propertyValue)){allImgs.push({src:match[2],element:element[0]})}});$.each(hasImageAttributes,function(i,attribute){var attributeValue=element.attr(attribute);var attributeValues;if(!attributeValue){return true}attributeValues=attributeValue.split(',');$.each(attributeValues,function(i,value){value=$.trim(value).split(' ')[0];allImgs.push({src:value,element:element[0]})})})})}else{obj.find('img:uncached').each(function(){allImgs.push({src:this.src,element:this})})}allImgsLength=allImgs.length;allImgsLoaded=0;if(allImgsLength===0){finishedCallback.call(obj[0]);deferred.resolveWith(obj[0])}$.each(allImgs,function(i,img){var image=new Image();var events='load.'+eventNamespace+' error.'+eventNamespace;$(image).one(events,function me(event){var eachArguments=[allImgsLoaded,allImgsLength,event.type=='load'];allImgsLoaded++;eachCallback.apply(img.element,eachArguments);deferred.notifyWith(img.element,eachArguments);$(this).off(events,me);if(allImgsLoaded==allImgsLength){finishedCallback.call(obj[0]);deferred.resolveWith(obj[0]);return false}});image.src=img.src})});return deferred.promise()}}(jQuery));
4658(function(e,t,r){"use strict";function n(r){if(o=t.documentElement,a=t.body,Y(),lt=this,r=r||{},mt=r.constants||{},r.easing)for(var n in r.easing)X[n]=r.easing[n];Tt=r.edgeStrategy||"set",ft={beforerender:r.beforerender,render:r.render,keyframe:r.keyframe},ut=r.forceHeight!==!1,ut&&(zt=r.scale||1),pt=r.mobileDeceleration||x,gt=r.smoothScrolling!==!1,vt=r.smoothScrollingDuration||A,ht={targetTop:lt.getScrollTop()},Kt=(r.mobileCheck||function(){return/Android|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent||navigator.vendor||e.opera)})(),Kt?(ct=t.getElementById(r.skrollrBody||E),ct&&it(),j(),Dt(o,[y,S],[T])):Dt(o,[y,b],[T]),lt.refresh(),kt(e,"resize orientationchange",function(){var e=o.clientWidth,t=o.clientHeight;(t!==Bt||e!==$t)&&(Bt=t,$t=e,_t=!0)});var i=R();return function l(){J(),St=i(l)}(),lt}var o,a,i={get:function(){return lt},init:function(e){return lt||new n(e)},VERSION:"0.6.29"},l=Object.prototype.hasOwnProperty,s=e.Math,c=e.getComputedStyle,f="touchstart",u="touchmove",m="touchcancel",p="touchend",d="skrollable",g=d+"-before",v=d+"-between",h=d+"-after",y="skrollr",T="no-"+y,b=y+"-desktop",S=y+"-mobile",k="linear",w=1e3,x=.004,
vendor: 10,302 bytes, line 4658
4658E="skrollr-body",A=200,F="start",C="end",H="center",D="bottom",I="___skrollable_id",P=/^(?:input|textarea|button|select)$/i,N=/^\s+|\s+$/g,O=/^data(?:-(_\w+))?(?:-?(-?\d*\.?\d+p?))?(?:-?(start|end|top|center|bottom))?(?:-?(top|center|bottom))?$/,V=/\s*(@?[\w\-\[\]]+)\s*:\s*(.+?)\s*(?:;|$)/gi,z=/^(@?[a-z\-]+)\[(\w+)\]$/,q=/-([a-z0-9_])/g,L=function(e,t){return t.toUpperCase()},M=/[\-+]?[\d]*\.?[\d]+/g,$=/\{\?\}/g,B=/rgba?\(\s*-?\d+\s*,\s*-?\d+\s*,\s*-?\d+/g,_=/[a-z\-]+-gradient/g,G="",K="",Y=function(){var e=/^(?:O|Moz|webkit|ms)|(?:-(?:o|moz|webkit|ms)-)/;if(c){var t=c(a,null);for(var n in t)if(G=n.match(e)||+n==n&&t[n].match(e))break;if(!G)return G=K="",r;G=G[0],"-"===G.slice(0,1)?(K=G,G={"-webkit-":"webkit","-moz-":"Moz","-ms-":"ms","-o-":"O"}[G]):K="-"+G.toLowerCase()+"-"}},R=function(){var t=e.requestAnimationFrame||e[G.toLowerCase()+"RequestAnimationFrame"],r=Nt();return(Kt||!t)&&(t=function(t){var n=Nt()-r,o=s.max(0,1e3/60-n);return e.setTimeout(function(){r=Nt(),t()},o)}),t},U=function(){var t=e.cancelAnimationFrame||e[G.toLowerCase()+"CancelAnimationFrame"];return(Kt||!t)&&(t=function(t){return e.clearTimeout(t)}),t},X={begin:function(){return 0},end:function(){return 1},linear:function(e){return e},quadratic:function(e){return e*e},cubic:function(e){return e*e*e},swing:function(e){return-s.cos(e*s.PI)/2+.5},sqrt:function(e){return s.sqrt(e)},outCubic:function(e){return s.pow(e-1,3)+1},bounce:function(e){var t;if(.5083>=e)t=3;else if(.8489>=e)t=9;else if(.96208>=e)t=27;else{if(!(.99981>=e))return 1;t=91}return 1-s.abs(3*s.cos(1.028*e*t)/t)}};n.prototype.refresh=function(e){var n,o,a=!1;for(e===r?(a=!0,st=[],Gt=0,e=t.getElementsByTagName("*")):e.length===r&&(e=[e]),n=0,o=e.length;o>n;n++){var i=e[n],l=i,s=[],c=gt,f=Tt,u=!1;if(a&&I in i&&delete i[I],i.attributes){for(var m=0,p=i.attributes.length;p>m;m++){var g=i.attributes[m];if("data-anchor-target"!==g.name)if("data-smooth-scrolling"!==g.name)if("data-edge-strategy"!==g.name)if("data-emit-events"!==g.name){var v=g.name.match(O);if(null!==v){var h={props:g.value,element:i,eventType:g.name.replace(q,L)};s.push(h);var y=v[1];y&&(h.constant=y.substr(1));var T=v[2];/p$/.test(T)?(h.isPercentage=!0,h.offset=(0|T.slice(0,-1))/100):h.offset=0|T;var b=v[3],S=v[4]||b;b&&b!==F&&b!==C?(h.mode="relative",h.anchors=[b,S]):(h.mode="absolute",b===C?h.isEnd=!0:h.isPercentage||(h.offset=h.offset*zt))}}else u=!0;else f=g.value;else c="off"!==g.value;else if(l=t.querySelector(g.value),null===l)throw'Unable to find anchor target "'+g.value+'"'}if(s.length){var k,w,x;!a&&I in i?(x=i[I],k=st[x].styleAttr,w=st[x].classAttr):(x=i[I]=Gt++,k=i.style.cssText,w=Ht(i)),st[x]={element:i,styleAttr:k,classAttr:w,anchorTarget:l,keyFrames:s,smoothScrolling:c,edgeStrategy:f,emitEvents:u,lastFrameIndex:-1},Dt(i,[d],[])}}}for(At(),n=0,o=e.length;o>n;n++){var E=st[e[n][I]];E!==r&&(Q(E),tt(E))}return lt},n.prototype.relativeToAbsolute=function(e,t,r){var n=o.clientHeight,a=e.getBoundingClientRect(),i=a.top,l=a.bottom-a.top;return t===D?i-=n:t===H&&(i-=n/2),r===D?i+=l:r===H&&(i+=l/2),i+=lt.getScrollTop(),0|i+.5},n.prototype.animateTo=function(e,t){t=t||{};var n=Nt(),o=lt.getScrollTop();return dt={startTop:o,topDiff:e-o,targetTop:e,duration:t.duration||w,startTime:n,endTime:n+(t.duration||w),easing:X[t.easing||k],done:t.done},dt.topDiff||(dt.done&&dt.done.call(lt,!1),dt=r),lt},n.prototype.stopAnimateTo=function(){dt&&dt.done&&dt.done.call(lt,!0),dt=r},n.prototype.isAnimatingTo=function(){return!!dt},n.prototype.isMobile=function(){return Kt},n.prototype.setScrollTop=function(t,r){return yt=r===!0,Kt?Yt=s.min(s.max(t,0),Vt):e.scrollTo(0,t),lt},n.prototype.getScrollTop=function(){return Kt?Yt:e.pageYOffset||o.scrollTop||a.scrollTop||0},n.prototype.getMaxScrollTop=function(){return Vt},n.prototype.on=function(e,t){return ft[e]=t,lt},n.prototype.off=function(e){return delete ft[e],lt},n.prototype.destroy=function(){var e=U();e(St),xt(),Dt(o,[T],[y,b,S]);for(var t=0,n=st.length;n>t;t++)at(st[t].element);o.style.overflow=a.style.overflow="",o.style.height=a.style.height="",ct&&i.setStyle(ct,"transform","none"),lt=r,ct=r,ft=r,ut=r,Vt=0,zt=1,mt=r,pt=r,qt="down",Lt=-1,$t=0,Bt=0,_t=!1,dt=r,gt=r,vt=r,ht=r,yt=r,Gt=0,Tt=r,Kt=!1,Yt=0,bt=r};var j=function(){var n,i,l,c,d,g,v,h,y,T,b,S;kt(o,[f,u,m,p].join(" "),function(e){var o=e.changedTouches[0];for(c=e.target;3===c.nodeType;)c=c.parentNode;switch(d=o.clientY,g=o.clientX,T=e.timeStamp,P.test(c.tagName)||e.preventDefault(),e.type){case f:n&&n.blur(),lt.stopAnimateTo(),n=c,i=v=d,l=g,y=T;break;case u:P.test(c.tagName)&&t.activeElement!==c&&e.preventDefault(),h=d-v,S=T-b,lt.setScrollTop(Yt-h,!0),v=d,b=T;break;default:case m:case p:var a=i-d,k=l-g,w=k*k+a*a;if(49>w){if(!P.test(n.tagName)){n.focus();var x=t.createEvent("MouseEvents");x.initMouseEvent("click",!0,!0,e.view,1,o.screenX,o.screenY,o.clientX,o.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,0,null),n.dispatchEvent(x)}return}n=r;var E=h/S;E=s.max(s.min(E,3),-3);var A=s.abs(E/pt),F=E*A+.5*pt*A*A,C=lt.getScrollTop()-F,H=0;C>Vt?(H=(Vt-C)/F,C=Vt):0>C&&(H=-C/F,C=0),A*=1-H,lt.animateTo(0|C+.5,{easing:"outCubic",duration:A})}}),e.scrollTo(0,0),o.style.overflow=a.style.overflow="hidden"},W=function(){var e,t,r,n,a,i,l,c,f,u,m,p=o.clientHeight,d=Ft();for(c=0,f=st.length;f>c;c++)for(e=st[c],t=e.element,r=e.anchorTarget,n=e.keyFrames,a=0,i=n.length;i>a;a++)l=n[a],u=l.offset,m=d[l.constant]||0,l.frame=u,l.isPercentage&&(u*=p,l.frame=u),"relative"===l.mode&&(at(t),l.frame=lt.relativeToAbsolute(r,l.anchors[0],l.anchors[1])-u,at(t,!0)),l.frame+=m,ut&&!l.isEnd&&l.frame>Vt&&(Vt=l.frame);for(Vt=s.max(Vt,Ct()),c=0,f=st.length;f>c;c++){for(e=st[c],n=e.keyFrames,a=0,i=n.length;i>a;a++)l=n[a],m=d[l.constant]||0,l.isEnd&&(l.frame=Vt-l.offset+m);e.keyFrames.sort(Ot)}},Z=function(e,t){for(var r=0,n=st.length;n>r;r++){var o,a,s=st[r],c=s.element,f=s.smoothScrolling?e:t,u=s.keyFrames,m=u.length,p=u[0],y=u[u.length-1],T=p.frame>f,b=f>y.frame,S=T?p:y,k=s.emitEvents,w=s.lastFrameIndex;if(T||b){if(T&&-1===s.edge||b&&1===s.edge)continue;switch(T?(Dt(c,[g],[h,v]),k&&w>-1&&(Et(c,p.eventType,qt),s.lastFrameIndex=-1)):(Dt(c,[h],[g,v]),k&&m>w&&(Et(c,y.eventType,qt),s.lastFrameIndex=m)),s.edge=T?-1:1,s.edgeStrategy){case"reset":at(c);continue;case"ease":f=S.frame;break;default:case"set":var x=S.props;for(o in x)l.call(x,o)&&(a=ot(x[o].value),0===o.indexOf("@")?c.setAttribute(o.substr(1),a):i.setStyle(c,o,a));continue}}else 0!==s.edge&&(Dt(c,[d,v],[g,h]),s.edge=0);for(var E=0;m-1>E;E++)if(f>=u[E].frame&&u[E+1].frame>=f){var A=u[E],F=u[E+1];for(o in A.props)if(l.call(A.props,o)){var C=(f-A.frame)/(F.frame-A.frame);C=A.props[o].easing(C),a=nt(A.props[o].value,F.props[o].value,C),a=ot(a),0===o.indexOf("@")?c.setAttribute(o.substr(1),a):i.setStyle(c,o,a)}k&&w!==E&&("down"===qt?Et(c,A.eventType,qt):Et(c,F.eventType,qt),s.lastFrameIndex=E);break}}},J=function(){_t&&(_t=!1,At());var e,t,n=lt.getScrollTop(),o=Nt();if(dt)o>=dt.endTime?(n=dt.targetTop,e=dt.done,dt=r):(t=dt.easing((o-dt.startTime)/dt.duration),n=0|dt.startTop+t*dt.topDiff),lt.setScrollTop(n,!0);else if(!yt){var a=ht.targetTop-n;a&&(ht={startTop:Lt,topDiff:n-Lt,targetTop:n,startTime:Mt,endTime:Mt+vt}),ht.endTime>=o&&(t=X.sqrt((o-ht.startTime)/vt),n=0|ht.startTop+t*ht.topDiff)}if(Kt&&ct&&i.setStyle(ct,"transform","translate(0, "+-Yt+"px) "+bt),yt||Lt!==n){qt=n>Lt?"down":Lt>n?"up":qt,yt=!1;var l={curTop:n,lastTop:Lt,maxTop:Vt,direction:qt},s=ft.beforerender&&ft.beforerender.call(lt,l);s!==!1&&(Z(n,lt.getScrollTop()),Lt=n,ft.render&&ft.render.call(lt,l)),e&&e.call(lt,!1)}Mt=o},Q=function(e){for(var t=0,r=e.keyFrames.length;r>t;t++){for(var n,o,a,i,l=e.keyFrames[t],s={};null!==(i=V.exec(l.props));)a=i[1],o=i[2],n=a.match(z),null!==n?(a=n[1],n=n[2]):n=k,o=o.indexOf("!")?et(o):[o.slice(1)],s[a]={value:o,easing:X[n]};l.props=s}},et=function(e){var t=[];return B.lastIndex=0,e=e.replace(B,function(e){return e.replace(M,function(e){return 100*(e/255)+"%"})}),K&&(_.lastIndex=0,e=e.replace(_,function(e){return K+e})),e=e.replace(M,function(e){return t.push(+e),"{?}"}),t.unshift(e),t},tt=function(e){var t,r,n={};for(t=0,r=e.keyFrames.length;r>t;t++)rt(e.keyFrames[t],n);for(n={},t=e.keyFrames.length-1;t>=0;t--)rt(e.keyFrames[t],n)},rt=function(e,t){var r;for(r in t)l.call(e.props,r)||(e.props[r]=t[r]);for(r in e.props)t[r]=e.props[r]},nt=function(e,t,r){var n,o=e.length;if(o!==t.length)throw"Can't interpolate between \""+e[0]+'" and "'+t[0]+'"';var a=[e[0]];for(n=1;o>n;n++)a[n]=e[n]+(t[n]-e[n])*r;return a},ot=function(e){var t=1;return $.lastIndex=0,e[0].replace($,function(){return e[t++]})},at=function(e,t){e=[].concat(e);for(var r,n,o=0,a=e.length;a>o;o++)n=e[o],r=st[n[I]],r&&(t?(n.style.cssText=r.dirtyStyleAttr,Dt(n,r.dirtyClassAttr)):(r.dirtyStyleAttr=n.style.cssText,r.dirtyClassAttr=Ht(n),n.style.cssText=r.styleAttr,Dt(n,r.classAttr)))},it=function(){bt="translateZ(0)",i.setStyle(ct,"transform",bt);var e=c(ct),t=e.getPropertyValue("transform"),r=e.getPropertyValue(K+"transform"),n=t&&"none"!==t||r&&"none"!==r;n||(bt="")};i.setStyle=function(e,t,r){var n=e.style;if(t=t.replace(q,L).replace("-",""),"zIndex"===t)n[t]=isNaN(r)?r:""+(0|r);else if("float"===t)n.styleFloat=n.cssFloat=r;else try{G&&(n[G+t.slice(0,1).toUpperCase()+t.slice(1)]=r),n[t]=r}catch(o){}};var lt,st,ct,ft,ut,mt,pt,dt,gt,vt,ht,yt,Tt,bt,St,kt=i.addEvent=function(t,r,n){var o=function(t){return t=t||e.event,t.target||(t.target=t.srcElement),t.preventDefault||(t.preventDefault=function(){t.returnValue=!1,t.defaultPrevented=!0}),n.call(this,t)};r=r.split(" ");for(var a,i=0,l=r.length;l>i;i++)a=r[i],t.addEventListener?t.addEventListener(a,n,!1):t.attachEvent("on"+a,o),Rt.push({element:t,name:a,listener:n})},wt=i.removeEvent=function(e,t,r){t=t.split(" ");for(var n=0,o=t.length;o>n;n++)e.removeEventListener?e.removeEventListener(t[n],r,!1):e.detachEvent("on"+t[n],r)},xt=function(){for(var e,t=0,r=Rt.length;r>t;t++)e=Rt[t],wt(e.element,e.name,e.listener);Rt=[]},Et=function(e,t,r){ft.keyframe&&ft.keyframe.call(lt,e,t,r)},At=function(){var e=lt.getScrollTop();Vt=0,ut&&!Kt&&(a.style.height=""),W(),ut&&!Kt&&(a.style.height=Vt+o.clientHeight+"px"),Kt?lt.setScrollTop(s.min(lt.getScrollTop(),Vt)):lt.setScrollTop(e,!0),yt=!0},Ft=function(){var e,t,r=o.clientHeight,n={};for(e in mt)t=mt[e],"function"==typeof t?t=t.call(lt):/p$/.test(t)&&(t=t.
4658slice(0,-1)/100*r),n[e]=t;return n},Ct=function(){var e,t=0;return ct&&(t=s.max(ct.offsetHeight,ct.scrollHeight)),e=s.max(t,a.scrollHeight,a.offsetHeight,o.scrollHeight,o.offsetHeight,o.clientHeight),e-o.clientHeight},Ht=function(t){var r="className";return e.SVGElement&&t instanceof e.SVGElement&&(t=t[r],r="baseVal"),t[r]},Dt=function(t,n,o){var a="className";if(e.SVGElement&&t instanceof e.SVGElement&&(t=t[a],a="baseVal"),o===r)return t[a]=n,r;for(var i=t[a],l=0,s=o.length;s>l;l++)i=Pt(i).replace(Pt(o[l])," ");i=It(i);for(var c=0,f=n.length;f>c;c++)-1===Pt(i).indexOf(Pt(n[c]))&&(i+=" "+n[c]);t[a]=It(i)},It=function(e){return e.replace(N,"")},Pt=function(e){return" "+e+" "},Nt=Date.now||function(){return+new Date},Ot=function(e,t){return e.frame-t.frame},Vt=0,zt=1,qt="down",Lt=-1,Mt=Nt(),$t=0,Bt=0,_t=!1,Gt=0,Kt=!1,Yt=0,Rt=[];"function"==typeof define&&define.amd?define([],function(){return i}):"undefined"!=typeof module&&module.exports?module.exports=i:e.skrollr=i})(window,document);
4659
4660 /**
4661 * jQuery.share - social media sharing plugin
4662 * ---
4663 * @author Carol Skelly (http://in1.com)
4664 * @version 1.0
4665 * @license MIT license (http://opensource.org/licenses/mit-license.php)
4666 * ---
4667 */
4668
4669!function(t,e){var s=e.document;t.fn.share=function(i){var r={init:function(i){this.share.settings=t.extend({},this.share.defaults,i);var r=(this.share.settings,this.share.settings.networks),o=this.share.settings.theme,a=this.share.settings.orientation,u=this.share.settings.affix,h=this.share.settings.margin,l=this.share.settings.title||t(s).attr("title"),c=this.share.settings.urlToShare||t(location).attr("href"),p="";return t.each(t(s).find('meta[name="description"]'),function(e,s){p=t(s).attr("content")}),this.each(function(){var s,i=t(this),m=i.attr("id"),d=encodeURIComponent(c),f=l.replace("|",""),g=p.substring(0,250);r.forEach(function(e){s=n.networkDefs[e].url,s=s.replace("|u|",d).replace("|t|",f).replace("|d|",g).replace("|140|",f.substring(0,130)),t("<a href='"+s+"' title='Share this page on "+e+"' class='pop share-"+o+" share-"+o+"-"+e+"'></a>").appendTo(i)}),t("#"+m+".share-"+o).css("margin",h),"horizontal"!=a?t("#"+m+" a.share-"+o).css("display","block"):t("#"+m+" a.share-"+o).css("display","inline-block"),"undefined"!=typeof u&&(i.addClass("share-affix"),-1!=u.indexOf("right")?(i.css("left","auto"),i.css("right","0px"),-1!=u.indexOf("center")&&i.css("top","40%")):-1!=u.indexOf("left center")&&i.css("top","40%"),-1!=u.indexOf("bottom")&&(i.css("bottom","0px"),i.css("top","auto"),-1!=u.indexOf("center")&&i.css("left","40%"))),t(".pop").click(function(){return e.open(t(this).attr("href"),"t","toolbar=0,resizable=1,status=0,width=640,height=528"),!1})})}},n={networkDefs:{facebook:{url:"http://www.facebook.com/share.php?u=|u|"},twitter:{url:"https://twitter.com/share?via=in1.com&text=|140|"},linkedin:{url:"http://www.linkedin.com/shareArticle?mini=true&url=|u|&title=|t|&summary=|d|&source=in1.com"},in1:{url:"http://www.in1.com/cast?u=|u|",w:"490",h:"529"},tumblr:{url:"http://www.tumblr.com/share?v=3&u=|u|"},digg:{url:"http://digg.com/submit?url=|u|&title=|t|"},googleplus:{url:"https://plusone.google.com/_/+1/confirm?hl=en&url=|u|"},reddit:{url:"http://reddit.com/submit?url=|u|"},pinterest:{url:"http://pinterest.com/pin/create/button/?url=|u|&media=&description=|d|"},posterous:{url:"http://posterous.com/share?linkto=|u|&title=|t|"},stumbleupon:{url:"http://www.stumbleupon.com/submit?url=|u|&title=|t|"},email:{url:"mailto:?subject=|t|"}}};return r[i]?r[i].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof i&&i?void t.error('Method "'+i+'" does not exist in social plugin'):r.init.apply(this,arguments)},t.fn.share.defaults={networks:["in1","facebook","twitter","linkedin"],theme:"icon",autoShow:!0,margin:"3px",orientation:"horizontal",useIn1:!0},t.fn.share.settings={}}(jQuery,window);
4670
4671/**
4672 * @name		Shuffle Letters
4673 * @author		Martin Angelov
4674 * @version 	1.0
4675 * @url			http://tutorialzine.com/2011/09/shuffle-letters-effect-jquery/
4676 * @license		MIT License
4677 */
4678
4679(function(e){function t(e){var t="";if(e=="lowerLetter"){t="abcdefghijklmnopqrstuvwxyz0123456789"}
4679else if(e=="upperLetter"){t="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"}else if(e=="symbol"){t="0123456789"}var n=t.split("");return n[Math.floor(Math.random()*n.length)]}e.fn.shuffleLetters=function(n){var r=e.extend({step:8,fps:25,text:"",callback:function(){}},n);return this.each(function(){var n=e(this),i="";if(n.data("animated")){return true}n.data("animated",true);if(r.text){i=r.text.split("")}else{i=n.text().split("")}var s=[],o=[];for(var u=0;u<i.length;u++){var a=i[u];if(a==" "){s[u]="space";continue}else if(/[a-z]/.test(a)){s[u]="lowerLetter"}else if(/[A-Z]/.test(a)){s[u]="upperLetter"}else{s[u]="symbol"}o.push(u)}n.html("");(function f(e){var u,a=o.length,l=i.slice(0);if(e>a){n.data("animated",false);r.callback(n);return}for(u=Math.max(e,0);u<a;u++){if(u<e+r.step){l[o[u]]=t(s[o[u]])}else{l[o[u]]=""}}n.text(l.join(""));setTimeout(function(){f(e+1)},1e3/r.fps)})(-r.step)})}})(jQuery);
4680
4681
4682(function($) {
4683var selectors = []; var check_binded = false;var check_lock = false; var defaults = {interval: 250, force_process: false};var $window = $(window); var $prior_appeared;function process() {check_lock = false;for (var index in selectors) {var $appeared = $(selectors[index]).filter(function() {return $(this).is(':appeared');});$appeared.trigger('appear', [$appeared]);if ($prior_appeared) {var $disappeared = $prior_appeared.not($appeared);$disappeared.trigger('disappear', [$disappeared]);}$prior_appeared = $appeared;}}$.expr[':']['appeared'] = function(element) {var $element = $(element);if (!$element.is(':visible')) {return false;} var window_left = $window.scrollLeft(); var window_top = $window.scrollTop();var offset = $element.offset();var left = offset.left; var top = offset.top;if (top + $element.height() >= window_top &&top - ($element.data('appear-top-offset') || 0) <= window_top + $window.height() &&left + $element.width() >= window_left &&left - ($element.data('appear-left-offset') || 0) <= window_left + $window.width()) {return true;} else {return false;}};$.fn.extend({appear: function(options) {var opts = $.extend({}, defaults, options || {}); var selector = this.selector || this;if (!check_binded) {var on_check = function() {if (check_lock) {return; } check_lock = true;setTimeout(process, opts.interval);};$(window).scroll(on_check).resize(on_check);check_binded = true;} if (opts.force_process) {setTimeout(process, opts.interval);}selectors.push(selector);return $(selector);}});$.extend({force_appear: function() {if (check_binded) {process();return true;};return false;}});})(jQuery);
4684
4685
4686if (typeof Object.create !== "function") {
4687  Object.create = function(obj) {
4688    function F() {}
4689    F.prototype = obj;
4690    return new F();
4691  };
4692}
4693(function($, window, document) {
4694  var
4695    loadAPI = function loadAPI(callback) {
4696      var tag = document.createElement('script'),
4697      head = document.getElementsByTagName('head')[0];
4698      tag.src = location.protocol + '//www.youtube.com/iframe_api';
4699      head.appendChild(tag);
4700      head = null;
4701      tag = null;
4702
4703      iframeIsReady(callback);
4704    },
4705    iframeIsReady = function iframeIsReady(callback) {
4706      if (typeof YT === 'undefined' && typeof window.loadingPlayer === 'undefined') {
4707        window.loadingPlayer = true;
4708        window.dfd = $.Deferred();
4709        window.onYouTubeIframeAPIReady = function() {
4710          window.onYouTubeIframeAPIReady = null;
4711          window.dfd.resolve( "John" );
4712          callback();
4713        };
4714      } else {
4715        window.dfd.done(function( name ) {
4716          callback();
4717        });
4718      }
4719    };
4720  YTPlayer = {
4721    player: null,
4722    defaults: {
4723      ratio: 16 / 9,
4724      videoId: 'LSmgKRx5pBo',
4725      mute: true,
4726      repeat: true,
4727      width: $(window).width(),
4728      playButtonClass: 'YTPlayer-play',
4729      pauseButtonClass: 'YTPlayer-pause',
4730      muteButtonClass: 'YTPlayer-mute',
4731      volumeUpClass: 'YTPlayer-volume-up',
4732      volumeDownClass: 'YTPlayer-volume-down',
4733      start: 0,
4734      pauseOnScroll: false,
4735      fitToBackground: true,
4736      playerVars: {
4737        modestbranding: 1,
4738        autoplay: 1,
4739        controls: 0,
4740        showinfo: 0,
4741        wmode: 'transparent',
4742        branding: 0,
4743        rel: 0,
4744        autohide: 0,
4745        origin: window.location.origin
4746      },
4747      events: null
4748    },
4749    init: function init(node, userOptions) {
4750      var self = this;
4751      self.userOptions = userOptions;
4752      self.$body = $('body'),
4753      self.$node = $(node),
4754      self.$window = $(window);
4755      self.defaults.events = {
4756        onReady: function(e) {
4757          self.onPlayerReady(e);
4758          if (self.options.pauseOnScroll) {
4759            self.pauseOnScroll();
4760          }
4761          if (typeof self.options.callback == 'function') {
4762            self.options.callback.call(this);
4763          }
4764        },
4765        onStateChange: function(e) {
4766          if (e.data === 1) {
4767            self.$node.addClass('loaded');
4768          } else if (e.data === 0 && self.options.repeat) {
4769            self.player.seekTo(self.options.start);
4770          }
4771        }
4772      }
4773      self.options = $.extend(true, {}, self.defaults, self.userOptions);
4774      self.ID = (new Date()).getTime();
4775      self.holderID = 'YTPlayer-ID-' + self.ID;
4776      if (self.options.fitToBackground) {
4777        self.createBackgroundVideo();
4778      } else {
4779        self.createContainerVideo();
4780      }
4781      self.$window.on('resize.YTplayer' + self.ID, function() {
4782        self.resize(self);
4783      });
4784
4785      loadAPI(self.onYouTubeIframeAPIReady.bind(self));
4786
4787      self.resize(self);
4788
4789      return self;
4790    },
4791    pauseOnScroll: function pauseOnScroll() {
4792      var self = this;
4793      self.$window.on('scroll.YTplayer' + self.ID, function() {
4794        var state = self.player.getPlayerState();
4795        if (state === 1) {
4796          self.player.pauseVideo();
4797        }
4798      });
4799      self.$window.scrollStopped(function(){
4800        var state = self.player.getPlayerState();
4801        if (state === 2) {
4802          self.player.playVideo();
4803        }
4804      });
4805    },
4806    createContainerVideo: function createContainerVideo() {
4807      var self = this;
4808      var $YTPlayerString = $('<div id="ytplayer-container' + self.ID + '" >\
4809                                    <div id="' + self.holderID + '" class="ytplayer-player"></div> \
4810                                    </div> \
4811                                    <div id="ytplayer-shield"></div>');
4812
4813      self.$node.append($YTPlayerString);
4814      self.$YTPlayerString = $YTPlayerString;
4815      $YTPlayerString = null;
4816    },
4817    createBackgroundVideo: function createBackgroundVideo() {
4818      var self = this,
4819        $YTPlayerString = $('<div id="ytplayer-container' + self.ID + '" class="ytplayer-container background">\
4820                                    <div id="' + self.holderID + '" class="ytplayer-player"></div>\
4821                                    </div>\
4822                                    <div id="ytplayer-shield"></div>');
4823
4824      self.$node.append($YTPlayerString);
4825      self.$YTPlayerString = $YTPlayerString;
4826      $YTPlayerString = null;
4827    },
4828    resize: function resize(self) {
4829      var container = $(window);
4830
4831      if (!self.options.fitToBackground) {
4832        container = self.$node;
4833      }
4834      var width = container.width(),
4835        pWidth,
4836        height = container.height(),
4837        pHeight,
4838        $YTPlayerPlayer = $('#' + self.holderID);
4839      if (width / self.options.ratio < height) {
4840        pWidth = Math.ceil(height * self.options.ratio);
4841        $YTPlayerPlayer.width(pWidth).height(height).css({
4842          left: (width - pWidth) / 2,
4843          top: 0
4844        });
4845      } else {
4846        pHeight = Math.ceil(width / self.options.ratio); // get new player height
4847        $YTPlayerPlayer.width(width).height(pHeight).css({
4848          left: 0,
4849          top: 0
4850        });
4851      }
4852      $YTPlayerPlayer = null;
4853      container = null;
4854    },
4855    onYouTubeIframeAPIReady: function onYouTubeIframeAPIReady() {
4856      var self = this;
4857
4858      self.player = new window.YT.Player(self.holderID, {
4859        width: self.options.width,
4860        height: Math.ceil(self.options.width / self.options.ratio),
4861        videoId: self.options.videoId,
4862        playerVars: self.options.playerVars,
4863        events: self.options.events
4864      });
4865    },
4866    onPlayerReady: function onPlayerReady(e) {
4867      if (this.options.mute) {
4868        e.target.mute();
4869      }
4870      e.target.playVideo();
4871    },
4872    getPlayer: function getPlayer() {
4873      return this.player;
4874    },
4875    destroy: function destroy() {
4876      var self = this;
4877      self.$node
4878        .removeData('yt-init')
4879        .removeData('ytPlayer')
4880        .removeClass('loaded');
4881      self.$YTPlayerString.remove();
4882      $(window).off('resize.YTplayer' + self.ID);
4883      $(window).off('scroll.YTplayer' + self.ID);
4884      self.$body = null;
4885      self.$node = null;
4886      self.$YTPlayerString = null;
4887      self.player.destroy();
4888      self.player = null;
4889    }
4890  };
4891  $.fn.scrollStopped = function(callback) {
4892    var $this = $(this), self = this;
4893    $this.scroll(function(){
4894      if ($this.data('scrollTimeout')) {
4895        clearTimeout($this.data('scrollTimeout'));
4896      }
4897      $this.data('scrollTimeout', setTimeout(callback,250,self));
4898    });
4899  };
4900  $.fn.YTPlayer = function(options) {
4901    return this.each(function() {
4902      var el = this;
4903      $(el).data("yt-init", true);
4904      var player = Object.create(YTPlayer);
4905      player.init(el, options);
4906      $.data(el, "ytPlayer", player);
4907    });
4908  };
4909})(jQuery, window, document);
4910
4911/*! OwlCarousel2Thumbs - v0.1.3 | (c) 2015 @gijsroge | MIT license | https://github.com/gijsroge/OwlCarousel2-Thumbs */
4912!function(a){"use strict";var b=function(c){this.owl=c,this._thumbcontent=[],this.owl_currentitem=this.owl.options.startPosition,this.$element=this.owl.$element,this._handlers={"prepared.owl.carousel":
4912a.proxy(function(b){if(b.namespace&&this.owl._options.thumbs&&!this.owl._options.thumbImage)this._thumbcontent.push(a(b.content).find("[data-thumb]").attr("data-thumb"));else if(b.namespace&&this.owl._options.thumbs&&this.owl._options.thumbImage){var c=a(b.content).find("img");this._thumbcontent.push(c)}},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this.owl._options.thumbs&&(this.initialize(),this.currentslide(),this.draw())},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"===a.property.name&&this.owl._options.thumbs&&(this.currentslide(),this.draw())},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._initialized&&this.draw()},this)},this.owl._options=a.extend(b.Defaults,this.owl.options),this.owl.$element.on(this._handlers)};b.Defaults={thumbs:!0,thumbImage:!1,thumbContainerClass:"owl-thumbs",thumbItemClass:"owl-thumb-item"},b.prototype.currentslide=function(){this.owl_currentitem=this.owl._current-this.owl._clones.length/2,this.owl_currentitem===this.owl._items.length&&(this.owl_currentitem=0)},b.prototype.draw=function(){a(this._thumbcontent._thumbcontainer).children().filter(".active").removeClass("active"),a(this._thumbcontent._thumbcontainer).children().eq(this.owl_currentitem).addClass("active")},b.prototype.initialize=function(){var b=this.owl._options;this._thumbcontent._thumbcontainer=a("<div>").addClass(b.thumbContainerClass).appendTo(this.$element);var c;if(this.owl._options.thumbImage)for(c=0;c<this._thumbcontent.length;++c)this._thumbcontent._thumbcontainer.append("<button class="+b.thumbItemClass+'><img src="'+this._thumbcontent[c].attr("src")+'" alt="'+this._thumbcontent[c].attr("alt")+'" /></button>');else for(c=0;c<this._thumbcontent.length;++c)this._thumbcontent._thumbcontainer.append("<div class="+b.thumbItemClass+">"+this._thumbcontent[c]+"</div>");a(this._thumbcontent._thumbcontainer).on("click","button",a.proxy(function(c){var d=a(c.target).parent().is(this._thumbcontent._thumbcontainer)?a(c.target).index():a(c.target).parent().index();c.preventDefault(),this.owl.to(d,300)},this))},b.prototype.destroy=function(){var a,b;for(a in this._handlers)this.owl.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Thumbs=b}(window.Zepto||window.jQuery,window,document);
4913
4914
4915(function ($, window) {
4916    /**
4917     * Makes a nice constellation on canvas
4918     * @constructor Constellation
4919     */
4920    function Constellation (canvas, options) {
4921        var $canvas = $(canvas),
4922            context = canvas.getContext('2d'),
4923            defaults = {
4924                star: {
4925                    color: 'rgba(255, 255, 255, .5)',
4926                    width: 1
4927                },
4928                line: {
4929                    color: 'rgba(255, 255, , .5)',
4930                    width: 0.2
4931                },
4932                position: {
4933                    x: canvas.width * 1,
4934                    y: canvas.height * 0.5
4935                },
4936                width: window.innerWidth,
4937                height: window.innerHeight,
4938                velocity: 0.4,
4939                length: 60,
4940                distance: 200,
4941                radius: 150,
4942                stars: []
4943            },
4944            config = $.extend(true, {}, defaults, options);
4945
4946        function Star () {
4947            this.x = Math.random() * canvas.width;
4948            this.y = Math.random() * canvas.height;
4949
4950            this.vx = (config.velocity - (Math.random() * 0.5));
4951            this.vy = (config.velocity - (Math.random() * 0.5));
4952
4953            this.radius = Math.random() * config.star.width;
4954        }
4955
4956        Star.prototype = {
4957            create: function(){
4958                context.beginPath();
4959                context.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);
4960                context.fill();
4961            },
4962
4963            animate: function(){
4964                var i;
4965                for (i = 0; i < config.length; i++) {
4966
4967                    var star = config.stars[i];
4968
4969                    if (star.y < 0 || star.y > canvas.height) {
4970                        star.vx = star.vx;
4971                        star.vy = - star.vy;
4972                    } else if (star.x < 0 || star.x > canvas.width) {
4973                        star.vx = - star.vx;
4974                        star.vy = star.vy;
4975                    }
4976
4977                    star.x += star.vx;
4978                    star.y += star.vy;
4979                }
4980            },
4981
4982            line: function(){
4983                var length = config.length,
4984                    iStar,
4985                    jStar,
4986                    i,
4987                    j;
4988
4989                for (i = 0; i < length; i++) {
4990                    for (j = 0; j < length; j++) {
4991                        iStar = config.stars[i];
4992                        jStar = config.stars[j];
4993
4994                        if (
4995                            (iStar.x - jStar.x) < config.distance &&
4996                            (iStar.y - jStar.y) < config.distance &&
4997                            (iStar.x - jStar.x) > - config.distance &&
4998                            (iStar.y - jStar.y) > - config.distance
4999                        ) {
5000                            if (
5001                                (iStar.x - config.position.x) < config.radius &&
5002                                (iStar.y - config.position.y) < config.radius &&
5003                                (iStar.x - config.position.x) > - config.radius &&
5004                                (iStar.y - config.position.y) > - config.radius
5005                            ) {
5006                                context.beginPath();
5007                                context.moveTo(iStar.x, iStar.y);
5008                                context.lineTo(jStar.x, jStar.y);
5009                                context.stroke();
5010                                context.closePath();
5011                            }
5012                        }
5013                    }
5014                }
5015            }
5016        };
5017
5018        this.createStars = function () {
5019            var length = config.length,
5020                star,
5021                i;
5022
5023            context.clearRect(0, 0, canvas.width, canvas.height);
5024
5025            for (i = 0; i < length; i++) {
5026                config.stars.push(new Star());
5027                star = config.stars[i];
5028
5029                star.create();
5030            }
5031
5032            star.line();
5033            star.animate();
5034        };
5035
5036        this.setCanvas = function () {
5037            canvas.width = $('.particular').width();
5038            canvas.height = config.height;
5039        };
5040
5041        this.setContext = function () {
5042            context.fillStyle = config.star.color;
5043            context.strokeStyle = config.line.color;
5044            context.lineWidth = config.line.width;
5045        };
5046
5047        this.loop = function (callback) {
5048            callback();
5049
5050            window.requestAnimationFrame(function () {
5051                this.loop(callback);
5052            }.bind(this));
5053        };
5054
5055        this.bind = function () {
5056            $(window).on('mousemove', function(e){
5057                config.position.x = e.pageX - $canvas.offset().left;
5058                config.position.y = e.pageY - $canvas.offset().top;
5059            });
5060        };
5061
5062        this.init = function () {
5063            this.setCanvas();
5064            this.setContext();
5065            this.loop(this.createStars);
5066            this.bind();
5067        };
5068    }
5069
5070    $.fn.constellation = function (options) {
5071        return this.each(function () {
5072            var c = new Constellation(this, options);
5073            c.init();
5074        });
5075    };
5076})($, window);
5077
5078 /**!
5079 * easyPieChart
5080 * Lightweight plugin to render simple, animated and retina optimized pie charts
5081 *
5082 * @license Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
5083 * @author Robert Fleischmann <[email protected]> (http://robert-fleischmann.de)
5084 * @version 2.1.1
5085 **/
5086(function(e,t){if(typeof exports==="object"){module.exports=t(require("jquery"))}else if(typeof define==="function"&&define.amd){define("EasyPieChart",["jquery"],t)}else{t(e.jQuery)}})(this,function(e){var t=function(e,t){var n;var r=document.createElement("canvas");if(typeof G_vmlCanvasManager!=="undefined"){G_vmlCanvasManager.initElement(r)}var i=r.getContext("2d");r.width=r.height=t.size;e.appendChild(r);var s=1;if(window.devicePixelRatio>1){s=window.devicePixelRatio;r.style.width=r.style.height=[t.size,"px"].join("");r.width=r.height=t.size*s;i.scale(s,s)}i.translate(t.size/2,t.size/2);i.rotate((-1/2+t.rotate/180)*Math.PI);var o=(t.size-t.lineWidth)/2;if(t.scaleColor&&t.scaleLength){o-=t.scaleLength+2}Date.now=Date.now||function(){return+(new Date)};var u=function(e,t,n){n=Math.min(Math.max(0,n||1),1);i.beginPath();i.arc(0,0,o,0,Math.PI*2*n,false);i.strokeStyle=e;i.lineWidth=t;i.stroke()};var a=function(){var e;var n;var r=24;i.lineWidth=1;i.fillStyle=t.scaleColor;i.save();for(var r=24;r>0;--r){if(r%6===0){n=t.scaleLength;e=0}else{n=t.scaleLength*.6;e=t.scaleLength-n}i.fillRect(-t.size/2+e,0,n,1);i.rotate(Math.PI/12)}i.restore()};var f=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();var l=function(){t.scaleColor&&a();t.trackColor&&u(t.trackColor,t.lineWidth)};this.clear=function(){i.clearRect(t.size/-2,t.size/-2,t.size,t.size)};this.draw=function(e){if(!!t.scaleColor||!!t.trackColor){if(i.getImageData&&i.putImageData){if(!n){l();n=i.getImageData(0,0,t.size*s,t.size*s)}else{i.putImageData(n,0,0)}}else{this.clear();l()}}else{this.clear()}i.lineCap=t.lineCap;var r;if(typeof t.barColor==="function"){r=t.barColor(e)}else{r=t.barColor}if(e>0){u(r,t.lineWidth,e/100)}}.bind(this);this.animate=function(e,n){var r=Date.now();t.onStart(e,n);var i=function(){var s=Math.min(Date.now()-r,t.animate);var o=t.easing(this,s,e,n-e,t.animate);this.draw(o);t.onStep(e,n,o);if(s>=t.animate){t.onStop(e,n)}else{f(i)}}.bind(this);f(i)}.bind(this)};var n=function(e,n){var r={barColor:"#F54A4B",trackColor:"#ccc",scaleColor:"#ccc",scaleLength:0,lineCap:"round",lineWidth:10,size:152,rotate:0,animate:4e3,easing:function(e,t,n,r,i){t=t/(i/2);if(t<1){return r/2*t*t+n}return-r/2*(--t*(t-2)-1)+n},onStart:function(e,t){return},onStep:function(e,t,n){return},onStop:function(e,t){return}};if(typeof t!=="undefined"){r.renderer=t}else if(typeof SVGRenderer!=="undefined"){r.renderer=SVGRenderer}else{throw new Error("Please load either the SVG- or the CanvasRenderer")}var i={};var s=0;var o=function(){this.el=e;this.options=i;for(var t in r){if(r.hasOwnProperty(t)){i[t]=n&&typeof n[t]!=="undefined"?n[t]:r[t];if(typeof i[t]==="function"){i[t]=i[t].bind(this)}}}if(typeof i.easing==="string"&&typeof jQuery!=="undefined"&&jQuery.isFunction(jQuery.easing[i.easing])){i.easing=jQuery.easing[i.easing]}else{i.easing=r.easing}
5086this.renderer=new i.renderer(e,i);this.renderer.draw(s);if(e.dataset&&e.dataset.percent){this.update(parseFloat(e.dataset.percent))}else if(e.getAttribute&&e.getAttribute("data-percent")){this.update(parseFloat(e.getAttribute("data-percent")))}}.bind(this);this.update=function(e){e=parseFloat(e);if(i.animate){this.renderer.animate(s,e)}else{this.renderer.draw(e)}s=e;return this}.bind(this);o()};e.fn.easyPieChart=function(t){return this.each(function(){if(!e.data(this,"easyPieChart")){e.data(this,"easyPieChart",new n(this,t))}})}});
5087var Froogaloop=function(){function e(a){return new e.fn.init(a)}function g(a,c,b){if(!b.contentWindow.postMessage)return!1;a=JSON.stringify({method:a,value:c});b.contentWindow.postMessage(a,h)}function l(a){var c,b;try{c=JSON.parse(a.data),b=c.event||c.method}catch(e){}"ready"!=b||k||(k=!0);if(!/^https?:\/\/player.vimeo.com/.test(a.origin))return!1;"*"===h&&(h=a.origin);a=c.value;var m=c.data,f=""===f?null:c.player_id;c=f?d[f][b]:d[b];b=[];if(!c)return!1;void 0!==a&&b.push(a);m&&b.push(m);f&&b.push(f);
5088return 0<b.length?c.apply(null,b):c.call()}function n(a,c,b){b?(d[b]||(d[b]={}),d[b][a]=c):d[a]=c}var d={},k=!1,h="*";e.fn=e.prototype={element:null,init:function(a){"string"===typeof a&&(a=document.getElementById(a));this.element=a;return this},api:function(a,c){if(!this.element||!a)return!1;var b=this.element,d=""!==b.id?b.id:null,e=c&&c.constructor&&c.call&&c.apply?null:c,f=c&&c.constructor&&c.call&&c.apply?c:null;f&&n(a,f,d);g(a,e,b);return this},addEvent:function(a,c){if(!this.element)return!1;
5089var b=this.element,d=""!==b.id?b.id:null;n(a,c,d);"ready"!=a?g("addEventListener",a,b):"ready"==a&&k&&c.call(null,d);return this},removeEvent:function(a){if(!this.element)return!1;var c=this.element,b=""!==c.id?c.id:null;a:{if(b&&d[b]){if(!d[b][a]){b=!1;break a}d[b][a]=null}else{if(!d[a]){b=!1;break a}d[a]=null}b=!0}"ready"!=a&&b&&g("removeEventListener",a,c)}};e.fn.init.prototype=e.fn;window.addEventListener?window.addEventListener("message",l,!1):window.attachEvent("onmessage",l);return window.Froogaloop=
5090window.$f=e}();
5091(function($, window, document, undefined) {
5092
5093    'use strict';
5094
5095    var defaults = {
5096        videoMaxWidth: '855px',
5097        youtubePlayerParams: false,
5098        vimeoPlayerParams: false,
5099        dailymotionPlayerParams: false,
5100        videojs: false
5101    };
5102
5103    var Video = function(element) {
5104
5105        this.core = $(element).data('lightGallery');
5106
5107        this.$el = $(element);
5108        this.core.s = $.extend({}, defaults, this.core.s);
5109        this.videoLoaded = false;
5110
5111        this.init();
5112
5113        return this;
5114    };
5115
5116    Video.prototype.init = function() {
5117        var _this = this;
5118
5119        // Event triggered when video url found without poster
5120        _this.core.$el.on('hasVideo.lg.tm', function(event, index, src, html) {
5121            _this.core.$slide.eq(index).find('.lg-video').append(_this.loadVideo(src, 'lg-object', true, index, html));
5122            if (html) {
5123                if (_this.core.s.videojs) {
5124                    try {
5125                        videojs(_this.core.$slide.eq(index).find('.lg-html5').get(0), {}, function() {
5126                            if (!_this.videoLoaded) {
5127                                this.play();
5128                            }
5129                        });
5130                    } catch (e) {
5131                        console.error('Make sure you have included videojs');
5132                    }
5133                } else {
5134                    _this.core.$slide.eq(index).find('.lg-html5').get(0).play();
5135                }
5136            }
5137        });
5138
5139        // Set max width for video
5140        _this.core.$el.on('onAferAppendSlide.lg.tm', function(event, index) {
5141            _this.core.$slide.eq(index).find('.lg-video-cont').css('max-width', _this.core.s.videoMaxWidth);
5142            _this.videoLoaded = true;
5143        });
5144
5145        var loadOnClick = function($el) {
5146            // check slide has poster
5147            if ($el.find('.lg-object').hasClass('lg-has-poster') && $el.find('.lg-object').is(':visible')) {
5148
5149                // chack already video element present
5150                if (!$el.hasClass('lg-has-video')) {
5151
5152                    $el.addClass('lg-video-palying lg-has-video');
5153
5154                    var _src;
5155                    var _html;
5156                    var _loadVideo = function(_src, _html) {
5157
5158                        $el.find('.lg-video').append(_this.loadVideo(_src, '', false, _this.core.index, _html));
5159
5160                        if (_html) {
5161                            if (_this.core.s.videojs) {
5162                                try {
5163                                    videojs(_this.core.$slide.eq(_this.core.index).find('.lg-html5').get(0), {}, function() {
5164                                        this.play();
5165                                    });
5166                                } catch (e) {
5167                                    console.error('Make sure you have included videojs');
5168                                }
5169                            } else {
5170                                _this.core.$slide.eq(_this.core.index).find('.lg-html5').get(0).play();
5171                            }
5172                        }
5173
5174                    };
5175
5176                    if (_this.core.s.dynamic) {
5177
5178                        _src = _this.core.s.dynamicEl[_this.core.index].src;
5179                        _html = _this.core.s.dynamicEl[_this.core.index].html;
5180
5181                        _loadVideo(_src, _html);
5182
5183                    } else {
5184
5185                        _src = _this.core.$items.eq(_this.core.index).attr('href') || _this.core.$items.eq(_this.core.index).attr('data-src');
5186                        _html = _this.core.$items.eq(_this.core.index).attr('data-html');
5187
5188                        _loadVideo(_src, _html);
5189
5190                    }
5191
5192                    var $tempImg = $el.find('.lg-object');
5193                    $el.find('.lg-video').append($tempImg);
5194
5195                    // @todo loading icon for html5 videos also
5196                    // for showing the loading indicator while loading video
5197                    if (!$el.find('.lg-video-object').hasClass('lg-html5')) {
5198                        $el.removeClass('lg-complete');
5199                        $el.find('.lg-video-object').on('load.lg error.lg', function() {
5200                            $el.addClass('lg-complete');
5201                        });
5202                    }
5203
5204                } else {
5205
5206                    var youtubePlayer = $el.find('.lg-youtube').get(0);
5207                    var vimeoPlayer = $el.find('.lg-vimeo').get(0);
5208                    var dailymotionPlayer = $el.find('.lg-dailymotion').get(0);
5209                    var html5Player = $el.find('.lg-html5').get(0);
5210                    if (youtubePlayer) {
5211                        youtubePlayer.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');
5212                    } else if (vimeoPlayer) {
5213                        try {
5214                            $f(vimeoPlayer).api('play');
5215                        } catch (e) {
5216                            console.error('Make sure you have included froogaloop2 js');
5217                        }
5218                    } else if (dailymotionPlayer) {
5219                        dailymotionPlayer.contentWindow.postMessage('play', '*');
5220
5221                    } else if (html5Player) {
5222                        if (_this.core.s.videojs) {
5223                            try {
5224                                videojs(html5Player).play();
5225                            } catch (e) {
5226                                console.error('Make sure you have included videojs');
5227                            }
5228                        } else {
5229                            html5Player.play();
5230                        }
5231                    }
5232
5233                    $el.addClass('lg-video-palying');
5234
5235                }
5236            }
5237        };
5238
5239        if (_this.core.doCss() && _this.core.$items.length > 1 && ((_this.core.s.enableSwipe && _this.core.isTouch) || (_this.core.s.enableDrag && !_this.core.isTouch))) {
5240            _this.core.$el.on('onSlideClick.lg.tm', function() {
5241                var $el = _this.core.$slide.eq(_this.core.index);
5242                loadOnClick($el);
5243            });
5244        } else {
5245
5246            // For IE 9 and bellow
5247            _this.core.$slide.on('click.lg', function() {
5248                loadOnClick($(this));
5249            });
5250        }
5251
5252        _this.core.$el.on('onBeforeSlide.lg.tm', function(event, prevIndex, index) {
5253
5254            var $videoSlide = _this.core.$slide.eq(prevIndex);
5255            var youtubePlayer = $videoSlide.find('.lg-youtube').get(0);
5256            var vimeoPlayer = $videoSlide.find('.lg-vimeo').get(0);
5257            var dailymotionPlayer = $videoSlide.find('.lg-dailymotion').get(0);
5258            var html5Player = $videoSlide.find('.lg-html5').get(0);
5259            if (youtubePlayer) {
5260                youtubePlayer.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
5261            } else if (vimeoPlayer) {
5262                try {
5263                    $f(vimeoPlayer).api('pause');
5264                } catch (e) {
5265                    console.error('Make sure you have included froogaloop2 js');
5266                }
5267            } else if (dailymotionPlayer) {
5268                dailymotionPlayer.contentWindow.postMessage('pause', '*');
5269
5270            } else if (html5Player) {
5271                if (_this.core.s.videojs) {
5272                    try {
5273                        videojs(html5Player).pause();
5274                    } catch (e) {
5275                        console.error('Make sure you have included videojs');
5276                    }
5277                } else {
5278                    html5Player.pause();
5279                }
5280            }
5281
5282            var _src;
5283            if (_this.core.s.dynamic) {
5284                _src = _this.core.s.dynamicEl[index].src;
5285            } else {
5286                _src = _this.core.$items.eq(index).attr('href') || _this.core.$items.eq(index).attr('data-src');
5287
5288            }
5289
5290            var _isVideo = _this.core.isVideo(_src, index) || {};
5291            if (_isVideo.youtube || _isVideo.vimeo || _isVideo.dailymotion) {
5292                _this.core.$outer.addClass('lg-hide-download');
5293            }
5294
5295            //$videoSlide.addClass('lg-complete');
5296
5297        });
5298
5299        _this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex) {
5300            _this.core.$slide.eq(prevIndex).removeClass('lg-video-palying');
5301        });
5302    };
5303
5304    Video.prototype.loadVideo = function(src, addClass, noposter, index, html) {
5305        var video = '';
5306        var autoplay = 1;
5307        var a = '';
5308        var isVideo = this.core.isVideo(src, index) || {};
5309
5310        // Enable autoplay for first video if poster doesn't exist
5311        if (noposter) {
5312            if (this.videoLoaded) {
5313                autoplay = 0;
5314            } else {
5315                autoplay = 1;
5316            }
5317        }
5318
5319        if (isVideo.youtube) {
5320
5321            a = '?wmode=opaque&autoplay=' + autoplay + '&enablejsapi=1';
5322            if (this.core.s.youtubePlayerParams) {
5323                a = a + '&' + $.param(this.core.s.youtubePlayerParams);
5324            }
5325
5326            video = '<iframe class="lg-video-object lg-youtube ' + addClass + '" width="560" height="315" src="//www.youtube.com/embed/' + isVideo.youtube[1] + a + '" frameborder="0" allowfullscreen></iframe>';
5327
5328        } else if (isVideo.vimeo) {
5329
5330            a = '?autoplay=' + autoplay + '&api=1';
5331            if (this.core.s.vimeoPlayerParams) {
5332                a = a + '&' + $.param(this.core.s.vimeoPlayerParams);
5333            }
5334
5335            video = '<iframe class="lg-video-object lg-vimeo ' + addClass + '" width="560" height="315"  src="http://player.vimeo.com/video/' + isVideo.vimeo[1] + a + '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
5336
5337        } else if (isVideo.dailymotion) {
5338
5339            a = '?wmode=opaque&autoplay=' + autoplay + '&api=postMessage';
5340            if (this.core.s.dailymotionPlayerParams) {
5341                a = a + '&' + $.param(this.core.s.dailymotionPlayerParams);
5342            }
5343
5344            video = '<iframe class="lg-video-object lg-dailymotion ' + addClass + '" width="560" height="315" src="//www.dailymotion.com/embed/video/' + isVideo.dailymotion[1] + a + '" frameborder="0" allowfullscreen></iframe>';
5345
5346        } else if (isVideo.html5) {
5347            var fL = html.substring(0, 1);
5348            if (fL === '.' || fL === '#') {
5349                html = $(html).html();
5350            }
5351
5352            video = html;
5353        }
5354
5355        return video;
5356    };
5357
5358    Video.prototype.destroy = function() {
5359        this.videoLoaded = false;
5360    };
5361
5362    $.fn.lightGallery.modules.video = Video;
5363
5364})(jQuery, window, document);
5365 /**
5366 * Single Page Nav Plugin
5367 * Copyright (c) 2014 Chris Wojcik <[email protected]>
5368 * Dual licensed under MIT and GPL.
5369 * @author Chris Wojcik
5370 * @version 1.2.0
5371 */
5372
5373// Utility
5374if(typeof Object.create!=='function'){Object.create=function(obj){function F(){}F.prototype=obj;return new F()}}(function($,window,document,undefined){"use strict";var SinglePageNav={init:function(options,container){this.options=$.extend({},$.fn.singlePageNav.defaults,options);this.container=container;this.$container=$(container);this.$links=this.$container.find('a');if(this.options.filter!==''){this.$links=this.$links.filter(this.options.filter)}this.$window=$(window);this.$htmlbody=$('html, body');this.$links.on('click.singlePageNav',$.proxy(this.handleClick,this));this.didScroll=false;this.checkPosition();this.setTimer()},handleClick:function(e){var self=this,link=e.currentTarget,$elem=$(link.hash);e.preventDefault();if($elem.length){self.clearTimer();if(typeof self.options.beforeStart==='function'){self.options.beforeStart()}self.setActiveLink(link.hash);self.scrollTo($elem,function(){if(self.options.updateHash&&history.pushState){history.pushState(null,null,link.hash)}self.setTimer();if(typeof self.options.onComplete==='function'){self.options.onComplete()}})}},scrollTo:function($elem,callback){var self=this;var target=self.getCoords($elem).top;var called=false;self.$htmlbody.stop().animate({scrollTop:target},{duration:self.options.speed,easing:self.options.easing,complete:function(){if(typeof callback==='function'&&!called){callback()}called=true}})},setTimer:function(){var self=this;self.$window.on('scroll.singlePageNav',function(){self.didScroll=true});self.timer=setInterval(function(){if(self.didScroll){self.didScroll=false;self.checkPosition()}},250)},clearTimer:function(){clearInterval(this.timer);this.$window.off('scroll.singlePageNav');this.didScroll=false},checkPosition:function(){var scrollPos=this.$window.scrollTop();var currentSection=this.getCurrentSection(scrollPos);if(currentSection!==null){this.setActiveLink(currentSection)}},getCoords:function($elem){return{top:Math.round($elem.offset().top)-this.options.offset}},setActiveLink:function(href){var $activeLink=this.$container.find("a[href$='"+href+"']");if(!$activeLink.hasClass(this.options.currentClass)){this.$links.removeClass(this.options.currentClass);$activeLink.addClass(this.options.currentClass)}},getCurrentSection:function(scrollPos){var i,hash,coords,section;for(i=0;i<this.$links.length;i++){hash=this.$links[i].hash;if($(hash).length){coords=this.getCoords($(hash));if(scrollPos>=coords.top-this.options.threshold){section=hash;if($(".scroll-nav  a").hasClass("act-link")){$(".scroll-nav  a.act-link").each(function(){ var bgt=$(this).data('bgtex'); $(".footer-title h2").html(bgt)})}}}}return section||((this.$links.length===0)?(null):(this.$links[0].hash))}};$.fn.singlePageNav=function(options){return this.each(function(){var singlePageNav=Object.create(SinglePageNav);singlePageNav.init(options,this)})};$.fn.singlePageNav.defaults={offset:0,threshold:120,speed:400,currentClass:'current',easing:'swing',updateHash:false,filter:'',onComplete:false,beforeStart:false}})(jQuery,window,document);
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384/* jquery.nicescroll 3.6.0 InuYaksa*2014 MIT http://nicescroll.areaaperta.com */(function(f){"function"===typeof define&&define.amd?define(["jquery"],f):f(jQuery)})(function(f){var y=!1,D=!1,N=0,O=2E3,x=0,H=["webkit","ms","moz","o"],s=window.requestAnimationFrame||!1,t=window.cancelAnimationFrame||!1;if(!s)for(var P in H){var E=H[P];s||(s=window[E+"RequestAnimationFrame"]);t||(t=window[E+"CancelAnimationFrame"]||window[E+"CancelRequestAnimationFrame"])}var v=window.MutationObserver||window.WebKitMutationObserver||!1,I={zindex:"auto",cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",
5385cursorwidth:"5px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:60,mousescrollstep:24,touchbehavior:!1,hwacceleration:!0,usetransition:!0,boxzoom:!1,dblclickzoom:!0,gesturezoom:!0,grabcursorenabled:!0,autohidemode:!0,background:"",iframeautoresize:!0,cursorminheight:32,preservenativescrolling:!0,railoffset:!1,railhoffset:!1,bouncescroll:!0,spacebarenabled:!0,railpadding:{top:0,right:0,left:0,bottom:0},disableoutline:!0,horizrailenabled:!0,railalign:"right",railvalign:"bottom",
5386enabletranslate3d:!0,enablemousewheel:!0,enablekeyboard:!0,smoothscroll:!0,sensitiverail:!0,enablemouselockapi:!0,cursorfixedheight:!1,directionlockdeadzone:6,hidecurs
5386ordelay:400,nativeparentscrolling:!0,enablescrollonselection:!0,overflowx:!0,overflowy:!0,cursordragspeed:.3,rtlmode:"auto",cursordragontouch:!1,oneaxismousemode:"auto",scriptpath:function(){var f=document.getElementsByTagName("script"),f=f[f.length-1].src.split("?")[0];return 0<f.split("/").length?f.split("/").slice(0,-1).join("/")+
5387"/":""}(),preventmultitouchscrolling:!0},F=!1,Q=function(){if(F)return F;var f=document.createElement("DIV"),c=f.style,h=navigator.userAgent,m=navigator.platform,d={haspointerlock:"pointerLockElement"in document||"webkitPointerLockElement"in document||"mozPointerLockElement"in document};d.isopera="opera"in window;d.isopera12=d.isopera&&"getUserMedia"in navigator;d.isoperamini="[object OperaMini]"===Object.prototype.toString.call(window.operamini);d.isie="all"in document&&"attachEvent"in f&&!d.isopera;
5388d.isieold=d.isie&&!("msInterpolationMode"in c);d.isie7=d.isie&&!d.isieold&&(!("documentMode"in document)||7==document.documentMode);d.isie8=d.isie&&"documentMode"in document&&8==document.documentMode;d.isie9=d.isie&&"performance"in window&&9<=document.documentMode;d.isie10=d.isie&&"performance"in window&&10==document.documentMode;d.isie11="msRequestFullscreen"in f&&11<=document.documentMode;d.isie9mobile=/iemobile.9/i.test(h);d.isie9mobile&&(d.isie9=!1);d.isie7mobile=!d.isie9mobile&&d.isie7&&/iemobile/i.test(h);
5389d.ismozilla="MozAppearance"in c;d.iswebkit="WebkitAppearance"in c;d.ischrome="chrome"in window;d.ischrome22=d.ischrome&&d.haspointerlock;d.ischrome26=d.ischrome&&"transition"in c;d.cantouch="ontouchstart"in document.documentElement||"ontouchstart"in window;d.hasmstouch=window.MSPointerEvent||!1;d.hasw3ctouch=window.PointerEvent||!1;d.ismac=/^mac$/i.test(m);d.isios=d.cantouch&&/iphone|ipad|ipod/i.test(m);d.isios4=d.isios&&!("seal"in Object);d.isios7=d.isios&&"webkitHidden"in document;d.isandroid=/android/i.test(h);
5390d.haseventlistener="addEventListener"in f;d.trstyle=!1;d.hastransform=!1;d.hastranslate3d=!1;d.transitionstyle=!1;d.hastransition=!1;d.transitionend=!1;m=["transform","msTransform","webkitTransform","MozTransform","OTransform"];for(h=0;h<m.length;h++)if("undefined"!=typeof c[m[h]]){d.trstyle=m[h];break}d.hastransform=!!d.trstyle;d.hastransform&&(c[d.trstyle]="translate3d(1px,2px,3px)",d.hastranslate3d=/translate3d/.test(c[d.trstyle]));d.transitionstyle=!1;d.prefixstyle="";d.transitionend=!1;for(var m=
5391"transition webkitTransition msTransition MozTransition OTransition OTransition KhtmlTransition".split(" "),n=" -webkit- -ms- -moz- -o- -o -khtml-".split(" "),p="transitionend webkitTransitionEnd msTransitionEnd transitionend otransitionend oTransitionEnd KhtmlTransitionEnd".split(" "),h=0;h<m.length;h++)if(m[h]in c){d.transitionstyle=m[h];d.prefixstyle=n[h];d.transitionend=p[h];break}d.ischrome26&&(d.prefixstyle=n[1]);d.hastransition=d.transitionstyle;a:{h=["-webkit-grab","-moz-grab","grab"];
5391if(d.ischrome&&
5392!d.ischrome22||d.isie)h=[];for(m=0;m<h.length;m++)if(n=h[m],c.cursor=n,c.cursor==n){c=n;break a}c="url(//mail.google.com/mail/images/2/openhand.cur),n-resize"}d.cursorgrabvalue=c;d.hasmousecapture="setCapture"in f;d.hasMutationObserver=!1!==v;return F=d},R=function(k,c){function h(){var b=a.doc.css(e.trstyle);return b&&"matrix"==b.substr(0,6)?b.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/):!1}function m(){var b=a.win;if("zIndex"in b)return b.zIndex();for(;0<b.length&&9!=b[0].nodeType;){var g=
5393b.css("zIndex");if(!isNaN(g)&&0!=g)return parseInt(g);b=b.parent()}return!1}function d(b,g,q){g=b.css(g);b=parseFloat(g);return isNaN(b)?(b=w[g]||0,q=3==b?q?a.win.outerHeight()-a.win.innerHeight():a.win.outerWidth()-a.win.innerWidth():1,a.isie8&&b&&(b+=1),q?b:0):b}function n(b,g,q,c){a._bind(b,g,function(a){a=a?a:window.event;var c={original:a,target:a.target||a.srcElement,type:"wheel",deltaMode:"MozMousePixelScroll"==a.type?0:1,deltaX:0,deltaZ:0,preventDefault:function(){a.preventDefault?a.preventDefault():
5394a.returnValue=!1;return!1},stopImmediatePropagation:function(){a.stopImmediatePropagation?a.stopImmediatePropagation():a.cancelBubble=!0}};"mousewheel"==g?(c.deltaY=-.025*a.wheelDelta,a.wheelDeltaX&&(c.deltaX=-.025*a.wheelDeltaX)):c.deltaY=a.detail;return q.call(b,c)},c)}function p(b,g,c){var d,e;0==b.deltaMode?(d=-Math.floor(a.opt.mousescrollstep/54*b.deltaX),e=-Math.floor(a.opt.mousescrollstep/54*b.deltaY)):1==b.deltaMode&&(d=-Math.floor(b.deltaX*a.opt.mousescrollstep),e=-Math.floor(b.deltaY*a.opt.mousescrollstep));
5395g&&a.opt.oneaxismousemode&&0==d&&e&&(d=e,e=0,c&&(0>d?a.getScrollLeft()>=a.page.maxw:0>=a.getScrollLeft())&&(e=d,d=0));d&&(a.scrollmom&&a.scrollmom.stop(),a.lastdeltax+=d,a.debounced("mousewheelx",function(){var b=a.lastdeltax;a.lastdeltax=0;a.rail.drag||a.doScrollLeftBy(b)},15));if(e){if(a.opt.nativeparentscrolling&&c&&!a.ispage&&!a.zoomactive)if(0>e){if(a.getScrollTop()>=a.page.maxh)return!0}else if(0>=a.getScrollTop())return!0;a.scrollmom&&a.scrollmom.stop();a.lastdeltay+=e;a.debounced("mousewheely",
5396function(){var b=a.lastdeltay;a.lastdeltay=0;a.rail.drag||a.doScrollBy(b)},15)}b.stopImmediatePropagation();return b.preventDefault()}var a=this;this.version="3.6.0";this.name="nicescroll";this.me=c;this.opt={doc:f("body"),win:!1};f.extend(this.opt,I);this.opt.snapbackspeed=80;if(k)for(var G in a.opt)"undefined"!=typeof k[G]&&(a.opt[G]=k[G]);this.iddoc=(this.doc=a.opt.doc)&&this.doc[0]?this.doc[0].id||"":"";this.ispage=/^BODY|HTML/.test(a.opt.win?a.opt.win[0].nodeName:this.doc[0].nodeName);this.haswrapper=
5397!1!==a.opt.win;this.win=a.opt.win||(this.ispage?f(window):this.doc);this.docscroll=this.ispage&&!this.haswrapper?f(window):this.win;this.body=f("body");this.iframe=this.isfixed=this.viewport=!1;this.isiframe="IFRAME"==this.doc[0].nodeName&&"IFRAME"==this.win[0].nodeName;this.istextarea="TEXTAREA"==this.win[0].nodeName;this.forcescreen=!1;this.canshowonmouseevent="scroll"!=a.opt.autohidemode;this.page=this.view=this.onzoomout=this.onzoomin=this.onscrollcancel=this.onscrollend=this.onscrollstart=this.onclick=
5398this.ongesturezoom=this.onkeypress=this.onmousewheel=this.onmousemove=this.onmouseup=this.onmousedown=!1;this.scroll={x:0,y:0};this.scrollratio={x:0,y:0};this.cursorheight=20;this.scrollvaluemax=0;this.isrtlmode="auto"==this.opt.rtlmode?"rtl"==(this.win[0]==window?this.body:this.win).css("direction"):!0===this.opt.rtlmode;this.observerbody=this.observerremover=this.observer=this.scrollmom=this.scrollrunning=!1;do this.id="ascrail"+O++;while(document.getElementById(this.id));this.hasmousefocus=this.hasfocus=
5399this.zoomactive=this.zoom=this.selectiondrag=this.cursorfreezed=this.cursor=this.rail=!1;this.visibility=!0;this.hidden=this.locked=this.railslocked=!1;this.cursoractive=!0;this.wheelprevented=!1;this.overflowx=a.opt.overflowx;this.overflowy=a.opt.overflowy;this.nativescrollingarea=!1;this.checkarea=0;this.events=[];this.saved={};this.delaylist={};this.synclist={};this.lastdeltay=this.lastdeltax=0;this.detected=Q();var e=f.extend({},this.detected);this.ishwscroll=(this.canhwscroll=e.hastransform&&
5400a.opt.hwacceleration)&&a.haswrapper;this.hasreversehr=this.isrtlmode&&!e.iswebkit;this.istouchcapable=!1;!e.cantouch||e.isios||e.isandroid||!e.iswebkit&&!e.ismozilla||(this.istouchcapable=!0,e.cantouch=!1);a.opt.enablemouselockapi||(e.hasmousecapture=!1,e.haspointerlock=!1);this.debounced=function(b,g,c){var d=a.delaylist[b];a.delaylist[b]=g;d||setTimeout(function(){var g=a.delaylist[b];a.delaylist[b]=!1;g.call(a)},c)};var r=!1;this.synched=function(b,g){a.synclist[b]=g;(function(){r||(s(function(){r=
5401!1;for(var b in a.synclist){var g=a.synclist[b];g&&g.call(a);a.synclist[b]=!1}}),r=!0)})();return b};this.unsynched=function(b){a.synclist[b]&&(a.synclist[b]=!1)};this.css=function(b,g){for(var c in g)a.saved.css.push([b,c,b.css(c)]),b.css(c,g[c])};this.scrollTop=function(b){return"undefined"==typeof b?a.getScrollTop():a.setScrollTop(b)};this.scrollLeft=function(b){return"undefined"==typeof b?a.getScrollLeft():a.setScrollLeft(b)};var A=function(a,g,c,d,e,f,h){this.st=a;this.ed=g;this.spd=c;this.p1=
5402d||0;this.p2=e||1;this.p3=f||0;this.p4=h||1;this.ts=(new Date).getTime();this.df=this.ed-this.st};A.prototype={B2:function(a){return 3*a*a*(1-a)},B3:function(a){return 3*a*(1-a)*(1-a)},B4:function(a){return(1-a)*(1-a)*(1-a)},getNow:function(){var a=1-((new Date).getTime()-this.ts)/this.spd,g=this.B2(a)+this.B3(a)+this.B4(a);return 0>a?this.ed:this.st+Math.round(this.df*g)},update:function(a,g){this.st=this.getNow();this.ed=a;this.spd=g;this.ts=(new Date).getTime();this.df=this.ed-this.st;return this}};
5403if(this.ishwscroll){this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"};e.hastranslate3d&&e.isios&&this.doc.css("-webkit-backface-visibility","hidden");
5403this.getScrollTop=function(b){if(!b){if(b=h())return 16==b.length?-b[13]:-b[5];if(a.timerscroll&&a.timerscroll.bz)return a.timerscroll.bz.getNow()}return a.doc.translate.y};this.getScrollLeft=function(b){if(!b){if(b=h())return 16==b.length?-b[12]:-b[4];if(a.timerscroll&&a.timerscroll.bh)return a.timerscroll.bh.getNow()}return a.doc.translate.x};this.notifyScrollEvent=
5404function(a){var g=document.createEvent("UIEvents");g.initUIEvent("scroll",!1,!0,window,1);g.niceevent=!0;a.dispatchEvent(g)};var K=this.isrtlmode?1:-1;e.hastranslate3d&&a.opt.enabletranslate3d?(this.setScrollTop=function(b,g){a.doc.translate.y=b;a.doc.translate.ty=-1*b+"px";a.doc.css(e.trstyle,"translate3d("+a.doc.translate.tx+","+a.doc.translate.ty+",0px)");g||a.notifyScrollEvent(a.win[0])},this.setScrollLeft=function(b,g){a.doc.translate.x=b;a.doc.translate.tx=b*K+"px";a.doc.css(e.trstyle,"translate3d("+
5405a.doc.translate.tx+","+a.doc.translate.ty+",0px)");g||a.notifyScrollEvent(a.win[0])}):(this.setScrollTop=function(b,g){a.doc.translate.y=b;a.doc.translate.ty=-1*b+"px";a.doc.css(e.trstyle,"translate("+a.doc.translate.tx+","+a.doc.translate.ty+")");g||a.notifyScrollEvent(a.win[0])},this.setScrollLeft=function(b,g){a.doc.translate.x=b;a.doc.translate.tx=b*K+"px";a.doc.css(e.trstyle,"translate("+a.doc.translate.tx+","+a.doc.translate.ty+")");g||a.notifyScrollEvent(a.win[0])})}else this.getScrollTop=
5406function(){return a.docscroll.scrollTop()},this.setScrollTop=function(b){return a.docscroll.scrollTop(b)},this.getScrollLeft=function(){return a.detected.ismozilla&&a.isrtlmode?Math.abs(a.docscroll.scrollLeft()):a.docscroll.scrollLeft()},this.setScrollLeft=function(b){return a.docscroll.scrollLeft(a.detected.ismozilla&&a.isrtlmode?-b:b)};this.getTarget=function(a){return a?a.target?a.target:a.srcElement?a.srcElement:!1:!1};this.hasParent=function(a,g){if(!a)return!1;for(var c=a.target||a.srcElement||
5407a||!1;c&&c.id!=g;)c=c.parentNode||!1;return!1!==c};var w={thin:1,medium:3,thick:5};this.getDocumentScrollOffset=function(){return{top:window.pageYOffset||document.documentElement.scrollTop,left:window.pageXOffset||document.documentElement.scrollLeft}};this.getOffset=function(){if(a.isfixed){var b=a.win.offset(),g=a.getDocumentScrollOffset();b.top-=g.top;b.left-=g.left;return b}b=a.win.offset();if(!a.viewport)return b;g=a.viewport.offset();return{top:b.top-g.top,left:b.left-g.left}};this.updateScrollBar=
5408function(b){if(a.ishwscroll)a.rail.css({height:a.win.innerHeight()-(a.opt.railpadding.top+a.opt.railpadding.bottom)}),a.railh&&a.railh.css({width:a.win.innerWidth()-(a.opt.railpadding.left+a.opt.railpadding.right)});else{var g=a.getOffset(),c=g.top,e=g.left-(a.opt.railpadding.left+a.opt.railpadding.right),c=c+d(a.win,"border-top-width",!0),e=e+(a.rail.align?a.win.outerWidth()-d(a.win,"border-right-width")-a.rail.width:d(a.win,"border-left-width")),f=a.opt.railoffset;f&&(f.top&&(c+=f.top),a.rail.align&&
5409f.left&&(e+=f.left));a.railslocked||a.rail.css({top:c,left:e,height:(b?b.h:a.win.innerHeight())-(a.opt.railpadding.top+a.opt.railpadding.bottom)});a.zoom&&a.zoom.css({top:c+1,left:1==a.rail.align?e-20:e+a.rail.width+4});if(a.railh&&!a.railslocked){c=g.top;e=g.left;if(f=a.opt.railhoffset)f.top&&(c+=f.top),f.left&&(e+=f.left);b=a.railh.align?c+d(a.win,"border-top-width",!0)+a.win.innerHeight()-a.railh.height:c+d(a.win,"border-top-width",!0);e+=d(a.win,"border-left-width");a.railh.css({top:b-(a.opt.railpadding.top+
5410a.opt.railpadding.bottom),left:e,width:a.railh.width})}}};this.doRailClick=function(b,g,c){var e;a.railslocked||(a.cancelEvent(b),g?(g=c?a.doScrollLeft:a.doScrollTop,e=c?(b.pageX-a.railh.offset().left-a.cursorwidth/2)*a.scrollratio.x:(b.pageY-a.rail.offset().top-a.cursorheight/2)*a.scrollratio.y,g(e)):(g=c?a.doScrollLeftBy:a.doScrollBy,e=c?a.scroll.x:a.scroll.y,b=c?b.pageX-a.railh.offset().left:b.pageY-a.rail.offset().top,c=c?a.view.w:a.view.h,g(e>=b?c:-c)))};a.hasanimationframe=s;a.hascancelanimationframe=
5411t;a.hasanimationframe?a.hascancelanimationframe||(t=function(){a.cancelAnimationFrame=!0}):(s=function(a){return setTimeout(a,15-Math.floor(+new Date/1E3)%16)},t=clearInterval);this.init=function(){a.saved.css=[];
5411if(e.isie7mobile||e.isoperamini)return!0;e.hasmstouch&&a.css(a.ispage?f("html"):a.win,{"-ms-touch-action":"none"});a.zindex="auto";a.zindex=a.ispage||"auto"!=a.opt.zindex?a.opt.zindex:m()||"auto";!a.ispage&&"auto"!=a.zindex&&a.zindex>x&&(x=a.zindex);a.isie&&0==a.zindex&&"auto"==a.opt.zindex&&
5412(a.zindex="auto");if(!a.ispage||!e.cantouch&&!e.isieold&&!e.isie9mobile){var b=a.docscroll;a.ispage&&(b=a.haswrapper?a.win:a.doc);e.isie9mobile||a.css(b,{"overflow-y":"hidden"});a.ispage&&e.isie7&&("BODY"==a.doc[0].nodeName?a.css(f("html"),{"overflow-y":"hidden"}):"HTML"==a.doc[0].nodeName&&a.css(f("body"),{"overflow-y":"hidden"}));!e.isios||a.ispage||a.haswrapper||a.css(f("body"),{"-webkit-overflow-scrolling":"touch"});var g=f(document.createElement("div"));g.css({position:"relative",top:0,"float":"right",
5413width:a.opt.cursorwidth,height:"0px","background-color":a.opt.cursorcolor,border:a.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":a.opt.cursorborderradius,"-moz-border-radius":a.opt.cursorborderradius,"border-radius":a.opt.cursorborderradius});
5413g.hborder=parseFloat(g.outerHeight()-g.innerHeight());g.addClass("nicescroll-cursors");a.cursor=g;var c=f(document.createElement("div"));c.attr("id",a.id);c.addClass("nicescroll-rails nicescroll-rails-vr");var d,h,k=["left","right",
5414"top","bottom"],J;for(J in k)h=k[J],(d=a.opt.railpadding[h])?c.css("padding-"+h,d+"px"):a.opt.railpadding[h]=0;c.append(g);c.width=Math.max(parseFloat(a.opt.cursorwidth),g.outerWidth());c.css({width:c.width+"px",zIndex:a.zindex,background:a.opt.background,cursor:"default"});c.visibility=!0;c.scrollable=!0;c.align="left"==a.opt.railalign?0:1;a.rail=c;g=a.rail.drag=!1;!a.opt.boxzoom||a.ispage||e.isieold||(g=document.createElement("div"),a.bind(g,"click",a.doZoom),a.bind(g,"mouseenter",function(){a.zoom.css("opacity",
5415a.opt.cursoropacitymax)}),a.bind(g,"mouseleave",function(){a.zoom.css("opacity",a.opt.cursoropacitymin)}),a.zoom=f(g),a.zoom.css({cursor:"pointer","z-index":a.zindex,backgroundImage:"url("+a.opt.scriptpath+"zoomico.png)",height:18,width:18,backgroundPosition:"0px 0px"}),a.opt.dblclickzoom&&a.bind(a.win,"dblclick",a.doZoom),e.cantouch&&a.opt.gesturezoom&&(a.ongesturezoom=function(b){1.5<b.scale&&a.doZoomIn(b);.8>b.scale&&a.doZoomOut(b);return a.cancelEvent(b)},a.bind(a.win,"gestureend",a.ongesturezoom)));
5416a.railh=!1;var l;a.opt.horizrailenabled&&(a.css(b,{"overflow-x":"hidden"}),g=f(document.createElement("div")),g.css({position:"absolute",top:0,height:a.opt.cursorwidth,width:"0px","background-color":a.opt.cursorcolor,border:a.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":a.opt.cursorborderradius,"-moz-border-radius":a.opt.cursorborderradius,"border-radius":a.opt.cursorborderradius}),e.isieold&&g.css({overflow:"hidden"}),g.wborder=parseFloat(g.outerWidth()-g.innerWidth()),
5417g.addClass("nicescroll-cursors"),a.cursorh=g,l=f(document.createElement("div")),l.attr("id",a.id+"-hr"),l.addClass("nicescroll-rails nicescroll-rails-hr"),l.height=Math.max(parseFloat(a.opt.cursorwidth),g.outerHeight()),l.css({height:l.height+"px",zIndex:a.zindex,background:a.opt.background}),l.append(g),l.visibility=!0,l.scrollable=!0,l.align="top"==a.opt.railvalign?0:1,a.railh=l,a.railh.drag=!1);a.ispage?(c.css({position:"fixed",top:"0px",height:"100%"}),c.align?c.css({right:"0px"}):c.css({left:"0px"}),
5418a.body.append(c),a.railh&&(l.css({position:"fixed",left:"0px",width:"100%"}),l.align?l.css({bottom:"0px"}):l.css({top:"0px"}),a.body.append(l))):(a.ishwscroll?("static"==a.win.css("position")&&a.css(a.win,{position:"relative"}),b="HTML"==a.win[0].nodeName?a.body:a.win,f(b).scrollTop(0).scrollLeft(0),a.zoom&&(a.zoom.css({position:"absolute",top:1,right:0,"margin-right":c.width+4}),b.append(a.zoom)),c.css({position:"absolute",top:0}),c.align?c.css({right:0}):c.css({left:0}),b.append(c),l&&(l.css({position:"absolute",
5419left:0,bottom:0}),l.align?l.css({bottom:0}):l.css({top:0}),b.append(l))):(a.isfixed="fixed"==a.win.css("position"),b=a.isfixed?"fixed":"absolute",a.isfixed||(a.viewport=a.getViewport(a.win[0])),a.viewport&&(a.body=a.viewport,0==/fixed|absolute/.test(a.viewport.css("position"))&&a.css(a.viewport,{position:"relative"})),c.css({position:b}),a.zoom&&a.zoom.css({position:b}),a.updateScrollBar(),a.body.append(c),a.zoom&&a.body.append(a.zoom),a.railh&&(l.css({position:b}),a.body.append(l))),e.isios&&a.css(a.win,
5420{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),e.isie&&a.opt.disableoutline&&a.win.attr("hideFocus","true"),e.iswebkit&&a.opt.disableoutline&&a.win.css({outline:"none"}));!1===a.opt.autohidemode?(a.autohidedom=!1,a.rail.css({opacity:a.opt.cursoropacitymax}),a.railh&&a.railh.css({opacity:a.opt.cursoropacitymax})):!0===a.opt.autohidemode||"leave"===a.opt.autohidemode?(a.autohidedom=f().add(a.rail),e.isie8&&(a.autohidedom=a.autohidedom.add(a.cursor)),a.railh&&(a.autohidedom=
5421a.autohidedom.add(a.railh)),a.railh&&e.isie8&&(a.autohidedom=a.autohidedom.add(a.cursorh))):"scroll"==a.opt.autohidemode?(a.autohidedom=f().add(a.rail),a.railh&&(a.autohidedom=a.autohidedom.add(a.railh))):"cursor"==a.opt.autohidemode?(a.autohidedom=f().add(a.cursor),a.railh&&(a.autohidedom=a.autohidedom.add(a.cursorh))):"hidden"==a.opt.autohidemode&&(a.autohidedom=!1,a.hide(),a.railslocked=!1);if(e.isie9mobile)a.scrollmom=new L(a),a.onmangotouch=function(){var b=a.getScrollTop(),c=a.getScrollLeft();
5422if(b==a.scrollmom.lastscrolly&&c==a.scrollmom.lastscrollx)return!0;var g=b-a.mangotouch.sy,e=c-a.mangotouch.sx;if(0!=Math.round(Math.sqrt(Math.pow(e,2)+Math.pow(g,2)))){var d=0>g?-1:1,f=0>e?-1:1,q=+new Date;a.mangotouch.lazy&&clearTimeout(a.mangotouch.lazy);80<q-a.mangotouch.tm||a.mangotouch.dry!=d||a.mangotouch.drx!=f?(a.scrollmom.stop(),a.scrollmom.reset(c,b),a.mangotouch.sy=b,a.mangotouch.ly=b,a.mangotouch.sx=c,a.mangotouch.lx=c,a.mangotouch.dry=d,a.mangotouch.drx=f,a.mangotouch.tm=q):(a.scrollmom.stop(),
5423a.scrollmom.update(a.mangotouch.sx-e,a.mangotouch.sy-g),a.mangotouch.tm=q,g=Math.max(Math.abs(a.mangotouch.ly-b),Math.abs(a.mangotouch.lx-c)),a.mangotouch.ly=b,a.mangotouch.lx=c,2<g&&(a.mangotouch.lazy=setTimeout(function(){a.mangotouch.lazy=!1;a.mangotouch.dry=0;a.mangotouch.drx=0;a.mangotouch.tm=0;a.scrollmom.doMomentum(30)},100)))}},c=a.getScrollTop(),l=a.getScrollLeft(),a.mangotouch={sy:c,ly:c,dry:0,sx:l,lx:l,drx:0,lazy:!1,tm:0},a.bind(a.docscroll,"scroll",a.onmangotouch);else{if(e.cantouch||
5424a.istouchcapable||a.opt.touchbehavior||e.hasmstouch){a.scrollmom=new L(a);a.ontouchstart=function(b){if(b.pointerType&&2!=b.pointerType&&"touch"!=b.pointerType)return!1;a.hasmoving=!1;if(!a.railslocked){var c;if(e.hasmstouch)for(c=b.target?b.target:!1;c;){var g=f(c).getNiceScroll();if(0<g.length&&g[0].me==a.me)break;
5424if(0<g.length)return!1;if("DIV"==c.nodeName&&c.id==a.id)break;c=c.parentNode?c.parentNode:!1}a.cancelScroll();if((c=a.getTarget(b))&&/INPUT/i.test(c.nodeName)&&/range/i.test(c.type))return a.stopPropagation(b);
5425!("clientX"in b)&&"changedTouches"in b&&(b.clientX=b.changedTouches[0].clientX,b.clientY=b.changedTouches[0].clientY);a.forcescreen&&(g=b,b={original:b.original?b.original:b},b.clientX=g.screenX,b.clientY=g.screenY);a.rail.drag={x:b.clientX,y:b.clientY,sx:a.scroll.x,sy:a.scroll.y,st:a.getScrollTop(),sl:a.getScrollLeft(),pt:2,dl:!1};if(a.ispage||!a.opt.directionlockdeadzone)a.rail.drag.dl="f";else{var g=f(window).width(),d=f(window).height(),q=Math.max(document.body.scrollWidth,document.documentElement.scrollWidth),
5426h=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight),d=Math.max(0,h-d),g=Math.max(0,q-g);a.rail.drag.ck=!a.rail.scrollable&&a.railh.scrollable?0<d?"v":!1:a.rail.scrollable&&!a.railh.scrollable?0<g?"h":!1:!1;a.rail.drag.ck||(a.rail.drag.dl="f")}a.opt.touchbehavior&&a.isiframe&&e.isie&&(g=a.win.position(),a.rail.drag.x+=g.left,a.rail.drag.y+=g.top);a.hasmoving=!1;a.lastmouseup=!1;a.scrollmom.reset(b.clientX,b.clientY);if(!e.cantouch&&!this.istouchcapable&&!b.pointerType){if(!c||
5427!/INPUT|SELECT|TEXTAREA/i.test(c.nodeName))return!a.ispage&&e.hasmousecapture&&c.setCapture(),a.opt.touchbehavior?(c.onclick&&!c._onclick&&(c._onclick=c.onclick,c.onclick=function(b){if(a.hasmoving)return!1;c._onclick.call(this,b)}),a.cancelEvent(b)):a.stopPropagation(b);/SUBMIT|CANCEL|BUTTON/i.test(f(c).attr("type"))&&(pc={tg:c,click:!1},a.preventclick=pc)}}};a.ontouchend=function(b){if(!a.rail.drag)return!0;if(2==a.rail.drag.pt){if(b.pointerType&&2!=b.pointerType&&"touch"!=b.pointerType)return!1;
5428a.scrollmom.doMomentum();a.rail.drag=!1;if(a.hasmoving&&(a.lastmouseup=!0,a.hideCursor(),e.hasmousecapture&&document.releaseCapture(),!e.cantouch))return a.cancelEvent(b)}else if(1==a.rail.drag.pt)return a.onmouseup(b)};var n=a.opt.touchbehavior&&a.isiframe&&!e.hasmousecapture;a.ontouchmove=function(b,c){if(!a.rail.drag||b.targetTouches&&a.opt.preventmultitouchscrolling&&1<b.targetTouches.length||b.pointerType&&2!=b.pointerType&&"touch"!=b.pointerType)return!1;if(2==a.rail.drag.pt){if(e.cantouch&&
5429e.isios&&"undefined"==typeof b.original)return!0;a.hasmoving=!0;a.preventclick&&!a.preventclick.click&&(a.preventclick.click=a.preventclick.tg.onclick||!1,a.preventclick.tg.onclick=a.onpreventclick);b=f.extend({original:b},b);"changedTouches"in b&&(b.clientX=b.changedTouches[0].clientX,b.clientY=b.changedTouches[0].clientY);if(a.forcescreen){var g=b;b={original:b.original?b.original:b};b.clientX=g.screenX;b.clientY=g.screenY}var d,g=d=0;n&&!c&&(d=a.win.position(),g=-d.left,d=-d.top);var q=b.clientY+
5430d;d=q-a.rail.drag.y;var h=b.clientX+g,u=h-a.rail.drag.x,k=a.rail.drag.st-d;a.ishwscroll&&a.opt.bouncescroll?0>k?k=Math.round(k/2):k>a.page.maxh&&(k=a.page.maxh+Math.round((k-a.page.maxh)/2)):(0>k&&(q=k=0),k>a.page.maxh&&(k=a.page.maxh,q=0));var l;a.railh&&a.railh.scrollable&&(l=a.isrtlmode?u-a.rail.drag.sl:a.rail.drag.sl-u,a.ishwscroll&&a.opt.bouncescroll?0>l?l=Math.round(l/2):l>a.page.maxw&&(l=a.page.maxw+Math.round((l-a.page.maxw)/2)):(0>l&&(h=l=0),l>a.page.maxw&&(l=a.page.maxw,h=0)));g=!1;if(a.rail.drag.dl)g=
5431!0,"v"==a.rail.drag.dl?l=a.rail.drag.sl:"h"==a.rail.drag.dl&&(k=a.rail.drag.st);else{d=Math.abs(d);var u=Math.abs(u),z=a.opt.directionlockdeadzone;if("v"==a.rail.drag.ck){if(d>z&&u<=.3*d)return a.rail.drag=!1,!0;u>z&&(a.rail.drag.dl="f",f("body").scrollTop(f("body").scrollTop()))}else if("h"==a.rail.drag.ck){if(u>z&&d<=.3*u)return a.rail.drag=!1,!0;d>z&&(a.rail.drag.dl="f",f("body").scrollLeft(f("body").scrollLeft()))}}a.synched("touchmove",function(){a.rail.drag&&2==a.rail.drag.pt&&(a.prepareTransition&&
5432a.prepareTransition(0),a.rail.scrollable&&a.setScrollTop(k),a.scrollmom.update(h,q),a.railh&&a.railh.scrollable?(a.setScrollLeft(l),a.showCursor(k,l)):a.showCursor(k),e.isie10&&document.selection.clear())});e.ischrome&&a.istouchcapable&&(g=!1);if(g)return a.cancelEvent(b)}else if(1==a.rail.drag.pt)return a.onmousemove(b)}}a.onmousedown=function(b,c){if(!a.rail.drag||1==a.rail.drag.pt){if(a.railslocked)return a.cancelEvent(b);a.cancelScroll();a.rail.drag={x:b.clientX,y:b.clientY,sx:a.scroll.x,sy:a.scroll.y,
5433pt:1,hr:!!c};var g=a.getTarget(b);!a.ispage&&e.hasmousecapture&&g.setCapture();a.isiframe&&!e.hasmousecapture&&(a.saved.csspointerevents=a.doc.css("pointer-events"),a.css(a.doc,{"pointer-events":"none"}));a.hasmoving=!1;return a.cancelEvent(b)}};a.onmouseup=function(b){if(a.rail.drag){if(1!=a.rail.drag.pt)return!0;e.hasmousecapture&&document.releaseCapture();a.isiframe&&!e.hasmousecapture&&a.doc.css("pointer-events",a.saved.csspointerevents);a.rail.drag=!1;a.hasmoving&&a.triggerScrollEnd();return a.cancelEvent(b)}};
5434a.onmousemove=function(b){if(a.rail.drag&&1==a.rail.drag.pt){if(e.ischrome&&0==b.which)return a.onmouseup(b);a.cursorfreezed=!0;a.hasmoving=!0;if(a.rail.drag.hr){a.scroll.x=a.rail.drag.sx+(b.clientX-a.rail.drag.x);0>a.scroll.x&&(a.scroll.x=0);var c=a.scrollvaluemaxw;a.scroll.x>c&&(a.scroll.x=c)}else a.scroll.y=a.rail.drag.sy+(b.clientY-a.rail.drag.y),0>a.scroll.y&&(a.scroll.y=0),c=a.scrollvaluemax,a.scroll.y>c&&(a.scroll.y=c);a.synched("mousemove",function(){a.rail.drag&&1==a.rail.drag.pt&&(a.showCursor(),
5435a.rail.drag.hr?a.hasreversehr?a.doScrollLeft(a.scrollvaluemaxw-Math.round(a.scroll.x*a.scrollratio.x),a.opt.cursordragspeed):a.doScrollLeft(Math.round(a.scroll.x*a.scrollratio.x),a.opt.cursordragspeed):a.doScrollTop(Math.round(a.scroll.y*a.scrollratio.y),a.opt.cursordragspeed))});return a.cancelEvent(b)}};if(e.cantouch||a.opt.touchbehavior)a.onpreventclick=function(b){if(a.preventclick)return a.preventclick.tg.oncl
5435ick=a.preventclick.click,a.preventclick=!1,a.cancelEvent(b)},a.bind(a.win,"mousedown",
5436a.ontouchstart),a.onclick=e.isios?!1:function(b){return a.lastmouseup?(a.lastmouseup=!1,a.cancelEvent(b)):!0},a.opt.grabcursorenabled&&e.cursorgrabvalue&&(a.css(a.ispage?a.doc:a.win,{cursor:e.cursorgrabvalue}),a.css(a.rail,{cursor:e.cursorgrabvalue}));else{var p=function(b){if(a.selectiondrag){if(b){var c=a.win.outerHeight();b=b.pageY-a.selectiondrag.top;0<b&&b<c&&(b=0);b>=c&&(b-=c);a.selectiondrag.df=b}0!=a.selectiondrag.df&&(a.doScrollBy(2*-Math.floor(a.selectiondrag.df/6)),a.debounced("doselectionscroll",
5437function(){p()},50))}};a.hasTextSelected="getSelection"in document?function(){return 0<document.getSelection().rangeCount}:"selection"in document?function(){return"None"!=document.selection.type}:function(){return!1};a.onselectionstart=function(b){a.ispage||(a.selectiondrag=a.win.offset())};a.onselectionend=function(b){a.selectiondrag=!1};a.onselectiondrag=function(b){a.selectiondrag&&a.hasTextSelected()&&a.debounced("selectionscroll",function(){p(b)},250)}}e.hasw3ctouch?(a.css(a.rail,{"touch-action":"none"}),
5438a.css(a.cursor,{"touch-action":"none"}),a.bind(a.win,"pointerdown",a.ontouchstart),a.bind(document,"pointerup",a.ontouchend),a.bind(document,"pointermove",a.ontouchmove)):e.hasmstouch?(a.css(a.rail,{"-ms-touch-action":"none"}),a.css(a.cursor,{"-ms-touch-action":"none"}),a.bind(a.win,"MSPointerDown",a.ontouchstart),a.bind(document,"MSPointerUp",a.ontouchend),a.bind(document,"MSPointerMove",a.ontouchmove),a.bind(a.cursor,"MSGestureHold",function(a){a.preventDefault()}),a.bind(a.cursor,"contextmenu",
5439function(a){a.preventDefault()})):this.istouchcapable&&(a.bind(a.win,"touchstart",a.ontouchstart),a.bind(document,"touchend",a.ontouchend),a.bind(document,"touchcancel",a.ontouchend),a.bind(document,"touchmove",a.ontouchmove));if(a.opt.cursordragontouch||!e.cantouch&&!a.opt.touchbehavior)a.rail.css({cursor:"default"}),a.railh&&a.railh.css({cursor:"default"}),a.jqbind(a.rail,"mouseenter",function(){if(!a.ispage&&!a.win.is(":visible"))return!1;a.canshowonmouseevent&&a.showCursor();a.rail.active=!0}),
5440a.jqbind(a.rail,"mouseleave",function(){a.rail.active=!1;a.rail.drag||a.hideCursor()}),a.opt.sensitiverail&&(a.bind(a.rail,"click",function(b){a.doRailClick(b,!1,!1)}),a.bind(a.rail,"dblclick",function(b){a.doRailClick(b,!0,!1)}),a.bind(a.cursor,"click",function(b){a.cancelEvent(b)}),a.bind(a.cursor,"dblclick",function(b){a.cancelEvent(b)})),a.railh&&(a.jqbind(a.railh,"mouseenter",function(){if(!a.ispage&&!a.win.is(":visible"))return!1;a.canshowonmouseevent&&a.showCursor();a.rail.active=!0}),a.jqbind(a.railh,
5441"mouseleave",function(){a.rail.active=!1;a.rail.drag||a.hideCursor()}),a.opt.sensitiverail&&(a.bind(a.railh,"click",function(b){a.doRailClick(b,!1,!0)}),a.bind(a.railh,"dblclick",function(b){a.doRailClick(b,!0,!0)}),a.bind(a.cursorh,"click",function(b){a.cancelEvent(b)}),a.bind(a.cursorh,"dblclick",function(b){a.cancelEvent(b)})));e.cantouch||a.opt.touchbehavior?(a.bind(e.hasmousecapture?a.win:document,"mouseup",a.ontouchend),a.bind(document,"mousemove",a.ontouchmove),a.onclick&&a.bind(document,"click",
5442a.onclick),a.opt.cursordragontouch&&(a.bind(a.cursor,"mousedown",a.onmousedown),a.bind(a.cursor,"mouseup",a.onmouseup),a.cursorh&&a.bind(a.cursorh,"mousedown",function(b){a.onmousedown(b,!0)}),a.cursorh&&a.bind(a.cursorh,"mouseup",a.onmouseup))):(a.bind(e.hasmousecapture?a.win:document,"mouseup",a.onmouseup),a.bind(document,"mousemove",a.onmousemove),a.onclick&&a.bind(document,"click",a.onclick),a.bind(a.cursor,"mousedown",a.onmousedown),a.bind(a.cursor,"mouseup",a.onmouseup),a.railh&&(a.bind(a.cursorh,
5443"mousedown",function(b){a.onmousedown(b,!0)}),a.bind(a.cursorh,"mouseup",a.onmouseup)),!a.ispage&&a.opt.enablescrollonselection&&(a.bind(a.win[0],"mousedown",a.onselectionstart),a.bind(document,"mouseup",a.onselectionend),a.bind(a.cursor,"mouseup",a.onselectionend),a.cursorh&&a.bind(a.cursorh,"mouseup",a.onselectionend),a.bind(document,"mousemove",a.onselectiondrag)),a.zoom&&(a.jqbind(a.zoom,"mouseenter",function(){a.canshowonmouseevent&&a.showCursor();a.rail.active=!0}),a.jqbind(a.zoom,"mouseleave",
5444function(){a.rail.active=!1;a.rail.drag||a.hideCursor()})));a.opt.enablemousewheel&&(a.isiframe||a.bind(e.isie&&a.ispage?document:a.win,"mousewheel",a.onmousewheel),a.bind(a.rail,"mousewheel",a.onmousewheel),a.railh&&a.bind(a.railh,"mousewheel",a.onmousewheelhr));a.ispage||e.cantouch||/HTML|^BODY/.test(a.win[0].nodeName)||(a.win.attr("tabindex")||a.win.attr({tabindex:N++}),a.jqbind(a.win,"focus",function(b){y=a.getTarget(b).id||!0;a.hasfocus=!0;a.canshowonmouseevent&&a.noticeCursor()}),a.jqbind(a.win,
5445"blur",function(b){y=!1;a.hasfocus=!1}),a.jqbind(a.win,"mouseenter",function(b){D=a.getTarget(b).id||!0;a.hasmousefocus=!0;a.canshowonmouseevent&&a.noticeCursor()}),a.jqbind(a.win,"mouseleave",function(){D=!1;a.hasmousefocus=!1;a.rail.drag||a.hideCursor()}))}a.onkeypress=function(b){if(a.railslocked&&0==a.page.maxh)return!0;b=b?b:window.e;var c=a.getTarget(b);if(c&&/INPUT|TEXTAREA|SELECT|OPTION/.test(c.nodeName)&&(!c.getAttribute("type")&&!c.type||!/submit|button|cancel/i.tp)||f(c).attr("contenteditable"))return!0;
5446if(a.hasfocus||a.hasmousefocus&&!y||a.ispage&&!y&&!D){c=b.keyCode;if(a.railslocked&&27!=c)return a.cancelEvent(b);var g=b.ctrlKey||!1,d=b.shiftKey||!1,e=!1;switch(c){case 38:case 63233:a.doScrollBy(72);e=!0;break;case 40:case 63235:a.doScrollBy(-72);e=!0;break;
5446case 37:case 63232:a.railh&&(g?a.doScrollLeft(0):a.doScrollLeftBy(72),e=!0);break;case 39:case 63234:a.railh&&(g?a.doScrollLeft(a.page.maxw):a.doScrollLeftBy(-72),e=!0);break;case 33:case 63276:a.doScrollBy(a.view.h);e=!0;break;case 34:case 63277:a.doScrollBy(-a.view.h);
5447e=!0;break;case 36:case 63273:a.railh&&g?a.doScrollPos(0,0):a.doScrollTo(0);e=!0;break;case 35:case 63275:a.railh&&g?a.doScrollPos(a.page.maxw,a.page.maxh):a.doScrollTo(a.page.maxh);e=!0;break;case 32:a.opt.spacebarenabled&&(d?a.doScrollBy(a.view.h):a.doScrollBy(-a.view.h),e=!0);break;case 27:a.zoomactive&&(a.doZoom(),e=!0)}if(e)return a.cancelEvent(b)}};a.opt.enablekeyboard&&a.bind(document,e.isopera&&!e.isopera12?"keypress":"keydown",a.onkeypress);a.bind(document,"keydown",function(b){b.ctrlKey&&
5448(a.wheelprevented=!0)});a.bind(document,"keyup",function(b){b.ctrlKey||(a.wheelprevented=!1)});a.bind(window,"blur",function(b){a.wheelprevented=!1});a.bind(window,"resize",a.lazyResize);a.bind(window,"orientationchange",a.lazyResize);a.bind(window,"load",a.lazyResize);if(e.ischrome&&!a.ispage&&!a.haswrapper){var r=a.win.attr("style"),c=parseFloat(a.win.css("width"))+1;a.win.css("width",c);a.synched("chromefix",function(){a.win.attr("style",r)})}a.onAttributeChange=function(b){a.lazyResize(a.isieold?
5449250:30)};!1!==v&&(a.observerbody=new v(function(b){b.forEach(function(b){if("attributes"==b.type)return f("body").hasClass("modal-open")?a.hide():a.show()});if(document.body.scrollHeight!=a.page.maxh)return a.lazyResize(30)}),a.observerbody.observe(document.body,{childList:!0,subtree:!0,characterData:!1,attributes:!0,attributeFilter:["class"]}));a.ispage||a.haswrapper||(!1!==v?(a.observer=new v(function(b){b.forEach(a.onAttributeChange)}),a.observer.observe(a.win[0],{childList:!0,characterData:!1,
5450attributes:!0,subtree:!1}),a.observerremover=new v(function(b){b.forEach(function(b){if(0<b.removedNodes.length)for(var c in b.removedNodes)if(a&&b.removedNodes[c]==a.win[0])return a.remove()})}),a.observerremover.observe(a.win[0].parentNode,{childList:!0,characterData:!1,attributes:!1,subtree:!1})):(a.bind(a.win,e.isie&&!e.isie9?"propertychange":"DOMAttrModified",a.onAttributeChange),e.isie9&&a.win[0].attachEvent("onpropertychange",a.onAttributeChange),a.bind(a.win,"DOMNodeRemoved",function(b){b.target==
5451a.win[0]&&a.remove()})));!a.ispage&&a.opt.boxzoom&&a.bind(window,"resize",a.resizeZoom);a.istextarea&&a.bind(a.win,"mouseup",a.lazyResize);a.lazyResize(30)}if("IFRAME"==this.doc[0].nodeName){var M=function(){a.iframexd=!1;var b;try{b="contentDocument"in this?this.contentDocument:this.contentWindow.document}catch(c){a.iframexd=!0,b=!1}if(a.iframexd)return"console"in window&&console.log("NiceScroll error: policy restriced iframe"),!0;a.forcescreen=!0;a.isiframe&&(a.iframe={doc:f(b),html:a.doc.contents().find("html")[0],
5452body:a.doc.contents().find("body")[0]},a.getContentSize=function(){return{w:Math.max(a.iframe.html.scrollWidth,a.iframe.body.scrollWidth),h:Math.max(a.iframe.html.scrollHeight,a.iframe.body.scrollHeight)}},a.docscroll=f(a.iframe.body));if(!e.isios&&a.opt.iframeautoresize&&!a.isiframe){a.win.scrollTop(0);a.doc.height("");var g=Math.max(b.getElementsByTagName("html")[0].scrollHeight,b.body.scrollHeight);a.doc.height(g)}a.lazyResize(30);e.isie7&&a.css(f(a.iframe.html),{"overflow-y":"hidden"});a.css(f(a.iframe.body),
5453{"overflow-y":"hidden"});e.isios&&a.haswrapper&&a.css(f(b.body),{"-webkit-transform":"translate3d(0,0,0)"});"contentWindow"in this?a.bind(this.contentWindow,"scroll",a.onscroll):a.bind(b,"scroll",a.onscroll);a.opt.enablemousewheel&&a.bind(b,"mousewheel",a.onmousewheel);a.opt.enablekeyboard&&a.bind(b,e.isopera?"keypress":"keydown",a.onkeypress);if(e.cantouch||a.opt.touchbehavior)a.bind(b,"mousedown",a.ontouchstart),a.bind(b,"mousemove",function(b){return a.ontouchmove(b,!0)}),a.opt.grabcursorenabled&&
5454e.cursorgrabvalue&&a.css(f(b.body),{cursor:e.cursorgrabvalue});a.bind(b,"mouseup",a.ontouchend);a.zoom&&(a.opt.dblclickzoom&&a.bind(b,"dblclick",a.doZoom),a.ongesturezoom&&a.bind(b,"gestureend",a.ongesturezoom))};this.doc[0].readyState&&"complete"==this.doc[0].readyState&&setTimeout(function(){M.call(a.doc[0],!1)},500);a.bind(this.doc,"load",M)}};this.showCursor=function(b,c){a.cursortimeout&&(clearTimeout(a.cursortimeout),a.cursortimeout=0);if(a.rail){a.autohidedom&&(a.autohidedom.stop().css({opacity:a.opt.cursoropacitymax}),
5455a.cursoractive=!0);a.rail.drag&&1==a.rail.drag.pt||("undefined"!=typeof b&&!1!==b&&(a.scroll.y=Math.round(1*b/a.scrollratio.y)),"undefined"!=typeof c&&(a.scroll.x=Math.round(1*c/a.scrollratio.x)));a.cursor.css({height:a.cursorheight,top:a.scroll.y});if(a.cursorh){var d=a.hasreversehr?a.scrollvaluemaxw-a.scroll.x:a.scroll.x;!a.rail.align&&a.rail.visibility?a.cursorh.css({width:a.cursorwidth,left:d+a.rail.width}):a.cursorh.css({width:a.cursorwidth,left:d});a.cursoractive=!0}a.zoom&&a.zoom.stop().css({opacity:a.opt.cursoropacitymax})}};
5456this.hideCursor=function(b){a.cursortimeout||!a.rail||!a.autohidedom||a.hasmousefocus&&"leave"==a.opt.autohidemode||(a.cursortimeout=setTimeout(function(){a.rail.active&&a.showonmouseevent||(a.autohidedom.stop().animate({opacity:a.opt.cursoropacitymin}),a.zoom&&a.zoom.stop().animate({opacity:a.opt.cursoropacitymin}),a.cursoractive=!1);a.cursortimeout=0}
5456,b||a.opt.hidecursordelay))};this.noticeCursor=function(b,c,d){a.showCursor(c,d);a.rail.active||a.hideCursor(b)};this.getContentSize=a.ispage?function(){return{w:Math.max(document.body.scrollWidth,
5457document.documentElement.scrollWidth),h:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}}:a.haswrapper?function(){return{w:a.doc.outerWidth()+parseInt(a.win.css("paddingLeft"))+parseInt(a.win.css("paddingRight")),h:a.doc.outerHeight()+parseInt(a.win.css("paddingTop"))+parseInt(a.win.css("paddingBottom"))}}:function(){return{w:a.docscroll[0].scrollWidth,h:a.docscroll[0].scrollHeight}};this.onResize=function(b,c){if(!a||!a.win)return!1;if(!a.haswrapper&&!a.ispage){if("none"==
5458a.win.css("display"))return a.visibility&&a.hideRail().hideRailHr(),!1;a.hidden||a.visibility||a.showRail().showRailHr()}var d=a.page.maxh,e=a.page.maxw,f=a.view.h,h=a.view.w;a.view={w:a.ispage?a.win.width():parseInt(a.win[0].clientWidth),h:a.ispage?a.win.height():parseInt(a.win[0].clientHeight)};a.page=c?c:a.getContentSize();a.page.maxh=Math.max(0,a.page.h-a.view.h);a.page.maxw=Math.max(0,a.page.w-a.view.w);if(a.page.maxh==d&&a.page.maxw==e&&a.view.w==h&&a.view.h==f){if(a.ispage)return a;d=a.win.offset();
5459if(a.lastposition&&(e=a.lastposition,e.top==d.top&&e.left==d.left))return a;a.lastposition=d}0==a.page.maxh?(a.hideRail(),a.scrollvaluemax=0,a.scroll.y=0,a.scrollratio.y=0,a.cursorheight=0,a.setScrollTop(0),a.rail.scrollable=!1):(a.page.maxh-=a.opt.railpadding.top+a.opt.railpadding.bottom,a.rail.scrollable=!0);0==a.page.maxw?(a.hideRailHr(),a.scrollvaluemaxw=0,a.scroll.x=0,a.scrollratio.x=0,a.cursorwidth=0,a.setScrollLeft(0),a.railh.scrollable=!1):(a.page.maxw-=a.opt.railpadding.left+a.opt.railpadding.right,
5460a.railh.scrollable=!0);a.railslocked=a.locked||0==a.page.maxh&&0==a.page.maxw;if(a.railslocked)return a.ispage||a.updateScrollBar(a.view),!1;a.hidden||a.visibility?a.hidden||a.railh.visibility||a.showRailHr():a.showRail().showRailHr();a.istextarea&&a.win.css("resize")&&"none"!=a.win.css("resize")&&(a.view.h-=20);a.cursorheight=Math.min(a.view.h,Math.round(a.view.h/a.page.h*a.view.h));a.cursorheight=a.opt.cursorfixedheight?a.opt.cursorfixedheight:Math.max(a.opt.cursorminheight,a.cursorheight);a.cursorwidth=
5461Math.min(a.view.w,Math.round(a.view.w/a.page.w*a.view.w));a.cursorwidth=a.opt.cursorfixedheight?a.opt.cursorfixedheight:Math.max(a.opt.cursorminheight,a.cursorwidth);a.scrollvaluemax=a.view.h-a.cursorheight-a.cursor.hborder-(a.opt.railpadding.top+a.opt.railpadding.bottom);a.railh&&(a.railh.width=0<a.page.maxh?a.view.w-a.rail.width:a.view.w,a.scrollvaluemaxw=a.railh.width-a.cursorwidth-a.cursorh.wborder-(a.opt.railpadding.left+a.opt.railpadding.right));a.ispage||a.updateScrollBar(a.view);a.scrollratio=
5462{x:a.page.maxw/a.scrollvaluemaxw,y:a.page.maxh/a.scrollvaluemax};a.getScrollTop()>a.page.maxh?a.doScrollTop(a.page.maxh):(a.scroll.y=Math.round(a.getScrollTop()*(1/a.scrollratio.y)),a.scroll.x=Math.round(a.getScrollLeft()*(1/a.scrollratio.x)),a.cursoractive&&a.noticeCursor());a.scroll.y&&0==a.getScrollTop()&&a.doScrollTo(Math.floor(a.scroll.y*a.scrollratio.y));return a};this.resize=a.onResize;this.lazyResize=function(b){b=isNaN(b)?30:b;a.debounced("resize",a.resize,b);return a};this.jqbind=function(b,
5463c,d){a.events.push({e:b,n:c,f:d,q:!0});f(b).bind(c,d)};this.bind=function(b,c,d,f){var h="jquery"in b?b[0]:b;"mousewheel"==c?window.addEventListener||"onwheel"in document?a._bind(h,"wheel",d,f||!1):(b="undefined"!=typeof document.onmousewheel?"mousewheel":"DOMMouseScroll",n(h,b,d,f||!1),"DOMMouseScroll"==b&&n(h,"MozMousePixelScroll",d,f||!1)):h.addEventListener?(e.cantouch&&/mouseup|mousedown|mousemove/.test(c)&&a._bind(h,"mousedown"==c?"touchstart":"mouseup"==c?"touchend":"touchmove",function(a){if(a.touches){if(2>
5464a.touches.length){var b=a.touches.length?a.touches[0]:a;b.original=a;d.call(this,b)}}else a.changedTouches&&(b=a.changedTouches[0],b.original=a,d.call(this,b))},f||!1),a._bind(h,c,d,f||!1),e.cantouch&&"mouseup"==c&&a._bind(h,"touchcancel",d,f||!1)):a._bind(h,c,function(b){(b=b||window.event||!1)&&b.srcElement&&(b.target=b.srcElement);"pageY"in b||(b.pageX=b.clientX+document.documentElement.scrollLeft,b.pageY=b.clientY+document.documentElement.scrollTop);return!1===d.call(h,b)||!1===f?a.cancelEvent(b):
5465!0})};e.haseventlistener?(this._bind=function(b,c,d,e){a.events.push({e:b,n:c,f:d,b:e,q:!1});b.addEventListener(c,d,e||!1)},this.cancelEvent=function(a){if(!a)return!1;a=a.original?a.original:a;a.preventDefault();a.stopPropagation();a.preventManipulation&&a.preventManipulation();return!1},this.stopPropagation=function(a){if(!a)return!1;a=a.original?a.original:a;a.stopPropagation();return!1},this._unbind=function(a,c,d,e){a.removeEventListener(c,d,e)}):(this._bind=function(b,c,d,e){a.events.push({e:b,
5466n:c,f:d,b:e,q:!1});b.attachEvent?b.attachEvent("on"+c,d):b["on"+c]=d},this.cancelEvent=function(a){a=window.event||!1;if(!a)return!1;a.cancelBubble=!0;a.cancel=!0;return a.returnValue=!1},this.stopPropagation=function(a){a=window.event||!1;if(!a)return!1;a.cancelBubble=!0;return!1},this._unbind=function(a,c,d,e){a.detachEvent?a.detachEvent("on"+c,d):a["on"+c]=!1});this.unbindAll=function(){for(var b=0;b<a.events.length;b++){var c=a.events[b];c.q?c.e.unbind(c.n,c.f):a._unbind(c.e,c.n,c.f,c.b)}};this.showRail=
5467function(){0==a.page.maxh||!a.ispage&&"none"==a.win.css("display")||(a.visibility=!0,a.rail.visibility=!0,a.rail.css("display","block"));return a};this.showRailHr=function(){if(!a.railh)return a;0==a.page.maxw||!a.ispage&&"none"==a.win.css("display")||(a.railh.visibility=!0,a.railh.css("display","block"));return a};this.hideRail=function(){a.visibility=!1;a.rail.visibility=!1;a.rail.css("display","none");return a};this.hideRailHr=function(){if(!a.railh)return a;a.railh.visibility=!1;a.railh.css("display",
5468"none");return a};this.show=function(){a.hidden=!1;a.railslocked=!1;return a.showRail().showRailHr()};this.hide=function(){a.hidden=!0;a.railslocked=!0;return a.hideRail().hideRailHr()};this.toggle=function(){return a.hidden?a.show():a.hide()};this.remove=function(){a.stop();a.cursortimeout&&clearTimeout(a.cursortimeout);a.doZoomOut();a.unbindAll();e.isie9&&a.win[0].detachEvent("onpropertychange",a.onAttributeChange);!1!==a.observer&&a.observer.disconnect();!1!==a.observerremover&&a.observerremover.disconnect();
5469!1!==a.observerbody&&a.observerbody.disconnect();a.events=null;a.cursor&&a.cursor.remove();a.cursorh&&a.cursorh.remove();a.rail&&a.rail.remove();a.railh&&a.railh.remove();a.zoom&&a.zoom.remove();for(var b=0;b<a.saved.css.length;b++){var c=a.saved.css[b];c[0].css(c[1],"undefined"==typeof c[2]?"":c[2])}a.saved=!1;a.me.data("__nicescroll","");var d=f.nicescroll;d.each(function(b){if(this&&this.id===a.id){delete d[b];for(var c=++b;c<d.length;c++,b++)d[b]=d[c];d.length--;d.length&&delete d[d.length]}});
5470for(var h in a)a[h]=null,delete a[h];a=null};this.scrollstart=function(b){this.onscrollstart=b;return a};this.scrollend=function(b){this.onscrollend=b;return a};this.scrollcancel=function(b){this.onscrollcancel=b;return a};this.zoomin=function(b){this.onzoomin=b;return a};this.zoomout=function(b){this.onzoomout=b;return a};this.isScrollable=function(a){a=a.target?a.target:a;if("OPTION"==a.nodeName)return!0;for(;a&&1==a.nodeType&&!/^BODY|HTML/.test(a.nodeName);){var c=f(a),c=c.css("overflowY")||c.css("overflowX")||
5471c.css("overflow")||"";if(/scroll|auto/.test(c))return a.clientHeight!=a.scrollHeight;a=a.parentNode?a.parentNode:!1}return!1};this.getViewport=function(a){for(a=a&&a.parentNode?a.parentNode:!1;a&&1==a.nodeType&&!/^BODY|HTML/.test(a.nodeName);){var c=f(a);if(/fixed|absolute/.test(c.css("position")))return c;var d=c.css("overflowY")||c.css("overflowX")||c.css("overflow")||"";if(/scroll|auto/.test(d)&&a.clientHeight!=a.scrollHeight||0<c.getNiceScroll().length)return c;a=a.parentNode?a.parentNode:!1}return!1};
5472this.triggerScrollEnd=function(){if(a.onscrollend){var b=a.getScrollLeft(),c=a.getScrollTop();a.onscrollend.call(a,{type:"scrollend",current:{x:b,y:c},end:{x:b,y:c}})}};this.onmousewheel=function(b){if(!a.wheelprevented){if(a.railslocked)return a.debounced("checkunlock",a.resize,250),!0;if(a.rail.drag)return a.cancelEvent(b);"auto"==a.opt.oneaxismousemode&&0!=b.deltaX&&(a.opt.oneaxismousemode=!1);if(a.opt.oneaxismousemode&&0==b.deltaX&&!a.rail.scrollable)return a.railh&&a.railh.scrollable?a.onmousewheelhr(b):
5473!0;var c=+new Date,d=!1;a.opt.preservenativescrolling&&a.checkarea+600<c&&(a.nativescrollingarea=a.isScrollable(b),d=!0);a.checkarea=c;if(a.nativescrollingarea)return!0;if(b=p(b,!1,d))a.checkarea=0;return b}};this.onmousewheelhr=function(b){if(!a.wheelprevented){if(a.railslocked||!a.railh.scrollable)return!0;if(a.rail.drag)return a.cancelEvent(b);var c=+new Date,d=!1;a.opt.preservenativescrolling&&a.checkarea+600<c&&(a.nativescrollingarea=a.isScrollable(b),d=!0);a.checkarea=c;return a.nativescrollingarea?
5474!0:a.railslocked?a.cancelEvent(b):p(b,!0,d)}};this.stop=function(){a.cancelScroll();a.scrollmon&&a.scrollmon.stop();a.cursorfreezed=!1;a.scroll.y=Math.round(a.getScrollTop()*(1/a.scrollratio.y));a.noticeCursor();return a};this.getTransitionSpeed=function(b){var c=Math.round(10*a.opt.scrollspeed);b=Math.min(c,Math.round(b/20*a.opt.scrollspeed));return 20<b?b:0};a.opt.smoothscroll?a.ishwscroll&&e.hastransition&&a.opt.usetransition&&a.opt.smoothscroll?(this.prepareTransition=function(b,c){var d=c?20<
5475b?b:0:a.getTransitionSpeed(b),f=d?e.prefixstyle+"transform "+d+"ms ease-out":"";a.lasttransitionstyle&&a.lasttransitionstyle==f||(a.lasttransitionstyle=f,a.doc.css(e.transitionstyle,f));return d},this.doScrollLeft=function(b,c){var d=a.scrollrunning?a.newscrolly:a.getScrollTop();a.doScrollPos(b,d,c)},this.doScrollTop=function(b,c){var d=a.scrollrunning?a.newscrollx:a.getScrollLeft();a.doScrollPos(d,b,c)},this.doScrollPos=function(b,c,d){var f=a.getScrollTop(),h=a.getScrollLeft();(0>(a.newscrolly-
5476f)*(c-f)||0>(a.newscrollx-h)*(b-h))&&a.cancelScroll();0==a.opt.bouncescroll&&(0>c?c=0:c>a.page.maxh&&(c=a.page.maxh),0>b?b=0:b>a.page.maxw&&(b=a.page.maxw));if(a.scrollrunning&&b==a.newscrollx&&c==a.newscrolly)return!1;a.newscrolly=c;a.newscrollx=b;a.newscrollspeed=d||!1;if(a.timer)return!1;a.timer=setTimeout(function(){var d=a.getScrollTop(),f=a.getScrollLeft(),h,k;h=b-f;k=c-d;h=Math.round(Math.sqrt(Math.pow(h,2)+Math.pow(k,2)));h=a.newscrollspeed&&1<a.newscrollspeed?a.newscrollspeed:a.getTransitionSpeed(h);
5477a.newscrollspeed&&1>=a.newscrollspeed&&(h*=a.newscrollspeed);a.prepareTransition(h,!0);a.timerscroll&&a.timerscroll.tm&&clearInterval(a.timerscroll.tm);0<h&&(!a.scrollrunning&&a.onscrollstart&&a.onscrollstart.call(a,{type:"scrollstart",current:{x:f,y:d},request:{x:b,y:c},end:{x:a.newscrollx,y:a.newscrolly},speed:h}),e.transitionend?a.scrollendtrapped||(a.scrollendtrapped=!0,a.bind(a.doc,e.transitionend,a.onScrollTransitionEnd,!1)):(a.scrollendtrapped&&clearTimeout(a.scrollendtrapped),a.scrollendtrapped=
5478setTimeout(a.onScrollTransitionEnd,h)),a.timerscroll={bz:new A(d,a.newscrolly,h,0,0,.58,1),bh:new A(f,a.newscrollx,h,0,0,.58,1)},a.cursorfreezed||(a.timerscroll.tm=setInterval(function(){a.showCursor(a.getScrollTop(),a.getScrollLeft())},60)));a.synched("doScroll-set",function(){a.timer=0;a.scrollendtrapped&&(a.scrollrunning=!0);a.setScrollTop(a.newscrolly);a.setScrollLeft(a.newscrollx);if(!a.scrollendtrapped)a.onScrollTransitionEnd()})},50)},this.cancelScroll=function(){if(!a.scrollendtrapped)return!0;
5479var b=a.getScrollTop(),c=a.getScrollLeft();a.scrollrunning=!1;e.transitionend||clearTimeout(e.transitionend);a.scrollendtrapped=!1;a._unbind(a.doc[0],e.transitionend,a.onScrollTransitionEnd);a.prepareTransition(0);a.setScrollTop(b);a.railh&&a.setScrollLeft(c);a.timerscroll&&a.timerscroll.tm&&clearInterval(a.timerscroll.tm);a.timerscroll=!1;a.cursorfreezed=!1;a.showCursor(b,c);return a},this.onScrollTransitionEnd=function(){a.scrollendtrapped&&a._unbind(a.doc[0],e.transitionend,a.onScrollTransitionEnd);
5480a.scrollendtrapped=!1;a.prepareTransition(0);a.timerscroll&&a.timerscroll.tm&&clearInterval(a.timerscroll.tm);a.timerscroll=!1;var b=a.getScrollTop(),c=a.getScrollLeft();a.setScrollTop(b);a.railh&&a.setScrollLeft(c);a.noticeCursor(!1,b,c);a.cursorfreezed=!1;0>b?b=0:b>a.page.maxh&&(b=a.page.maxh);0>c?c=0:c>a.page.maxw&&(c=a.page.maxw);if(b!=a.newscrolly||c!=a.newscrollx)return a.doScrollPos(c,b,a.opt.snapbackspeed);a.onscrollend&&a.scrollrunning&&a.triggerScrollEnd();a.scrollrunning=!1}):(this.doScrollLeft=
5481function(b,c){var d=a.scrollrunning?a.newscrolly:a.getScrollTop();a.doScrollPos(b,d,c)},this.doScrollTop=function(b,c){var d=a.scrollrunning?a.newscrollx:a.getScrollLeft();a.doScrollPos(d,b,c)},this.doScrollPos=function(b,c,d){function e(){if(a.cancelAnimationFrame)return!0;a.scrollrunning=!0;if(n=1-n)return a.timer=s(e)||1;var b=0,c,d,g=d=a.getScrollTop();
5481if(a.dst.ay){g=a.bzscroll?a.dst.py+a.bzscroll.getNow()*a.dst.ay:a.newscrolly;c=g-d;if(0>c&&g<a.newscrolly||0<c&&g>a.newscrolly)g=a.newscrolly;
5482a.setScrollTop(g);g==a.newscrolly&&(b=1)}else b=1;d=c=a.getScrollLeft();if(a.dst.ax){d=a.bzscroll?a.dst.px+a.bzscroll.getNow()*a.dst.ax:a.newscrollx;c=d-c;if(0>c&&d<a.newscrollx||0<c&&d>a.newscrollx)d=a.newscrollx;a.setScrollLeft(d);d==a.newscrollx&&(b+=1)}else b+=1;2==b?(a.timer=0,a.cursorfreezed=!1,a.bzscroll=!1,a.scrollrunning=!1,0>g?g=0:g>a.page.maxh&&(g=a.page.maxh),0>d?d=0:d>a.page.maxw&&(d=a.page.maxw),d!=a.newscrollx||g!=a.newscrolly?a.doScrollPos(d,g):a.onscrollend&&a.triggerScrollEnd()):
5483a.timer=s(e)||1}c="undefined"==typeof c||!1===c?a.getScrollTop(!0):c;if(a.timer&&a.newscrolly==c&&a.newscrollx==b)return!0;a.timer&&t(a.timer);a.timer=0;var f=a.getScrollTop(),h=a.getScrollLeft();(0>(a.newscrolly-f)*(c-f)||0>(a.newscrollx-h)*(b-h))&&a.cancelScroll();a.newscrolly=c;a.newscrollx=b;a.bouncescroll&&a.rail.visibility||(0>a.newscrolly?a.newscrolly=0:a.newscrolly>a.page.maxh&&(a.newscrolly=a.page.maxh));a.bouncescroll&&a.railh.visibility||(0>a.newscrollx?a.newscrollx=0:a.newscrollx>a.page.maxw&&
5484(a.newscrollx=a.page.maxw));a.dst={};a.dst.x=b-h;a.dst.y=c-f;a.dst.px=h;a.dst.py=f;var k=Math.round(Math.sqrt(Math.pow(a.dst.x,2)+Math.pow(a.dst.y,2)));a.dst.ax=a.dst.x/k;a.dst.ay=a.dst.y/k;var l=0,m=k;0==a.dst.x?(l=f,m=c,a.dst.ay=1,a.dst.py=0):0==a.dst.y&&(l=h,m=b,a.dst.ax=1,a.dst.px=0);k=a.getTransitionSpeed(k);d&&1>=d&&(k*=d);a.bzscroll=0<k?a.bzscroll?a.bzscroll.update(m,k):new A(l,m,k,0,1,0,1):!1;if(!a.timer){(f==a.page.maxh&&c>=a.page.maxh||h==a.page.maxw&&b>=a.page.maxw)&&a.checkContentSize();
5485var n=1;a.cancelAnimationFrame=!1;a.timer=1;a.onscrollstart&&!a.scrollrunning&&a.onscrollstart.call(a,{type:"scrollstart",current:{x:h,y:f},request:{x:b,y:c},end:{x:a.newscrollx,y:a.newscrolly},speed:k});e();(f==a.page.maxh&&c>=f||h==a.page.maxw&&b>=h)&&a.checkContentSize();a.noticeCursor()}},this.cancelScroll=function(){a.timer&&t(a.timer);a.timer=0;a.bzscroll=!1;a.scrollrunning=!1;return a}):(this.doScrollLeft=function(b,c){var d=a.getScrollTop();a.doScrollPos(b,d,c)},this.doScrollTop=function(b,
5486c){var d=a.getScrollLeft();a.doScrollPos(d,b,c)},this.doScrollPos=function(b,c,d){var e=b>a.page.maxw?a.page.maxw:b;0>e&&(e=0);var f=c>a.page.maxh?a.page.maxh:c;0>f&&(f=0);a.synched("scroll",function(){a.setScrollTop(f);a.setScrollLeft(e)})},this.cancelScroll=function(){});this.doScrollBy=function(b,c){var d=0,d=c?Math.floor((a.scroll.y-b)*a.scrollratio.y):(a.timer?a.newscrolly:a.getScrollTop(!0))-b;if(a.bouncescroll){var e=Math.round(a.view.h/2);d<-e?d=-e:d>a.page.maxh+e&&(d=a.page.maxh+e)}a.cursorfreezed=
5487!1;e=a.getScrollTop(!0);if(0>d&&0>=e)return a.noticeCursor();if(d>a.page.maxh&&e>=a.page.maxh)return a.checkContentSize(),a.noticeCursor();a.doScrollTop(d)};this.doScrollLeftBy=function(b,c){var d=0,d=c?Math.floor((a.scroll.x-b)*a.scrollratio.x):(a.timer?a.newscrollx:a.getScrollLeft(!0))-b;if(a.bouncescroll){var e=Math.round(a.view.w/2);d<-e?d=-e:d>a.page.maxw+e&&(d=a.page.maxw+e)}a.cursorfreezed=!1;e=a.getScrollLeft(!0);if(0>d&&0>=e||d>a.page.maxw&&e>=a.page.maxw)return a.noticeCursor();a.doScrollLeft(d)};
5488this.doScrollTo=function(b,c){c&&Math.round(b*a.scrollratio.y);a.cursorfreezed=!1;a.doScrollTop(b)};this.checkContentSize=function(){var b=a.getContentSize();b.h==a.page.h&&b.w==a.page.w||a.resize(!1,b)};a.onscroll=function(b){a.rail.drag||a.cursorfreezed||a.synched("scroll",function(){a.scroll.y=Math.round(a.getScrollTop()*(1/a.scrollratio.y));a.railh&&(a.scroll.x=Math.round(a.getScrollLeft()*(1/a.scrollratio.x)));a.noticeCursor()})};a.bind(a.docscroll,"scroll",a.onscroll);this.doZoomIn=function(b){if(!a.zoomactive){a.zoomactive=
5489!0;a.zoomrestore={style:{}};var c="position top left zIndex backgroundColor marginTop marginBottom marginLeft marginRight".split(" "),d=a.win[0].style,h;for(h in c){var k=c[h];a.zoomrestore.style[k]="undefined"!=typeof d[k]?d[k]:""}a.zoomrestore.style.width=a.win.css("width");a.zoomrestore.style.height=a.win.css("height");a.zoomrestore.padding={w:a.win.outerWidth()-a.win.width(),h:a.win.outerHeight()-a.win.height()};e.isios4&&(a.zoomrestore.scrollTop=f(window).scrollTop(),f(window).scrollTop(0));
5490a.win.css({position:e.isios4?"absolute":"fixed",top:0,left:0,"z-index":
5490x+100,margin:"0px"});c=a.win.css("backgroundColor");(""==c||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(c))&&a.win.css("backgroundColor","#fff");a.rail.css({"z-index":x+101});a.zoom.css({"z-index":x+102});a.zoom.css("backgroundPosition","0px -18px");a.resizeZoom();a.onzoomin&&a.onzoomin.call(a);return a.cancelEvent(b)}};this.doZoomOut=function(b){if(a.zoomactive)return a.zoomactive=!1,a.win.css("margin",""),a.win.css(a.zoomrestore.style),
5491e.isios4&&f(window).scrollTop(a.zoomrestore.scrollTop),a.rail.css({"z-index":a.zindex}),a.zoom.css({"z-index":a.zindex}),a.zoomrestore=!1,a.zoom.css("backgroundPosition","0px 0px"),a.onResize(),a.onzoomout&&a.onzoomout.call(a),a.cancelEvent(b)};this.doZoom=function(b){return a.zoomactive?a.doZoomOut(b):a.doZoomIn(b)};this.resizeZoom=function(){if(a.zoomactive){var b=a.getScrollTop();a.win.css({width:f(window).width()-a.zoomrestore.padding.w+"px",height:f(window).height()-a.zoomrestore.padding.h+"px"});
5492a.onResize();a.setScrollTop(Math.min(a.page.maxh,b))}};this.init();f.nicescroll.push(this)},L=function(f){var c=this;this.nc=f;this.steptime=this.lasttime=this.speedy=this.speedx=this.lasty=this.lastx=0;this.snapy=this.snapx=!1;this.demuly=this.demulx=0;this.lastscrolly=this.lastscrollx=-1;this.timer=this.chky=this.chkx=0;this.time=function(){return+new Date};this.reset=function(f,k){c.stop();var d=c.time();c.steptime=0;c.lasttime=d;c.speedx=0;c.speedy=0;c.lastx=f;c.lasty=k;c.lastscrollx=-1;c.lastscrolly=
5493-1};this.update=function(f,k){var d=c.time();c.steptime=d-c.lasttime;c.lasttime=d;var d=k-c.lasty,n=f-c.lastx,p=c.nc.getScrollTop(),a=c.nc.getScrollLeft(),p=p+d,a=a+n;c.snapx=0>a||a>c.nc.page.maxw;c.snapy=0>p||p>c.nc.page.maxh;c.speedx=n;c.speedy=d;c.lastx=f;c.lasty=k};this.stop=function(){c.nc.unsynched("domomentum2d");c.timer&&clearTimeout(c.timer);c.timer=0;c.lastscrollx=-1;c.lastscrolly=-1};this.doSnapy=function(f,k){var d=!1;0>k?(k=0,d=!0):k>c.nc.page.maxh&&(k=c.nc.page.maxh,d=!0);0>f?(f=0,d=
5494!0):f>c.nc.page.maxw&&(f=c.nc.page.maxw,d=!0);d?c.nc.doScrollPos(f,k,c.nc.opt.snapbackspeed):c.nc.triggerScrollEnd()};this.doMomentum=function(f){var k=c.time(),d=f?k+f:c.lasttime;f=c.nc.getScrollLeft();var n=c.nc.getScrollTop(),p=c.nc.page.maxh,a=c.nc.page.maxw;c.speedx=0<a?Math.min(60,c.speedx):0;c.speedy=0<p?Math.min(60,c.speedy):0;d=d&&60>=k-d;if(0>n||n>p||0>f||f>a)d=!1;f=c.speedx&&d?c.speedx:!1;if(c.speedy&&d&&c.speedy||f){var s=Math.max(16,c.steptime);50<s&&(f=s/50,c.speedx*=f,c.speedy*=f,s=
549550);c.demulxy=0;c.lastscrollx=c.nc.getScrollLeft();c.chkx=c.lastscrollx;c.lastscrolly=c.nc.getScrollTop();c.chky=c.lastscrolly;var e=c.lastscrollx,r=c.lastscrolly,t=function(){var d=600<c.time()-k?.04:.02;c.speedx&&(e=Math.floor(c.lastscrollx-c.speedx*(1-c.demulxy)),c.lastscrollx=e,0>e||e>a)&&(d=.1);c.speedy&&(r=Math.floor(c.lastscrolly-c.speedy*(1-c.demulxy)),c.lastscrolly=r,0>r||r>p)&&(d=.1);c.demulxy=Math.min(1,c.demulxy+d);c.nc.synched("domomentum2d",function(){c.speedx&&(c.nc.getScrollLeft()!=
5496c.chkx&&c.stop(),c.chkx=e,c.nc.setScrollLeft(e));c.speedy&&(c.nc.getScrollTop()!=c.chky&&c.stop(),c.chky=r,c.nc.setScrollTop(r));c.timer||(c.nc.hideCursor(),c.doSnapy(e,r))});1>c.demulxy?c.timer=setTimeout(t,s):(c.stop(),c.nc.hideCursor(),c.doSnapy(e,r))};t()}else c.doSnapy(c.nc.getScrollLeft(),c.nc.getScrollTop())}},w=f.fn.scrollTop;f.cssHooks.pageYOffset={get:function(k,c,h){return(c=f.data(k,"__nicescroll")||!1)&&c.ishwscroll?c.getScrollTop():w.call(k)},set:function(k,c){var h=f.data(k,"__nicescroll")||
5497!1;h&&h.ishwscroll?h.setScrollTop(parseInt(c)):w.call(k,c);return this}};f.fn.scrollTop=function(k){if("undefined"==typeof k){var c=this[0]?f.data(this[0],"__nicescroll")||!1:!1;return c&&c.ishwscroll?c.getScrollTop():w.call(this)}return this.each(function(){var c=f.data(this,"__nicescroll")||!1;c&&c.ishwscroll?c.setScrollTop(parseInt(k)):w.call(f(this),k)})};var B=f.fn.scrollLeft;f.cssHooks.pageXOffset={get:function(k,c,h){return(c=f.data(k,"__nicescroll")||!1)&&c.ishwscroll?c.getScrollLeft():B.call(k)},
5498set:function(k,c){var h=f.data(k,"__nicescroll")||!1;h&&h.ishwscroll?h.setScrollLeft(parseInt(c)):B.call(k,c);return this}};f.fn.scrollLeft=function(k){if("undefined"==typeof k){var c=this[0]?f.data(this[0],"__nicescroll")||!1:!1;return c&&c.ishwscroll?c.getScrollLeft():B.call(this)}return this.each(function(){var c=f.data(this,"__nicescroll")||!1;c&&c.ishwscroll?c.setScrollLeft(parseInt(k)):B.call(f(this),k)})};
5498var C=function(k){var c=this;this.length=0;this.name="nicescrollarray";this.each=function(d){for(var f=
54990,h=0;f<c.length;f++)d.call(c[f],h++);return c};this.push=function(d){c[c.length]=d;c.length++};this.eq=function(d){return c[d]};if(k)for(var h=0;h<k.length;h++){var m=f.data(k[h],"__nicescroll")||!1;m&&(this[this.length]=m,this.length++)}return this};(function(f,c,h){for(var m=0;m<c.length;m++)h(f,c[m])})(C.prototype,"show hide toggle onResize resize remove stop doScrollPos".split(" "),function(f,c){f[c]=function(){var f=arguments;return this.each(function(){this[c].apply(this,f)})}});f.fn.getNiceScroll=
5500function(k){return"undefined"==typeof k?new C(this):this[k]&&f.data(this[k],"__nicescroll")||!1};f.extend(f.expr[":"],{nicescroll:function(k){return f.data(k,"__nicescroll")?!0:!1}});f.fn.niceScroll=function(k,c){"undefined"!=typeof c||"object"!=typeof k||"jquery"in k||(c=k,k=!1);c=f.extend({},c);var h=new C;"undefined"==typeof c&&(c={});k&&(c.doc=f(k),c.win=f(this));var m=!("doc"in c);m||"win"in c||(c.win=f(this));this.each(function(){var d=f(this).data("__nicescroll")||!1;d||(c.doc=m?f(this):c.doc,
5501d=new R(c,f(this)),f(this).data("__nicescroll",d));h.push(d)});return 1==h.length?h[0]:h};window.NiceScroll={getjQuery:function(){return f}};f.nicescroll||(f.nicescroll=new C,f.nicescroll.options=I)});

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.