PageSourceSearch

https://alfamarmoraria.com.br/wp-content/themes/alfa-marmoraria/js/scripts-vendors.js?ver=4.1.37

js alfamarmoraria.com.br collected 2026-10-04 20:42:26 UTC 836,598 bytes, 17,968 lines download raw bytes

vendor: 14,667 bytes, lines 1-14
1;(function($, window) {/*!
2 * VERSION: 1.12.1
3 * DATE: 2014-06-26
4 * UPDATES AND DOCS AT: http://www.greensock.com
5 * 
6 * Includes all of the following: TweenLite, TweenMax, TimelineLite, TimelineMax, EasePack, CSSPlugin, RoundPropsPlugin, BezierPlugin, AttrPlugin, DirectionalRotationPlugin
7 *
8 * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
9 * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
10 * Club GreenSock members, the software agreement that was issued with your membership.
11 * 
12 * @author: Jack Doyle, [email protected]
13 **/
14(window._gsQueue||(window._gsQueue=[])).push(function(){"use strict";window._gsDefine("TweenMax",["core.Animation","core.SimpleTimeline","TweenLite"],function(t,e,i){var s=[].slice,r=function(t,e,s){i.call(this,t,e,s),this._cycle=0,this._yoyo=this.vars.yoyo===!0,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._dirty=!0,this.render=r.prototype.render},n=1e-10,a=i._internals,o=a.isSelector,h=a.isArray,l=r.prototype=i.to({},.1,{}),_=[];r.version="1.12.1",l.constructor=r,l.kill()._gc=!1,r.killTweensOf=r.killDelayedCallsTo=i.killTweensOf,r.getTweensOf=i.getTweensOf,r.lagSmoothing=i.lagSmoothing,r.ticker=i.ticker,r.render=i.render,l.invalidate=function(){return this._yoyo=this.vars.yoyo===!0,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._uncache(!0),i.prototype.invalidate.call(this)},l.updateTo=function(t,e){var s,r=this.ratio;e&&this._startTime<this._timeline._time&&(this._startTime=this._timeline._time,this._uncache(!1),this._gc?this._enabled(!0,!1):this._timeline.insert(this,this._startTime-this._delay));for(s in t)this.vars[s]=t[s];if(this._initted)if(e)this._initted=!1;else if(this._gc&&this._enabled(!0,!1),this._notifyPluginsOfEnabled&&this._firstPT&&i._onPluginEvent("_onDisable",this),this._time/this._duration>.998){var n=this._time;this.render(0,!0,!1),this._initted=!1,this.render(n,!0,!1)}else if(this._time>0){this._initted=!1,this._init();for(var a,o=1/(1-r),h=this._firstPT;h;)a=h.s+h.c,h.c*=o,h.s=a-h.c,h=h._next}return this},l.render=function(t,e,i){this._initted||0===this._duration&&this.vars.repeat&&this.invalidate();var s,r,o,h,l,u,p,f,c=this._dirty?this.totalDuration():this._totalDuration,m=this._time,d=this._totalTime,g=this._cycle,v=this._duration,y=this._rawPrevTime;if(t>=c?(this._totalTime=c,this._cycle=this._repeat,this._yoyo&&0!==(1&this._cycle)?(this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0):(this._time=v,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1),this._reversed||(s=!0,r="onComplete"),0===v&&(this._initted||!this.vars.lazy||i)&&(this._startTime===this._timeline._duration&&(t=0),(0===t||0>y||y===n)&&y!==t&&(i=!0,y>n&&(r="onReverseComplete")),this._rawPrevTime=f=!e||t||y===t?t:n)):1e-7>t?(this._totalTime=this._time=this._cycle=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==d||0===v&&y>0&&y!==n)&&(r="onReverseComplete",s=this._reversed),0>t?(this._active=!1,0===v&&(this._initted||!this.vars.lazy||i)&&(y>=0&&(i=!0),this._rawPrevTime=f=!e||t||y===t?t:n)):this._initted||(i=!0)):(this._totalTime=this._time=t,0!==this._repeat&&(h=v+this._repeatDelay,this._cycle=this._totalTime/h>>0,0!==this._cycle&&this._cycle===this._totalTime/h&&this._cycle--,this._time=this._totalTime-this._cycle*h,this._yoyo&&0!==(1&this._cycle)&&(this._time=v-this._time),this._time>v?this._time=v:0>this._time&&(this._time=0)),this._easeType?(l=this._time/v,u=this._easeType,p=this._easePower,(1===u||3===u&&l>=.5)&&(l=1-l),3===u&&(l*=2),1===p?l*=l:2===p?l*=l*l:3===p?l*=l*l*l:4===p&&(l*=l*l*l*l),this.ratio=1===u?1-l:2===u?l:.5>this._time/v?l/2:1-l/2):this.ratio=this._ease.getRatio(this._time/v)),m===this._time&&!i&&g===this._cycle)return d!==this._totalTime&&this._onUpdate&&(e||this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||_)),void 0;if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!i&&this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration))return this._time=m,this._totalTime=d,this._rawPrevTime=y,this._cycle=g,a.lazyTweens.push(this),this._lazy=t,void 0;this._time&&!s?this.ratio=this._ease.getRatio(this._time/v):s&&this._ease._calcEnd&&(this.ratio=this._ease.getRatio(0===this._time?0:1))}for(this._lazy!==!1&&(this._lazy=!1),this._active||!this._paused&&this._time!==m&&t>=0&&(this._active=!0),0===d&&(2===this._initted&&t>0&&this._init(),this._startAt&&(t>=0?this._startAt.render(t,e,i):r||(r="_dummyGS")),this.vars.onStart&&(0!==this._totalTime||0===v)&&(e||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||_))),o=this._firstPT;o;)o.f?o.t[o.p](o.c*this.ratio+o.s):o.t[o.p]=o.c*this.ratio+o.s,o=o._next;this._onUpdate&&(0>t&&this._startAt&&this._startTime&&this._startAt.render(t,e,i),e||(this._totalTime!==d||s)&&this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||_)),this._cycle!==g&&(e||this._gc||this.vars.onRepeat&&this.vars.onRepeat.apply(this.vars.onRepeatScope||this,this.vars.onRepeatParams||_)),r&&(this._gc||(0>t&&this._startAt&&!this._onUpdate&&this._startTime&&this._startAt.render(t,e,i),s&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[r]&&this.vars[r].apply(this.vars[r+"Scope"]||this,this.vars[r+"Params"]||_),0===v&&this._rawPrevTime===n&&f!==n&&(this._rawPrevTime=0)))},r.to=function(t,e,i){return new r(t,e,i)},r.from=function(t,e,i){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,new r(t,e,i)},r.fromTo=function(t,e,i,s){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,new r(t,e,s)},r.staggerTo=r.allTo=function(t,e,n,a,l,u,p){a=a||0;var f,c,m,d,g=n.delay||0,v=[],y=function(){n.onComplete&&n.onComplete.apply(n.onCompleteScope||this,arguments),l.apply(p||this,u||_)};for(h(t)||("string"==typeof t&&(t=i.selector(t)||t),o(t)&&(t=s.call(t,0))),f=t.length,m=0;f>m;m++){c={};for(d in n)c[d]=n[d];c.delay=g,m===f-1&&l&&(c.onComplete=y),v[m]=new r(t[m],e,c),g+=a}return v},r.staggerFrom=r.allFrom=function(t,e,i,s,n,a,o){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,r.staggerTo(t,e,i,s,n,a,o)},r.staggerFromTo=r.allFromTo=function(t,e,i,s,n,a,o,h){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,r.staggerTo(t,e,s,n,a,o,h)},r.delayedCall=function(t,e,i,s,n){return new r(e,0,{delay:t,onComplete:e,onCompleteParams:i,onCompleteScope:s,onReverseComplete:e,onReverseCompleteParams:i,onReverseCompleteScope:s,immediateRender:!1,useFrames:n,overwrite:0})},r.set=function(t,e){return new r(t,0,e)},r.isTweening=function(t){return i.getTweensOf(t,!0).length>0};var u=function(t,e){for(var s=[],r=0,n=t._first;n;)n instanceof i?s[r++]=n:(e&&(s[r++]=n),s=s.concat(u(n,e)),r=s.length),n=n._next;return s},p=r.getAllTweens=function(e){return u(t._rootTimeline,e).concat(u(t._rootFramesTimeline,e))};r.killAll=function(t,i,s,r){null==i&&(i=!0),null==s&&(s=!0);var n,a,o,h=p(0!=r),l=h.length,_=i&&s&&r;for(o=0;l>o;o++)a=h[o],(_||a instanceof e||(n=a.target===a.vars.onComplete)&&s||i&&!n)&&(t?a.totalTime(a._reversed?0:a.totalDuration()):a._enabled(!1,!1))},r.killChildTweensOf=function(t,e){if(null!=t){var n,l,_,u,p,f=a.tweenLookup;if("string"==typeof t&&(t=i.selector(t)||t),o(t)&&(t=s.call(t,0)),h(t))for(u=t.length;--u>-1;)r.killChildTweensOf(t[u],e);else{n=[];for(_ in f)for(l=f[_].target.parentNode;l;)l===t&&(n=n.concat(f[_].tweens)),l=l.parentNode;for(p=n.length,u=0;p>u;u++)e&&n[u].totalTime(n[u].totalDuration()),n[u]._enabled(!1,!1)}}};var f=function(t,i,s,r){i=i!==!1,s=s!==!1,r=r!==!1;for(var n,a,o=p(r),h=i&&s&&r,l=o.length;--l>-1;)a=o[l],(h||a instanceof e||(n=a.target===a.vars.onComplete)&&s||i&&!n)&&a.paused(t)};return r.pauseAll=function(t,e,i){f(!0,t,e,i)},r.resumeAll=function(t,e,i){f(!1,t,e,i)},r.globalTimeScale=function(e){var s=t._rootTimeline,r=i.ticker.time;return arguments.length?(e=e||n,s._startTime=r-(r-s._startTime)*s._timeScale/e,s=t._rootFramesTimeline,r=i.ticker.frame,s._startTime=r-(r-s._startTime)*s._timeScale/e,s._timeScale=t._rootTimeline._timeScale=e,e):s._timeScale},l.progress=function(t){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&0!==(1&this._cycle)?1-t:t)+this._cycle*(this._duration+this._repeatDelay),!1):this._time/this.duration()},l.totalProgress=function(t){return arguments.length?this.totalTime(this.totalDuration()*t,!1):this._totalTime/this.totalDuration()},l.time=function(t,e){return arguments.length?(this._dirty&&this.totalDuration(),t>this._duration&&(t=this._duration),this._yoyo&&0!==(1&this._cycle)?t=this._duration-t+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(t+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(t,e)):this._time},l.duration=function(e){return arguments.length?t.prototype.duration.call(this,e):this._duration},l.totalDuration=function(t){return arguments.length?-1===this._repeat?this:this.duration((t-this._repeat*this._repeatDelay)/(this._repeat+1)):(this._dirty&&(this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat,this._dirty=!1),this._totalDuration)},l.repeat=function(t){return arguments.length?(this._repeat=t,this._uncache(!0)):this._repeat},l.repeatDelay=function(t){return arguments.length?(this._repeatDelay=t,this._uncache(!0)):this._repeatDelay},l.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},r},!0),window._gsDefine("TimelineLite",["core.Animation","core.SimpleTimeline","TweenLite"],function(t,e,i){var s=function(t){e.call(this,t),this._labels={},this.autoRemoveChildren=this.vars.autoRemoveChildren===!0,this.smoothChildTiming=this.vars.smoothChildTiming===!0,this._sortChildren=!0,this._onUpdate=this.vars.onUpdate;var i,s,r=this.vars;for(s in r)i=r[s],a(i)&&-1!==i.join("").indexOf("{self}")&&(r[s]=this._swapSelfInParams(i));a(r.tweens)&&this.add(r.tweens,0,r.align,r.stagger)},r=1e-10,n=i._internals.isSelector,a=i._internals.isArray,o=[],h=window._gsDefine.globals,l=function(t){var e,i={};for(e in t)i[e]=t[e];return i},_=function(t,e,i,s){t._timeline.pause(t._startTime),e&&e.apply(s||t._timeline,i||o)},u=o.slice,p=s.prototype=new e;return s.version="1.12.1",p.constructor=s,p.kill()._gc=!1,p.to=function(t,e,s,r){var n=s.repeat&&h.TweenMax||i;return e?this.add(new n(t,e,s),r):this.set(t,s,r)},p.from=function(t,e,s,r){return this.add((s.repeat&&h.TweenMax||i).from(t,e,s),r)},p.fromTo=function(t,e,s,r,n){var a=r.repeat&&h.TweenMax||i;return e?this.add(a.fromTo(t,e,s,r),n):this.set(t,r,n)},p.staggerTo=function(t,e,r,a,o,h,_,p){var f,c=new s({onComplete:h,onCompleteParams:_,onCompleteScope:p,smoothChildTiming:this.smoothChildTiming});for("string"==typeof t&&(t=i.selector(t)||t),n(t)&&(t=u.call(t,0)),a=a||0,f=0;t.length>f;f++)r.startAt&&(r.startAt=l(r.startAt)),c.to(t[f],e,l(r),f*a);return this.add(c,o)},p.staggerFrom=function(t,e,i,s,r,n,a,o){return i.immediateRender=0!=i.immediateRender,i.runBackwards=!0,this.staggerTo(t,e,i,s,r,n,a,o)},p.staggerFromTo=function(t,e,i,s,r,n,a,o,h){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,this.staggerTo(t,e,s,r,n,a,o,h)},p.call=function(t,e,s,r){return this.add(i.delayedCall(0,t,e,s),r)},p.set=function(t,e,s){return s=this._parseTimeOrLabel(s,0,!0),null==e.immediateRender&&(e.immediateRender=s===this._time&&!this._paused),this.add(new i(t,0,e),s)},s.exportRoot=function(t,e){t=t||{},null==t.smoothChildTiming&&(t.smoothChildTiming=!0);var r,n,a=new s(t),o=a._timeline;for(null==e&&(e=!0),o._remove(a,!0),a._startTime=0,a._rawPrevTime=a._time=a._totalTime=o._time,r=o._first;r;)n=r._next,e&&r instanceof i&&r.target===r.vars.onComplete||a.add(r,r._startTime-r._delay),r=n;return o.add(a,0),a},p.add=function(r,n,o,h){var l,_,u,p,f,c;if("number"!=typeof n&&(n=this._parseTimeOrLabel(n,0,!0,r)),!(r instanceof t)){if(r instanceof Array||r&&r.push&&a(r)){for(o=o||"normal",h=h||0,l=n,_=r.length,u=0;_>u;u++)a(p=r[u])&&(p=new s({tweens:p})),this.add(p,l),"string"!=typeof p&&"function"!=typeof p&&("sequence"===o?l=p._startTime+p.totalDuration()/p._timeScale:"start"===o&&(p._startTime-=p.delay())),l+=h;return this._uncache(!0)}if("string"==typeof r)return this.addLabel(r,n);if("function"!=typeof r)throw"Cannot add "+r+" into the timeline; it is not a tween, timeline, function, or string.";r=i.delayedCall(0,r)}if(e.prototype.add.call(this,r,n),(this._gc||this._time===this._duration)&&!this._paused&&this._duration<this.duration())for(f=this,c=f.rawTime()>r._startTime;f._timeline;)c&&f._timeline.smoothChildTiming?f.totalTime(f._totalTime,!0):f._gc&&f._enabled(!0,!1),f=f._timeline;return this},p.remove=function(e){if(e instanceof t)return this._remove(e,!1);if(e instanceof Array||e&&e.push&&a(e)){for(var i=e.length;--i>-1;)this.remove(e[i]);return this}return"string"==typeof e?this.removeLabel(e):this.kill(null,e)},p._remove=function(t,i){e.prototype._remove.call(this,t,i);var s=this._last;return s?this._time>s._startTime+s._totalDuration/s._timeScale&&(this._time=this.duration(),this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},p.append=function(t,e){return this.add(t,this._parseTimeOrLabel(null,e,!0,t))},p.insert=p.insertMultiple=function(t,e,i,s){return this.add(t,e||0,i,s)},p.appendMultiple=function(t,e,i,s){return this.add(t,this._parseTimeOrLabel(null,e,!0,t),i,s)},p.addLabel=function(t,e){return this._labels[t]=this._parseTimeOrLabel(e),this},p.addPause=function(t,e,i,s){return this.call(_,["{self}",e,i,s],this,t)},p.removeLabel=function(t){return delete this._labels[t],this},p.getLabelTime=function(t){return null!=this._labels[t]?this._labels[t]:-1},p._parseTimeOrLabel=function(e,i,s,r){var n;if(r instanceof t&&r.timeline===this)this.remove(r);else if(r&&(r instanceof Array||r.push&&a(r)))for(n=r.length;--n>-1;)r[n]instanceof t&&r[n].timeline===this&&this.remove(r[n]);if("string"==typeof i)return this._parseTimeOrLabel(i,s&&"number"==typeof e&&null==this._labels[i]?e-this.duration():0,s);if(i=i||0,"string"!=typeof e||!isNaN(e)&&null==this._labels[e])null==e&&(e=this.duration());else{if(n=e.indexOf("="),-1===n)return null==this._labels[e]?s?this._labels[e]=this.duration()+i:i:this._labels[e]+i;i=parseInt(e.charAt(n-1)+"1",10)*Number(e.substr(n+1)),e=n>1?this._parseTimeOrLabel(e.substr(0,n-1),0,s):this.duration()}return Number(e)+i},p.seek=function(t,e){return this.totalTime("number"==typeof t?t:this._parseTimeOrLabel(t),e!==!1)},p.stop=function(){return this.paused(!0)},p.gotoAndPlay=function(t,e){return this.play(t,e)},p.gotoAndStop=function(t,e){return this.pause(t,e)}
14,p.render=function(t,e,i){this._gc&&this._enabled(!0,!1);var s,n,a,h,l,_=this._dirty?this.totalDuration():this._totalDuration,u=this._time,p=this._startTime,f=this._timeScale,c=this._paused;if(t>=_?(this._totalTime=this._time=_,this._reversed||this._hasPausedChild()||(n=!0,h="onComplete",0===this._duration&&(0===t||0>this._rawPrevTime||this._rawPrevTime===r)&&this._rawPrevTime!==t&&this._first&&(l=!0,this._rawPrevTime>r&&(h="onReverseComplete"))),this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:r,t=_+1e-4):1e-7>t?(this._totalTime=this._time=0,(0!==u||0===this._duration&&this._rawPrevTime!==r&&(this._rawPrevTime>0||0>t&&this._rawPrevTime>=0))&&(h="onReverseComplete",n=this._reversed),0>t?(this._active=!1,0===this._duration&&this._rawPrevTime>=0&&this._first&&(l=!0),this._rawPrevTime=t):(this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:r,t=0,this._initted||(l=!0))):this._totalTime=this._time=this._rawPrevTime=t,this._time!==u&&this._first||i||l){if(this._initted||(this._initted=!0),this._active||!this._paused&&this._time!==u&&t>0&&(this._active=!0),0===u&&this.vars.onStart&&0!==this._time&&(e||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||o)),this._time>=u)for(s=this._first;s&&(a=s._next,!this._paused||c);)(s._active||s._startTime<=this._time&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=a;else for(s=this._last;s&&(a=s._prev,!this._paused||c);)(s._active||u>=s._startTime&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=a;this._onUpdate&&(e||this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||o)),h&&(this._gc||(p===this._startTime||f!==this._timeScale)&&(0===this._time||_>=this.totalDuration())&&(n&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[h]&&this.vars[h].apply(this.vars[h+"Scope"]||this,this.vars[h+"Params"]||o)))}},p._hasPausedChild=function(){for(var t=this._first;t;){if(t._paused||t instanceof s&&t._hasPausedChild())return!0;t=t._next}return!1},p.getChildren=function(t,e,s,r){r=r||-9999999999;for(var n=[],a=this._first,o=0;a;)r>a._startTime||(a instanceof i?e!==!1&&(n[o++]=a):(s!==!1&&(n[o++]=a),t!==!1&&(n=n.concat(a.getChildren(!0,e,s)),o=n.length))),a=a._next;return n},p.getTweensOf=function(t,e){var s,r,n=this._gc,a=[],o=0;for(n&&this._enabled(!0,!0),s=i.getTweensOf(t),r=s.length;--r>-1;)(s[r].timeline===this||e&&this._contains(s[r]))&&(a[o++]=s[r]);return n&&this._enabled(!1,!0),a},p._contains=function(t){for(var e=t.timeline;e;){if(e===this)return!0;e=e.timeline}return!1},p.shiftChildren=function(t,e,i){i=i||0;for(var s,r=this._first,n=this._labels;r;)r._startTime>=i&&(r._startTime+=t),r=r._next;if(e)for(s in n)n[s]>=i&&(n[s]+=t);return this._uncache(!0)},p._kill=function(t,e){if(!t&&!e)return this._enabled(!1,!1);for(var i=e?this.getTweensOf(e):this.getChildren(!0,!0,!1),s=i.length,r=!1;--s>-1;)i[s]._kill(t,e)&&(r=!0);return r},p.clear=function(t){var e=this.getChildren(!1,!0,!0),i=e.length;for(this._time=this._totalTime=0;--i>-1;)e[i]._enabled(!1,!1);return t!==!1&&(this._labels={}),this._uncache(!0)},p.invalidate=function(){for(var t=this._first;t;)t.invalidate(),t=t._next;return this},p._enabled=function(t,i){if(t===this._gc)for(var s=this._first;s;)s._enabled(t,!0),s=s._next;return e.prototype._enabled.call(this,t,i)},p.duration=function(t){return arguments.length?(0!==this.duration()&&0!==t&&this.timeScale(this._duration/t),this):(this._dirty&&this.totalDuration(),this._duration)},p.totalDuration=function(t){if(!arguments.length){if(this._dirty){for(var e,i,s=0,r=this._last,n=999999999999;r;)e=r._prev,r._dirty&&r.totalDuration(),r._startTime>n&&this._sortChildren&&!r._paused?this.add(r,r._startTime-r._delay):n=r._startTime,0>r._startTime&&!r._paused&&(s-=r._startTime,this._timeline.smoothChildTiming&&(this._startTime+=r._startTime/this._timeScale),this.shiftChildren(-r._startTime,!1,-9999999999),n=0),i=r._startTime+r._totalDuration/r._timeScale,i>s&&(s=i),r=e;this._duration=this._totalDuration=s,this._dirty=!1}return this._totalDuration}return 0!==this.totalDuration()&&0!==t&&this.timeScale(this._totalDuration/t),this},p.usesFrames=function(){for(var e=this._timeline;e._timeline;)e=e._timeline;return e===t._rootFramesTimeline},p.rawTime=function(){return this._paused?this._totalTime:(this._timeline.rawTime()-this._startTime)*this._timeScale},s},!0),window._gsDefine("TimelineMax",["TimelineLite","TweenLite","easing.Ease"],function(t,e,
14i){var s=function(e){t.call(this,e),this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._cycle=0,this._yoyo=this.vars.yoyo===!0,this._dirty=!0},r=1e-10,n=[],a=new i(null,null,1,0),o=s.prototype=new t;return o.constructor=s,o.kill()._gc=!1,s.version="1.12.1",o.invalidate=function(){return this._yoyo=this.vars.yoyo===!0,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._uncache(!0),t.prototype.invalidate.call(this)},o.addCallback=function(t,i,s,r){return this.add(e.delayedCall(0,t,s,r),i)},o.removeCallback=function(t,e){if(t)if(null==e)this._kill(null,t);else for(var i=this.getTweensOf(t,!1),s=i.length,r=this._parseTimeOrLabel(e);--s>-1;)i[s]._startTime===r&&i[s]._enabled(!1,!1);return this},o.tweenTo=function(t,i){i=i||{};var s,r,o,h={ease:a,overwrite:i.delay?2:1,useFrames:this.usesFrames(),immediateRender:!1};for(r in i)h[r]=i[r];return h.time=this._parseTimeOrLabel(t),s=Math.abs(Number(h.time)-this._time)/this._timeScale||.001,o=new e(this,s,h),h.onStart=function(){o.target.paused(!0),o.vars.time!==o.target.time()&&s===o.duration()&&o.duration(Math.abs(o.vars.time-o.target.time())/o.target._timeScale),i.onStart&&i.onStart.apply(i.onStartScope||o,i.onStartParams||n)},o},o.tweenFromTo=function(t,e,i){i=i||{},t=this._parseTimeOrLabel(t),i.startAt={onComplete:this.seek,onCompleteParams:[t],onCompleteScope:this},i.immediateRender=i.immediateRender!==!1;var s=this.tweenTo(e,i);return s.duration(Math.abs(s.vars.time-t)/this._timeScale||.001)},o.render=function(t,e,i){this._gc&&this._enabled(!0,!1);var s,a,o,h,l,_,u=this._dirty?this.totalDuration():this._totalDuration,p=this._duration,f=this._time,c=this._totalTime,m=this._startTime,d=this._timeScale,g=this._rawPrevTime,v=this._paused,y=this._cycle;if(t>=u?(this._locked||(this._totalTime=u,this._cycle=this._repeat),this._reversed||this._hasPausedChild()||(a=!0,h="onComplete",0===this._duration&&(0===t||0>g||g===r)&&g!==t&&this._first&&(l=!0,g>r&&(h="onReverseComplete"))),this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:r,this._yoyo&&0!==(1&this._cycle)?this._time=t=0:(this._time=p,t=p+1e-4)):1e-7>t?(this._locked||(this._totalTime=this._cycle=0),this._time=0,(0!==f||0===p&&g!==r&&(g>0||0>t&&g>=0)&&!this._locked)&&(h="onReverseComplete",a=this._reversed),0>t?(this._active=!1,0===p&&g>=0&&this._first&&(l=!0),this._rawPrevTime=t):(this._rawPrevTime=p||!e||t||this._rawPrevTime===t?t:r,t=0,this._initted||(l=!0))):(0===p&&0>g&&(l=!0),this._time=this._rawPrevTime=t,this._locked||(this._totalTime=t,0!==this._repeat&&(_=p+this._repeatDelay,this._cycle=this._totalTime/_>>0,0!==this._cycle&&this._cycle===this._totalTime/_&&this._cycle--,this._time=this._totalTime-this._cycle*_,this._yoyo&&0!==(1&this._cycle)&&(this._time=p-this._time),this._time>p?(this._time=p,t=p+1e-4):0>this._time?this._time=t=0:t=this._time))),this._cycle!==y&&!this._locked){var T=this._yoyo&&0!==(1&y),w=T===(this._yoyo&&0!==(1&this._cycle)),x=this._totalTime,b=this._cycle,P=this._rawPrevTime,S=this._time;if(this._totalTime=y*p,y>this._cycle?T=!T:this._totalTime+=p,this._time=f,this._rawPrevTime=0===p?g-1e-4:g,this._cycle=y,this._locked=!0,f=T?0:p,this.render(f,e,0===p),e||this._gc||this.vars.onRepeat&&this.vars.onRepeat.apply(this.vars.onRepeatScope||this,this.vars.onRepeatParams||n),w&&(f=T?p+1e-4:-1e-4,this.render(f,!0,!1)),this._locked=!1,this._paused&&!v)return;this._time=S,this._totalTime=x,this._cycle=b,this._rawPrevTime=P}if(!(this._time!==f&&this._first||i||l))return c!==this._totalTime&&this._onUpdate&&(e||this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||n)),void 0;if(this._initted||(this._initted=!0),this._active||!this._paused&&this._totalTime!==c&&t>0&&(this._active=!0),0===c&&this.vars.onStart&&0!==this._totalTime&&(e||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||n)),this._time>=f)for(s=this._first;s&&(o=s._next,!this._paused||v);)(s._active||s._startTime<=this._time&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=o;else for(s=this._last;s&&(o=s._prev,!this._paused||v);)(s._active||f>=s._startTime&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=o;
vendor: 13,234 bytes, lines 14-15
14this._onUpdate&&(e||this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||n)),h&&(this._locked||this._gc||(m===this._startTime||d!==this._timeScale)&&(0===this._time||u>=this.totalDuration())&&(a&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[h]&&this.vars[h].apply(this.vars[h+"Scope"]||this,this.vars[h+"Params"]||n)))},o.getActive=function(t,e,i){null==t&&(t=!0),null==e&&(e=!0),null==i&&(i=!1);var s,r,n=[],a=this.getChildren(t,e,i),o=0,h=a.length;for(s=0;h>s;s++)r=a[s],r.isActive()&&(n[o++]=r);return n},o.getLabelAfter=function(t){t||0!==t&&(t=this._time);var e,i=this.getLabelsArray(),s=i.length;for(e=0;s>e;e++)if(i[e].time>t)return i[e].name;return null},o.getLabelBefore=function(t){null==t&&(t=this._time);for(var e=this.getLabelsArray(),i=e.length;--i>-1;)if(t>e[i].time)return e[i].name;return null},o.getLabelsArray=function(){var t,e=[],i=0;for(t in this._labels)e[i++]={time:this._labels[t],name:t};return e.sort(function(t,e){return t.time-e.time}),e},o.progress=function(t){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&0!==(1&this._cycle)?1-t:t)+this._cycle*(this._duration+this._repeatDelay),!1):this._time/this.duration()},o.totalProgress=function(t){return arguments.length?this.totalTime(this.totalDuration()*t,!1):this._totalTime/this.totalDuration()},o.totalDuration=function(e){return arguments.length?-1===this._repeat?this:this.duration((e-this._repeat*this._repeatDelay)/(this._repeat+1)):(this._dirty&&(t.prototype.totalDuration.call(this),this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat),this._totalDuration)},o.time=function(t,e){return arguments.length?(this._dirty&&this.totalDuration(),t>this._duration&&(t=this._duration),this._yoyo&&0!==(1&this._cycle)?t=this._duration-t+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(t+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(t,e)):this._time},o.repeat=function(t){return arguments.length?(this._repeat=t,this._uncache(!0)):this._repeat},o.repeatDelay=function(t){return arguments.length?(this._repeatDelay=t,this._uncache(!0)):this._repeatDelay},o.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},o.currentLabel=function(t){return arguments.length?this.seek(t,!0):this.getLabelBefore(this._time+1e-8)},s},!0),function(){var t=180/Math.PI,e=[],i=[],s=[],r={},n=function(t,e,i,s){this.a=t,this.b=e,this.c=i,this.d=s,this.da=s-t,this.ca=i-t,this.ba=e-t},a=",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,",o=function(t,e,i,s){var r={a:t},n={},a={},o={c:s},h=(t+e)/2,l=(e+i)/2,_=(i+s)/2,u=(h+l)/2,p=(l+_)/2,f=(p-u)/8;return r.b=h+(t-h)/4,n.b=u+f,r.c=n.a=(r.b+n.b)/2,n.c=a.a=(u+p)/2,a.b=p-f,o.b=_+(s-_)/4,a.c=o.a=(a.b+o.b)/2,[r,n,a,o]},h=function(t,r,n,a,h){var l,_,u,p,f,c,m,d,g,v,y,T,w,x=t.length-1,b=0,P=t[0].a;for(l=0;x>l;l++)f=t[b],_=f.a,u=f.d,p=t[b+1].d,h?(y=e[l],T=i[l],w=.25*(T+y)*r/(a?.5:s[l]||.5),c=u-(u-_)*(a?.5*r:0!==y?w/y:0),m=u+(p-u)*(a?.5*r:0!==T?w/T:0),d=u-(c+((m-c)*(3*y/(y+T)+.5)/4||0))):(c=u-.5*(u-_)*r,m=u+.5*(p-u)*r,d=u-(c+m)/2),c+=d,m+=d,f.c=g=c,f.b=0!==l?P:P=f.a+.6*(f.c-f.a),f.da=u-_,f.ca=g-_,f.ba=P-_,n?(v=o(_,P,g,u),t.splice(b,1,v[0],v[1],v[2],v[3]),b+=4):b++,P=m;f=t[b],f.b=P,f.c=P+.4*(f.d-P),f.da=f.d-f.a,f.ca=f.c-f.a,f.ba=P-f.a,n&&(v=o(f.a,P,f.c,f.d),t.splice(b,1,v[0],v[1],v[2],v[3]))},l=function(t,s,r,a){var o,h,l,_,u,p,f=[];if(a)for(t=[a].concat(t),h=t.length;--h>-1;)"string"==typeof(p=t[h][s])&&"="===p.charAt(1)&&(t[h][s]=a[s]+Number(p.charAt(0)+p.substr(2)));if(o=t.length-2,0>o)return f[0]=new n(t[0][s],0,0,t[-1>o?0:1][s]),f;for(h=0;o>h;h++)l=t[h][s],_=t[h+1][s],f[h]=new n(l,0,0,_),r&&(u=t[h+2][s],e[h]=(e[h]||0)+(_-l)*(_-l),i[h]=(i[h]||0)+(u-_)*(u-_));return f[h]=new n(t[h][s],0,0,t[h+1][s]),f},_=function(t,n,o,_,u,p){var f,c,m,d,g,v,y,T,w={},x=[],b=p||t[0];u="string"==typeof u?","+u+",":a,null==n&&(n=1);for(c in t[0])x.push(c);if(t.length>1){for(T=t[t.length-1],y=!0,f=x.length;--f>-1;)if(c=x[f],Math.abs(b[c]-T[c])>.05){y=!1;break}y&&(t=t.concat(),p&&t.unshift(p),t.push(t[1]),p=t[t.length-3])}for(e.length=i.length=s.length=0,f=x.length;--f>-1;)c=x[f],r[c]=-1!==u.indexOf(","+c+","),w[c]=l(t,c,r[c],p);for(f=e.length;--f>-1;)e[f]=Math.sqrt(e[f]),i[f]=Math.sqrt(i[f]);if(!_){for(f=x.length;--f>-1;)if(r[c])for(m=w[x[f]],v=m.length-1,d=0;v>d;d++)g=m[d+1].da/i[d]+m[d].da/e[d],s[d]=(s[d]||0)+g*g;for(f=s.length;--f>-1;)s[f]=Math.sqrt(s[f])}for(f=x.length,d=o?4:1;--f>-1;)c=x[f],m=w[c],h(m,n,o,_,r[c]),y&&(m.splice(0,d),m.splice(m.length-d,d));return w},u=function(t,e,i){e=e||"soft";var s,r,a,o,h,l,_,u,p,f,c,m={},d="cubic"===e?3:2,g="soft"===e,v=[];if(g&&i&&(t=[i].concat(t)),null==t||d+1>t.length)throw"invalid Bezier data";for(p in t[0])v.push(p);for(l=v.length;--l>-1;){for(p=v[l],m[p]=h=[],f=0,u=t.length,_=0;u>_;_++)s=null==i?t[_][p]:"string"==typeof(c=t[_][p])&&"="===c.charAt(1)?i[p]+Number(c.charAt(0)+c.substr(2)):Number(c),g&&_>1&&u-1>_&&(h[f++]=(s+h[f-2])/2),h[f++]=s;for(u=f-d+1,f=0,_=0;u>_;_+=d)s=h[_],r=h[_+1],a=h[_+2],o=2===d?0:h[_+3],h[f++]=c=3===d?new n(s,r,a,o):new n(s,(2*r+s)/3,(2*r+a)/3,a);h.length=f}return m},p=function(t,e,i){for(var s,r,n,a,o,h,l,_,u,p,f,c=1/i,m=t.length;--m>-1;)for(p=t[m],n=p.a,a=p.d-n,o=p.c-n,h=p.b-n,s=r=0,_=1;i>=_;_++)l=c*_,u=1-l,s=r-(r=(l*l*a+3*u*(l*o+u*h))*l),f=m*i+_-1,e[f]=(e[f]||0)+s*s},f=function(t,e){e=e>>0||6;var i,s,r,n,a=[],o=[],h=0,l=0,_=e-1,u=[],f=[];for(i in t)p(t[i],a,e);for(r=a.length,s=0;r>s;s++)h+=Math.sqrt(a[s]),n=s%e,f[n]=h,n===_&&(l+=h,n=s/e>>0,u[n]=f,o[n]=l,h=0,f=[]);return{length:l,lengths:o,segments:u}},c=window._gsDefine.plugin({propName:"bezier",priority:-1,version:"1.3.2",API:2,global:!0,init:function(t,e,i){this._target=t,e instanceof Array&&(e={values:e}),this._func={},this._round={},this._props=[],this._timeRes=null==e.timeResolution?6:parseInt(e.timeResolution,10);var s,r,n,a,o,h=e.values||[],l={},p=h[0],c=e.autoRotate||i.vars.orientToBezier;this._autoRotate=c?c instanceof Array?c:[["x","y","rotation",c===!0?0:Number(c)||0]]:null;for(s in p)this._props.push(s);for(n=this._props.length;--n>-1;)s=this._props[n],this._overwriteProps.push(s),r=this._func[s]="function"==typeof t[s],l[s]=r?t[s.indexOf("set")||"function"!=typeof t["get"+s.substr(3)]?s:"get"+s.substr(3)]():parseFloat(t[s]),o||l[s]!==h[0][s]&&(o=l);if(this._beziers="cubic"!==e.type&&"quadratic"!==e.type&&"soft"!==e.type?_(h,isNaN(e.curviness)?1:e.curviness,!1,"thruBasic"===e.type,e.correlate,o):u(h,e.type,l),this._segCount=this._beziers[s].length,this._timeRes){var m=f(this._beziers,this._timeRes);this._length=m.length,this._lengths=m.lengths,this._segments=m.segments,this._l1=this._li=this._s1=this._si=0,this._l2=this._lengths[0],this._curSeg=this._segments[0],this._s2=this._curSeg[0],this._prec=1/this._curSeg.length}if(c=this._autoRotate)for(this._initialRotations=[],c[0]instanceof Array||(this._autoRotate=c=[c]),n=c.length;--n>-1;){for(a=0;3>a;a++)s=c[n][a],this._func[s]="function"==typeof t[s]?t[s.indexOf("set")||"function"!=typeof t["get"+s.substr(3)]?s:"get"+s.substr(3)]:!1;s=c[n][2],this._initialRotations[n]=this._func[s]?this._func[s].call(this._target):this._target[s]}return this._startRatio=i.vars.runBackwards?1:0,!0},set:function(e){var i,s,r,n,a,o,h,l,_,u,p=this._segCount,f=this._func,c=this._target,m=e!==this._startRatio;if(this._timeRes){if(_=this._lengths,u=this._curSeg,e*=this._length,r=this._li,e>this._l2&&p-1>r){for(l=p-1;l>r&&e>=(this._l2=_[++r]););this._l1=_[r-1],this._li=r,this._curSeg=u=this._segments[r],this._s2=u[this._s1=this._si=0]}else if(this._l1>e&&r>0){for(;r>0&&(this._l1=_[--r])>=e;);0===r&&this._l1>e?this._l1=0:r++,this._l2=_[r],this._li=r,this._curSeg=u=this._segments[r],this._s1=u[(this._si=u.length-1)-1]||0,this._s2=u[this._si]}if(i=r,e-=this._l1,r=this._si,e>this._s2&&u.length-1>r){for(l=u.length-1;l>r&&e>=(this._s2=u[++r]););this._s1=u[r-1],this._si=r}else if(this._s1>e&&r>0){for(;r>0&&(this._s1=u[--r])>=e;);0===r&&this._s1>e?this._s1=0:r++,this._s2=u[r],this._si=r}o=(r+(e-this._s1)/(this._s2-this._s1))*this._prec}else i=0>e?0:e>=1?p-1:p*e>>0,o=(e-i*(1/p))*p;for(s=1-o,r=this._props.length;--r>-1;)n=this._props[r],a=this._beziers[n][i],h=(o*o*a.da+3*s*(o*a.ca+s*a.ba))*o+a.a,this._round[n]&&(h=Math.round(h)),f[n]?c[n](h):c[n]=h;if(this._autoRotate){var d,g,v,y,T,w,x,b=this._autoRotate;for(r=b.length;--r>-1;)n=b[r][2],w=b[r][3]||0,x=b[r][4]===!0?1:t,a=this._beziers[b[r][0]],d=this._beziers[b[r][1]],a&&d&&(a=a[i],d=d[i],g=a.a+(a.b-a.a)*o,y=a.b+(a.c-a.b)*o,g+=(y-g)*o,y+=(a.c+(a.d-a.c)*o-y)*o,v=d.a+(d.b-d.a)*o,T=d.b+(d.c-d.b)*o,v+=(T-v)*o,T+=(d.c+(d.d-d.c)*o-T)*o,h=m?Math.atan2(T-v,y-g)*x+w:this._initialRotations[r],f[n]?c[n](h):c[n]=h)
15}}}),m=c.prototype;c.bezierThrough=_,c.cubicToQuadratic=o,c._autoCSS=!0,c.quadraticToCubic=function(t,e,i){return new n(t,(2*e+t)/3,(2*e+i)/3,i)},c._cssRegister=function(){var t=window._gsDefine.globals.CSSPlugin;if(t){var e=t._internals,i=e._parseToProxy,s=e._setPluginRatio,r=e.CSSPropTween;e._registerComplexSpecialProp("bezier",{parser:function(t,e,n,a,o,h){e instanceof Array&&(e={values:e}),h=new c;var l,_,u,p=e.values,f=p.length-1,m=[],d={};if(0>f)return o;for(l=0;f>=l;l++)u=i(t,p[l],a,o,h,f!==l),m[l]=u.end;for(_ in e)d[_]=e[_];return d.values=m,o=new r(t,"bezier",0,0,u.pt,2),o.data=u,o.plugin=h,o.setRatio=s,0===d.autoRotate&&(d.autoRotate=!0),!d.autoRotate||d.autoRotate instanceof Array||(l=d.autoRotate===!0?0:Number(d.autoRotate),d.autoRotate=null!=u.end.left?[["left","top","rotation",l,!1]]:null!=u.end.x?[["x","y","rotation",l,!1]]:!1),d.autoRotate&&(a._transform||a._enableTransforms(!1),u.autoRotate=a._target._gsTransform),h._onInitTween(u.proxy,d,a._tween),o}})}},m._roundProps=function(t,e){for(var i=this._overwriteProps,s=i.length;--s>-1;)(t[i[s]]||t.bezier||t.bezierThrough)&&(this._round[i[s]]=e)},m._kill=function(t){var e,i,s=this._props;for(e in this._beziers)if(e in t)for(delete this._beziers[e],delete this._func[e],i=s.length;--i>-1;)s[i]===e&&s.splice(i,1);return this._super._kill.call(this,t)}}(),window._gsDefine("plugins.CSSPlugin",["plugins.TweenPlugin","TweenLite"],function(t,e){var i,s,r,n,a=function(){t.call(this,"css"),this._overwriteProps.length=0,this.setRatio=a.prototype.setRatio},o={},h=a.prototype=new t("css");h.constructor=a,a.version="1.12.1",a.API=2,a.defaultTransformPerspective=0,a.defaultSkewType="compensated",h="px",a.suffixMap={top:h,right:h,bottom:h,left:h,width:h,height:h,fontSize:h,padding:h,margin:h,perspective:h,lineHeight:""};var l,_,u,p,f,c,m=/(?:\d|\-\d|\.\d|\-\.\d)+/g,d=/(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,g=/(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi,v=/[^\d\-\.]/g,y=/(?:\d|\-|\+|=|#|\.)*/g,T=/opacity *= *([^)]*)/i,w=/opacity:([^;]*)/i,x=/alpha\(opacity *=.+?\)/i,b=/^(rgb|hsl)/,P=/([A-Z])/g,S=/-([a-z])/gi,k=/(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi,R=function(t,e){return e.toUpperCase()},A=/(?:Left|Right|Width)/i,C=/(M11|M12|M21|M22)=[\d\-\.e]+/gi,O=/progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,D=/,(?=[^\)]*(?:\(|$))/gi,M=Math.PI/180,z=180/Math.PI,I={},E=document,L=E.createElement("div"),F=E.createElement("img"),N=a._internals={_specialProps:o},X=navigator.userAgent,U=function(){var t,e=X.indexOf("Android"),i=E.createElement("div");return u=-1!==X.indexOf("Safari")&&-1===X.indexOf("Chrome")&&(-1===e||Number(X.substr(e+8,1))>3),f=u&&6>Number(X.substr(X.indexOf("Version/")+8,1)),p=-1!==X.indexOf("Firefox"),/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(X)&&(c=parseFloat(RegExp.$1)),i.innerHTML="<a style='top:1px;opacity:.55;'>a</a>",t=i.getElementsByTagName("a")[0],t?/^0.55/.test(t.style.opacity):!1}(),Y=function(t){return T.test("string"==typeof t?t:(t.currentStyle?t.currentStyle.filter:t.style.filter)||"")?parseFloat(RegExp.$1)/100:1},j=function(t){window.console&&console.log(t)},B="",q="",V=function(t,e){e=e||L;var i,s,r=e.style;if(void 0!==r[t])return t;for(t=t.charAt(0).toUpperCase()+t.substr(1),i=["O","Moz","ms","Ms","Webkit"],s=5;--s>-1&&void 0===r[i[s]+t];);return s>=0?(q=3===s?"ms":i[s],B="-"+q.toLowerCase()+"-",q+t):null},W=E.defaultView?E.defaultView.getComputedStyle:function(){},G=a.getStyle=function(t,e,i,s,r){var n;return U||"opacity"!==e?(!s&&t.style[e]?n=t.style[e]:(i=i||W(t))?n=i[e]||i.getPropertyValue(e)||i.getPropertyValue(e.replace(P,"-$1").toLowerCase()):t.currentStyle&&(n=t.currentStyle[e]),null==r||n&&"none"!==n&&"auto"!==n&&"auto auto"!==n?n:r):Y(t)},$=N.convertToPixels=function(t,i,s,r,n){if("px"===r||!r)return s;if("auto"===r||!s)return 0;var o,h,l,_=A.test(i),u=t,p=L.style,f=0>s;if(f&&(s=-s),"%"===r&&-1!==i.indexOf("border"))o=s/100*(_?t.clientWidth:t.clientHeight);else{if(p.cssText="border:0 solid red;position:"+G(t,"position")+";line-height:0;","%"!==r&&u.appendChild)p[_?"borderLeftWidth":"borderTopWidth"]=s+r;else{if(u=t.parentNode||E.body,h=u._gsCache,l=e.ticker.frame,h&&_&&h.time===l)return h.width*s/100;p[_?"width":"height"]=s+r}u.appendChild(L),o=parseFloat(L[_?"offsetWidth":"offsetHeight"]),u.removeChild(L),_&&"%"===r&&a.cacheWidths!==!1&&(h=u._gsCache=u._gsCache||{},h.time=l,h.width=100*(o/s)),0!==o||n||(o=$(t,i,s,r,!0))}return f?-o:o}
15,Z=N.calculateOffset=function(t,e,i){if("absolute"!==G(t,"position",i))return 0;var s="left"===e?"Left":"Top",r=G(t,"margin"+s,i);return t["offset"+s]-($(t,e,parseFloat(r),r.replace(y,""))||0)},Q=function(t,e){var i,s,r={};if(e=e||W(t,null))if(i=e.length)for(;--i>-1;)r[e[i].replace(S,R)]=e.getPropertyValue(e[i]);else for(i in e)r[i]=e[i];else if(e=t.currentStyle||t.style)for(i in e)"string"==typeof i&&void 0===r[i]&&(r[i.replace(S,R)]=e[i]);return U||(r.opacity=Y(t)),s=Pe(t,e,!1),r.rotation=s.rotation,r.skewX=s.skewX,r.scaleX=s.scaleX,r.scaleY=s.scaleY,r.x=s.x,r.y=s.y,xe&&(r.z=s.z,r.rotationX=s.rotationX,r.rotationY=s.rotationY,r.scaleZ=s.scaleZ),r.filters&&delete r.filters,r},H=function(t,e,i,s,r){var n,a,o,h={},l=t.style;for(a in i)"cssText"!==a&&"length"!==a&&isNaN(a)&&(e[a]!==(n=i[a])||r&&r[a])&&-1===a.indexOf("Origin")&&("number"==typeof n||"string"==typeof n)&&(h[a]="auto"!==n||"left"!==a&&"top"!==a?""!==n&&"auto"!==n&&"none"!==n||"string"!=typeof e[a]||""===e[a].replace(v,"")?n:0:Z(t,a),void 0!==l[a]&&(o=new ue(l,a,l[a],o)));if(s)for(a in s)"className"!==a&&(h[a]=s[a]);return{difs:h,firstMPT:o}},K={width:["Left","Right"],height:["Top","Bottom"]},J=["marginLeft","marginRight","marginTop","marginBottom"],te=function(t,e,i){var s=parseFloat("width"===e?t.offsetWidth:t.offsetHeight),r=K[e],n=r.length;for(i=i||W(t,null);--n>-1;)s-=parseFloat(G(t,"padding"+r[n],i,!0))||0,s-=parseFloat(G(t,"border"+r[n]+"Width",i,!0))||0;return s},ee=function(t,e){(null==t||""===t||"auto"===t||"auto auto"===t)&&(t="0 0");var i=t.split(" "),s=-1!==t.indexOf("left")?"0%":-1!==t.indexOf("right")?"100%":i[0],r=-1!==t.indexOf("top")?"0%":-1!==t.indexOf("bottom")?"100%":i[1];return null==r?r="0":"center"===r&&(r="50%"),("center"===s||isNaN(parseFloat(s))&&-1===(s+"").indexOf("="))&&(s="50%"),e&&(e.oxp=-1!==s.indexOf("%"),e.oyp=-1!==r.indexOf("%"),e.oxr="="===s.charAt(1),e.oyr="="===r.charAt(1),e.ox=parseFloat(s.replace(v,"")),e.oy=parseFloat(r.replace(v,""))),s+" "+r+(i.length>2?" "+i[2]:"")},ie=function(t,e){return"string"==typeof t&&"="===t.charAt(1)?parseInt(t.charAt(0)+"1",10)*parseFloat(t.substr(2)):parseFloat(t)-parseFloat(e)},se=function(t,e){return null==t?e:"string"==typeof t&&"="===t.charAt(1)?parseInt(t.charAt(0)+"1",10)*Number(t.substr(2))+e:parseFloat(t)},re=function(t,e,i,s){var r,n,a,o,h=1e-6;return null==t?o=e:"number"==typeof t?o=t:(r=360,n=t.split("_"),a=Number(n[0].replace(v,""))*(-1===t.indexOf("rad")?1:z)-("="===t.charAt(1)?0:e),n.length&&(s&&(s[i]=e+a),-1!==t.indexOf("short")&&(a%=r,a!==a%(r/2)&&(a=0>a?a+r:a-r)),-1!==t.indexOf("_cw")&&0>a?a=(a+9999999999*r)%r-(0|a/r)*r:-1!==t.indexOf("ccw")&&a>0&&(a=(a-9999999999*r)%r-(0|a/r)*r)),o=e+a),h>o&&o>-h&&(o=0),o},ne={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],fuchsia:[255,0,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]},ae=function(t,e,i){return t=0>t?t+1:t>1?t-1:t,0|255*(1>6*t?e+6*(i-e)*t:.5>t?i:2>3*t?e+6*(i-e)*(2/3-t):e)+.5},oe=function(t){var e,i,s,r,n,a;return t&&""!==t?"number"==typeof t?[t>>16,255&t>>8,255&t]:(","===t.charAt(t.length-1)&&(t=t.substr(0,t.length-1)),ne[t]?ne[t]:"#"===t.charAt(0)?(4===t.length&&(e=t.charAt(1),i=t.charAt(2),s=t.charAt(3),t="#"+e+e+i+i+s+s),t=parseInt(t.substr(1),16),[t>>16,255&t>>8,255&t]):"hsl"===t.substr(0,3)?(t=t.match(m),r=Number(t[0])%360/360,n=Number(t[1])/100,a=Number(t[2])/100,i=.5>=a?a*(n+1):a+n-a*n,e=2*a-i,t.length>3&&(t[3]=Number(t[3])),t[0]=ae(r+1/3,e,i),t[1]=ae(r,e,i),t[2]=ae(r-1/3,e,i),t):(t=t.match(m)||ne.transparent,t[0]=Number(t[0]),t[1]=Number(t[1]),t[2]=Number(t[2]),t.length>3&&(t[3]=Number(t[3])),t)):ne.black},he="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#.+?\\b";for(h in ne)he+="|"+h+"\\b";he=RegExp(he+")","gi");var le=function(t,e,i,s){if(null==t)return function(t){return t};var r,n=e?(t.match(he)||[""])[0]:"",a=t.split(n).join("").match(g)||[],o=t.substr(0,t.indexOf(a[0])),h=")"===t.charAt(t.length-1)?")":"",l=-1!==t.indexOf(" ")?" ":",",_=a.length,u=_>0?a[0].replace(m,""):"";return _?r=e?function(t){var e,p,f,c;if("number"==typeof t)t+=u;else if(s&&D.test(t)){for(c=t.replace(D,"|").split("|"),f=0;c.length>f;f++)c[f]=r(c[f]);return c.join(",")}if(e=(t.match(he)||[n])[0],p=t.split(e).join("").match(g)||[],f=p.length,_>f--)for(;_>++f;)p[f]=i?p[0|(f-1)/2]:a[f];return o+p.join(l)+l+e+h+(-1!==t.indexOf("inset")?" inset":"")}:function(t){var e,n,p;if("number"==typeof t)t+=u;else if(s&&D.test(t)){for(n=t.replace(D,"|").split("|"),p=0;n.length>p;p++)n[p]=r(n[p]);return n.join(",")}if(e=t.match(g)||[],p=e.length,_>p--)for(;_>++p;)e[p]=i?e[0|(p-1)/2]:a[p];return o+e.join(l)+h}:function(t){return t}},_e=function(t){return t=t.split(","),function(e,i,s,r,n,a,o){var h,l=(i+"").split(" ");for(o={},h=0;4>h;h++)o[t[h]]=l[h]=l[h]||l[(h-1)/2>>0];return r.parse(e,o,n,a)}},ue=(N._setPluginRatio=function(t){this.plugin.setRatio(t);for(var e,i,s,r,n=this.data,a=n.proxy,o=n.firstMPT,h=1e-6;o;
vendor: 4,282 bytes, line 15
15)e=a[o.v],o.r?e=Math.round(e):h>e&&e>-h&&(e=0),o.t[o.p]=e,o=o._next;if(n.autoRotate&&(n.autoRotate.rotation=a.rotation),1===t)for(o=n.firstMPT;o;){if(i=o.t,i.type){if(1===i.type){for(r=i.xs0+i.s+i.xs1,s=1;i.l>s;s++)r+=i["xn"+s]+i["xs"+(s+1)];i.e=r}}else i.e=i.s+i.xs0;o=o._next}},function(t,e,i,s,r){this.t=t,this.p=e,this.v=i,this.r=r,s&&(s._prev=this,this._next=s)}),pe=(N._parseToProxy=function(t,e,i,s,r,n){var a,o,h,l,_,u=s,p={},f={},c=i._transform,m=I;for(i._transform=null,I=e,s=_=i.parse(t,e,s,r),I=m,n&&(i._transform=c,u&&(u._prev=null,u._prev&&(u._prev._next=null)));s&&s!==u;){if(1>=s.type&&(o=s.p,f[o]=s.s+s.c,p[o]=s.s,n||(l=new ue(s,"s",o,l,s.r),s.c=0),1===s.type))for(a=s.l;--a>0;)h="xn"+a,o=s.p+"_"+h,f[o]=s.data[h],p[o]=s[h],n||(l=new ue(s,h,o,l,s.rxp[h]));s=s._next}return{proxy:p,end:f,firstMPT:l,pt:_}},N.CSSPropTween=function(t,e,s,r,a,o,h,l,_,u,p){this.t=t,this.p=e,this.s=s,this.c=r,this.n=h||e,t instanceof pe||n.push(this.n),this.r=l,this.type=o||0,_&&(this.pr=_,i=!0),this.b=void 0===u?s:u,this.e=void 0===p?s+r:p,a&&(this._next=a,a._prev=this)}),fe=a.parseComplex=function(t,e,i,s,r,n,a,o,h,_){i=i||n||"",a=new pe(t,e,0,0,a,_?2:1,null,!1,o,i,s),s+="";var u,p,f,c,g,v,y,T,w,x,P,S,k=i.split(", ").join(",").split(" "),R=s.split(", ").join(",").split(" "),A=k.length,C=l!==!1;for((-1!==s.indexOf(",")||-1!==i.indexOf(","))&&(k=k.join(" ").replace(D,", ").split(" "),R=R.join(" ").replace(D,", ").split(" "),A=k.length),A!==R.length&&(k=(n||"").split(" "),A=k.length),a.plugin=h,a.setRatio=_,u=0;A>u;u++)if(c=k[u],g=R[u],T=parseFloat(c),T||0===T)a.appendXtra("",T,ie(g,T),g.replace(d,""),C&&-1!==g.indexOf("px"),!0);else if(r&&("#"===c.charAt(0)||ne[c]||b.test(c)))S=","===g.charAt(g.length-1)?"),":")",c=oe(c),g=oe(g),w=c.length+g.length>6,w&&!U&&0===g[3]?(a["xs"+a.l]+=a.l?" transparent":"transparent",a.e=a.e.split(R[u]).join("transparent")):(U||(w=!1),a.appendXtra(w?"rgba(":"rgb(",c[0],g[0]-c[0],",",!0,!0).appendXtra("",c[1],g[1]-c[1],",",!0).appendXtra("",c[2],g[2]-c[2],w?",":S,!0),w&&(c=4>c.length?1:c[3],a.appendXtra("",c,(4>g.length?1:g[3])-c,S,!1)));else if(v=c.match(m)){if(y=g.match(d),!y||y.length!==v.length)return a;for(f=0,p=0;v.length>p;p++)P=v[p],x=c.indexOf(P,f),a.appendXtra(c.substr(f,x-f),Number(P),ie(y[p],P),"",C&&"px"===c.substr(x+P.length,2),0===p),f=x+P.length;a["xs"+a.l]+=c.substr(f)}else a["xs"+a.l]+=a.l?" "+c:c;if(-1!==s.indexOf("=")&&a.data){for(S=a.xs0+a.data.s,u=1;a.l>u;u++)S+=a["xs"+u]+a.data["xn"+u];a.e=S+a["xs"+u]}return a.l||(a.type=-1,a.xs0=a.e),a.xfirst||a},ce=9;for(h=pe.prototype,h.l=h.pr=0;--ce>0;)h["xn"+ce]=0,h["xs"+ce]="";h.xs0="",h._next=h._prev=h.xfirst=h.data=h.plugin=h.setRatio=h.rxp=null,h.appendXtra=function(t,e,i,s,r,n){var a=this,o=a.l;return a["xs"+o]+=n&&o?" "+t:t||"",i||0===o||a.plugin?(a.l++,a.type=a.setRatio?2:1,a["xs"+a.l]=s||"",o>0?(a.data["xn"+o]=e+i,a.rxp["xn"+o]=r,a["xn"+o]=e,a.plugin||(a.xfirst=new pe(a,"xn"+o,e,i,a.xfirst||a,0,a.n,r,a.pr),a.xfirst.xs0=0),a):(a.data={s:e+i},a.rxp={},a.s=e,a.c=i,a.r=r,a)):(a["xs"+o]+=e+(s||""),a)};var me=function(t,e){e=e||{},this.p=e.prefix?V(t)||t:t,o[t]=o[this.p]=this,this.format=e.formatter||le(e.defaultValue,e.color,e.collapsible,e.multi),e.parser&&(this.parse=e.parser),this.clrs=e.color,this.multi=e.multi,this.keyword=e.keyword,this.dflt=e.defaultValue,this.pr=e.priority||0},de=N._registerComplexSpecialProp=function(t,e,i){"object"!=typeof e&&(e={parser:i});var s,r,n=t.split(","),a=e.defaultValue;for(i=i||[a],s=0;n.length>s;s++)e.prefix=0===s&&e.prefix,e.defaultValue=i[s]||a,r=new me(n[s],e)},ge=function(t){if(!o[t]){var e=t.charAt(0).toUpperCase()+t.substr(1)+"Plugin";de(t,{parser:function(t,i,s,r,n,a,h){var l=(window.GreenSockGlobals||window).com.greensock.plugins[e];return l?(l._cssRegister(),o[s].parse(t,i,s,r,n,a,h)):(j("Error: "+e+" js file not loaded."),n)}})}};h=me.prototype,h.parseComplex=function(t,e,i,s,r,n){var a,o,h,l,_,u,p=this.keyword;if(this.multi&&(D.test(i)||D.test(e)?(o=e.replace(D,"|").split("|"),h=i.replace(D,"|").split("|")):p&&(o=[e],h=[i])),h){for(l=h.length>o.length?h.length:o.length,a=0;l>a;a++)e=o[a]=o[a]||this.dflt,i=h[a]=h[a]||this.dflt,p&&(_=e.indexOf(p),u=i.indexOf(p),_!==u&&(i=-1===u?h:o,i[a]+=" "+p));e=o.join(", "),i=h.join(", ")}return fe(t,this.p,e,i,this.clrs,this.dflt,s,this.pr,r,n)}
15,h.parse=function(t,e,i,s,n,a){return this.parseComplex(t.style,this.format(G(t,this.p,r,!1,this.dflt)),this.format(e),n,a)},a.registerSpecialProp=function(t,e,i){de(t,{parser:function(t,s,r,n,a,o){var h=new pe(t,r,0,0,a,2,r,!1,i);return h.plugin=o,h.setRatio=e(t,s,n._tween,r),h},priority:i})};var ve="scaleX,scaleY,scaleZ,x,y,z,skewX,skewY,rotation,rotationX,rotationY,perspective".split(","),ye=V("transform"),Te=B+"transform",we=V("transformOrigin"),xe=null!==V("perspective"),be=N.Transform=function(){this.skewY=0},Pe=N.getTransform=function(t,e,i,s){if(t._gsTransform&&i&&!s)return t._gsTransform;var r,n,o,h,l,_,u,p,f,c,m,d,g,v=i?t._gsTransform||new be:new be,y=0>v.scaleX,T=2e-5,w=1e5,x=179.99,b=x*M,P=xe?parseFloat(G(t,we,e,!1,"0 0 0").split(" ")[2])||v.zOrigin||0:0;for(ye?r=G(t,Te,e,!0):t.currentStyle&&(r=t.currentStyle.filter.match(C),r=r&&4===r.length?[r[0].substr(4),Number(r[2].substr(4)),Number(r[1].substr(4)),r[3].substr(4),v.x||0,v.y||0].join(","):""),n=(r||"").match(/(?:\-|\b)[\d\-\.e]+\b/gi)||[],o=n.length;--o>-1;)h=Number(n[o]),n[o]=(l=h-(h|=0))?(0|l*w+(0>l?-.5:.5))/w+h:h;if(16===n.length){var S=n[8],k=n[9],R=n[10],A=n[12],O=n[13],D=n[14];if(v.zOrigin&&(D=-v.zOrigin,A=S*D-n[12],O=k*D-n[13],D=R*D+v.zOrigin-n[14]),!i||s||null==v.rotationX){var I,E,L,F,N,X,U,Y=n[0],j=n[1],B=n[2],q=n[3],V=n[4],W=n[5],$=n[6],Z=n[7],Q=n[11],H=Math.atan2($,R),K=-b>H||H>b;v.rotationX=H*z,H&&(F=Math.cos(-H),N=Math.sin(-H),I=V*F+S*N,E=W*F+k*N,L=$*F+R*N,S=V*-N+S*F,k=W*-N+k*F,R=$*-N+R*F,Q=Z*-N+Q*F,V=I,W=E,$=L),H=Math.atan2(S,Y),v.rotationY=H*z,H&&(X=-b>H||H>b,F=Math.cos(-H),N=Math.sin(-H),I=Y*F-S*N,E=j*F-k*N,L=B*F-R*N,k=j*N+k*F,R=B*N+R*F,Q=q*N+Q*F,Y=I,j=E,B=L),H=Math.atan2(j,W),v.rotation=H*z,H&&(U=-b>H||H>b,F=Math.cos(-H),N=Math.sin(-H),Y=Y*F+V*N,E=j*F+W*N,W=j*-N+W*F,$=B*-N+$*F,j=E),U&&K?v.rotation=v.rotationX=0:U&&X?v.rotation=v.rotationY=0:X&&K&&(v.rotationY=v.rotationX=0),v.scaleX=(0|Math.sqrt(Y*Y+j*j)*w+.5)/w,v.scaleY=(0|Math.sqrt(W*W+k*k)*w+.5)/w,v.scaleZ=(0|Math.sqrt($*$+R*R)*w+.5)/w,v.skewX=0,v.perspective=Q?1/(0>Q?-Q:Q):0,v.x=A,v.y=O,v.z=D}}else if(!(xe&&!s&&n.length&&v.x===n[4]&&v.y===n[5]&&(v.rotationX||v.rotationY)||void 0!==v.x&&"none"===G(t,"display",e))){var J=n.length>=6,te=J?n[0]:1,ee=n[1]||0,ie=n[2]||0,se=J?n[3]:1;v.x=n[4]||0,v.y=n[5]||0,_=Math.sqrt(te*te+ee*ee),u=Math.sqrt(se*se+ie*ie),p=te||ee?Math.atan2(ee,te)*z:v.rotation||0,f=ie||se?Math.atan2(ie,se)*z+p:v.skewX||0,c=_-Math.abs(v.scaleX||0),m=u-Math.abs(v.scaleY||0),Math.abs(f)>90&&270>Math.abs(f)&&(y?(_*=-1,f+=0>=p?180:-180,p+=0>=p?180:-180):(u*=-1,f+=0>=f?180:-180)),d=(p-v.rotation)%180,g=(f-v.skewX)%180,(void 0===v.skewX||c>T||-T>c||m>T||-T>m||d>-x&&x>d&&false|d*w||g>-x&&x>g&&false|g*w)&&(v.scaleX=_,v.scaleY=u,v.rotation=p,v.skewX=f),xe&&(v.rotationX=v.rotationY=v.z=0,v.perspective=parseFloat(a.defaultTransformPerspective)||0,v.scaleZ=1)}v.zOrigin=P;for(o in v)T>v[o]&&v[o]>-T&&(v[o]=0);return i&&(t._gsTransform=v),v},Se=function(t){var e,i,s=this.data,r=-s.rotation*M,n=r+s.skewX*M,a=1e5,o=(0|Math.cos(r)*s.scaleX*a)/a,h=(0|Math.sin(r)*s.scaleX*a)/a,l=(0|Math.sin(n)*-s.scaleY*a)/a,_=(0|Math.cos(n)*s.scaleY*a)/a,u=this.t.style,p=this.t.currentStyle;if(p){i=h,h=-l,l=-i,e=p.filter,u.filter="";var f,m,d=this.t.offsetWidth,g=this.t.offsetHeight,v="absolute"!==p.position,w="progid:DXImageTransform.Microsoft.Matrix(M11="+o+", M12="+h+", M21="+l+", M22="+_,x=s.x,b=s.y;if(null!=s.ox&&(f=(s.oxp?.01*d*s.ox:s.ox)-d/2,m=(s.oyp?.01*g*s.oy:s.oy)-g/2,x+=f-(f*o+m*h),b+=m-(f*l+m*_)),v?(f=d/2,m=g/2,w+=", Dx="+(f-(f*o+m*h)+x)+", Dy="+(m-(f*l+m*_)+b)+")"):w+=", sizingMethod='auto expand')",u.filter=-1!==e.indexOf("DXImageTransform.Microsoft.Matrix(")?e.replace(O,w):w+" "+e,(0===t||1===t)&&1===o&&0===h&&0===l&&1===_&&(v&&-1===w.indexOf("Dx=0, Dy=0")||T.test(e)&&100!==parseFloat(RegExp.$1)||-1===e.indexOf("gradient("&&e.indexOf("Alpha"))&&u.removeAttribute("filter")),!v){var P,S,k,R=8>c?1:-1;for(f=s.ieOffsetX||0,m=s.ieOffsetY||0,s.ieOffsetX=Math.round((d-((0>o?-o:o)*d+(0>h?-h:h)*g))/2+x),s.ieOffsetY=Math.round((g-((0>_?-_:_)*g+(0>l?-l:l)*d))/2+b),ce=0;4>ce;ce++)S=J[ce],P=p[S],i=-1!==P.indexOf("px")?parseFloat(P):$(this.t,S,parseFloat(P),P.replace(y,""))||0,k=i!==s[S]?2>ce?-s.ieOffsetX:-s.ieOffsetY:2>ce?f-s.ieOffsetX:m-s.ieOffsetY,u[S]=(s[S]=Math.round(i-k*(0===ce||2===ce?1:R)))+"px"}}},ke=N.set3DTransformRatio=function(t){var e,i,s,r,n,a,o,h,l,_,u,f,c,m,d,g,v,y,T,w,x,b,P,S=this.data,k=this.t.style,R=S.rotation*M,A=S.scaleX,C=S.scaleY,O=S.scaleZ,D=S.perspective;if(!(1!==t&&0!==t||"auto"!==S.force3D||S.rotationY||S.rotationX||1!==O||D||S.z))return Re.call(this,t),void 0;if(p){var z=1e-4;z>A&&A>-z&&(A=O=2e-5),z>C&&C>-z&&(C=O=2e-5),!D||S.z||S.rotationX||S.rotationY||(D=0)}if(R||S.skewX)y=Math.cos(R),T=Math.sin(R),e=y,n=T,S.skewX&&(R-=S.skewX*M,y=Math.cos(R),T=Math.sin(R),"simple"===S.skewType&&(w=Math.tan(S.skewX*M),w=Math.sqrt(1+w*w),y*=w,T*=w)),i=-T,a=y;else{if(!(S.rotationY||S.rotationX||1!==O||D))return k[ye]="translate3d("+S.x+"px,"+S.y+"px,"+S.z+"px)"+(1!==A||1!==C?" scale("+A+","+C+")":""),void 0;e=a=1,i=n=0}u=1,s=r=o=h=l=_=f=c=m=0,d=D?-1/D:0,g=S.zOrigin,v=1e5,R=S.rotationY*M,R&&(y=Math.cos(R),T=Math.sin(R),l=u*-T,c=d*-T,s=e*T,o=n*T,u*=y,d*=y,e*=y,n*=y),R=S.rotationX*M,R&&(y=Math.cos(R),T=Math.sin(R),w=i*y+s*T,x=a*y+o*T,b=_*y+u*T,P=m*y+d*T,s=i*-T+s*y,o=a*-T+o*y,u=_*-T+u*y,d=m*-T+d*y,i=w,a=x,_=b,m=P),1!==O&&(s*=O,o*=O,u*=O,d*=O),1!==C&&(i*=C,a*=C,_*=C,m*=C),1!==A&&(e*=A,n*=A,l*=A,c*=A),g&&(f-=g,r=s*f,h=o*f,f=u*f+g),r=(w=(r+=S.x)-(r|=0))?(0|w*v+(0>w?-.5:.5))/v+r:r,h=(w=(h+=S.y)-(h|=0))?(0|w*v+(0>w?-.5:.5))/v+h:h,f=(w=(f+=S.z)-(f|=0))?(0|w*v+(0>w?-.5:.5))/v+f:f,k[ye]="matrix3d("+[(0|e*v)/v,(0|n*v)/v,(0|l*v)/v,(0|c*v)/v,(0|i*v)/v,(0|a*v)/v,(0|_*v)/v,(0|m*v)/v,(0|s*v)/v,(0|o*v)/v,(0|u*v)/v,(0|d*v)/v,r,h,f,D?1+-f/D:1].join(",")+")"},Re=N.set2DTransformRatio=function(t){var e,i,s,r,n,a=this.data,o=this.t,h=o.style;return a.rotationX||a.rotationY||a.z||a.force3D===!0||"auto"===a.force3D&&1!==t&&0!==t?(this.setRatio=ke,ke.call(this,t),void 0):(a.rotation||a.skewX?(e=a.rotation*M,i=e-a.skewX*M,s=1e5,r=a.scaleX*s,n=a.scaleY*s,h[ye]="matrix("+(0|Math.cos(e)*r)/s+","+(0|Math.sin(e)*r)/s+","+(0|Math.sin(i)*-n)/s+","+(0|Math.cos(i)*n)/s+","+a.x+","+a.y+")"):h[ye]="matrix("+a.scaleX+",0,0,"+a.scaleY+","+a.x+","+a.y+")",void 0)};de("transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,transformPerspective,directionalRotation,parseTransform,force3D,skewType",{parser:function(t,e,
15i,s,n,o,h){if(s._transform)return n;var l,_,u,p,f,c,m,d=s._transform=Pe(t,r,!0,h.parseTransform),g=t.style,v=1e-6,y=ve.length,T=h,w={};if("string"==typeof T.transform&&ye)u=L.style,u[ye]=T.transform,u.display="block",u.position="absolute",E.body.appendChild(L),l=Pe(L,null,!1),E.body.removeChild(L);else if("object"==typeof T){if(l={scaleX:se(null!=T.scaleX?T.scaleX:T.scale,d.scaleX),scaleY:se(null!=T.scaleY?T.scaleY:T.scale,d.scaleY),scaleZ:se(T.scaleZ,d.scaleZ),x:se(T.x,d.x),y:se(T.y,d.y),z:se(T.z,d.z),perspective:se(T.transformPerspective,d.perspective)},m=T.directionalRotation,null!=m)if("object"==typeof m)for(u in m)T[u]=m[u];else T.rotation=m;l.rotation=re("rotation"in T?T.rotation:"shortRotation"in T?T.shortRotation+"_short":"rotationZ"in T?T.rotationZ:d.rotation,d.rotation,"rotation",w),xe&&(l.rotationX=re("rotationX"in T?T.rotationX:"shortRotationX"in T?T.shortRotationX+"_short":d.rotationX||0,d.rotationX,"rotationX",w),l.rotationY=re("rotationY"in T?T.rotationY:"shortRotationY"in T?T.shortRotationY+"_short":d.rotationY||0,d.rotationY,"rotationY",w)),l.skewX=null==T.skewX?d.skewX:re(T.skewX,d.skewX),l.skewY=null==T.skewY?d.skewY:re(T.skewY,d.skewY),(_=l.skewY-d.skewY)&&(l.skewX+=_,l.rotation+=_)}for(xe&&null!=T.force3D&&(d.force3D=T.force3D,c=!0),d.skewType=T.skewType||d.skewType||a.defaultSkewType,f=d.force3D||d.z||d.rotationX||d.rotationY||l.z||l.rotationX||l.rotationY||l.perspective,f||null==T.scale||(l.scaleZ=1);--y>-1;)i=ve[y],p=l[i]-d[i],(p>v||-v>p||null!=I[i])&&(c=!0,n=new pe(d,i,d[i],p,n),i in w&&(n.e=w[i]),n.xs0=0,n.plugin=o,s._overwriteProps.push(n.n));return p=T.transformOrigin,(p||xe&&f&&d.zOrigin)&&(ye?(c=!0,i=we,p=(p||G(t,i,r,!1,"50% 50%"))+"",n=new pe(g,i,0,0,n,-1,"transformOrigin"),n.b=g[i],n.plugin=o,xe?(u=d.zOrigin,p=p.split(" "),d.zOrigin=(p.length>2&&(0===u||"0px"!==p[2])?parseFloat(p[2]):u)||0,n.xs0=n.e=p[0]+" "+(p[1]||"50%")+" 0px",n=new pe(d,"zOrigin",0,0,n,-1,n.n),n.b=u,n.xs0=n.e=d.zOrigin):n.xs0=n.e=p):ee(p+"",d)),c&&(s._transformType=f||3===this._transformType?3:2),n},prefix:!0}),de("boxShadow",{defaultValue:"0px 0px 0px 0px #999",prefix:!0,color:!0,multi:!0,keyword:"inset"}),de("borderRadius",{defaultValue:"0px",parser:function(t,e,i,n,a){e=this.format(e);var o,h,l,_,u,p,f,c,m,d,g,v,y,T,w,x,b=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],P=t.style;for(m=parseFloat(t.offsetWidth),d=parseFloat(t.offsetHeight),o=e.split(" "),h=0;b.length>h;h++)this.p.indexOf("border")&&(b[h]=V(b[h])),u=_=G(t,b[h],r,!1,"0px"),-1!==u.indexOf(" ")&&(_=u.split(" "),u=_[0],_=_[1]),p=l=o[h],f=parseFloat(u),v=u.substr((f+"").length),y="="===p.charAt(1),y?(c=parseInt(p.charAt(0)+"1",10),p=
vendor: 9,749 bytes, lines 15-16
15p.substr(2),c*=parseFloat(p),g=p.substr((c+"").length-(0>c?1:0))||""):(c=parseFloat(p),g=p.substr((c+"").length)),""===g&&(g=s[i]||v),g!==v&&(T=$(t,"borderLeft",f,v),w=$(t,"borderTop",f,v),"%"===g?(u=100*(T/m)+"%",_=100*(w/d)+"%"):"em"===g?(x=$(t,"borderLeft",1,"em"),u=T/x+"em",_=w/x+"em"):(u=T+"px",_=w+"px"),y&&(p=parseFloat(u)+c+g,l=parseFloat(_)+c+g)),a=fe(P,b[h],u+" "+_,p+" "+l,!1,"0px",a);return a},prefix:!0,formatter:le("0px 0px 0px 0px",!1,!0)}),de("backgroundPosition",{defaultValue:"0 0",parser:function(t,e,i,s,n,a){var o,h,l,_,u,p,f="background-position",m=r||W(t,null),d=this.format((m?c?m.getPropertyValue(f+"-x")+" "+m.getPropertyValue(f+"-y"):m.getPropertyValue(f):t.currentStyle.backgroundPositionX+" "+t.currentStyle.backgroundPositionY)||"0 0"),g=this.format(e);if(-1!==d.indexOf("%")!=(-1!==g.indexOf("%"))&&(p=G(t,"backgroundImage").replace(k,""),p&&"none"!==p)){for(o=d.split(" "),h=g.split(" "),F.setAttribute("src",p),l=2;--l>-1;)d=o[l],_=-1!==d.indexOf("%"),_!==(-1!==h[l].indexOf("%"))&&(u=0===l?t.offsetWidth-F.width:t.offsetHeight-F.height,o[l]=_?parseFloat(d)/100*u+"px":100*(parseFloat(d)/u)+"%");d=o.join(" ")}return this.parseComplex(t.style,d,g,n,a)},formatter:ee}),de("backgroundSize",{defaultValue:"0 0",formatter:ee}),de("perspective",{defaultValue:"0px",prefix:!0}),de("perspectiveOrigin",{defaultValue:"50% 50%",prefix:!0}),de("transformStyle",{prefix:!0}),de("backfaceVisibility",{prefix:!0}),de("userSelect",{prefix:!0}),de("margin",{parser:_e("marginTop,marginRight,marginBottom,marginLeft")}),de("padding",{parser:_e("paddingTop,paddingRight,paddingBottom,paddingLeft")}),de("clip",{defaultValue:"rect(0px,0px,0px,0px)",parser:function(t,e,i,s,n,a){var o,h,l;return 9>c?(h=t.currentStyle,l=8>c?" ":",",o="rect("+h.clipTop+l+h.clipRight+l+h.clipBottom+l+h.clipLeft+")",e=this.format(e).split(",").join(l)):(o=this.format(G(t,this.p,r,!1,this.dflt)),e=this.format(e)),this.parseComplex(t.style,o,e,n,a)}}),de("textShadow",{defaultValue:"0px 0px 0px #999",color:!0,multi:!0}),de("autoRound,strictUnits",{parser:function(t,e,i,s,r){return r}}),de("border",{defaultValue:"0px solid #000",parser:function(t,e,i,s,n,a){return this.parseComplex(t.style,this.format(G(t,"borderTopWidth",r,!1,"0px")+" "+G(t,"borderTopStyle",r,!1,"solid")+" "+G(t,"borderTopColor",r,!1,"#000")),this.format(e),n,a)},color:!0,formatter:function(t){var e=t.split(" ");return e[0]+" "+(e[1]||"solid")+" "+(t.match(he)||["#000"])[0]}}),de("borderWidth",{parser:_e("borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth")}),de("float,cssFloat,styleFloat",{parser:function(t,e,i,s,r){var n=t.style,a="cssFloat"in n?"cssFloat":"styleFloat";return new pe(n,a,0,0,r,-1,i,!1,0,n[a],e)}});var Ae=function(t){var e,i=this.t,s=i.filter||G(this.data,"filter"),r=0|this.s+this.c*t;100===r&&(-1===s.indexOf("atrix(")&&-1===s.indexOf("radient(")&&-1===s.indexOf("oader(")?(i.removeAttribute("filter"),e=!G(this.data,"filter")):(i.filter=s.replace(x,""),e=!0)),e||(this.xn1&&(i.filter=s=s||"alpha(opacity="+r+")"),-1===s.indexOf("pacity")?0===r&&this.xn1||(i.filter=s+" alpha(opacity="+r+")"):i.filter=s.replace(T,"opacity="+r))};de("opacity,alpha,autoAlpha",{defaultValue:"1",parser:function(t,e,i,s,n,a){var o=parseFloat(G(t,"opacity",r,!1,"1")),h=t.style,l="autoAlpha"===i;return"string"==typeof e&&"="===e.charAt(1)&&(e=("-"===e.charAt(0)?-1:1)*parseFloat(e.substr(2))+o),l&&1===o&&"hidden"===G(t,"visibility",r)&&0!==e&&(o=0),U?n=new pe(h,"opacity",o,e-o,n):(n=new pe(h,"opacity",100*o,100*(e-o),n),n.xn1=l?1:0,h.zoom=1,n.type=2,n.b="alpha(opacity="+n.s+")",n.e="alpha(opacity="+(n.s+n.c)+")",n.data=t,n.plugin=a,n.setRatio=Ae),l&&(n=new pe(h,"visibility",0,0,n,-1,null,!1,0,0!==o?"inherit":"hidden",0===e?"hidden":"inherit"),n.xs0="inherit",s._overwriteProps.push(n.n),s._overwriteProps.push(i)),n}});var Ce=function(t,e){e&&(t.removeProperty?("ms"===e.substr(0,2)&&(e="M"+e.substr(1)),t.removeProperty(e.replace(P,"-$1").toLowerCase())):t.removeAttribute(e))},Oe=function(t){if(this.t._gsClassPT=this,1===t||0===t){this.t.setAttribute("class",0===t?this.b:this.e);for(var e=this.data,i=this.t.style;e;)e.v?i[e.p]=e.v:Ce(i,e.p),e=e._next;1===t&&this.t._gsClassPT===this&&(this.t._gsClassPT=null)}else this.t.getAttribute("class")!==this.e&&this.t.setAttribute("class",this.e)};de("className",{parser:function(t,e,s,n,a,o,h){var l,_,u,p,f,c=t.getAttribute("class")||"",m=t.style.cssText;if(a=n._classNamePT=new pe(t,s,0,0,a,2),a.setRatio=Oe,a.pr=-11,i=!0,a.b=c,_=Q(t,r),u=t._gsClassPT){for(p={},f=u.data;f;)p[f.p]=1,f=f._next;u.setRatio(1)}return t._gsClassPT=a,a.e="="!==e.charAt(1)?e:c.replace(RegExp("\\s*\\b"+e.substr(2)+"\\b"),"")+("+"===e.charAt(0)?" "+e.substr(2):""),n._tween._duration&&(t.setAttribute("class",a.e),l=H(t,_,Q(t),h,p),t.setAttribute("class",c),a.data=l.firstMPT,t.style.cssText=m,a=a.xfirst=n.parse(t,l.difs,a,o)),a}});var De=function(t){if((1===t||0===t)&&this.data._totalTime===this.data._totalDuration&&"isFromStart"!==this.data.data){var e,i,s,r,n=this.t.style,a=o.transform.parse;if("all"===this.e)n.cssText="",r=!0;else for(e=this.e.split(","),s=e.length;--s>-1;)i=e[s],o[i]&&(o[i].parse===a?r=!0:i="transformOrigin"===i?we:o[i].p),Ce(n,i);r&&(Ce(n,ye),this.t._gsTransform&&delete this.t._gsTransform)}};for(de("clearProps",{parser:function(t,e,s,r,n){return n=new pe(t,s,0,0,n,2),n.setRatio=De,n.e=e,n.pr=-10,n.data=r._tween,i=!0,n}}),h="bezier,throwProps,physicsProps,physics2D".split(","),ce=h.length;ce--;)ge(h[ce]);h=a.prototype,h._firstPT=null,h._onInitTween=function(t,e,o){if(!t.nodeType)return!1;this._target=t,this._tween=o,this._vars=e,l=e.autoRound,i=!1,s=e.suffixMap||a.suffixMap,r=W(t,""),n=this._overwriteProps;var h,p,c,m,d,g,v,y,T,x=t.style;if(_&&""===x.zIndex&&(h=G(t,"zIndex",r),("auto"===h||""===h)&&this._addLazySet(x,"zIndex",0)),"string"==typeof e&&(m=x.cssText,h=Q(t,r),x.cssText=m+";"+e,h=H(t,h,Q(t)).difs,!U&&w.test(e)&&(h.opacity=parseFloat(RegExp.$1)),e=h,x.cssText=m),this._firstPT=p=this.parse(t,e,null),this._transformType){for(T=3===this._transformType,ye?u&&(_=!0,""===x.zIndex&&(v=G(t,"zIndex",r),("auto"===v||""===v)&&this._addLazySet(x,"zIndex",0)),f&&this._addLazySet(x,"WebkitBackfaceVisibility",this._vars.WebkitBackfaceVisibility||(T?"visible":"hidden"))):x.zoom=1,c=p;c&&c._next;)c=c._next;y=new pe(t,"transform",0,0,null,2),this._linkCSSP(y,null,c),y.setRatio=T&&xe?ke:ye?Re:Se,y.data=this._transform||Pe(t,r,!0),n.pop()}if(i){for(;p;){for(g=p._next,c=m;c&&c.pr>p.pr;)c=c._next;(p._prev=c?c._prev:d)?p._prev._next=p:m=p,(p._next=c)?c._prev=p:d=p,p=g}this._firstPT=m}return!0},h.parse=function(t,e,i,n){var a,h,_,u,p,f,c,m,d,g,v=t.style;for(a in e)f=e[a],h=o[a],h?i=h.parse(t,f,a,this,i,n,e):(p=G(t,a,r)+"",d="string"==typeof f,"color"===a||"fill"===a||"stroke"===a||-1!==a.indexOf("Color")||d&&b.test(f)?(d||(f=oe(f),f=(f.length>3?"rgba(":"rgb(")+f.join(",")+")"),i=fe(v,a,p,f,!0,"transparent",i,0,n)):!d||-1===f.indexOf(" ")&&-1===f.indexOf(",")?(_=parseFloat(p),c=_||0===_?p.substr((_+"").length):"",(""===p||"auto"===p)&&("width"===a||"height"===a?(_=te(t,a,r),c="px"):"left"===a||"top"===a?(_=Z(t,a,r),c="px"):(_="opacity"!==a?0:1,c="")),g=d&&"="===f.charAt(1),g?(u=parseInt(f.charAt(0)+"1",10),f=f.substr(2),u*=parseFloat(f),m=f.replace(y,"")):(u=parseFloat(f),m=d?f.substr((u+"").length)||"":""),""===m&&(m=a in s?s[a]:c),f=u||0===u?(g?u+_:u)+m:e[a],c!==m&&""!==m&&(u||0===u)&&_&&(_=$(t,a,_,c),"%"===m?(_/=$(t,a,100,"%")/100,e.strictUnits!==!0&&(p=_+"%")):"em"===m?_/=$(t,a,1,"em"):"px"!==m&&(u=$(t,a,u,m),m="px"),g&&(u||0===u)&&(f=u+_+m)),g&&(u+=_),!_&&0!==_||!u&&0!==u?void 0!==v[a]&&(f||"NaN"!=f+""&&null!=f)?(i=new pe(v,a,u||_||0,0,i,-1,a,!1,0,p,f),i.xs0="none"!==f||"display"!==a&&-1===a.indexOf("Style")?f:p):j("invalid "+a+" tween value: "+e[a]):(i=new pe(v,a,_,u-_,i,0,a,l!==!1&&("px"===m||"zIndex"===a),0,p,f),i.xs0=m)):i=fe(v,a,p,f,!0,null,i,0,n)),n&&i&&!i.plugin&&(i.plugin=n);return i},h.setRatio=function(t){var e,i,s,r=this._firstPT,n=1e-6;if(1!==t||this._tween._time!==this._tween._duration&&0!==this._tween._time)if(t||this._tween._time!==this._tween._duration&&0!==this._tween._time||this._tween._rawPrevTime===-1e-6)for(;r;){if(e=r.c*t+r.s,r.r?e=Math.round(e):n>e&&e>-n&&(e=0),r.type)if(1===r.type)if(s=r.l,2===s)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2;else if(3===s)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2+r.xn2+r.xs3;else if(4===s)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2+r.xn2+r.xs3+r.xn3+r.xs4;else if(5===s)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2+r.xn2+r.xs3+r.xn3+r.xs4+r.xn4+r.xs5;else{for(i=r.xs0+e+r.xs1,s=1;r.l>s;s++)i+=r["xn"+s]+r["xs"+(s+1)];r.t[r.p]=i}else-1===r.type?r.t[r.p]=r.xs0:r.setRatio&&r.setRatio(t);else r.t[r.p]=e+r.xs0;r=r._next}else for(;r;)2!==r.type?r.t[r.p]=r.b:r.setRatio(t),r=r._next;else for(;r;)2!==r.type?r.t[r.p]=r.e:r.setRatio(t),r=r._next},h._enableTransforms=function(t){this._transformType=t||3===this._transformType?3:2,this._transform=this._transform||Pe(this._target,r,!0)};var Me=function(){this.t[this.p]=this.e,this.data._linkCSSP(this,this._next,null,!0)
16};h._addLazySet=function(t,e,i){var s=this._firstPT=new pe(t,e,0,0,this._firstPT,2);s.e=i,s.setRatio=Me,s.data=this},h._linkCSSP=function(t,e,i,s){return t&&(e&&(e._prev=t),t._next&&(t._next._prev=t._prev),t._prev?t._prev._next=t._next:this._firstPT===t&&(this._firstPT=t._next,s=!0),i?i._next=t:s||null!==this._firstPT||(this._firstPT=t),t._next=e,t._prev=i),t},h._kill=function(e){var i,s,r,n=e;if(e.autoAlpha||e.alpha){n={};for(s in e)n[s]=e[s];n.opacity=1,n.autoAlpha&&(n.visibility=1)}return e.className&&(i=this._classNamePT)&&(r=i.xfirst,r&&r._prev?this._linkCSSP(r._prev,i._next,r._prev._prev):r===this._firstPT&&(this._firstPT=i._next),i._next&&this._linkCSSP(i._next,i._next._next,r._prev),this._classNamePT=null),t.prototype._kill.call(this,n)};
16var ze=function(t,e,i){var s,r,n,a;if(t.slice)for(r=t.length;--r>-1;)ze(t[r],e,i);else for(s=t.childNodes,r=s.length;--r>-1;)n=s[r],a=n.type,n.style&&(e.push(Q(n)),i&&i.push(n)),1!==a&&9!==a&&11!==a||!n.childNodes.length||ze(n,e,i)};return a.cascadeTo=function(t,i,s){var r,n,a,o=e.to(t,i,s),h=[o],l=[],_=[],u=[],p=e._internals.reservedProps;for(t=o._targets||o.target,ze(t,l,u),o.render(i,!0),ze(t,_),o.render(0,!0),o._enabled(!0),r=u.length;--r>-1;)if(n=H(u[r],l[r],_[r]),n.firstMPT){n=n.difs;for(a in s)p[a]&&(n[a]=s[a]);h.push(e.to(u[r],i,n))}return h},t.activate([a]),a},!0),function(){var t=window._gsDefine.plugin({propName:"roundProps",priority:-1,API:2,init:function(t,e,i){return this._tween=i,!0}}),e=t.prototype;e._onInitAllProps=function(){for(var t,e,i,s=this._tween,r=s.vars.roundProps instanceof Array?s.vars.roundProps:s.vars.roundProps.split(","),n=r.length,a={},o=s._propLookup.roundProps;--n>-1;)a[r[n]]=1;for(n=r.length;--n>-1;)for(t=r[n],e=s._firstPT;e;)i=e._next,e.pg?e.t._roundProps(a,!0):e.n===t&&(this._add(e.t,t,e.s,e.c),i&&(i._prev=e._prev),e._prev?e._prev._next=i:s._firstPT===e&&(s._firstPT=i),e._next=e._prev=null,s._propLookup[t]=o),e=i;return!1},e._add=function(t,e,i,s){this._addTween(t,e,i,i+s,e,!0),this._overwriteProps.push(e)}}(),window._gsDefine.plugin({propName:"attr",API:2,version:"0.3.2",init:function(t,e){var i,s,r;if("function"!=typeof t.setAttribute)return!1;this._target=t,this._proxy={},this._start={},this._end={};for(i in e)this._start[i]=this._proxy[i]=s=t.getAttribute(i),r=this._addTween(this._proxy,i,parseFloat(s),e[i],i),this._end[i]=r?r.s+r.c:e[i],this._overwriteProps.push(i);return!0},set:function(t){this._super.setRatio.call(this,t);for(var e,i=this._overwriteProps,s=i.length,r=1===t?this._end:t?this._proxy:this._start;--s>-1;)e=i[s],this._target.setAttribute(e,r[e]+"")}}),window._gsDefine.plugin({propName:"directionalRotation",API:2,version:"0.2.0",init:function(t,e){"object"!=typeof e&&(e={rotation:e}),this.finals={};var i,s,r,n,a,o,h=e.useRadians===!0?2*Math.PI:360,l=1e-6;for(i in e)"useRadians"!==i&&(o=(e[i]+"").split("_"),s=o[0],r=parseFloat("function"!=typeof t[i]?t[i]:t[i.indexOf("set")||"function"!=typeof t["get"+i.substr(3)]?i:"get"+i.substr(3)]()),n=this.finals[i]="string"==typeof s&&"="===s.charAt(1)?r+parseInt(s.charAt(0)+"1",10)*Number(s.substr(2)):Number(s)||0,a=n-r,o.length&&(s=o.join("_"),-1!==s.indexOf("short")&&(a%=h,a!==a%(h/2)&&(a=0>a?a+h:a-h)),-1!==s.indexOf("_cw")&&0>a?a=(a+9999999999*h)%h-(0|a/h)*h:-1!==s.indexOf("ccw")&&a>0&&(a=(a-9999999999*h)%h-(0|a/h)*h)),(a>l||-l>a)&&(this._addTween(t,i,r,r+a,i),this._overwriteProps.push(i)));return!0},set:function(t){var e;if(1!==t)this._super.setRatio.call(this,t);else for(e=this._firstPT;e;)e.f?e.t[e.p](this.finals[e.p]):e.t[e.p]=this.finals[e.p],e=e._next}})._autoCSS=!0,window._gsDefine("easing.Back",["easing.Ease"],function(t){var e,i,s,r=window.GreenSockGlobals||window,n=r.com.greensock,a=2*Math.PI,o=Math.PI/2,h=n._class,l=function(e,i){var s=h("easing."+e,function(){},!0),r=s.prototype=new t;return r.constructor=s,r.getRatio=i,s},_=t.register||function(){},u=function(t,e,i,s){var r=h("easing."+t,{easeOut:new e,easeIn:new i,easeInOut:new s},!0);return _(r,t),r},p=function(t,e,i){this.t=t,this.v=e,i&&(this.next=i,i.prev=this,this.c=i.v-e,this.gap=i.t-t)},f=function(e,i){var s=h("easing."+e,function(t){this._p1=t||0===t?t:1.70158,this._p2=1.525*this._p1},!0),r=s.prototype=new t;return r.constructor=s,r.getRatio=i,r.config=function(t){return new s(t)},s},c=u("Back",f("BackOut",function(t){return(t-=1)*t*((this._p1+1)*t+this._p1)+1}),f("BackIn",function(t){return t*t*((this._p1+1)*t-this._p1)}),f("BackInOut",function(t){return 1>(t*=2)?.5*t*t*((this._p2+1)*t-this._p2):.5*((t-=2)*t*((this._p2+1)*t+this._p2)+2)})),m=h("easing.SlowMo",function(t,e,i){e=e||0===e?e:.7,null==t?t=.7:t>1&&(t=1),this._p=1!==t?e:0,this._p1=(1-t)/2,this._p2=t,this._p3=this._p1+this._p2,this._calcEnd=i===!0},!0),d=m.prototype=new t;return d.constructor=m,d.getRatio=function(t){var e=t+(.5-t)*this._p;return this._p1>t?this._calcEnd?1-(t=1-t/this._p1)*t:e-(t=1-t/this._p1)*t*t*t*e:t>this._p3?this._calcEnd?1-(t=(t-this._p3)/this._p1)*t:e+(t-e)*(t=(t-this._p3)/this._p1)*t*t*t:this._calcEnd?1:e}
16,m.ease=new m(.7,.7),d.config=m.config=function(t,e,i){return new m(t,e,i)},e=h("easing.SteppedEase",function(t){t=t||1,this._p1=1/t,this._p2=t+1},!0),d=e.prototype=new t,d.constructor=e,d.getRatio=function(t){return 0>t?t=0:t>=1&&(t=.999999999),(this._p2*t>>0)*this._p1},d.config=e.config=function(t){return new e(t)},i=h("easing.RoughEase",function(e){e=e||{};for(var i,s,r,n,a,o,h=e.taper||"none",l=[],_=0,u=0|(e.points||20),f=u,c=e.randomize!==!1,m=e.clamp===!0,d=e.template instanceof t?e.template:null,g="number"==typeof e.strength?.4*e.strength:.4;--f>-1;)i=c?Math.random():1/u*f,s=d?d.getRatio(i):i,"none"===h?r=g:"out"===h?(n=1-i,r=n*n*g):"in"===h?r=i*i*g:.5>i?(n=2*i,r=.5*n*n*g):(n=2*(1-i),r=.5*n*n*g),c?s+=Math.random()*r-.5*r:f%2?s+=.5*r:s-=.5*r,m&&(s>1?s=1:0>s&&(s=0)),l[_++]={x:i,y:s};for(l.sort(function(t,e){return t.x-e.x}),o=new p(1,1,null),f=u;--f>-1;)a=l[f],o=new p(a.x,a.y,o);this._prev=new p(0,0,0!==o.t?o:o.next)},!0),d=i.prototype=new t,d.constructor=i,d.getRatio=function(t){var e=this._prev;if(t>e.t){for(;e.next&&t>=e.t;)e=e.next;e=e.prev}else for(;e.prev&&e.t>=t;)e=e.prev;return this._prev=e,e.v+(t-e.t)/e.gap*e.c},d.config=function(t){return new i(t)},i.ease=new i,u("Bounce",l("BounceOut",function(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}),l("BounceIn",function(t){return 1/2.75>(t=1-t)?1-7.5625*t*t:2/2.75>t?1-(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}),l("BounceInOut",function(t){var e=.5>t;return t=e?1-2*t:2*t-1,t=1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5})),u("Circ",l("CircOut",function(t){return Math.sqrt(1-(t-=1)*t)}),l("CircIn",function(t){return-(Math.sqrt(1-t*t)-1)}),l("CircInOut",function(t){return 1>(t*=2)?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)})),s=function(e,i,s){var r=h("easing."+e,function(t,e){this._p1=t||1,this._p2=e||s,this._p3=this._p2/a*(Math.asin(1/this._p1)||0)},!0),n=r.prototype=new t;return n.constructor=r,n.getRatio=i,n.config=function(t,e){return new r(t,e)},r},u("Elastic",s("ElasticOut",function(t){return this._p1*Math.pow(2,-10*t)*Math.sin((t-this._p3)*a/this._p2)+1},.3),s("ElasticIn",function(t){return-(this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*a/this._p2))},.3),s("ElasticInOut",function(t){return 1>(t*=2)?-.5*this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*a/this._p2):.5*this._p1*Math.pow(2,-10*(t-=1))*Math.sin((t-this._p3)*a/this._p2)+1},.45)),u("Expo",l("ExpoOut",function(t){return 1-Math.pow(2,-10*t)}),l("ExpoIn",function(t){return Math.pow(2,10*(t-1))-.001}),l("ExpoInOut",function(t){return 1>(t*=2)?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))})),u("Sine",l("SineOut",function(t){return Math.sin(t*o)}),l("SineIn",function(t){return-Math.cos(t*o)+1}),l("SineInOut",function(t){return-.5*(Math.cos(Math.PI*t)-1)})),h("easing.EaseLookup",{find:function(e){return t.map[e]}},!0),_(r.SlowMo,"SlowMo","ease,"),_(i,"RoughEase","ease,"),_(e,"SteppedEase","ease,"),c},!0)}),function(t){"use strict";var e=t.GreenSockGlobals||t;if(!e.TweenLite){var i,s,r,n,a,o=function(t){var i,s=t.split("."),r=e;for(i=0;s.length>i;i++)r[s[i]]=r=r[s[i]]||{};return r},h=o("com.greensock"),l=1e-10,_=[].slice,u=function(){},p=function(){var t=Object.prototype.toString,e=t.call([]);return function(i){return null!=i&&(i instanceof Array||"object"==typeof i&&!!i.push&&t.call(i)===e)}}(),f={},c=function(i,s,r,n){this.sc=f[i]?f[i].sc:[],f[i]=this,this.gsClass=null,this.func=r;var a=[];this.check=function(h){for(var l,_,u,p,m=s.length,d=m;--m>-1;)(l=f[s[m]]||new c(s[m],[])).gsClass?(a[m]=l.gsClass,d--):h&&l.sc.push(this);if(0===d&&r)for(_=("com.greensock."+i).split("."),u=_.pop(),p=o(_.join("."))[u]=this.gsClass=r.apply(r,a),n&&(e[u]=p,"function"==typeof define&&define.amd?define((t.GreenSockAMDPath?t.GreenSockAMDPath+"/":"")+i.split(".").join("/"),[],function(){return p}):"undefined"!=typeof module&&module.exports&&(module.exports=p)),m=0;this.sc.length>m;m++)this.sc[m].check()},this.check(!0)}
vendor: 14,868 bytes, line 16
16,m=t._gsDefine=function(t,e,i,s){return new c(t,e,i,s)},d=h._class=function(t,e,i){return e=e||function(){},m(t,[],function(){return e},i),e};m.globals=e;var g=[0,0,1,1],v=[],y=d("easing.Ease",function(t,e,i,s){this._func=t,this._type=i||0,this._power=s||0,this._params=e?g.concat(e):g},!0),T=y.map={},w=y.register=function(t,e,i,s){for(var r,n,a,o,l=e.split(","),_=l.length,u=(i||"easeIn,easeOut,easeInOut").split(",");--_>-1;)for(n=l[_],r=s?d("easing."+n,null,!0):h.easing[n]||{},a=u.length;--a>-1;)o=u[a],T[n+"."+o]=T[o+n]=r[o]=t.getRatio?t:t[o]||new t};for(r=y.prototype,r._calcEnd=!1,r.getRatio=function(t){if(this._func)return this._params[0]=t,this._func.apply(null,this._params);var e=this._type,i=this._power,s=1===e?1-t:2===e?t:.5>t?2*t:2*(1-t);return 1===i?s*=s:2===i?s*=s*s:3===i?s*=s*s*s:4===i&&(s*=s*s*s*s),1===e?1-s:2===e?s:.5>t?s/2:1-s/2},i=["Linear","Quad","Cubic","Quart","Quint,Strong"],s=i.length;--s>-1;)r=i[s]+",Power"+s,w(new y(null,null,1,s),r,"easeOut",!0),w(new y(null,null,2,s),r,"easeIn"+(0===s?",easeNone":"")),w(new y(null,null,3,s),r,"easeInOut");T.linear=h.easing.Linear.easeIn,T.swing=h.easing.Quad.easeInOut;var x=d("events.EventDispatcher",function(t){this._listeners={},this._eventTarget=t||this});r=x.prototype,r.addEventListener=function(t,e,i,s,r){r=r||0;var o,h,l=this._listeners[t],_=0;for(null==l&&(this._listeners[t]=l=[]),h=l.length;--h>-1;)o=l[h],o.c===e&&o.s===i?l.splice(h,1):0===_&&r>o.pr&&(_=h+1);l.splice(_,0,{c:e,s:i,up:s,pr:r}),this!==n||a||n.wake()},r.removeEventListener=function(t,e){var i,s=this._listeners[t];if(s)for(i=s.length;--i>-1;)if(s[i].c===e)return s.splice(i,1),void 0},r.dispatchEvent=function(t){var e,i,s,r=this._listeners[t];if(r)for(e=r.length,i=this._eventTarget;--e>-1;)s=r[e],s.up?s.c.call(s.s||i,{type:t,target:i}):s.c.call(s.s||i)};var b=t.requestAnimationFrame,P=t.cancelAnimationFrame,S=Date.now||function(){return(new Date).getTime()},k=S();for(i=["ms","moz","webkit","o"],s=i.length;--s>-1&&!b;)b=t[i[s]+"RequestAnimationFrame"],P=t[i[s]+"CancelAnimationFrame"]||t[i[s]+"CancelRequestAnimationFrame"];d("Ticker",function(t,e){var i,s,r,o,h,_=this,p=S(),f=e!==!1&&b,c=500,m=33,d=function(t){var e,n,a=S()-k;a>c&&(p+=a-m),k+=a,_.time=(k-p)/1e3,e=_.time-h,(!i||e>0||t===!0)&&(_.frame++,h+=e+(e>=o?.004:o-e),n=!0),t!==!0&&(r=s(d)),n&&_.dispatchEvent("tick")};x.call(_),_.time=_.frame=0,_.tick=function(){d(!0)},_.lagSmoothing=function(t,e){c=t||1/l,m=Math.min(e,c,0)},_.sleep=function(){null!=r&&(f&&P?P(r):clearTimeout(r),s=u,r=null,_===n&&(a=!1))},_.wake=function(){null!==r?_.sleep():_.frame>10&&(k=S()-c+5),s=0===i?u:f&&b?b:function(t){return setTimeout(t,0|1e3*(h-_.time)+1)},_===n&&(a=!0),d(2)},_.fps=function(t){return arguments.length?(i=t,o=1/(i||60),h=this.time+o,_.wake(),void 0):i},_.useRAF=function(t){return arguments.length?(_.sleep(),f=t,_.fps(i),void 0):f},_.fps(t),setTimeout(function(){f&&(!r||5>_.frame)&&_.useRAF(!1)},1500)}),r=h.Ticker.prototype=new h.events.EventDispatcher,r.constructor=h.Ticker;var R=d("core.Animation",function(t,e){if(this.vars=e=e||{},this._duration=this._totalDuration=t||0,this._delay=Number(e.delay)||0,this._timeScale=1,this._active=e.immediateRender===!0,this.data=e.data,this._reversed=e.reversed===!0,j){a||n.wake();var i=this.vars.useFrames?Y:j;i.add(this,i._time),this.vars.paused&&this.paused(!0)}});n=R.ticker=new h.Ticker,r=R.prototype,r._dirty=r._gc=r._initted=r._paused=!1,r._totalTime=r._time=0,r._rawPrevTime=-1,r._next=r._last=r._onUpdate=r._timeline=r.timeline=null,r._paused=!1;var A=function(){a&&S()-k>2e3&&n.wake(),setTimeout(A,2e3)};A(),r.play=function(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},r.pause=function(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},r.resume=function(t,e){return null!=t&&this.seek(t,e),this.paused(!1)},r.seek=function(t,e){return this.totalTime(Number(t),e!==!1)},r.restart=function(t,e){return this.reversed(!1).paused(!1).totalTime(t?-this._delay:0,e!==!1,!0)},r.reverse=function(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},r.render=function(){},r.invalidate=function(){return this},r.isActive=function(){var t,e=this._timeline,i=this._startTime;return!e||!this._gc&&!this._paused&&e.isActive()&&(t=e.rawTime())>=i&&i+this.totalDuration()/this._timeScale>t},r._enabled=function(t,e){return a||n.wake(),this._gc=!t,this._active=this.isActive(),e!==!0&&(t&&!this.timeline?this._timeline.add(this,this._startTime-this._delay):!t&&this.timeline&&this._timeline._remove(this,!0)),!1},r._kill=function(){return this._enabled(!1,!1)},r.kill=function(t,e){return this._kill(t,e),this},r._uncache=function(t){for(var e=t?this:this.timeline;e;)e._dirty=!0,e=e.timeline;return this},r._swapSelfInParams=function(t){for(var e=t.length,i=t.concat();--e>-1;)"{self}"===t[e]&&(i[e]=this);return i},r.eventCallback=function(t,e,i,s){if("on"===(t||"").substr(0,2)){var r=this.vars;if(1===arguments.length)return r[t];null==e?delete r[t]:(r[t]=e,r[t+"Params"]=p(i)&&-1!==i.join("").indexOf("{self}")?this._swapSelfInParams(i):i,r[t+"Scope"]=s),"onUpdate"===t&&(this._onUpdate=e)}return this},r.delay=function(t){return arguments.length?(this._timeline.smoothChildTiming&&this.startTime(this._startTime+t-this._delay),this._delay=t,this):this._delay},r.duration=function(t){return arguments.length?(this._duration=this._totalDuration=t,this._uncache(!0),this._timeline.smoothChildTiming&&this._time>0&&this._time<this._duration&&0!==t&&this.totalTime(this._totalTime*(t/this._duration),!0),this):(this._dirty=!1,this._duration)},r.totalDuration=function(t){return this._dirty=!1,arguments.length?this.duration(t):this._totalDuration},r.time=function(t,e){return arguments.length?(this._dirty&&this.totalDuration(),this.totalTime(t>this._duration?this._duration:t,e)):this._time},r.totalTime=function(t,e,i){if(a||n.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(0>t&&!i&&(t+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var s=this._totalDuration,r=this._timeline;if(t>s&&!i&&(t=s),this._startTime=(this._paused?this._pauseTime:r._time)-(this._reversed?s-t:t)/this._timeScale,r._dirty||this._uncache(!1),r._timeline)for(;r._timeline;)r._timeline._time!==(r._startTime+r._totalTime)/r._timeScale&&r.totalTime(r._totalTime,!0),r=r._timeline}this._gc&&this._enabled(!0,!1),(this._totalTime!==t||0===this._duration)&&(this.render(t,e,!1),z.length&&B())}return this},r.progress=r.totalProgress=function(t,e){return arguments.length?this.totalTime(this.duration()*t,e):this._time/this.duration()},r.startTime=function(t){return arguments.length?(t!==this._startTime&&(this._startTime=t,this.timeline&&this.timeline._sortChildren&&this.timeline.add(this,t-this._delay)),this):this._startTime},r.timeScale=function(t){if(!arguments.length)return this._timeScale;if(t=t||l,this._timeline&&this._timeline.smoothChildTiming){var e=this._pauseTime,i=e||0===e?e:this._timeline.totalTime();this._startTime=i-(i-this._startTime)*this._timeScale/t}return this._timeScale=t,this._uncache(!1)},r.reversed=function(t){return arguments.length?(t!=this._reversed&&(this._reversed=t,this.totalTime(this._timeline&&!this._timeline.smoothChildTiming?this.totalDuration()-this._totalTime:this._totalTime,!0)),this):this._reversed},r.paused=function(t){if(!arguments.length)return this._paused;if(t!=this._paused&&this._timeline){a||t||n.wake();var e=this._timeline,i=e.rawTime(),s=i-this._pauseTime;!t&&e.smoothChildTiming&&(this._startTime+=s,this._uncache(!1)),this._pauseTime=t?i:null,this._paused=t,this._active=this.isActive(),!t&&0!==s&&this._initted&&this.duration()&&this.render(e.smoothChildTiming?this._totalTime:(i-this._startTime)/this._timeScale,!0,!0)}return this._gc&&!t&&this._enabled(!0,!1),this};var C=d("core.SimpleTimeline",function(t){R.call(this,0,t),this.autoRemoveChildren=this.smoothChildTiming=!0});r=C.prototype=new R,r.constructor=C,r.kill()._gc=!1,r._first=r._last=null,r._sortChildren=!1,r.add=r.insert=function(t,e){var i,s;if(t._startTime=Number(e||0)+t._delay,t._paused&&this!==t._timeline&&(t._pauseTime=t._startTime+(this.rawTime()-t._startTime)/t._timeScale),t.timeline&&t.timeline._remove(t,!0),t.timeline=t._timeline=this,t._gc&&t._enabled(!0,!0),i=this._last,this._sortChildren)for(s=t._startTime;i&&i._startTime>s;)i=i._prev;return i?(t._next=i._next,i._next=t):(t._next=this._first,this._first=t),t._next?t._next._prev=t:this._last=t,t._prev=i,this._timeline&&this._uncache(!0),this},r._remove=function(t,e){return t.timeline===this&&(e||t._enabled(!1,!0),t.timeline=null,t._prev?t._prev._next=t._next:this._first===t&&(this._first=t._next),t._next?t._next._prev=t._prev:this._last===t&&(this._last=t._prev),this._timeline&&this._uncache(!0)),this},r.render=function(t,e,i){var s,r=this._first;for(this._totalTime=this._time=this._rawPrevTime=t;r;)s=r._next,(r._active||t>=r._startTime&&!r._paused)&&(r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(t-r._startTime)*r._timeScale,e,i):r.render((t-r._startTime)*r._timeScale,e,i)),r=s},r.rawTime=function(){return a||n.wake(),this._totalTime};var O=d("TweenLite",function(e,i,s){if(R.call(this,i,s),this.render=O.prototype.render,null==e)throw"Cannot tween a null target.";this.target=e="string"!=typeof e?e:O.selector(e)||e;var r,n,a,o=e.jquery||e.length&&e!==t&&e[0]&&(e[0]===t||e[0].nodeType&&e[0].style&&!e.nodeType),h=this.vars.overwrite;if(this._overwrite=h=null==h?U[O.defaultOverwrite]:"number"==typeof h?h>>0:U[h],(o||e instanceof Array||e.push&&p(e))&&"number"!=typeof e[0])for(this._targets=a=_.call(e,0),this._propLookup=[],this._siblings=[],r=0;a.length>r;r++)n=a[r],n?"string"!=typeof n?n.length&&n!==t&&n[0]&&(n[0]===t||n[0].nodeType&&n[0].style&&!n.nodeType)?(a.splice(r--,1),this._targets=a=a.concat(_.call(n,0))):(this._siblings[r]=q(n,this,!1),1===h&&this._siblings[r].length>1&&V(n,this,null,1,this._siblings[r])):(n=a[r--]=O.selector(n),"string"==typeof n&&a.splice(r+1,1)):a.splice(r--,1);else this._propLookup={},this._siblings=q(e,this,!1),1===h&&this._siblings.length>1&&V(e,this,null,1,this._siblings);(this.vars.immediateRender||0===i&&0===this._delay&&this.vars.immediateRender!==!1)&&(this._time=-l,this.render(-this._delay))},!0),D=function(e){return e.length&&e!==t&&e[0]&&(e[0]===t||e[0].nodeType&&e[0].style&&!e.nodeType)},M=function(t,e){var i,s={};for(i in t)X[i]||i in e&&"transform"!==i&&"x"!==i&&"y"!==i&&"width"!==i&&"height"!==i&&"className"!==i&&"border"!==i||!(!L[i]||L[i]&&L[i]._autoCSS)||(s[i]=t[i],delete t[i]);t.css=s};r=O.prototype=new R,r.constructor=O,r.kill()._gc=!1,r.ratio=0,r._firstPT=r._targets=r._overwrittenProps=r._startAt=null,r._notifyPluginsOfEnabled=r._lazy=!1,O.version="1.12.1",O.defaultEase=r._ease=new y(null,null,1,1),O.defaultOverwrite="auto",O.ticker=n,O.autoSleep=!0,O.lagSmoothing=function(t,e){n.lagSmoothing(t,e)},O.selector=t.$||t.jQuery||function(e){return t.$?(O.selector=t.$,t.$(e)):t.document?t.document.getElementById("#"===e.charAt(0)?e.substr(1):e):e};var z=[],I={},E=O._internals={isArray:p,isSelector:D,lazyTweens:z},L=O._plugins={},F=E.tweenLookup={},N=0,X=E.reservedProps={ease:1,delay:1,overwrite:1,onComplete:1,onCompleteParams:1,onCompleteScope:1,useFrames:1,runBackwards:1,startAt:1,onUpdate:1,onUpdateParams:1,onUpdateScope:1,onStart:1,onStartParams:1,onStartScope:1,onReverseComplete:1,onReverseCompleteParams:1,onReverseCompleteScope:1,onRepeat:1,onRepeatParams:1,onRepeatScope:1,easeParams:1,yoyo:1,immediateRender:1,repeat:1,repeatDelay:1,data:1,paused:1,reversed:1,autoCSS:1,lazy:1},U={none:0,all:1,auto:2,concurrent:3,allOnStart:4,preexisting:5,"true":1,"false":0},Y=R._rootFramesTimeline=new C,j=R._rootTimeline=new C,B=function(){var t=z.length;for(I={};--t>-1;)i=z[t],i&&i._lazy!==!1&&(i.render(i._lazy,!1,!0),i._lazy=!1);z.length=0};j._startTime=n.time,Y._startTime=n.frame,j._active=Y._active=!0,setTimeout(B,1),R._updateRoot=O.render=function(){var t,e,i;if(z.length&&B(),j.render((n.time-j._startTime)*j._timeScale,!1,!1),Y.render((n.frame-Y._startTime)*Y._timeScale,!1,!1),z.length&&B(),!(n.frame%120)){for(i in F){for(e=F[i].tweens,t=e.length;--t>-1;)e[t]._gc&&e.splice(t,1);0===e.length&&delete F[i]}if(i=j._first,(!i||i._paused)&&O.autoSleep&&!Y._first&&1===n._listeners.tick.length){for(;i&&i._paused;)i=i._next;i||n.sleep()}}},n.addEventListener("tick",R._updateRoot);var q=function(t,e,i){var s,r,n=t._gsTweenID;if(F[n||(t._gsTweenID=n="t"+N++)]||(F[n]={target:t,tweens:[]}),e&&(s=F[n].tweens,s[r=s.length]=e,i))for(;--r>-1;)s[r]===e&&s.splice(r,1);return F[n].tweens},V=function(t,e,i,s,r){var n,a,o,h;if(1===s||s>=4){for(h=r.length,n=0;h>n;n++)if((o=r[n])!==e)o._gc||o._enabled(!1,!1)&&(a=!0);else if(5===s)break;return a}var _,u=e._startTime+l,p=[],f=0,c=0===e._duration;for(n=r.length;--n>-1;)(o=r[n])===e||o._gc||o._paused||(o._timeline!==e._timeline?(_=_||W(e,0,c),0===W(o,_,c)&&(p[f++]=o)):u>=o._startTime&&o._startTime+o.totalDuration()/o._timeScale>u&&((c||!o._initted)&&2e-10>=u-o._startTime||(p[f++]=o)));for(n=f;--n>-1;)o=p[n],2===s&&o._kill(i,t)&&(a=!0),(2!==s||!o._firstPT&&o._initted)&&o._enabled(!1,!1)&&(a=!0);return a},W=function(t,e,i){for(var s=t._timeline,r=s._timeScale,n=t._startTime;s._timeline;){if(n+=s._startTime,r*=s._timeScale,s._paused)return-100;s=s._timeline}return n/=r,n>e?n-e:i&&n===e||!t._initted&&2*l>n-e?l:(n+=t.totalDuration()/t._timeScale/r)>e+l?0:n-e-l};r._init=function(){var t,e,i,s,r,n=this.vars,a=this._overwrittenProps,o=this._duration,h=!!n.immediateRender,l=n.ease;if(n.startAt){this._startAt&&(this._startAt.render(-1,!0),this._startAt.kill()),r={};for(s in n.startAt)r[s]=n.startAt[s];if(r.overwrite=!1,r.immediateRender=!0,r.lazy=h&&n.lazy!==!1,r.startAt=r.delay=null,this._startAt=O.to(this.target,0,r),h)if(this._time>0)this._startAt=null;else if(0!==o)return}else if(n.runBackwards&&0!==o)if(this._startAt)this._startAt.render(-1,!0),this._startAt.kill(),this._startAt=null;else{i={};for(s in n)X[s]&&"autoCSS"!==s||(i[s]=n[s]);if(i.overwrite=0,i.data="isFromStart",i.lazy=h&&n.lazy!==!1,i.immediateRender=h,this._startAt=O.to(this.target,0,i),h){if(0===this._time)return}else this._startAt._init(),this._startAt._enabled(!1)}if(this._ease=l?l instanceof y?n.easeParams instanceof Array?l.config.apply(l,n.easeParams):l:"function"==typeof l?new y(l,n.easeParams):T[l]||O.defaultEase:O.defaultEase,this._easeType=this._ease._type,this._easePower=this._ease._power,this._firstPT=null,this._targets)for(t=this._targets.length;--t>-1;)this._initProps(this._targets[t],this._propLookup[t]={},this._siblings[t],a?a[t]:null)&&(e=!0);else e=this._initProps(this.target,this._propLookup,this._siblings,a);if(e&&O._onPluginEvent("_onInitAllProps",this),a&&(this._firstPT||"function"!=typeof this.target&&this._enabled(!1,!1)),n.runBackwards)for(i=this._firstPT;i;)i.s+=i.c,i.c=-i.c,i=i._next;this._onUpdate=n.onUpdate,this._initted=!0}
vendor: 5,282 bytes, line 16
16,r._initProps=function(e,i,s,r){var n,a,o,h,l,_;if(null==e)return!1;I[e._gsTweenID]&&B(),this.vars.css||e.style&&e!==t&&e.nodeType&&L.css&&this.vars.autoCSS!==!1&&M(this.vars,e);for(n in this.vars){if(_=this.vars[n],X[n])_&&(_ instanceof Array||_.push&&p(_))&&-1!==_.join("").indexOf("{self}")&&(this.vars[n]=_=this._swapSelfInParams(_,this));else if(L[n]&&(h=new L[n])._onInitTween(e,this.vars[n],this)){for(this._firstPT=l={_next:this._firstPT,t:h,p:"setRatio",s:0,c:1,f:!0,n:n,pg:!0,pr:h._priority},a=h._overwriteProps.length;--a>-1;)i[h._overwriteProps[a]]=this._firstPT;(h._priority||h._onInitAllProps)&&(o=!0),(h._onDisable||h._onEnable)&&(this._notifyPluginsOfEnabled=!0)}else this._firstPT=i[n]=l={_next:this._firstPT,t:e,p:n,f:"function"==typeof e[n],n:n,pg:!1,pr:0},l.s=l.f?e[n.indexOf("set")||"function"!=typeof e["get"+n.substr(3)]?n:"get"+n.substr(3)]():parseFloat(e[n]),l.c="string"==typeof _&&"="===_.charAt(1)?parseInt(_.charAt(0)+"1",10)*Number(_.substr(2)):Number(_)-l.s||0;l&&l._next&&(l._next._prev=l)}return r&&this._kill(r,e)?this._initProps(e,i,s,r):this._overwrite>1&&this._firstPT&&s.length>1&&V(e,this,i,this._overwrite,s)?(this._kill(i,e),this._initProps(e,i,s,r)):(this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration)&&(I[e._gsTweenID]=!0),o)},r.render=function(t,e,i){var s,r,n,a,o=this._time,h=this._duration,_=this._rawPrevTime;if(t>=h)this._totalTime=this._time=h,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1,this._reversed||(s=!0,r="onComplete"),0===h&&(this._initted||!this.vars.lazy||i)&&(this._startTime===this._timeline._duration&&(t=0),(0===t||0>_||_===l)&&_!==t&&(i=!0,_>l&&(r="onReverseComplete")),this._rawPrevTime=a=!e||t||_===t?t:l);else if(1e-7>t)this._totalTime=this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==o||0===h&&_>0&&_!==l)&&(r="onReverseComplete",s=this._reversed),0>t?(this._active=!1,0===h&&(this._initted||!this.vars.lazy||i)&&(_>=0&&(i=!0),this._rawPrevTime=a=!e||t||_===t?t:l)):this._initted||(i=!0);else if(this._totalTime=this._time=t,this._easeType){var u=t/h,p=this._easeType,f=this._easePower;(1===p||3===p&&u>=.5)&&(u=1-u),3===p&&(u*=2),1===f?u*=u:2===f?u*=u*u:3===f?u*=u*u*u:4===f&&(u*=u*u*u*u),this.ratio=1===p?1-u:2===p?u:.5>t/h?u/2:1-u/2}else this.ratio=this._ease.getRatio(t/h);if(this._time!==o||i){if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!i&&this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration))return this._time=this._totalTime=o,this._rawPrevTime=_,z.push(this),this._lazy=t,void 0;this._time&&!s?this.ratio=this._ease.getRatio(this._time/h):s&&this._ease._calcEnd&&(this.ratio=this._ease.getRatio(0===this._time?0:1))}for(this._lazy!==!1&&(this._lazy=!1),this._active||!this._paused&&this._time!==o&&t>=0&&(this._active=!0),0===o&&(this._startAt&&(t>=0?this._startAt.render(t,e,i):r||(r="_dummyGS")),this.vars.onStart&&(0!==this._time||0===h)&&(e||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||v))),n=this._firstPT;n;)n.f?n.t[n.p](n.c*this.ratio+n.s):n.t[n.p]=n.c*this.ratio+n.s,n=n._next;this._onUpdate&&(0>t&&this._startAt&&this._startTime&&this._startAt.render(t,e,i),e||(this._time!==o||s)&&this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||v)),r&&(this._gc||(0>t&&this._startAt&&!this._onUpdate&&this._startTime&&this._startAt.render(t,e,i),s&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[r]&&this.vars[r].apply(this.vars[r+"Scope"]||this,this.vars[r+"Params"]||v),0===h&&this._rawPrevTime===l&&a!==l&&(this._rawPrevTime=0)))}},r._kill=function(t,e){if("all"===t&&(t=null),null==t&&(null==e||e===this.target))return this._lazy=!1,this._enabled(!1,!1);e="string"!=typeof e?e||this._targets||this.target:O.selector(e)||e;var i,s,r,n,a,o,h,l;if((p(e)||D(e))&&"number"!=typeof e[0])for(i=e.length;--i>-1;)this._kill(t,e[i])&&(o=!0);else{if(this._targets){for(i=this._targets.length;--i>-1;)if(e===this._targets[i]){a=this._propLookup[i]||{},this._overwrittenProps=this._overwrittenProps||[],s=this._overwrittenProps[i]=t?this._overwrittenProps[i]||{}:"all";break}}else{if(e!==this.target)return!1;a=this._propLookup,s=this._overwrittenProps=t?this._overwrittenProps||{}:"all"}if(a){h=t||a,l=t!==s&&"all"!==s&&t!==a&&("object"!=typeof t||!t._tempKill);for(r in h)(n=a[r])&&(n.pg&&n.t._kill(h)&&(o=!0),n.pg&&0!==n.t._overwriteProps.length||(n._prev?n._prev._next=n._next:n===this._firstPT&&(this._firstPT=n._next),n._next&&(n._next._prev=n._prev),n._next=n._prev=null),delete a[r]),l&&(s[r]=1);!this._firstPT&&this._initted&&this._enabled(!1,!1)}}return o},r.invalidate=function(){return this._notifyPluginsOfEnabled&&O._onPluginEvent("_onDisable",this),this._firstPT=null,this._overwrittenProps=null,this._onUpdate=null,this._startAt=null,this._initted=this._active=this._notifyPluginsOfEnabled=this._lazy=!1,this._propLookup=this._targets?{}:[],this},r._enabled=function(t,e){if(a||n.wake(),t&&this._gc){var i,s=this._targets;if(s)for(i=s.length;--i>-1;)this._siblings[i]=q(s[i],this,!0);else this._siblings=q(this.target,this,!0)}return R.prototype._enabled.call(this,t,e),this._notifyPluginsOfEnabled&&this._firstPT?O._onPluginEvent(t?"_onEnable":"_onDisable",this):!1}
16,O.to=function(t,e,i){return new O(t,e,i)},O.from=function(t,e,i){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,new O(t,e,i)},O.fromTo=function(t,e,i,s){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,new O(t,e,s)},O.delayedCall=function(t,e,i,s,r){return new O(e,0,{delay:t,onComplete:e,onCompleteParams:i,onCompleteScope:s,onReverseComplete:e,onReverseCompleteParams:i,onReverseCompleteScope:s,immediateRender:!1,useFrames:r,overwrite:0})},O.set=function(t,e){return new O(t,0,e)},O.getTweensOf=function(t,e){if(null==t)return[];t="string"!=typeof t?t:O.selector(t)||t;var i,s,r,n;if((p(t)||D(t))&&"number"!=typeof t[0]){for(i=t.length,s=[];--i>-1;)s=s.concat(O.getTweensOf(t[i],e));for(i=s.length;--i>-1;)for(n=s[i],r=i;--r>-1;)n===s[r]&&s.splice(i,1)}else for(s=q(t).concat(),i=s.length;--i>-1;)(s[i]._gc||e&&!s[i].isActive())&&s.splice(i,1);return s},O.killTweensOf=O.killDelayedCallsTo=function(t,e,i){"object"==typeof e&&(i=e,e=!1);for(var s=O.getTweensOf(t,e),r=s.length;--r>-1;)s[r]._kill(i,t)};var G=d("plugins.TweenPlugin",function(t,e){this._overwriteProps=(t||"").split(","),this._propName=this._overwriteProps[0],this._priority=e||0,this._super=G.prototype},!0);if(r=G.prototype,G.version="1.10.1",G.API=2,r._firstPT=null,r._addTween=function(t,e,i,s,r,n){var a,o;return null!=s&&(a="number"==typeof s||"="!==s.charAt(1)?Number(s)-i:parseInt(s.charAt(0)+"1",10)*Number(s.substr(2)))?(this._firstPT=o={_next:this._firstPT,t:t,p:e,s:i,c:a,f:"function"==typeof t[e],n:r||e,r:n},o._next&&(o._next._prev=o),o):void 0},r.setRatio=function(t){for(var e,i=this._firstPT,s=1e-6;i;)e=i.c*t+i.s,i.r?e=Math.round(e):s>e&&e>-s&&(e=0),i.f?i.t[i.p](e):i.t[i.p]=e,i=i._next},r._kill=function(t){var e,i=this._overwriteProps,s=this._firstPT;if(null!=t[this._propName])this._overwriteProps=[];else for(e=i.length;--e>-1;)null!=t[i[e]]&&i.splice(e,1);for(;s;)null!=t[s.n]&&(s._next&&(s._next._prev=s._prev),s._prev?(s._prev._next=s._next,s._prev=null):this._firstPT===s&&(this._firstPT=s._next)),s=s._next;return!1},r._roundProps=function(t,e){for(var i=this._firstPT;i;)(t[this._propName]||null!=i.n&&t[i.n.split(this._propName+"_").join("")])&&(i.r=e),i=i._next},O._onPluginEvent=function(t,e){var i,s,r,n,a,o=e._firstPT;if("_onInitAllProps"===t){for(;o;){for(a=o._next,s=r;s&&s.pr>o.pr;)s=s._next;(o._prev=s?s._prev:n)?o._prev._next=o:r=o,(o._next=s)?s._prev=o:n=o,o=a}o=e._firstPT=r}for(;o;)o.pg&&"function"==typeof o.t[t]&&o.t[t]()&&(i=!0),o=o._next;return i},G.activate=function(t){for(var e=t.length;--e>-1;)t[e].API===G.API&&(L[(new t[e])._propName]=t[e]);return!0},m.plugin=function(t){if(!(t&&t.propName&&t.init&&t.API))throw"illegal plugin definition.";
17var e,i=t.propName,s=t.priority||0,r=t.overwriteProps,n={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_roundProps",initAll:"_onInitAllProps"},a=d("plugins."+i.charAt(0).toUpperCase()+i.substr(1)+"Plugin",function(){G.call(this,i,s),this._overwriteProps=r||[]},t.global===!0),o=a.prototype=new G(i);o.constructor=a,a.API=t.API;for(e in n)"function"==typeof t[e]&&(o[n[e]]=t[e]);return a.version=t.version,G.activate([a]),a},i=t._gsQueue){for(s=0;i.length>s;s++)i[s]();for(r in f)f[r].func||t.console.log("GSAP encountered missing dependency: com.greensock."+r)}a=!1}}(window);
18
19
20/*! SCROLL TO PLUGIN FOR GS
21 * VERSION: beta 1.7.1
22 * DATE: 2013-10-23
23 * UPDATES AND DOCS AT: http://www.greensock.com
24 *
25 * @license Copyright (c) 2008-2013, GreenSock. All rights reserved.
26 * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
27 * Club GreenSock members, the software agreement that was issued with your membership.
28 * 
29 * @author: Jack Doyle, [email protected]
30 **/
31(window._gsQueue||(window._gsQueue=[])).push(function(){"use strict";var t=document.documentElement,e=window,i=function(i,s){var r="x"===s?"Width":"Height",n="scroll"+r,a="client"+r,o=document.body;return i===e||i===t||i===o?Math.max(t[n],o[n])-(e["inner"+r]||Math.max(t[a],o[a])):i[n]-i["offset"+r]},s=window._gsDefine.plugin({propName:"scrollTo",API:2,init:function(t,s,r){return this._wdw=t===e,this._target=t,this._tween=r,"object"!=typeof s&&(s={y:s}),this._autoKill=s.autoKill!==!1,this.x=this.xPrev=this.getX(),this.y=this.yPrev=this.getY(),null!=s.x?this._addTween(this,"x",this.x,"max"===s.x?i(t,"x"):s.x,"scrollTo_x",!0):this.skipX=!0,null!=s.y?this._addTween(this,"y",this.y,"max"===s.y?i(t,"y"):s.y,"scrollTo_y",!0):this.skipY=!0,!0},set:function(t){this._super.setRatio.call(this,t);var i=this._wdw||!this.skipX?this.getX():this.xPrev,s=this._wdw||!this.skipY?this.getY():this.yPrev,r=s-this.yPrev,n=i-this.xPrev;this._autoKill&&(!this.skipX&&(n>7||-7>n)&&(this.skipX=!0),!this.skipY&&(r>7||-7>r)&&(this.skipY=!0),this.skipX&&this.skipY&&this._tween.kill()),this._wdw?e.scrollTo(this.skipX?i:this.x,this.skipY?s:this.y):(this.skipY||(this._target.scrollTop=this.y),this.skipX||(this._target.scrollLeft=this.x)),this.xPrev=this.x,this.yPrev=this.y}}),r=s.prototype;s.max=i,r.getX=function(){return this._wdw?null!=e.pageXOffset?e.pageXOffset:null!=t.scrollLeft?t.scrollLeft:document.body.scrollLeft:this._target.scrollLeft},r.getY=function(){return this._wdw?null!=e.pageYOffset?e.pageYOffset:null!=t.scrollTop?t.scrollTop:document.body.scrollTop:this._target.scrollTop},r._kill=function(t){return t.scrollTo_x&&(this.skipX=!0),t.scrollTo_y&&(this.skipY=!0),this._super._kill.call(this,t)}}),window._gsDefine&&window._gsQueue.pop()();
32;
33(function ($) {
34
35  window.choppedjs = {};
36
37  function extend(){
38    for(var i=1; i<arguments.length; i++)
39    for(var key in arguments[i])
40      if(arguments[i].hasOwnProperty(key))
41        arguments[0][key] = arguments[i][key];
42    return arguments[0];
43  }
44  
45  choppedjs.onEvent = function (eventType, handler, timeout, config) {
46    var defaults = {
47      name: 'unnamed',
48      mute: false,
49      immediate: true
50    };
51    this.options = extend({}, defaults, config);
52    this.eventType = eventType;
53    this.timeout = timeout;
54    this.handler = handler;
55    this.isExecuteTime = this.options.immediate;
56    this.interval = '';
57    var _this = this;
58    init();
59
60    function init() {
61      //reset the execute determiner
62      $(window)[_this.eventType](function () {
63        _this.isExecuteTime = true;
64      });
65
66      //execute the handler based on the timeout user passed
67      _this.interval = setInterval(function () {
68        if (_this.isExecuteTime && !_this.options.mute) {
69          try {
70            handler();
71          } catch (err) {
72            console.log(err);
73          }
74          //turn off the exec time until user scroll again
75          _this.isExecuteTime = false;
76        }
77      }, _this.timeout);
78    }
79
80  };
81
82  choppedjs.onScroll = function (handler, timeout, options) {
83    return new choppedjs.onEvent('scroll', handler, timeout, options);
84  };
85
86  choppedjs.onResize = function (handler, timeout, options) {
87    return new choppedjs.onEvent('resize', handler, timeout, options);
88  };
89
90  choppedjs.onMousemove = function (handler, timeout, options) {
91    return new choppedjs.onEvent('mousemove', handler, timeout, options);
92  };
93  
94}(jQuery));
95;window.ChopScroll = function (handler, timeout, name) {
96  this.timeout = timeout;
97  this.handler = handler;
98  this.name = name || 'unnamed';
99  this.isExecuteTime = true;
100  this.interval = '';
101  var _this = this;
102  init();
103
104  function init() {
105    //reset the execute determiner
106    jQuery(window).scroll(function () {
107      _this.isExecuteTime = true;
108    });
109
110    //execute the handler based on the timeout user passed
111    _this.interval = setInterval(function () {
112      if (_this.isExecuteTime) {
113        try {
114          handler();
115        } catch (err) {
116          console.log(err);
117        }
118        //turn off the exec time until user scroll again
119        _this.isExecuteTime = false;
120      }
121    }, _this.timeout);
122  }
123
124}
125
126;
127/**
128 * fullPage 2.1.2
129 * https://github.com/alvarotrigo/fullPage.js
130 * MIT licensed
131 *
132 * Copyright (C) 2013 alvarotrigo.com - A project by Alvaro Trigo
133 */
134/**
135 * fullPage 2.1.4
136 * https://github.com/alvarotrigo/fullPage.js
137 * MIT licensed
138 *
139 * Copyright (C) 2013 alvarotrigo.com - A project by Alvaro Trigo
140 */
141
142(function($) {
143    $.fn.fullpage = function(options) {
144        // Create some defaults, extending them with any options that were provided
145        options = $.extend({
146            "verticalCentered": true,
147            'resize': true,
148            'sectionsColor' : [],
149            'anchors':[],
150            'scrollingSpeed': 700,
151            'easing': 'easeInQuart',
152            'menu': false,
153            'navigation': false,
154            'navigationPosition': 'right',
155            'navigationColor': '#000',
156            'navigationTooltips': [],
157            'slidesNavigation': false,
158            'slidesNavPosition': 'bottom',
159            'controlArrowColor': '#fff',
160            'loopBottom': false,
161            'loopTop': false,
162            'loopHorizontal': true,
163            'autoScrolling': true,
164            'scrollOverflow': false,
165            'css3': false,
166            'paddingTop': 0,
167            'paddingBottom': 0,
168            'fixedElements': null,
169            'normalScrollElements': null,
170            'keyboardScrolling': true,
171            'touchSensitivity': 5,
172            'continuousVertical': false,
173            'animateAnchor': true,
174            'normalScrollElementTouchThreshold': 5,
175
176            //events
177            'afterLoad': null,
178            'onLeave': null,
179            'afterRender': null,
180            'afterResize': null,
181            'afterSlideLoad': null,
182            'onSlideLeave': null
183        }, options);
184
185        // Disable mutually exclusive settings
186        if (options.continuousVertical &&
187            (options.loopTop || options.loopBottom)) {
188            options.continuousVertical = false;
189            console && console.log && console.log("Option loopTop/loopBottom is mutually exclusive with continuousVertical; continuousVertical disabled");
190        }
191
192        //Defines the delay to take place before being able to scroll to the next section
193        //BE CAREFUL! Not recommened to change it under 400 for a good behavior in laptops and
194        //Apple devices (laptops, mouses...)
195        var scrollDelay = 600;
196
197        $.fn.fullpage.setAutoScrolling = function(value){
198            options.autoScrolling = value;
199
200            var element = $('.section.active');
201
202            if(options.autoScrolling){
203                $('html, body').css({
204                    'overflow' : 'hidden',
205                    'height' : '100%'
206                });
207
208                if(element.length){
209                    //moving the container up
210                    silentScroll(element.position().top);
211                }
212
213            }else{
214                $('html, body').css({
215                    'overflow' : 'auto',
216                    'height' : 'auto'
217                });
218
219                silentScroll(0);
220
221                //scrolling the page to the section with no animation
222                $('html, body').scrollTop(element.position().top);
223            }
224
225        };
226
227        /**
228        * Defines the scrolling speed
229        */
230        $.fn.fullpage.setScrollingSpeed = function(value){
231           options.scrollingSpeed = value;
232        };
233
234        /**
235        * Adds or remove the possiblity of scrolling through sections by using the mouse wheel or the trackpad.
236        */
237        $.fn.fullpage.setMouseWheelScrolling = function (value){
238            if(value){
239                addMouseWheelHandler();
240            }else{
241                removeMouseWheelHandler();
242            }
243        };
244
245        /**
246        * Adds or remove the possiblity of scrolling through sections by using the mouse wheel/trackpad or touch gestures.
247        */
248        $.fn.fullpage.setAllowScrolling = function (value){
249            if(value){
250                $.fn.fullpage.setMouseWheelScrolling(true);
251                addTouchHandler();
252            }else{
253                $.fn.fullpage.setMouseWheelScrolling(false);
254                removeTouchHandler();
255            }
256        };
257
258        /**
259        * Adds or remove the possiblity of scrolling through sections by using the keyboard arrow keys
260        */
261        $.fn.fullpage.setKeyboardScrolling = function (value){
262            options.keyboardScrolling = value;
263        };
264
265        //flag to avoid very fast sliding for landscape sliders
266        var slideMoving = false;
267
268        var isTouchDevice = navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry|BB10|Windows Phone|Tizen|Bada)/);
269        var container = $(this);
270        var windowsHeight = $(window).height();
271        var isMoving = false;
272        var isResizing = false;
273        var lastScrolledDestiny;
274        var lastScrolledSlide;
275        var wrapperSelector = 'fullpage-wrapper';
276
277        $.fn.fullpage.setAllowScrolling(true);
278
279        //if css3 is not supported, it will use jQuery animations
280        if(options.css3){
281            options.css3 = support3d();
282        }
283
284        if($(this).length){
285            container.css({
286                'height': '100%',
287                'position': 'relative',
288                '-ms-touch-action': 'none'
289            });
290
291            //adding a class to recognize the container internally in the code
292            container.addClass(wrapperSelector);
293        }
294
295        //trying to use fullpage without a selector?
296        else{
297            console.error("Error! Fullpage.js needs to be initialized with a selector. For example: $('#myContainer').fullpage();");
298        }
299
300        //creating the navigation dots
301        if (options.navigation) {
302            $('#mk-theme-container').append('<div id="fullPage-nav"><ul></ul></div>');
303            var nav = $('#fullPage-nav');
304
305            nav.css('color', options.navigationColor);
306            nav.addClass(options.navigationPosition);
307        }
308
309        $('.section').each(function(index){
310            var that = $(this);
311            var slides = $(this).find('.slide');
312            var numSlides = slides.length;
313
314            //if no active section is defined, the 1st one will be the default one
315            if(!index && $('.section.active').length === 0) {
316                $(this).addClass('active');
317            }
318
319            $(this).css('height', windowsHeight + 'px');
320
321            if(options.paddingTop || options.paddingBottom){
322                $(this).css('padding', options.paddingTop  + ' 0 ' + options.paddingBottom + ' 0');
323            }
324
325            if (typeof options.sectionsColor[index] !==  'undefined') {
326                $(this).css('background-color', options.sectionsColor[index]);
327            }
328
329            if (typeof options.anchors[index] !== 'undefined') {
330                $(this).attr('data-anchor', options.anchors[index]);
331            }
332
333            if (options.navigation) {
334                var link = '';
335                if(options.anchors.length){
336                    link = options.anchors[index];
337                }
338                var tooltip = options.navigationTooltips[index];
339                if(typeof tooltip === 'undefined'){
340                    tooltip = '';
341                }
342
343                nav.find('ul').append('<li data-tooltip="' + tooltip + '"><a href="#' + link + '"><span></span></a></li>');
344            }
345
346
347            // if there's any slide
348            if (numSlides > 1) {
349                var sliderWidth = numSlides * 100;
350                var slideWidth = 100 / numSlides;
351
352                slides.wrapAll('<div class="slidesContainer" />');
353                slides.parent().wrap('<div class="slides" />');
354
355                $(this).find('.slidesContainer').css('width', sliderWidth + '%');
356                $(this).find('.slides').after('<div class="controlArrow prev"></div><div class="controlArrow next"></div>');
357
358                if(options.controlArrowColor!='#fff'){
359                    $(this).find('.controlArrow.next').css('border-color', 'transparent transparent transparent '+options.controlArrowColor);
360                    $(this).find('.controlArrow.prev').css('border-color', 'transparent '+ options.controlArrowColor + ' transparent transparent');
361                }
362
363                if(!options.loopHorizontal){
364                    $(this).find('.controlArrow.prev').hide();
365                }
366
367
368                if(options.slidesNavigation){
369                    addSlidesNavigation($(this), numSlides);
370                }
371
372                slides.each(function(index) {
373                    //if the slide won#t be an starting point, the default will be the first one
374                    if(!index && that.find('.slide.active').length == 0){
375                        $(this).addClass('active');
376                    }
377
378                    $(this).css('width', slideWidth + '%');
379
380                    if(options.verticalCentered){
381                        addTableClass($(this));
382                    }
383                });
384            }else{
385                if(options.verticalCentered){
386                    addTableClass($(this));
387                }
388            }
389
390
391
392
393        }).promise().done(function(){
394            $.fn.fullpage.setAutoScrolling(options.autoScrolling);
395
396            //the starting point is a slide?
397            var activeSlide = $('.section.active').find('.slide.active');
398            if( activeSlide.length &&  ($('.section.active').index('.section') != 0 || ($('.section.active').index('.section') == 0 && activeSlide.index() != 0))){
399                var prevScrollingSpeepd = options.scrollingSpeed;
400                $.fn.fullpage.setScrollingSpeed (0);
401                landscapeScroll($('.section.active').find('.slides'), activeSlide);
402                $.fn.fullpage.setScrollingSpeed(prevScrollingSpeepd);
403            }
404
405            //fixed elements need to be moved out of the plugin container due to problems with CSS3.
406            if(options.fixedElements && options.css3){
407                $(options.fixedElements).appendTo('body');
408            }
409
410            //vertical centered of the navigation + first bullet active
411            if(options.navigation){
412                nav.css('margin-top', '-' + (nav.height()/2) + 'px');
413                nav.find('li').eq($('.section.active').index('.section')).find('a').addClass('active');
414            }
415
416            //moving the menu outside the main container if it is inside (avoid problems with fixed positions when using CSS3 tranforms)
417            if(options.menu && options.css3 && $(options.menu).closest('.fullpage-wrapper').length){
418                $(options.menu).appendTo('body');
419            }
420
421            if(options.scrollOverflow){
422                if(container.hasClass('fullpage-used')){
423                    createSlimScrollingHandler();
424                }
425                //after DOM and images are loaded
426                $(window).on('load', createSlimScrollingHandler);
427            }else{
428                $.isFunction( options.afterRender ) && options.afterRender.call( this);
429            }
430
431
432            //getting the anchor link in the URL and deleting the `#`
433            var value =  window.location.hash.replace('#', '').split('/');
434            var destiny = value[0];
435
436            if(destiny.length){
437                var section = $('[data-anchor="'+destiny+'"]');
438
439                if(!options.animateAnchor && section.length){
440                    silentScroll(section.position().top);
441                    $.isFunction( options.afterLoad ) && options.afterLoad.call( this, destiny, (section.index('.section') + 1));
442
443                    //updating the active class
444                    section.addClass('active').siblings().removeClass('active');
445                }
446            }
447
448
449            $(window).on('load', function() {
450                scrollToAnchor();
451            });
452
453        });
454
455        function createSlimScrollingHandler(){
456            $('.section').each(function(){
457                var slides = $(this).find('.slide');
458
459                if(slides.length){
460                    slides.each(function(){
461                        createSlimScrolling($(this));
462                    });
463                }else{
464                    createSlimScrolling($(this));
465                }
466
467            });
468            $.isFunction( options.afterRender ) && options.afterRender.call( this);
469        }
470
471
472        var scrollId;
473        var isScrolling = false;
474
475        //when scrolling...
476        $(window).on('scroll', scrollHandler);
477
478        function scrollHandler(){
479            if(!options.autoScrolling){
480                var currentScroll = $(window).scrollTop();
481
482                var scrolledSections = $('.section').map(function(){
483                    if ($(this).offset().top < (currentScroll + 100)){
484                        return $(this);
485                    }
486                });
487
488                //geting the last one, the current one on the screen
489                var currentSection = scrolledSections[scrolledSections.length-1];
490
491                //executing only once the first time we reach the section
492                if(!currentSection.hasClass('active')){
493                    var leavingSection = $('.section.active').index('.section') + 1;
494
495                    isScrolling = true;
496
497                    var yMovement = getYmovement(currentSection);
498
499                    currentSection.addClass('active').siblings().removeClass('active');
500
501                    var anchorLink  = currentSection.data('anchor');
502                    $.isFunction( options.onLeave ) && options.onLeave.call( this, leavingSection, (currentSection.index('.section') + 1), yMovement);
503
504                    $.isFunction( options.afterLoad ) && options.afterLoad.call( this, anchorLink, (currentSection.index('.section') + 1));
505
506                    activateMenuElement(anchorLink);
507                    activateNavDots(anchorLink, 0);
508
509
510                    if(options.anchors.length && !isMoving){
511                        //needed to enter in hashChange event when using the menu with anchor links
512                        lastScrolledDestiny = anchorLink;
513
514                        location.hash = anchorLink;
515                    }
516
517                    //small timeout in order to avoid entering in hashChange event when scrolling is not finished yet
518                    clearTimeout(scrollId);
519                    scrollId = setTimeout(function(){
520                        isScrolling = false;
521                    }, 100);
522                }
523
524            }
525        }
526
527
528        var touchStartY = 0;
529        var touchStartX = 0;
530        var touchEndY = 0;
531        var touchEndX = 0;
532
533        /* Detecting touch events
534
535        * As we are changing the top property of the page on scrolling, we can not use the traditional way to detect it.
536        * This way, the touchstart and the touch moves shows an small difference between them which is the
537        * used one to determine the direction.
538        */
539        function touchMoveHandler(event){
540            var e = event.originalEvent;
541
542            if(options.autoScrolling){
543                //preventing the easing on iOS devices
544                event.preventDefault();
545            }
546
547            // additional: if one of the normalScrollElements isn't within options.normalScrollElementTouchThreshold hops up the DOM chain
548            if (!checkParentForNormalScrollElement(event.target)) {
549
550                var touchMoved = false;
551                var activeSection = $('.section.active');
552                var scrollable;
553
554                if (!isMoving && !slideMoving) { //if theres any #
555                    var touchEvents = getEventsPage(e);
556                    touchEndY = touchEvents['y'];
557                    touchEndX = touchEvents['x'];
558
559                    //if movement in the X axys is greater than in the Y and the currect section has slides...
560                    if (activeSection.find('.slides').length && Math.abs(touchStartX - touchEndX) > (Math.abs(touchStartY - touchEndY))) {
561
562                        //is the movement greater than the minimum resistance to scroll?
563                        if (Math.abs(touchStartX - touchEndX) > ($(window).width() / 100 * options.touchSensitivity)) {
564                            if (touchStartX > touchEndX) {
565                                $.fn.fullpage.moveSlideRight(); //next
566                            } else {
567                                $.fn.fullpage.moveSlideLeft(); //prev
568                            }
569                        }
570                    }
571
572                    //vertical scrolling (only when autoScrolling is enabled)
573                    else if(options.autoScrolling){
574
575                        //if there are landscape slides, we check if the scrolling bar is in the current one or not
576                        if(activeSection.find('.slides').length){
577                            scrollable= activeSection.find('.slide.active').find('.scrollable');
578                        }else{
579                            scrollable = activeSection.find('.scrollable');
580                        }
581
582                        //is the movement greater than the minimum resistance to scroll?
583                        if (Math.abs(touchStartY - touchEndY) > ($(window).height() / 100 * options.touchSensitivity)) {
584                            if (touchStartY > touchEndY) {
585                                if(scrollable.length > 0 ){
586                                    //is the scrollbar at the end of the scroll?
587                                    if(isScrolled('bottom', scrollable)){
588                                        $.fn.fullpage.moveSectionDown();
589                                    }else{
590                                        return true;
591                                    }
592                                }else{
593                                    // moved down
594                                    $.fn.fullpage.moveSectionDown();
595                                }
596                            } else if (touchEndY > touchStartY) {
597
598                                if(scrollable.length > 0){
599                                    //is the scrollbar at the start of the scroll?
600                                    if(isScrolled('top', scrollable)){
601                                        $.fn.fullpage.moveSectionUp();
602                                    }
603                                    else{
604                                        return true;
605                                    }
606                                }else{
607                                    // moved up
608                                    $.fn.fullpage.moveSectionUp();
609                                }
610                            }
611                        }
612                    }
613                }
614            }
615
616        }
617
618        /**
619         * recursive function to loop up the parent nodes to check if one of them exists in options.normalScrollElements
620         * Currently works well for iOS - Android might need some testing
621         * @param  {Element} el  target element / jquery selector (in subsequent nodes)
622         * @param  {int}     hop current hop compared to options.normalScrollElementTouchThreshold
623         * @return {boolean} true if there is a match to options.normalScrollElements
624         */
625        function checkParentForNormalScrollElement (el, hop) {
626            hop = hop || 0;
627            var parent = $(el).parent();
628
629            if (hop < options.normalScrollElementTouchThreshold &&
630                parent.is(options.normalScrollElements) ) {
631                return true;
632            } else if (hop == options.normalScrollElementTouchThreshold) {
633                return false;
634            } else {
635                return checkParentForNormalScrollElement(parent, ++hop);
636            }
637        }
638
639        function touchStartHandler(event){
640            var e = event.originalEvent;
641            var touchEvents = getEventsPage(e);
642            touchStartY = touchEvents['y'];
643            touchStartX = touchEvents['x'];
644        }
645
646
647        /**
648         * Detecting mousewheel scrolling
649         *
650         * http://blogs.sitepointstatic.com/examples/tech/mouse-wheel/index.html
651         * http://www.sitepoint.com/html5-javascript-mouse-wheel/
652         */
653        function MouseWheelHandler(e) {
654            if(options.autoScrolling){
655                // cross-browser wheel delta
656                e = window.event || e;
657                var delta = Math.max(-1, Math.min(1,
658                        (e.wheelDelta || -e.deltaY || -e.detail)));
659                var scrollable;
660                var activeSection = $('.section.active');
661
662                if (!isMoving) { //if theres any #
663
664                    //if there are landscape slides, we check if the scrolling bar is in the current one or not
665                    if(activeSection.find('.slides').length){
666                        scrollable= activeSection.find('.slide.active').find('.scrollable');
667                    }else{
668                        scrollable = activeSection.find('.scrollable');
669                    }
670
671                    //scrolling down?
672                    if (delta < 0) {
673                        if(scrollable.length > 0 ){
674                            //is the scrollbar at the end of the scroll?
675                            if(isScrolled('bottom', scrollable)){
676                                $.fn.fullpage.moveSectionDown();
677                            }else{
678                                return true; //normal scroll
679                            }
680                        }else{
681                            $.fn.fullpage.moveSectionDown();
682                        }
683                    }
684
685                    //scrolling up?
686                    else {
687                        if(scrollable.length > 0){
688                            //is the scrollbar at the start of the scroll?
689                            if(isScrolled('top', scrollable)){
690                                $.fn.fullpage.moveSectionUp();
691                            }else{
692                                return true; //normal scroll
693                            }
694                        }else{
695                            $.fn.fullpage.moveSectionUp();
696                        }
697                    }
698                }
699
700                return false;
701            }
702        }
703
704
705        $.fn.fullpage.moveSectionUp = function(){
706            var prev = $('.section.active').prev('.section');
707
708            //looping to the bottom if there's no more sections above
709            if (!prev.length && (options.loopTop || options.continuousVertical)) {
710                prev = $('.section').last();
711            }
712
713            if (prev.length) {
714                scrollPage(prev, null, true);
715            }
716        };
717
718        $.fn.fullpage.moveSectionDown = function (){
719            var next = $('.section.active').next('.section');
720
721            //looping to the top if there's no more sections below
722            if(!next.length &&
723                (options.loopBottom || options.continuousVertical)){
724                next = $('.section').first();
725            }
726
727            if(next.length > 0 ||
728                (!next.length &&
729                (options.loopBottom || options.continuousVertical))){
730                scrollPage(next, null, false);
731            }
732        };
733
734        $.fn.fullpage.moveTo = function (section, slide){
735            var destiny = '';
736
737            if(isNaN(section)){
738                destiny = $('[data-anchor="'+section+'"]');
739            }else{
740                destiny = $('.section').eq( (section -1) );
741            }
742
743            if (typeof slide !== 'undefined'){
744                scrollPageAndSlide(section, slide);
745            }else if(destiny.length > 0){
746                scrollPage(destiny);
747            }
748        };
749
750        $.fn.fullpage.moveSlideRight = function(){
751            moveSlide('next');
752        };
753
754        $.fn.fullpage.moveSlideLeft = function(){
755            moveSlide('prev');
756        };
757
758        function moveSlide(direction){
759            var activeSection = $('.section.active');
760            var slides = activeSection.find('.slides');
761
762            // more than one slide needed and nothing should be sliding
763            if (!slides.length || slideMoving) {
764                return;
765            }
766
767            var currentSlide = slides.find('.slide.active');
768            var destiny = null;
769
770            if(direction === 'prev'){
771                destiny = currentSlide.prev('.slide');
772            }else{
773                destiny = currentSlide.next('.slide');
774            }
775
776            //isn't there a next slide in the secuence?
777            if(!destiny.length){
778                //respect loopHorizontal settin
779                if (!options.loopHorizontal) return;
780
781                if(direction === 'prev'){
782                    destiny = currentSlide.siblings(':last');
783                }else{
784                    destiny = currentSlide.siblings(':first');
785                }
786            }
787
788            slideMoving = true;
789
790            landscapeScroll(slides, destiny);
791        }
792
793        function scrollPage(element, callback, isMovementUp){
794            var scrollOptions = {}, scrolledElement;
795            var dest = element.position();
796            if(typeof dest === "undefined"){ return; } //there's no element to scroll, leaving the function
797            var dtop = dest.top;
798            var yMovement = getYmovement(element);
799            var anchorLink  = element.data('anchor');
800            var sectionIndex = element.index('.section');
801            var activeSlide = element.find('.slide.active');
802            var activeSection = $('.section.active');
803            var leavingSection = activeSection.index('.section') + 1;
804
805            //caching the value of isResizing at the momment the function is called
806            //because it will be checked later inside a setTimeout and the value might change
807            var localIsResizing = isResizing;
808
809            if(activeSlide.length){
810                var slideAnchorLink = activeSlide.data('anchor');
811                var slideIndex = activeSlide.index();
812            }
813
814            // If continuousVertical && we need to wrap around
815            if (options.autoScrolling && options.continuousVertical && typeof (isMovementUp) !== "undefined" &&
816                ((!isMovementUp && yMovement == 'up') || // Intending to scroll down but about to go up or
817                (isMovementUp && yMovement == 'down'))) { // intending to scroll up but about to go down
818
819                // Scrolling down
820                if (!isMovementUp) {
821                    // Move all previous sections to after the active section
822                    $(".section.active").after(activeSection.prevAll(".section").get().reverse());
823                }
824                else { // Scrolling up
825                    // Move all next sections to before the active section
826                    $(".section.active").before(activeSection.nextAll(".section"));
827                }
828
829                // Maintain the displayed position (now that we changed the element order)
830                silentScroll($('.section.active').position().top);
831
832                // save for later the elements that still need to be reordered
833                var wrapAroundElements = activeSection;
834
835                // Recalculate animation variables
836                dest = element.position();
837                dtop = dest.top;
838                yMovement = getYmovement(element);
839            }
840
841
842            element.addClass('active').siblings().removeClass('active');
843
844            //preventing from activating the MouseWheelHandler event
845            //more than once if the page is scrolling
846            isMoving = true;
847
848            if(typeof anchorLink !== 'undefined'){
849                setURLHash(slideIndex, slideAnchorLink, anchorLink);
850            }
851
852            if(options.autoScrolling){
853                scrollOptions['top'] = -dtop;
854                scrolledElement = '.'+wrapperSelector;
855            }else{
856                scrollOptions['scrollTop'] = dtop;
857                scrolledElement = 'html, body';
858            }
859
860            // Fix section order after continuousVertical changes have been animated
861            var continuousVerticalFixSectionOrder = function () {
862                // If continuousVertical is in effect (and autoScrolling would also be in effect then),
863                // finish moving the elements around so the direct navigation will function more simply
864                if (!wrapAroundElements || !wrapAroundElements.length) {
865                    return;
866                }
867
868                if (isMovementUp) {
869                    $('.section:first').before(wrapAroundElements);
870                }
871                else {
872                    $('.section:last').after(wrapAroundElements);
873                }
874
875                silentScroll($('.section.active').position().top);
876            };
877
878
879            // Use CSS3 translate functionality or...
880            if (options.css3 && options.autoScrolling) {
881
882                //callback (onLeave) if the site is not just resizing and readjusting the slides
883                $.isFunction(options.onLeave) && !localIsResizing && options.onLeave.call(this, leavingSection, (sectionIndex + 1), yMovement);
884
885
886                var translate3d = 'translate3d(0px, -' + dtop + 'px, 0px)';
887                transformContainer(translate3d, true);
888
889                setTimeout(function () {
890                    //fix section order from continuousVertical
891                    continuousVerticalFixSectionOrder();
892
893                    //callback (afterLoad)  if the site is not just resizing and readjusting the slides
894                    $.isFunction(options.afterLoad) && !localIsResizing && options.afterLoad.call(this, anchorLink, (sectionIndex + 1));
895
896                    setTimeout(function () {
897                        isMoving = false;
898                        $.isFunction(callback) && callback.call(this);
899                    }, scrollDelay);
900                }, options.scrollingSpeed);
901            } else { // ... use jQuery animate
902
903                //callback (onLeave) if the site is not just resizing and readjusting the slides
904                $.isFunction(options.onLeave) && !localIsResizing && options.onLeave.call(this, leavingSection, (sectionIndex + 1), yMovement);
905
906                $(scrolledElement).animate(
907                    scrollOptions
908                , options.scrollingSpeed, options.easing, function () {
909                    //fix section order from continuousVertical
910                    continuousVerticalFixSectionOrder();
911
912                    //callback (afterLoad) if the site is not just resizing and readjusting the slides
913                    $.isFunction(options.afterLoad) && !localIsResizing && options.afterLoad.call(this, anchorLink, (sectionIndex + 1));
914
915                    setTimeout(function () {
916                        isMoving = false;
917                        $.isFunction(callback) && callback.call(this);
918                    }, scrollDelay);
919                });
920            }
921
922            //flag to avoid callingn `scrollPage()` twice in case of using anchor links
923            lastScrolledDestiny = anchorLink;
924
925            //avoid firing it twice (as it does also on scroll)
926            if(options.autoScrolling){
927                activateMenuElement(anchorLink);
928                activateNavDots(anchorLink, sectionIndex);
929            }
930        }
931
932        function scrollToAnchor(){
933            //getting the anchor link in the URL and deleting the `#`
934            var value =  window.location.hash.replace('#', '').split('/');
935            var section = value[0];
936            var slide = value[1];
937
938            if(section){  //if theres any #
939                scrollPageAndSlide(section, slide);
940            }
941        }
942
943        //detecting any change on the URL to scroll to the given anchor link
944        //(a way to detect back history button as we play with the hashes on the URL)
945        $(window).on('hashchange', hashChangeHandler);
946
947        function hashChangeHandler(){
948            if(!isScrolling){
949                var value =  window.location.hash.replace('#', '').split('/');
950                var section = value[0];
951                var slide = value[1];
952
953                //when moving to a slide in the first section for the first time (first time to add an anchor to the URL)
954                var isFirstSlideMove =  (typeof lastScrolledDestiny === 'undefined');
955                var isFirstScrollMove = (typeof lastScrolledDestiny === 'undefined' && typeof slide === 'undefined' && !slideMoving);
956
957                /*in order to call scrollpage() only once for each destination at a time
958                It is called twice for each scroll otherwise, as in case of using anchorlinks `hashChange`
959                event is fired on every scroll too.*/
960                if ((section && section !== lastScrolledDestiny) && !isFirstSlideMove || isFirstScrollMove || (!slideMoving && lastScrolledSlide != slide ))  {
961                    scrollPageAndSlide(section, slide);
962                }
963            }
964        }
965
966
967        /**
968         * Sliding with arrow keys, both, vertical and horizontal
969         */
970        $(document).keydown(function(e) {
971            //Moving the main page with the keyboard arrows if keyboard scrolling is enabled
972            if (options.keyboardScrolling && !isMoving) {
973                switch (e.which) {
974                    //up
975                    case 38:
976                    case 33:
977                        $.fn.fullpage.moveSectionUp();
978                        break;
979
980                    //down
981                    case 40:
982                    case 34:
983                        $.fn.fullpage.moveSectionDown();
984                        break;
985
986                    //Home
987                    case 36:
988                        $.fn.fullpage.moveTo(1);
989                        break;
990
991                    //End
992                    case 35:
993                        $.fn.fullpage.moveTo( $('.section').length );
994                        break;
995
996                    //left
997                    case 37:
998                        $.fn.fullpage.moveSlideLeft();
999                        break;
1000
1001                    //right
1002                    case 39:
1003                        $.fn.fullpage.moveSlideRight();
1004                        break;
1005
1006                    default:
1007                        return; // exit this handler for other keys
1008                }
1009            }
1010        });
1011
1012        //navigation action
1013        $(document).on('click', '#fullPage-nav a', function(e){
1014            e.preventDefault();
1015            var index = $(this).parent().index();
1016            scrollPage($('.section').eq(index));
1017        });
1018
1019        //navigation tooltips
1020        $(document).on({
1021            mouseenter: function(){
1022                var tooltip = $(this).data('tooltip');
1023                $('<div class="fullPage-tooltip ' + options.navigationPosition +'">' + tooltip + '</div>').hide().appendTo($(this)).fadeIn(200);
1024            },
1025            mouseleave: function(){
1026                $(this).find('.fullPage-tooltip').fadeOut().remove();
1027            }
1028        }, '#fullPage-nav li');
1029
1030
1031        if(options.normalScrollElements){
1032            $(document).on('mouseover', options.normalScrollElements, function () {
1033                $.fn.fullpage.setMouseWheelScrolling(false);
1034            });
1035
1036            $(document).on('mouseout', options.normalScrollElements, function(){
1037                $.fn.fullpage.setMouseWheelScrolling(true);
1038            });
1039        }
1040
1041        /**
1042         * Scrolling horizontally when clicking on the slider controls.
1043         */
1044        $('.section').on('click', '.controlArrow', function() {
1045            if ($(this).hasClass('prev')) {
1046                $.fn.fullpage.moveSlideLeft();
1047            } else {
1048                $.fn.fullpage.moveSlideRight();
1049            }
1050        });
1051
1052
1053        /**
1054         * Scrolling horizontally when clicking on the slider controls.
1055         */
1056        $('.section').on('click', '.toSlide', function(e) {
1057            e.preventDefault();
1058
1059            var slides = $(this).closest('.section').find('.slides');
1060            var currentSlide = slides.find('.slide.active');
1061            var destiny = null;
1062
1063            destiny = slides.find('.slide').eq( ($(this).data('index') -1) );
1064
1065            if(destiny.length > 0){
1066                landscapeScroll(slides, destiny);
1067            }
1068        });
1069
1070        /**
1071        * Scrolls horizontal sliders.
1072        */
1073        function landscapeScroll(slides, destiny){
1074            var destinyPos = destiny.position();
1075            var slidesContainer = slides.find('.slidesContainer').parent();
1076            var slideIndex = destiny.index();
1077            var section = slides.closest('.section');
1078            var sectionIndex = section.index('.section');
1079            var anchorLink = section.data('anchor');
1080            var slidesNav = section.find('.fullPage-slidesNav');
1081            var slideAnchor = destiny.data('anchor');
1082
1083            //caching the value of isResizing at the momment the function is called
1084            //because it will be checked later inside a setTimeout and the value might change
1085            var localIsResizing = isResizing;
1086
1087            if(options.onSlideLeave){
1088                var prevSlideIndex = section.find('.slide.active').index();
1089                var xMovement = getXmovement(prevSlideIndex, slideIndex);
1090
1091                //if the site is not just resizing and readjusting the slides
1092                if(!localIsResizing){
1093                    $.isFunction( options.onSlideLeave ) && options.onSlideLeave.call( this, anchorLink, (sectionIndex + 1), prevSlideIndex, xMovement);
1094                }
1095            }
1096
1097            destiny.addClass('active').siblings().removeClass('active');
1098
1099
1100            if(typeof slideAnchor === 'undefined'){
1101                slideAnchor = slideIndex;
1102            }
1103
1104            //only changing the URL if the slides are in the current section (not for resize re-adjusting)
1105            if(section.hasClass('active')){
1106
1107                if(!options.loopHorizontal){
1108                    //hidding it for the fist slide, showing for the rest
1109                    section.find('.controlArrow.prev').toggle(slideIndex!=0);
1110
1111                    //hidding it for the last slide, showing for the rest
1112                    section.find('.controlArrow.next').toggle(!destiny.is(':last-child'));
1113                }
1114
1115                setURLHash(slideIndex, slideAnchor, anchorLink);
1116            }
1117
1118            if(options.css3){
1119                var translate3d = 'translate3d(-' + destinyPos.left + 'px, 0px, 0px)';
1120
1121                slides.find('.slidesContainer').toggleClass('easing', options.scrollingSpeed>0).css(getTransforms(translate3d));
1122
1123                setTimeout(function(){
1124                    //if the site is not just resizing and readjusting the slides
1125                    if(!localIsResizing){
1126                        $.isFunction( options.afterSlideLoad ) && options.afterSlideLoad.call( this, anchorLink, (sectionIndex + 1), slideAnchor, slideIndex );
1127                    }
1128
1129                    slideMoving = false;
1130                }, options.scrollingSpeed, options.easing);
1131            }else{
1132                slidesContainer.animate({
1133                    scrollLeft : destinyPos.left
1134                }, options.scrollingSpeed, options.easing, function() {
1135
1136                    //if the site is not just resizing and readjusting the slides
1137                    if(!localIsResizing){
1138                        $.isFunction( options.afterSlideLoad ) && options.afterSlideLoad.call( this, anchorLink, (sectionIndex + 1), slideAnchor, slideIndex);
1139                    }
1140                    //letting them slide again
1141                    slideMoving = false;
1142                });
1143            }
1144
1145            slidesNav.find('.active').removeClass('active');
1146            slidesNav.find('li').eq(slideIndex).find('a').addClass('active');
1147        }
1148
1149
1150        if (!isTouchDevice) {
1151            var resizeId;
1152
1153            //when resizing the site, we adjust the heights of the sections
1154            $(window).resize(function() {
1155                //in order to call the functions only when the resize is finished
1156                //http://stackoverflow.com/questions/4298612/jquery-how-to-call-resize-event-only-once-its-finished-resizing
1157                clearTimeout(resizeId);
1158                resizeId = setTimeout($.fn.fullpage.reBuild, 500);
1159            });
1160
1161        }
1162
1163
1164        var supportsOrientationChange = "onorientationchange" in window,
1165        orientationEvent = supportsOrientationChange ? "orientationchange" : "resize";
1166
1167        $(window).bind(orientationEvent , function() {
1168            if(isTouchDevice){
1169                $.fn.fullpage.reBuild();
1170            }
1171        });
1172
1173
1174        /**
1175         * When resizing is finished, we adjust the slides sizes and positions
1176         */
1177        $.fn.fullpage.reBuild = function(){
1178            isResizing = true;
1179
1180            var windowsWidth = $(window).width();
1181            windowsHeight = $(window).height();
1182
1183            //text and images resizing
1184            if (options.resize) {
1185                resizeMe(windowsHeight, windowsWidth);
1186            }
1187
1188            $('.section').each(function(){
1189                var scrollHeight = windowsHeight - parseInt($(this).css('padding-bottom')) - parseInt($(this).css('padding-top'));
1190
1191                //adjusting the height of the table-cell for IE and Firefox
1192                if(options.verticalCentered){
1193                    $(this).find('.tableCell').css('height', getTableHeight($(this)) + 'px');
1194                }
1195
1196                $(this).css('height', windowsHeight + 'px');
1197
1198                //resizing the scrolling divs
1199                if(options.scrollOverflow){
1200                    var slides = $(this).find('.slide');
1201
1202                    if(slides.length){
1203                        slides.each(function(){
1204                            createSlimScrolling($(this));
1205                        });
1206                    }else{
1207                        createSlimScrolling($(this));
1208                    }
1209
1210                }
1211
1212                //adjusting the position fo the FULL WIDTH slides...
1213                var slides = $(this).find('.slides');
1214                if (slides.length) {
1215                    landscapeScroll(slides, slides.find('.slide.active'));
1216                }
1217            });
1218
1219            //adjusting the position for the current section
1220            var destinyPos = $('.section.active').position();
1221
1222            var activeSection = $('.section.active');
1223
1224            //isn't it the first section?
1225            if(activeSection.index('.section')){
1226                scrollPage(activeSection);
1227            }
1228
1229            isResizing = false;
1230            $.isFunction( options.afterResize ) && options.afterResize.call( this);
1231        }
1232
1233        /**
1234         * Resizing of the font size depending on the window size as well as some of the images on the site.
1235         */
1236        function resizeMe(displayHeight, displayWidth) {
1237            //Standard height, for which the body font size is correct
1238            var preferredHeight = 825;
1239            var windowSize = displayHeight;
1240
1241            /* Problem to be solved
1242
1243            if (displayHeight < 825) {
1244                var percentage = (windowSize * 100) / preferredHeight;
1245                var newFontSize = percentage.toFixed(2);
1246
1247                $("img").each(function() {
1248                    var newWidth = ((80 * percentage) / 100).toFixed(2);
1249                    $(this).css("width", newWidth + '%');
1250                });
1251            } else {
1252                $("img").each(function() {
1253                    $(this).css("width", '');
1254                });
1255            }*/
1256
1257            if (displayHeight < 825 || displayWidth < 900) {
1258                if (displayWidth < 900) {
1259                    windowSize = displayWidth;
1260                    preferredHeight = 900;
1261                }
1262                var percentage = (windowSize * 100) / preferredHeight;
1263                var newFontSize = percentage.toFixed(2);
1264
1265                $("body").css("font-size", newFontSize + '%');
1266            } else {
1267                $("body").css("font-size", '100%');
1268            }
1269        }
1270
1271        /**
1272         * Activating the website navigation dots according to the given slide name.
1273         */
1274        function activateNavDots(name, sectionIndex){
1275            if(options.navigation){
1276                $('#fullPage-nav').find('.active').removeClass('active');
1277                if(name){
1278                    $('#fullPage-nav').find('a[href="#' + name + '"]').addClass('active');
1279                }else{
1280                    $('#fullPage-nav').find('li').eq(sectionIndex).find('a').addClass('active');
1281                }
1282            }
1283        }
1284
1285        /**
1286         * Activating the website main menu elements according to the given slide name.
1287         */
1288        function activateMenuElement(name){
1289            if(options.menu){
1290                $(options.menu).find('.active').removeClass('active');
1291                $(options.menu).find('[data-menuanchor="'+name+'"]').addClass('active');
1292            }
1293        }
1294
1295        /**
1296        * Return a boolean depending on whether the scrollable element is at the end or at the start of the scrolling
1297        * depending on the given type.
1298        */
1299        function isScrolled(type, scrollable){
1300            if(type === 'top'){
1301                return !scrollable.scrollTop();
1302            }else if(type === 'bottom'){
1303                return scrollable.scrollTop() + 1 + scrollable.innerHeight() >= scrollable[0].scrollHeight;
1304            }
1305        }
1306
1307        /**
1308        * Retuns `up` or `down` depending on the scrolling movement to reach its destination
1309        * from the current section.
1310        */
1311        function getYmovement(destiny){
1312            var fromIndex = $('.section.active').index('.section');
1313            var toIndex = destiny.index('.section');
1314
1315            if(fromIndex > toIndex){
1316                return 'up';
1317            }
1318            return 'down';
1319        }
1320
1321        /**
1322        * Retuns `right` or `left` depending on the scrolling movement to reach its destination
1323        * from the current slide.
1324        */
1325        function getXmovement(fromIndex, toIndex){
1326            if( fromIndex == toIndex){
1327                return 'none'
1328            }
1329            if(fromIndex > toIndex){
1330                return 'left';
1331            }
1332            return 'right';
1333        }
1334
1335
1336        function createSlimScrolling(element){
1337            //needed to make `scrollHeight` work under Opera 12
1338            element.css('overflow', 'hidden');
1339
1340            //in case element is a slide
1341            var section = element.closest('.section');
1342            var scrollable = element.find('.scrollable');
1343
1344            //if there was scroll, the contentHeight will be the one in the scrollable section
1345            if(scrollable.length){
1346                var contentHeight = element.find('.scrollable').get(0).scrollHeight;
1347            }else{
1348                var contentHeight = element.get(0).scrollHeight;
1349                if(options.verticalCentered){
1350                    contentHeight = element.find('.tableCell').get(0).scrollHeight;
1351                }
1352            }
1353
1354            var scrollHeight = windowsHeight - parseInt(section.css('padding-bottom')) - parseInt(section.css('padding-top'));
1355
1356            //needs scroll?
1357            if ( contentHeight > scrollHeight) {
1358                //was there already an scroll ? Updating it
1359                if(scrollable.length){
1360                    scrollable.css('height', scrollHeight + 'px').parent().css('height', scrollHeight + 'px');
1361                }
1362                //creating the scrolling
1363                else{
1364                    if(options.verticalCentered){
1365                        element.find('.tableCell').wrapInner('<div class="scrollable" />');
1366                    }else{
1367                        element.wrapInner('<div class="scrollable" />');
1368                    }
1369
1370
1371                    element.find('.scrollable').slimScroll({
1372                        height: scrollHeight + 'px',
1373                        size: '10px',
1374                        alwaysVisible: true
1375                    });
1376                }
1377            }
1378
1379            //removing the scrolling when it is not necessary anymore
1380            else{
1381                removeSlimScroll(element);
1382            }
1383
1384            //undo
1385            element.css('overflow', '');
1386        }
1387
1388        function removeSlimScroll(element){
1389            element.find('.scrollable').children().first().unwrap().unwrap();
1390            element.find('.slimScrollBar').remove();
1391            element.find('.slimScrollRail').remove();
1392        }
1393
1394        function addTableClass(element){
1395            element.addClass('table').wrapInner('<div class="tableCell" style="height:' + getTableHeight(element) + 'px;" />');
1396        }
1397
1398        function getTableHeight(element){
1399            var sectionHeight = windowsHeight;
1400
1401            if(options.paddingTop || options.paddingBottom){
1402                var section = element;
1403                if(!section.hasClass('section')){
1404                    section = element.closest('.section');
1405                }
1406
1407                var paddings = parseInt(section.css('padding-top')) + parseInt(section.css('padding-bottom'));
1408                sectionHeight = (windowsHeight - paddings);
1409            }
1410
1411            return sectionHeight;
1412        }
1413
1414        /**
1415        * Adds a css3 transform property to the container class with or without animation depending on the animated param.
1416        */
1417        function transformContainer(translate3d, animated){
1418            container.toggleClass('easing', animated);
1419
1420            container.css(getTransforms(translate3d));
1421        }
1422
1423
1424        /**
1425        * Scrolls to the given section and slide
1426        */
1427        function scrollPageAndSlide(destiny, slide){
1428            if (typeof slide === 'undefined') {
1429                slide = 0;
1430            }
1431
1432            if(isNaN(destiny)){
1433                var section = $('[data-anchor="'+destiny+'"]');
1434            }else{
1435                var section = $('.section').eq( (destiny -1) );
1436            }
1437
1438
1439            //we need to scroll to the section and then to the slide
1440            if (destiny !== lastScrolledDestiny && !section.hasClass('active')){
1441                scrollPage(section, function(){
1442                    scrollSlider(section, slide)
1443                });
1444            }
1445            //if we were already in the section
1446            else{
1447                scrollSlider(section, slide);
1448            }
1449
1450        }
1451
1452        /**
1453        * Scrolls the slider to the given slide destination for the given section
1454        */
1455        function scrollSlider(section, slide){
1456            if(typeof slide != 'undefined'){
1457                var slides = section.find('.slides');
1458                var destiny =  slides.find('[data-anchor="'+slide+'"]');
1459
1460                if(!destiny.length){
1461                    destiny = slides.find('.slide').eq(slide);
1462                }
1463
1464                if(destiny.length){
1465                    landscapeScroll(slides, destiny);
1466                }
1467            }
1468        }
1469
1470        /**
1471        * Creates a landscape navigation bar with dots for horizontal sliders.
1472        */
1473        function addSlidesNavigation(section, numSlides){
1474            section.append('<div class="fullPage-slidesNav"><ul></ul></div>');
1475            var nav = section.find('.fullPage-slidesNav');
1476
1477            //top or bottom
1478            nav.addClass(options.slidesNavPosition);
1479
1480            for(var i=0; i< numSlides; i++){
1481                nav.find('ul').append('<li><a href="#"><span></span></a></li>');
1482            }
1483
1484            //centering it
1485            nav.css('margin-left', '-' + (nav.width()/2) + 'px');
1486
1487            nav.find('li').first().find('a').addClass('active');
1488        }
1489
1490
1491        /**
1492        * Sets the URL hash for a section with slides
1493        */
1494        function setURLHash(slideIndex, slideAnchor, anchorLink){
1495            var sectionHash = '';
1496
1497            if(options.anchors.length){
1498
1499                //isn't it the first slide?
1500                if(slideIndex){
1501                    if(typeof anchorLink !== 'undefined'){
1502                        sectionHash = anchorLink;
1503                    }
1504
1505                    //slide without anchor link? We take the index instead.
1506                    if(typeof slideAnchor === 'undefined'){
1507                        slideAnchor = slideIndex;
1508                    }
1509
1510                    lastScrolledSlide = slideAnchor;
1511                    location.hash = sectionHash + '/' + slideAnchor;
1512
1513                //first slide won't have slide anchor, just the section one
1514                }else if(typeof slideIndex !== 'undefined'){
1515                    lastScrolledSlide = slideAnchor;
1516                    location.hash = anchorLink;
1517                }
1518
1519                //section without slides
1520                else{
1521                    location.hash = anchorLink;
1522                }
1523            }
1524        }
1525
1526        /**
1527        * Scrolls the slider to the given slide destination for the given section
1528        */
1529        $(document).on('click', '.fullPage-slidesNav a', function(e){
1530            e.preventDefault();
1531            var slides = $(this).closest('.section').find('.slides');
1532            var destiny = slides.find('.slide').eq($(this).closest('li').index());
1533
1534            landscapeScroll(slides, destiny);
1535        });
1536
1537
1538        /**
1539        * Checks for translate3d support
1540        * @return boolean
1541        * http://stackoverflow.com/questions/5661671/detecting-transform-translate3d-support
1542        */
1543        function support3d() {
1544            var el = document.createElement('p'),
1545                has3d,
1546                transforms = {
1547                    'webkitTransform':'-webkit-transform',
1548                    'OTransform':'-o-transform',
1549                    'msTransform':'-ms-transform',
1550                    'MozTransform':'-moz-transform',
1551                    'transform':'transform'
1552                };
1553
1554            // Add it to the body to get the computed style.
1555            document.body.insertBefore(el, null);
1556
1557            for (var t in transforms) {
1558                if (el.style[t] !== undefined) {
1559                    el.style[t] = "translate3d(1px,1px,1px)";
1560                    has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);
1561                }
1562            }
1563
1564            document.body.removeChild(el);
1565
1566            return (has3d !== undefined && has3d.length > 0 && has3d !== "none");
1567        }
1568
1569
1570
1571        /**
1572        * Removes the auto scrolling action fired by the mouse wheel and tackpad.
1573        * After this function is called, the mousewheel and trackpad movements won't scroll through sections.
1574        */
1575        function removeMouseWheelHandler(){
1576            if (document.addEventListener) {
1577                document.removeEventListener('mousewheel', MouseWheelHandler, false); //IE9, Chrome, Safari, Oper
1578                document.removeEventListener('wheel', MouseWheelHandler, false); //Firefox
1579            } else {
1580                document.detachEvent("onmousewheel", MouseWheelHandler); //IE 6/7/8
1581            }
1582        }
1583
1584
1585        /**
1586        * Adds the auto scrolling action for the mouse wheel and tackpad.
1587        * After this function is called, the mousewheel and trackpad movements will scroll through sections
1588        */
1589        function addMouseWheelHandler(){
1590            if (document.addEventListener) {
1591                document.addEventListener("mousewheel", MouseWheelHandler, false); //IE9, Chrome, Safari, Oper
1592                document.addEventListener("wheel", MouseWheelHandler, false); //Firefox
1593            } else {
1594                document.attachEvent("onmousewheel", MouseWheelHandler); //IE 6/7/8
1595            }
1596        }
1597
1598
1599        /**
1600        * Adds the possibility to auto scroll through sections on touch devices.
1601        */
1602        function addTouchHandler(){
1603            if(isTouchDevice){
1604                //Microsoft pointers
1605                MSPointer = getMSPointer();
1606
1607                $(document).off('touchstart ' +  MSPointer.down).on('touchstart ' + MSPointer.down, touchStartHandler);
1608                $(document).off('touchmove ' + MSPointer.move).on('touchmove ' + MSPointer.move, touchMoveHandler);
1609            }
1610        }
1611
1612        /**
1613        * Removes the auto scrolling for touch devices.
1614        */
1615        function removeTouchHandler(){
1616            if(isTouchDevice){
1617                //Microsoft pointers
1618                MSPointer = getMSPointer();
1619
1620                $(document).off('touchstart ' + MSPointer.down);
1621                $(document).off('touchmove ' + MSPointer.move);
1622            }
1623        }
1624
1625
1626        /*
1627        * Returns and object with Microsoft pointers (for IE<11 and for IE >= 11)
1628        * http://msdn.microsoft.com/en-us/library/ie/dn304886(v=vs.85).aspx
1629        */
1630        function getMSPointer(){
1631            var pointer;
1632
1633            //IE >= 11
1634            if(window.PointerEvent){
1635                pointer = { down: "pointerdown", move: "pointermove"};
1636            }
1637
1638            //IE < 11
1639            else{
1640                pointer = { down: "MSPointerDown", move: "MSPointerMove"};
1641            }
1642
1643            return pointer;
1644        }
1645        /**
1646        * Gets the pageX and pageY properties depending on the browser.
1647        * https://github.com/alvarotrigo/fullPage.js/issues/194#issuecomment-34069854
1648        */
1649        function getEventsPage(e){
1650            var events = new Array();
1651            if (window.navigator.msPointerEnabled){
1652                events['y'] = e.pageY;
1653                events['x'] = e.pageX;
1654            }else{
1655                events['y'] = e.touches[0].pageY;
1656                events['x'] =  e.touches[0].pageX;
1657            }
1658
1659            return events;
1660        }
1661
1662        function silentScroll(top){
1663            if (options.css3) {
1664                var translate3d = 'translate3d(0px, -' + top + 'px, 0px)';
1665                transformContainer(translate3d, false);
1666            }
1667            else {
1668                container.css("top", -top);
1669            }
1670        }
1671
1672        function getTransforms(translate3d){
1673            return {
1674                '-webkit-transform': translate3d,
1675                '-moz-transform': translate3d,
1676                '-ms-transform':translate3d,
1677                'transform': translate3d
1678            };
1679        }
1680
1681
1682        /*
1683        * Destroys fullpage.js plugin events and optinally its html markup and styles
1684        */
1685        $.fn.fullpage.destroy = function(all){
1686            $.fn.fullpage.setAutoScrolling(false);
1687            $.fn.fullpage.setAllowScrolling(false);
1688            $.fn.fullpage.setKeyboardScrolling(false);
1689
1690
1691            $(window)
1692                .off('scroll', scrollHandler)
1693                .off('hashchange', hashChangeHandler);
1694
1695            $(document)
1696                .off('click', '#fullPage-nav a')
1697                .off('mouseenter', '#fullPage-nav li')
1698                .off('mouseleave', '#fullPage-nav li')
1699                .off('click', '.fullPage-slidesNav a')
1700                .off('mouseover', options.normalScrollElements)
1701                .off('mouseout', options.normalScrollElements);
1702
1703            $('.section')
1704                .off('click', '.controlArrow')
1705                .off('click', '.toSlide');
1706
1707            //lets make a mess!
1708            if(all){
1709                destroyStructure();
1710            }
1711        };
1712
1713        /*
1714        * Removes inline styles added by fullpage.js
1715        */
1716        function destroyStructure(){
1717            //reseting the `top` or `translate` properties to 0
1718            silentScroll(0);
1719
1720            $('#fullPage-nav, .fullPage-slidesNav, .controlArrow').remove();
1721
1722            //removing inline styles
1723            $('.section').css( {
1724                'height': '',
1725                'background-color' : '',
1726                'padding': ''
1727            });
1728
1729            $('.slide').css( {
1730                'width': ''
1731            });
1732
1733            container.css({
1734                'height': '',
1735                'position': '',
1736                '-ms-touch-action': ''
1737            });
1738
1739            //removing added classes
1740            $('.section, .slide').each(function(){
1741                removeSlimScroll($(this));
1742                $(this).removeClass('table active');
1743            })
1744
1745            container.find('.easing').removeClass('easing');
1746
1747            //Unwrapping content
1748            container.find('.tableCell, .slidesContainer, .slides').each(function(){
1749                //unwrap not being use in case there's no child element inside and its just text
1750                $(this).replaceWith(this.childNodes);
1751            });
1752
1753            //scrolling the page to the top with no animation
1754            $('html, body').scrollTop(0);
1755
1756            //to know if the plugin was already used in case it is used in a future again
1757            container.addClass('fullpage-used');
1758        }
1759
1760    };
1761
1762})(jQuery);
1763;
1764
1765/**
1766 * Ajax Portfolio
1767 */
1768(function ($, window, document, undefined) {
1769        "use strict";
1770        var pluginName = "ajaxPortfolio",
1771                defaults = {
1772                        propertyName: "value",
1773                        extraOffset: 100
1774                };
1775
1776        function Plugin(element, options) {
1777                this.element = $(element);
1778                this.settings = $.extend({}, defaults, options);
1779                this.init();
1780
1781        }
1782        Plugin.prototype = {
1783                init: function () {
1784                        var obj = this;
1785                        this.grid = this.element.find('.mk-portfolio-container'), 
1786                        this.items = this.grid.children();
1787
1788                        if (this.items.length < 1) return false; //If no items was found then exit
1789                        this.ajaxDiv = this.element.find('div.ajax-container'), 
1790                        this.filter = this.element.find('#mk-filter-portfolio'), 
1791                        this.loader = this.element.find('.portfolio-loader'), 
1792                        this.triggers = this.items.find('.project-load'), 
1793                        this.closeBtn = this.ajaxDiv.find('.close-ajax'), 
1794                        this.nextBtn = this.ajaxDiv.find('.next-ajax'), 
1795                        this.prevBtn = this.ajaxDiv.find('.prev-ajax'), 
1796                        this.api = {}, 
1797                        this.id = null, 
1798                        this.win = $(window), 
1799                        this.current = 0, 
1800                        this.breakpointT = 989, 
1801                        this.breakpointP = 767, 
1802                        this.columns = this.grid.data('columns'), 
1803                        this.real_col = this.columns;
1804                        this.loader.fadeIn();
1805                        if (this.items.length == 1) {
1806                                this.nextBtn.remove();
1807                                this.prevBtn.remove();
1808                        }
1809                        this.grid.waitForImages(function () {
1810                                obj.loader.fadeOut();
1811                                obj.bind_handler();
1812                        });
1813
1814                },
1815
1816                bind_handler: function () {
1817                        var obj = this; // Temp instance of this object
1818                        // Bind the filters with isotope
1819                        obj.filter.find('a').click(function () {
1820                                obj.triggers.removeClass('active');
1821                                obj.grid.removeClass('grid-open');
1822                                obj.close_project();
1823                                obj.filter.find('a').removeClass('active_sort');
1824                                $(this).addClass('active_sort');
1825                                var selector = $(this).attr('data-filter');
1826                                obj.grid.isotope({
1827                                        filter: selector
1828                                });
1829                                return false;
1830                        });
1831
1832                        obj.triggers.on('click', function () {
1833
1834                                var clicked = $(this),
1835                                        clickedParent = clicked.parents('.mk-portfolio-item');
1836
1837                                obj.current = clickedParent.index();
1838
1839                                if (clicked.hasClass('active')) return false;
1840
1841                                obj.close_project();
1842
1843                                obj.triggers.removeClass('active');
1844                                clicked.addClass('active');
1845                                obj.grid.addClass('grid-open');
1846                                obj.loader.fadeIn();
1847
1848                                obj.id = clicked.data('post-id');
1849
1850                                obj.load_project();
1851
1852                                return false;
1853
1854                        });
1855
1856                        obj.nextBtn.on('click', function () {
1857                                if (obj.current == obj.triggers.length - 1) {
1858                                        obj.triggers.eq(0).trigger('click');
1859                                        return false;
1860                                } else {
1861                                        obj.triggers.eq(obj.current + 1).trigger('click');
1862                                        return false;
1863                                }
1864
1865                        });
1866
1867                        obj.prevBtn.on('click', function () {
1868                                if (obj.current == 0) {
1869                                        obj.triggers.eq(obj.triggers.length - 1).trigger('click');
1870                                        return false;
1871                                } else {
1872                                        obj.triggers.eq(obj.current - 1).trigger('click');
1873                                        return false;
1874                                }
1875
1876                        });
1877
1878                        // Bind close button
1879                        obj.closeBtn.on('click', function () {
1880                                obj.close_project();
1881                                obj.triggers.removeClass('active');
1882                                obj.grid.removeClass('grid-open');
1883                                return false;
1884                        });
1885
1886
1887                },
1888                // Function to close the ajax container div
1889                close_project: function () {
1890                        var obj = this,
1891                                // Temp instance of this object
1892                                project = obj.ajaxDiv.find('.ajax_project'),
1893                                newH = project.actual('outerHeight');
1894
1895                        obj.ajaxDiv.find('iframe').attr('src', '');
1896
1897
1898                        if (obj.ajaxDiv.height() > 0) {
1899                                obj.ajaxDiv.css('height', newH + 'px').transition({
1900                                        height: 0,
1901                                        opacity: 0
1902                                }, 600);
1903                        } else {
1904                                obj.ajaxDiv.transition({
1905                                        height: 0,
1906                                        opacity: 0
1907                                }, 600);
1908                        }
1909                },
1910                load_project: function () {
1911                        var obj = this;
1912                        $.post(ajaxurl, {
1913                                action: 'mk_ajax_portfolio',
1914                                id: obj.id
1915                        }, function (response) {
1916                                obj.ajaxDiv.find('.ajax_project').remove();
1917                                obj.ajaxDiv.append(response);
1918                                obj.project_factory();
1919                                mk_ajax_lightbox_init();
1920                                mk_click_events();
1921                                mk_theme_toggle_box();
1922                                mk_social_share_global();
1923                                mk_swipe_slider_init();
1924                                setTimeout(function () {
1925                                        mk_flexslider_init();
1926                                        mk_load_isotop_enabled_scripts();
1927                                }, 1000);
1928                                mk_gallery();
1929
1930                        });
1931                },
1932                project_factory: function () {
1933                        var obj = this,
1934                                project = this.ajaxDiv.find('.ajax_project');
1935
1936
1937
1938                        project.waitForImages(function () {
1939                                $('html:not(:animated),body:not(:animated)').animate({
1940                                        scrollTop: obj.ajaxDiv.offset().top -160 -obj.settings.extraOffset
1941                                }, 700);
1942                                mk_flexslider_init();
1943                                obj.loader.fadeOut(function () {
1944                                        var newH = project.actual('outerHeight');
1945                                        obj.ajaxDiv.transition({
1946                                                opacity: 1,
1947                                                height: newH
1948                                        }, 400, function () {
1949                                                obj.ajaxDiv.css({
1950                                                        height: 'auto'
1951                                                });
1952                                        });
1953                                });
1954
1955                        });
1956
1957                },
1958
1959        };
1960        $.fn[pluginName] = function (options) {
1961                return this.each(function () {
1962                        //if (!$.data(this, "plugin_" + pluginName)) {
1963                                $.data(this, "plugin_" + pluginName);
1964                                        
1965                                        new Plugin(this, options)
1966                        //}
1967                });
1968        };
1969})(jQuery, window, document);
1970
1971
1972; /* 
1973 * Blur.js
1974 * Copyright Jacob Kelley
1975 * MIT License
1976 */
1977// Stackblur, courtesy of Mario Klingemann: http://www.quasimondo.com/StackBlurForCanvas/StackBlurDemo.html
1978(function(l) {
1979    l.fn.blurjs = function(e) {
1980        function O() {
1981            this.a = this.b = this.g = this.r = 0;
1982            this.next = null
1983        }
1984        var y = document.createElement("canvas"), P = !1, H = l(this).selector.replace(/[^a-zA-Z0-9]/g, "");
1985        if (y.getContext) {
1986            var e = l.extend({source: "body",radius: 5,overlay: "",offset: {x: 0,y: 0},optClass: "",cache: !1,cacheKeyPrefix: "blurjs-",draggable: !1,debug: !1}, e), R = [512, 512, 456, 512, 328, 456, 335, 512, 405, 328, 271, 456, 388, 335, 292, 512, 454, 405, 364, 328, 298, 271, 496, 456, 420, 388, 360, 335, 312, 292, 273, 512, 482, 454, 428, 405, 383, 364, 345, 
1987                328, 312, 298, 284, 271, 259, 496, 475, 456, 437, 420, 404, 388, 374, 360, 347, 335, 323, 312, 302, 292, 282, 273, 265, 512, 497, 482, 468, 454, 441, 428, 417, 405, 394, 383, 373, 364, 354, 345, 337, 328, 320, 312, 305, 298, 291, 284, 278, 271, 265, 259, 507, 496, 485, 475, 465, 456, 446, 437, 428, 420, 412, 404, 39
19876, 388, 381, 374, 367, 360, 354, 347, 341, 335, 329, 323, 318, 312, 307, 302, 297, 292, 287, 282, 278, 273, 269, 265, 261, 512, 505, 497, 489, 482, 475, 468, 461, 454, 447, 441, 435, 428, 422, 417, 411, 405, 399, 394, 389, 383, 378, 373, 368, 364, 359, 354, 350, 345, 341, 337, 332, 328, 324, 320, 316, 312, 309, 
1988                305, 301, 298, 294, 291, 287, 284, 281, 278, 274, 271, 268, 265, 262, 259, 257, 507, 501, 496, 491, 485, 480, 475, 470, 465, 460, 456, 451, 446, 442, 437, 433, 428, 424, 420, 416, 412, 408, 404, 400, 396, 392, 388, 385, 381, 377, 374, 370, 367, 363, 360, 357, 354, 350, 347, 344, 341, 338, 335, 332, 329, 326, 323, 320, 318, 315, 312, 310, 307, 304, 302, 299, 297, 294, 292, 289, 287, 285, 282, 280, 278, 275, 273, 271, 269, 267, 265, 263, 261, 259], S = [9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 
1989                20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 
1990                24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24];
1991            return this.each(function() {
1992                var A = l(this), I = l(e.source), B = I.css("backgroundImage").replace(/"/g, "").replace(/url\(|\)$/ig, "");
1993                ctx = y.getContext("2d");
1994                tempImg = new Image;
1995                tempImg.onload = function() {
1996                    if (P)
1997                        j = tempImg.src;
1998                    else {
1999                        y.style.display = "none";
2000                        y.width = tempImg.width;
2001                        y.height = tempImg.height;
2002                        ctx.drawImage(tempImg, 0, 0);
2003                        var j = y.width, q = y.height, k = e.radius;
2004                        if (!(isNaN(k) || 1 > k)) {
2005                            var k = 
2006                            k | 0, M = y.getContext("2d"), l;
2007                            try {
2008                                try {
2009                                    l = M.getImageData(0, 0, j, q)
2010                                } catch (L) {
2011                                    try {
2012                                        netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"), l = M.getImageData(0, 0, j, q)
2013                                    } catch (T) {
2014                                        throw alert("Cannot access local image"), Error("unable to access local image data: " + T);
2015                                    }
2016                                }
2017                            } catch (U) {
2018                                throw alert("Cannot access image"), Error("unable to access image data: " + U);
2019                            }
2020                            var c = l.data, u, z, a, d, f, J, g, h, i, v, w, x, m, n, o, r, s, t, C;
2021                            u = k + k + 1;
2022                            var K = j - 1, N = q - 1, p = k + 1, D = p * (p + 1) / 2, E = new O, b = E;
2023                            for (a = 1; a < u; a++)
2024                                if (b = b.next = new O, a == 
2025                                p)
2026                                    var Q = b;
2027                            b.next = E;
2028                            b = a = null;
2029                            J = f = 0;
2030                            var F = R[k], G = S[k];
2031                            for (z = 0; z < q; z++) {
2032                                m = n = o = g = h = i = 0;
2033                                v = p * (r = c[f]);
2034                                w = p * (s = c[f + 1]);
2035                                x = p * (t = c[f + 2]);
2036                                g += D * r;
2037                                h += D * s;
2038                                i += D * t;
2039                                b = E;
2040                                for (a = 0; a < p; a++)
2041                                    b.r = r, b.g = s, b.b = t, b = b.next;
2042                                for (a = 1; a < p; a++)
2043                                    d = f + ((K < a ? K : a) << 2), g += (b.r = r = c[d]) * (C = p - a), h += (b.g = s = c[d + 1]) * C, i += (b.b = t = c[d + 2]) * C, m += r, n += s, o += t, b = b.next;
2044                                a = E;
2045                                b = Q;
2046                                for (u = 0; u < j; u++)
2047                                    c[f] = g * F >> G, c[f + 1] = h * F >> G, c[f + 2] = i * F >> G, g -= v, h -= w, i -= x, v -= a.r, w -= a.g, x -= a.b, d = J + ((d = u + k + 1) < K ? d : K) << 2, m += a.r = c[d], n += a.g = c[d + 1], o += a.b = c[d + 2], g += m, h += n, i += o, a = a.next, 
2048                                    v += r = b.r, w += s = b.g, x += t = b.b, m -= r, n -= s, o -= t, b = b.next, f += 4;
2049                                J += j
2050                            }
2051                            for (u = 0; u < j; u++) {
2052                                n = o = m = h = i = g = 0;
2053                                f = u << 2;
2054                                v = p * (r = c[f]);
2055                                w = p * (s = c[f + 1]);
2056                                x = p * (t = c[f + 2]);
2057                                g += D * r;
2058                                h += D * s;
2059                                i += D * t;
2060                                b = E;
2061                                for (a = 0; a < p; a++)
2062                                    b.r = r, b.g = s, b.b = t, b = b.next;
2063                                d = j;
2064                                for (a = 1; a <= k; a++)
2065                                    f = d + u << 2, g += (b.r = r = c[f]) * (C = p - a), h += (b.g = s = c[f + 1]) * C, i += (b.b = t = c[f + 2]) * C, m += r, n += s, o += t, b = b.next, a < N && (d += j);
2066                                f = u;
2067                                a = E;
2068                                b = Q;
2069                                for (z = 0; z < q; z++)
2070                                    d = f << 2, c[d] = g * F >> G, c[d + 1] = h * F >> G, c[d + 2] = i * F >> G, g -= v, h -= w, i -= x, v -= a.r, w -= a.g, x -= a.b, d = u + ((d = z + p) < N ? d : N) * 
2070j << 2, g += m += a.r = c[d], h += n += a.g = 
2071                                    c[d + 1], i += o += a.b = c[d + 2], a = a.next, v += r = b.r, w += s = b.g, x += t = b.b, m -= r, n -= s, o -= t, b = b.next, f += j
2072                            }
2073                            M.putImageData(l, 0, 0)
2074                        }
2075                        if (!1 != e.overlay)
2076                            ctx.beginPath(), ctx.rect(0, 0, tempImg.width, tempImg.width), ctx.fillStyle = e.overlay, ctx.fill();
2077                        var j = y.toDataURL();
2078                        if (e.cache)
2079                            try {
2080                                e.debug && console.log("Cache Set"), localStorage.setItem(e.cacheKeyPrefix + H + "-" + B + "-data-image", j)
2081                            } catch (V) {
2082                                console.log(V)
2083                            }
2084                    }
2085                    q = I.css("backgroundAttachment");
2086                    k = "fixed" == q ? "" : "-" + (A.offset().left - I.offset().left - e.offset.x) + "px -" + (A.offset().top - I.offset().top - 
2087                    e.offset.y) + "px";
2088                    A.css({"background-image": 'url("' + j + '")',"background-repeat": I.css("backgroundRepeat"),"background-position": k,"background-attachment": q});
2089                    !1 != e.optClass && A.addClass(e.optClass);
2090                    e.draggable && (A.css({"background-attachment": "fixed","background-position": "0 0"}), A.draggable())
2091                };
2092                Storage.prototype.cacheChecksum = function(j) {
2093                    var q = "", k;
2094                    for (k in j)
2095                        var l = j[k], q = "[object Object]" == l.toString() ? q + (l.x.toString() + l.y.toString() + ",").replace(/[^a-zA-Z0-9]/g, "") : q + (l + ",").replace(/[^a-zA-Z0-9]/g, 
2096                        "");
2097                    this.getItem(e.cacheKeyPrefix + H + "-" + B + "-options-cache") != q && (this.removeItem(e.cacheKeyPrefix + H + "-" + B + "-options-cache"), this.setItem(e.cacheKeyPrefix + H + "-" + B + "-options-cache", q), e.debug && console.log("Settings Changed, Cache Emptied"))
2098                };
2099                var L = null;
2100                e.cache && (localStorage.cacheChecksum(e), L = localStorage.getItem(e.cacheKeyPrefix + H + "-" + B + "-data-image"));
2101                null != L ? (e.debug && console.log("Cache Used"), P = !0, tempImg.src = L) : (e.debug && console.log("Source Used"), tempImg.src = B)
2102            })
2103        }
2104    }
2105})(jQuery);
2106;
2107
2108/**
2109 * downCount: Simple Countdown clock with offset
2110 * Author: Sonny T. <[email protected]>, sonnyt.com
2111 */
2112
2113(function ($) {
2114
2115    $.fn.downCount = function (options, callback) {
2116        var settings = $.extend({
2117                date: null,
2118                offset: null
2119            }, options);
2120
2121        // Throw error if date is not set
2122        if (!settings.date) {
2123            $.error('Date is not defined.');
2124        }
2125
2126        // Throw error if date is set incorectly
2127        if (!Date.parse(settings.date)) {
2128            $.error('Incorrect date format, it should look like this, 12/24/2012 12:00:00.');
2129        }
2130
2131        // Save container
2132        var container = this;
2133
2134        /**
2135         * Change client's local date to match offset timezone
2136         * @return {Object} Fixed Date object.
2137         */
2138        var currentDate = function () {
2139            // get client's current date
2140            var date = new Date();
2141
2142            // turn date to utc
2143            var utc = date.getTime() + (date.getTimezoneOffset() * 60000);
2144
2145            // set new Date object
2146            var new_date = new Date(utc + (3600000*settings.offset))
2147
2148            return new_date;
2149        };
2150
2151        /**
2152         * Main downCount function that calculates everything
2153         */
2154        function countdown () {
2155            var target_date = new Date(settings.date), // set target date
2156                current_date = currentDate(); // get fixed current date
2157
2158            // difference of dates
2159            var difference = target_date - current_date;
2160
2161            // if difference is negative than it's pass the target date
2162            if (difference < 0) {
2163                // stop timer
2164                clearInterval(interval);
2165
2166                if (callback && typeof callback === 'function') callback();
2167
2168                return;
2169            }
2170
2171            // basic math variables
2172            var _second = 1000,
2173                _minute = _second * 60,
2174                _hour = _minute * 60,
2175                _day = _hour * 24;
2176
2177            // calculate dates
2178            var days = Math.floor(difference / _day),
2179                hours = Math.floor((difference % _day) / _hour),
2180                minutes = Math.floor((difference % _hour) / _minute),
2181                seconds = Math.floor((difference % _minute) / _second);
2182
2183                // fix dates so that it will show two digets
2184                days = (String(days).length >= 2) ? days : '0' + days;
2185                hours = (String(hours).length >= 2) ? hours : '0' + hours;
2186                minutes = (String(minutes).length >= 2) ? minutes : '0' + minutes;
2187                seconds = (String(seconds).length >= 2) ? seconds : '0' + seconds;
2188
2189            // based on the date change the refrence wording
2190            var ref_days = (days === 1) ? 'day' : 'days',
2191                ref_hours = (hours === 1) ? 'hour' : 'hours',
2192                ref_minutes = (minutes === 1) ? 'minute' : 'minutes',
2193                ref_seconds = (seconds === 1) ? 'second' : 'seconds';
2194
2195            // set to DOM
2196            container.find('.days').text(days);
2197            container.find('.hours').text(hours);
2198            container.find('.minutes').text(minutes);
2199            container.find('.seconds').text(seconds);
2200
2201            container.find('.days_ref').text(ref_days);
2202            container.find('.hours_ref').text(ref_hours);
2203            container.find('.minutes_ref').text(ref_minutes);
2204            container.find('.seconds_ref').text(ref_seconds);
2205        };
2206        
2207        // start
2208        var interval = setInterval(countdown, 1000);
2209    };
2210
2211})(jQuery);
2212;/*
2213 * debouncedresize: special jQuery event that happens once after a window resize
2214 *
2215 * latest version and complete README available on Github:
2216 * https://github.com/louisremi/jquery-smartresize
2217 *
2218 * Copyright 2012 @louis_remi
2219 * Licensed under the MIT license.
2220 *
2221 * This saved you an hour of work?
2222 * Send me music http://www.amazon.co.uk/wishlist/HNTU0468LQON
2223 */
2224(function ($) {
2225
2226        var $event = $.event,
2227                $special, resizeTimeout;
2228
2229        $special = $event.special.debouncedresize = {
2230                setup: function () {
2231                        $(this).on("resize", $special.handler);
2232                },
2233                teardown: function () {
2234                        $(this).off("resize", $special.handler);
2235                },
2236                handler: function (event, execAsap) {
2237                        // Save the context
2238                        var context = this,
2239                                args = arguments,
2240                                dispatch = function () {
2241                                        // set correct event type
2242                                        event.type = "debouncedresize";
2243                                        $event.dispatch.apply(context, args
vendor: 7,160 bytes, lines 2243-2413
2243);
2244                                };
2245
2246                        if (resizeTimeout) {
2247                                clearTimeout(resizeTimeout);
2248                        }
2249
2250                        execAsap ? dispatch() : resizeTimeout = setTimeout(dispatch, $special.threshold);
2251                },
2252                threshold: 150
2253        };
2254
2255})(jQuery);
2256;
2257
2258/*
2259 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
2260 *
2261 */
2262jQuery.easing["jswing"] = jQuery.easing["swing"];
2263jQuery.extend(jQuery.easing, {
2264        def: "easeOutQuad",
2265        swing: function (a, b, c, d, e) {
2266                return jQuery.easing[jQuery.easing.def](a, b, c, d, e)
2267        },
2268        easeInQuad: function (a, b, c, d, e) {
2269                return d * (b /= e) * b + c
2270        },
2271        easeOutQuad: function (a, b, c, d, e) {
2272                return -d * (b /= e) * (b - 2) + c
2273        },
2274        easeInOutQuad: function (a, b, c, d, e) {
2275                if ((b /= e / 2) < 1) return d / 2 * b * b + c;
2276                return -d / 2 * (--b * (b - 2) - 1) + c
2277        },
2278        easeInCubic: function (a, b, c, d, e) {
2279                return d * (b /= e) * b * b + c
2280        },
2281        easeOutCubic: function (a, b, c, d, e) {
2282                return d * ((b = b / e - 1) * b * b + 1) + c
2283        },
2284        easeInOutCubic: function (a, b, c, d, e) {
2285                if ((b /= e / 2) < 1) return d / 2 * b * b * b + c;
2286                return d / 2 * ((b -= 2) * b * b + 2) + c
2287        },
2288        easeInQuart: function (a, b, c, d, e) {
2289                return d * (b /= e) * b * b * b + c
2290        },
2291        easeOutQuart: function (a, b, c, d, e) {
2292                return -d * ((b = b / e - 1) * b * b * b - 1) + c
2293        },
2294        easeInOutQuart: function (a, b, c, d, e) {
2295                if ((b /= e / 2) < 1) return d / 2 * b * b * b * b + c;
2296                return -d / 2 * ((b -= 2) * b * b * b - 2) + c
2297        },
2298        easeInQuint: function (a, b, c, d, e) {
2299                return d * (b /= e) * b * b * b * b + c
2300        },
2301        easeOutQuint: function (a, b, c, d, e) {
2302                return d * ((b = b / e - 1) * b * b * b * b + 1) + c
2303        },
2304        easeInOutQuint: function (a, b, c, d, e) {
2305                if ((b /= e / 2) < 1) return d / 2 * b * b * b * b * b + c;
2306                return d / 2 * ((b -= 2) * b * b * b * b + 2) + c
2307        },
2308        easeInSine: function (a, b, c, d, e) {
2309                return -d * Math.cos(b / e * (Math.PI / 2)) + d + c
2310        },
2311        easeOutSine: function (a, b, c, d, e) {
2312                return d * Math.sin(b / e * (Math.PI / 2)) + c
2313        },
2314        easeInOutSine: function (a, b, c, d, e) {
2315                return -d / 2 * (Math.cos(Math.PI * b / e) - 1) + c
2316        },
2317        easeInExpo: function (a, b, c, d, e) {
2318                return b == 0 ? c : d * Math.pow(2, 10 * (b / e - 1)) + c
2319        },
2320        easeOutExpo: function (a, b, c, d, e) {
2321                return b == e ? c + d : d * (-Math.pow(2, -10 * b / e) + 1) + c
2322        },
2323        easeInOutExpo: function (a, b, c, d, e) {
2324                if (b == 0) return c;
2325                if (b == e) return c + d;
2326                if ((b /= e / 2) < 1) return d / 2 * Math.pow(2, 10 * (b - 1)) + c;
2327                return d / 2 * (-Math.pow(2, -10 * --b) + 2) + c
2328        },
2329        easeInCirc: function (a, b, c, d, e) {
2330                return -d * (Math.sqrt(1 - (b /= e) * b) - 1) + c
2331        },
2332        easeOutCirc: function (a, b, c, d, e) {
2333                return d * Math.sqrt(1 - (b = b / e - 1) * b) + c
2334        },
2335        easeInOutCirc: function (a, b, c, d, e) {
2336                if ((b /= e / 2) < 1) return -d / 2 * (Math.sqrt(1 - b * b) - 1) + c;
2337                return d / 2 * (Math.sqrt(1 - (b -= 2) * b) + 1) + c
2338        },
2339        easeInElastic: function (a, b, c, d, e) {
2340                var f = 1.70158;
2341                var g = 0;
2342                var h = d;
2343                if (b == 0) return c;
2344                if ((b /= e) == 1) return c + d;
2345                if (!g) g = e * .3;
2346                if (h < Math.abs(d)) {
2347                        h = d;
2348                        var f = g / 4
2349                } else var f = g / (2 * Math.PI) * Math.asin(d / h);
2350                return -(h * Math.pow(2, 10 * (b -= 1)) * Math.sin((b * e - f) * 2 * Math.PI / g)) + c
2351        },
2352        easeOutElastic: function (a, b, c, d, e) {
2353                var f = 1.70158;
2354                var g = 0;
2355                var h = d;
2356                if (b == 0) return c;
2357                if ((b /= e) == 1) return c + d;
2358                if (!g) g = e * .3;
2359                if (h < Math.abs(d)) {
2360                        h = d;
2361                        var f = g / 4
2362                } else var f = g / (2 * Math.PI) * Math.asin(d / h);
2363                return h * Math.pow(2, -10 * b) * Math.sin((b * e - f) * 2 * Math.PI / g) + d + c
2364        },
2365        easeInOutElastic: function (a, b, c, d, e) {
2366                var f = 1.70158;
2367                var g = 0;
2368                var h = d;
2369                if (b == 0) return c;
2370                if ((b /= e / 2) == 2) return c + d;
2371                if (!g) g = e * .3 * 1.5;
2372                if (h < Math.abs(d)) {
2373                        h = d;
2374                        var f = g / 4
2375                } else var f = g / (2 * Math.PI) * Math.asin(d / h);
2376                if (b < 1) return -.5 * h * Math.pow(2, 10 * (b -= 1)) * Math.sin((b * e - f) * 2 * Math.PI / g) + c;
2377                return h * Math.pow(2, -10 * (b -= 1)) * Math.sin((b * e - f) * 2 * Math.PI / g) * .5 + d + c
2378        },
2379        easeInBack: function (a, b, c, d, e, f) {
2380                if (f == undefined) f = 1.70158;
2381                return d * (b /= e) * b * ((f + 1) * b - f) + c
2382        },
2383        easeOutBack: function (a, b, c, d, e, f) {
2384                if (f == undefined) f = 1.70158;
2385                return d * ((b = b / e - 1) * b * ((f + 1) * b + f) + 1) + c
2386        },
2387        easeInOutBack: function (a, b, c, d, e, f) {
2388                if (f == undefined) f = 1.70158;
2389                if ((b /= e / 2) < 1) return d / 2 * b * b * (((f *= 1.525) + 1) * b - f) + c;
2390                return d / 2 * ((b -= 2) * b * (((f *= 1.525) + 1) * b + f) + 2) + c
2391        },
2392        easeInBounce: function (a, b, c, d, e) {
2393                return d - jQuery.easing.easeOutBounce(a, e - b, 0, d, e) + c
2394        },
2395        easeOutBounce: function (a, b, c, d, e) {
2396                if ((b /= e) < 1 / 2.75) {
2397                        return d * 7.5625 * b * b + c
2398                } else if (b < 2 / 2.75) {
2399                        return d * (7.5625 * (b -= 1.5 / 2.75) * b + .75) + c
2400                } else if (b < 2.5 / 2.75) {
2401                        return d * (7.5625 * (b -= 2.25 / 2.75) * b + .9375) + c
2402                } else {
2403                        return d * (7.5625 * (b -= 2.625 / 2.75) * b + .984375) + c
2404                }
2405        },
2406        easeInOutBounce: function (a, b, c, d, e) {
2407                if (b < e / 2) return jQuery.easing.easeInBounce(a, b * 2, 0, d, e) * .5 + c;
2408                return jQuery.easing.easeOutBounce(a, b * 2 - e, 0, d, e) * .5 + d * .5 + c
2409        }
2410});
2411
2412// Generated by CoffeeScript 1.4.0
2413/*
2414Easy pie chart is a jquery plugin to display simple animated pie charts for only one value
2415
2416Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
2417and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
2418
2419Built on top of the jQuery library (http://jquery.com)
2420
2421@source: http://github.com/rendro/easy-pie-chart/
2422@autor: Robert Fleischmann
2423@version: 1.1.0
2424
2425Inspired by: http://dribbble.com/shots/631074-Simple-Pie-Charts-II?list=popular&offset=210
2426Thanks to Philip Thrasher for the jquery plugin boilerplate for coffee script
2427*/
2428
2429(function ($) {
2430        $.easyPieChart = function (el, options) {
2431                var addScaleLine, animateLine, drawLine, easeInOutQuad, rAF, renderBackground, renderScale, renderTrack, _this = this;
2432                this.el = el;
2433                this.$el = $(el);
2434                this.$el.data("easyPieChart", this);
2435                this.init = function () {
2436                        var percent, scaleBy;
2437                        _this.options = $.extend({}, $.easyPieChart.defaultOptions, options);
2438                        percent = parseInt(_this.$el.data('percent'), 10);
2439                        _this.percentage = 0;
2440                        _this.canvas = $("<canvas width='" + _this.options.size + "' height='" + _this.options.size + "'></canvas>").get(0);
2441                        _this.$el.append(_this.canvas);
2442                        if (typeof G_vmlCanvasManager !== "undefined" && G_vmlCanvasManager !== null) {
2443                                G_vmlCanvasManager.initElement(_this.canvas);
2444                        }
2445                        _this.ctx = _this.canvas.getContext('2d');
2446                        if (window.devicePixelRatio > 1) {
2447                                scaleBy = window.devicePixelRatio;
2448                                $(_this.canvas).css({
2449                                        width: _this.options.size,
2450                                        height: _this.options.size
2451                                });
2452                                _this.canvas.width *= scaleBy;
2453                                _this.canvas.height *= scaleBy;
2454                                _this.ctx.scale(scaleBy, scaleBy);
2455                        }
2456                        _this.ctx.translate(_this.options.size / 2, _this.options.size / 2);
2457                        _this.$el.addClass('easyPieChart');
2458                        _this.$el.css({
2459                                width: _this.options.size,
2460                                height: _this.options.size,
2461                                lineHeight: "" + _this.options.size + "px"
2462                        });
2463                        _this.update(percent);
2464                        return _this;
2465                };
2466                this.update = function (percent) {
2467                        percent = parseFloat(percent) || 0;
2468                        if (_this.options.animate === false) {
2469                                drawLine(percent);
2470                        } else {
2471                                animateLine(_this.percentage, percent);
2472                        }
2473                        return _this;
2474                };
2475                renderScale = function () {
2476                        var i, _i, _results;
2477                        _this.ctx.fillStyle = _this.options.scaleColor;
2478                        _this.ctx.lineWidth = 1;
2479                        _results = [];
2480                        for (i = _i = 0; _i <= 24; i = ++_i) {
2481                                _results.push(addScaleLine(i));
2482                        }
2483                        return _results;
2484                };
2485                addScaleLine = function (i) {
2486                        var offset;
2487                        offset = i % 6 === 0 ? 0 : _this.options.size * 0.017;
2488                        _this.ctx.save();
2489                        _this.ctx.rotate(i * Math.PI / 12);
2490                        _this.ctx.fillRect(_this.options.size / 2 - offset, 0, -_this.options.size * 0.05 + offset, 1);
2491                        _this.ctx.restore();
2492                };
2493                renderTrack = function () {
2494                        var offset;
2495                        offset = _this.options.size / 2 - _this.options.lineWidth / 2;
2496                        if (_this.options.scaleColor !== false) {
2497                                offset -= _this.options.size * 0.08;
2498                        }
2499                        _this.ctx.beginPath();
2500                        _this.ctx.arc(0, 0, offset, 0, Math.PI * 2, true);
2501                        _this.ctx.closePath();
2502                        _this.ctx.strokeStyle = _this.options.trackColor;
2503                        _this.ctx.lineWidth = _this.options.lineWidth;
2504                        _this.ctx.stroke();
2505                };
2506                renderBackground = function () {
2507                        if (_this.options.scaleColor !== false) {
2508                                renderScale();
2509                        }
2510                        if (_this.options.trackColor !== false) {
2511                                renderTrack();
2512                        }
2513                };
2514                drawLine = function (percent) {
2515                        var offset;
2516                        renderBackground();
2517                        _this.ctx.strokeStyle = $.isFunction(_this.options.barColor) ? _this.options.barColor(percent) : _this.options.barColor;
2518                        _this.ctx.lineCap = _this.options.lineCap;
2519                        _this.ctx.lineWidth = _this.options.lineWidth;
2520                        offset = _this.options.size / 2 - _this.options.lineWidth / 2;
2521                        if (_this.options.scaleColor !== false) {
2522                                offset -= _this.options.size * 0.08;
2523                        }
2524                        _this.ctx.save();
2525                        _this.ctx.rotate(-Math.PI / 2);
2526                        _this.ctx.beginPath();
2527                        _this.ctx.arc(0, 0, offset, 0, Math.PI * 2 * percent / 100, false);
2528                        _this.ctx.stroke();
2529                        _this.ctx.restore();
2530                };
2531                rAF = (function () {
2532                        return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame ||
2533                        function (callback) {
2534                                return window.setTimeout(callback, 1000 / 60);
2535                        };
2536                })();
2537                animateLine = function (from, to) {
2538                        var anim, startTime;
2539                        _this.options.onStart.call(_this);
2540                        _this.percentage = to;
2541                        startTime = Date.now();
2542                        anim = function () {
2543                                var currentValue, process;
2544                                process = Date.now() - startTime;
2545                                if (process < _this.options.animate) {
2546                                        rAF(anim);
2547                                }
2548                                _this.ctx.clearRect(-_this.options.size / 2, -_this.options.size / 2, _this.options.size, _this.options.size);
2549                                renderBackground.call(_this);
2550                                currentValue = [easeInOutQuad(process, from, to - from, _this.options.animate)];
2551                                _this.options.onStep.call(_this, currentValue);
2552                                drawLine.call(_this, currentValue);
2553                                if (process >= _this.options.animate) {
2554                                        return _this.options.onStop.call(_this);
2555                                }
2556                        };
2557                        rAF(anim);
2558                };
2559                easeInOutQuad = function (t, b, c, d) {
2560                        var easeIn, easing;
2561                        easeIn = function (t) {
2562                                return Math.pow(t, 2);
2563                        };
2564                        easing = function (t) {
2565                                if (t < 1) {
2566                                        return easeIn(t);
2567                                } else {
2568                                        return 2 - easeIn((t / 2) * -2 + 2);
2569                                }
2570                        };
2571                        t /= d / 2;
2572                        return c / 2 * easing(t) + b;
2573                };
2574                return this.init();
2575        };
2576        $.easyPieChart.defaultOptions = {
2577                barColor: '#ef1e25',
2578                trackColor: '#f2f2f2',
2579                scaleColor: '#dfe0e0',
2580                lineCap: 'round',
2581                size: 110,
2582                lineWidth: 3,
2583                animate: false,
2584                onStart: $.noop,
2585                onStop: $.noop,
2586                onStep: $.noop
2587        };
2588        $.fn.easyPieChart = function (options) {
2589                return $.each(this, function (i, el) {
2590                        var $el;
2591                        $el = $(el);
2592                        if (!$el.data('easyPieChart')) {
2593                                return $el.data('easyPieChart', new $.easyPieChart(el, options));
2594                        }
2595                });
2596        };
2597        return void 0;
2598})(jQuery);
2599
2600
2601;
2602/*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */
2603(function(s, H, f, w) {
2604    var K = f("html"),
2605        q = f(s),
2606        p = f(H),
2607        b = f.fancybox = function() {
2608            b.open.apply(this, arguments)
2609        },
2610        J = navigator.userAgent.match(/msie/i),
2611        C = null,
2612        t = H.createTouch !== w,
2613        u = function(a) {
2614            return a && a.hasOwnProperty && a instanceof f
2615        },
2616        r = function(a) {
2617            return a && "string" === f.type(a)
2618        },
2619        F = function(a) {
2620            return r(a) && 0 < a.indexOf("%")
2621        },
2622        m = function(a, d) {
2623            var e = parseInt(a, 10) || 0;
2624            d && F(a) && (e *= b.getViewport()[d] / 100);
2625            return Math.ceil(e)
2626        },
2627        x = function(a, b) {
2628            return m(a, b) + "px"
2629        };
2630    f.extend(b, {
2631        version: "2.1.5",
2632        defaults: {
2633            padding: 15,
2634            margin: 20,
2635            width: 800,
2636            height: 600,
2637            minWidth: 100,
2638            minHeight: 100,
2639            maxWidth: 9999,
2640            maxHeight: 9999,
2641            pixelRatio: 1,
2642            autoSize: !0,
2643            autoHeight: !1,
2644            autoWidth: !1,
2645            autoResize: !0,
2646            autoCenter: !t,
2647            fitToView: !0,
2648            aspectRatio: !1,
2649            topRatio: 0.5,
2650            leftRatio: 0.5,
2651            scrolling: "auto",
2652            wrapCSS: "",
2653            arrows: !0,
2654            closeBtn: !0,
2655            closeClick: !1,
2656            nextClick: !1,
2657            mouseWheel: !0,
2658            autoPlay: !1,
2659            playSpeed: 3E3,
2660            preload: 3,
2661            modal: !1,
2662            loop: !0,
2663            ajax: {
2664                dataType: "html",
2665                headers: {
2666                    "X-fancyBox": !0
2667                }
2668            },
2669            iframe: {
2670                scrolling: "auto",
2671                preload: !0
2672            },
2673            swf: {
2674                wmode: "transparent",
2675                allowfullscreen: "true",
2676                allowscriptaccess: "always"
2677            },
2678            keys: {
2679                next: {
2680                    13: "left",
2681                    34: "up",
2682                    39: "left",
2683                    40: "up"
2684                },
2685                prev: {
2686                    8: "right",
2687                    33: "down",
2688                    37: "right",
2689                    38: "down"
2690                },
2691                close: [27],
2692                play: [32],
2693                toggle: [70]
2694            },
2695            direction: {
2696                next: "left",
2697                prev: "right"
2698            },
2699            scrollOutside: !0,
2700            index: 0,
2701            type: null,
2702            href: null,
2703            content: null,
2704            title: null,
2705            tpl: {
2706                wrap: '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',
2707                image: '<img class="fancybox-image" src="{href}" alt="" />',
2708                iframe: '<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen' +
2709                    (J ? ' allowtransparency="true"' : "") + "></iframe>",
2710                error: '<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',
2711                closeBtn: '<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',
2712                next: '<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',
2713                prev: '<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'
2714            },
2715            openEffect: "fade",
2716            openSpeed: 250,
2717            openEasing: "swing",
2718            openOpacity: !0,
2719            openMethod: "zoomIn",
2720            closeEffect: "fade",
2721            closeSpeed: 250,
2722            closeEasing: "swing",
2723            closeOpacity: !0,
2724            closeMethod: "zoomOut",
2725            nextEffect: "elastic",
2726            nextSpeed: 250,
2727            nextEasing: "swing",
2728            nextMethod: "changeIn",
2729            prevEffect: "elastic",
2730            prevSpeed: 250,
2731            prevEasing: "swing",
2732            prevMethod: "changeOut",
2733            helpers: {
2734                overlay: !0,
2735                title: !0
2736            },
2737            onCancel: f.noop,
2738            beforeLoad: f.noop,
2739            afterLoad: f.noop,
2740            beforeShow: f.noop,
2741            afterShow: f.noop,
2742            beforeChange: f.noop,
2743            beforeClose: f.noop,
2744            afterClose: f.noop
2745        },
2746        group: {},
2747        opts: {},
2748        previous: null,
2749        coming: null,
2750        current: null,
2751        isActive: !1,
2752        isOpen: !1,
2753        isOpened: !1,
2754        wrap: null,
2755        skin: null,
2756        outer: null,
2757        inner: null,
2758        player: {
2759            timer: null,
2760            isActive: !1
2761        },
2762        ajaxLoad: null,
2763        imgPreload: null,
2764        transitions: {},
2765        helpers: {},
2766        open: function(a, d) {
2767            if (a && (f.isPlainObject(d) || (d = {}), !1 !== b.close(!0))) return f.isArray(a) || (a = u(a) ? f(a).get() : [a]), f.each(a, function(e, 
vendor: 34,462 bytes, lines 2767-3517
2767c) {
2768                var l = {},
2769                    g, h, k, n, m;
2770                "object" === f.type(c) && (c.nodeType && (c = f(c)), u(c) ? (l = {
2771                        href: c.data("fancybox-href") || c.attr("href"),
2772                        title: f("<div/>").text(c.data("fancybox-title") || c.attr("title")).html(),
2773                        isDom: !0,
2774                        element: c
2775                    },
2776                    f.metadata && f.extend(!0, l, c.metadata())) : l = c);
2777                g = d.href || l.href || (r(c) ? c : null);
2778                h = d.title !== w ? d.title : l.title || "";
2779                n = (k = d.content || l.content) ? "html" : d.type || l.type;
2780                !n && l.isDom && (n = c.data("fancybox-type"), n || (n = (n = c.prop("class").match(/fancybox\.(\w+)/)) ? n[1] : null));
2781                r(g) && (n || (b.isImage(g) ? n = "image" : b.isSWF(g) ? n = "swf" : "#" === g.charAt(0) ? n = "inline" : r(c) && (n = "html", k = c)), "ajax" === n && (m = g.split(/\s+/, 2), g = m.shift(), m = m.shift()));
2782                k || ("inline" === n ? g ? k = f(r(g) ? g.replace(/.*(?=#[^\s]+$)/, "") : g) : l.isDom && (k = c) :
2783                    "html" === n ? k = g : n || g || !l.isDom || (n = "inline", k = c));
2784                f.extend(l, {
2785                    href: g,
2786                    type: n,
2787                    content: k,
2788                    title: h,
2789                    selector: m
2790                });
2791                a[e] = l
2792            }), b.opts = f.extend(!0, {}, b.defaults, d), d.keys !== w && (b.opts.keys = d.keys ? f.extend({}, b.defaults.keys, d.keys) : !1), b.group = a, b._start(b.opts.index)
2793        },
2794        cancel: function() {
2795            var a = b.coming;
2796            a && !1 === b.trigger("onCancel") || (b.hideLoading(), a && (b.ajaxLoad && b.ajaxLoad.abort(), b.ajaxLoad = null, b.imgPreload && (b.imgPreload.onload = b.imgPreload.onerror = null), a.wrap && a.wrap.stop(!0, !0).trigger("onReset").remove(),
2797                b.coming = null, b.current || b._afterZoomOut(a)))
2798        },
2799        close: function(a) {
2800            b.cancel();
2801            !1 !== b.trigger("beforeClose") && (b.unbindEvents(), b.isActive && (b.isOpen && !0 !== a ? (b.isOpen = b.isOpened = !1, b.isClosing = !0, f(".fancybox-item, .fancybox-nav").remove(), b.wrap.stop(!0, !0).removeClass("fancybox-opened"), b.transitions[b.current.closeMethod]()) : (f(".fancybox-wrap").stop(!0).trigger("onReset").remove(), b._afterZoomOut())))
2802        },
2803        play: function(a) {
2804            var d = function() {
2805                    clearTimeout(b.player.timer)
2806                },
2807                e = function() {
2808                    d();
2809                    b.current && b.player.isActive &&
2810                        (b.player.timer = setTimeout(b.next, b.current.playSpeed))
2811                },
2812                c = function() {
2813                    d();
2814                    p.unbind(".player");
2815                    b.player.isActive = !1;
2816                    b.trigger("onPlayEnd")
2817                };
2818            !0 === a || !b.player.isActive && !1 !== a ? b.current && (b.current.loop || b.current.index < b.group.length - 1) && (b.player.isActive = !0, p.bind({
2819                "onCancel.player beforeClose.player": c,
2820                "onUpdate.player": e,
2821                "beforeLoad.player": d
2822            }), e(), b.trigger("onPlayStart")) : c()
2823        },
2824        next: function(a) {
2825            var d = b.current;
2826            d && (r(a) || (a = d.direction.next), b.jumpto(d.index + 1, a, "next"))
2827        },
2828        prev: function(a) {
2829            var d =
2830                b.current;
2831            d && (r(a) || (a = d.direction.prev), b.jumpto(d.index - 1, a, "prev"))
2832        },
2833        jumpto: function(a, d, e) {
2834            var c = b.current;
2835            c && (a = m(a), b.direction = d || c.direction[a >= c.index ? "next" : "prev"], b.router = e || "jumpto", c.loop && (0 > a && (a = c.group.length + a % c.group.length), a %= c.group.length), c.group[a] !== w && (b.cancel(), b._start(a)))
2836        },
2837        reposition: function(a, d) {
2838            var e = b.current,
2839                c = e ? e.wrap : null,
2840                l;
2841            c && (l = b._getPosition(d), a && "scroll" === a.type ? (delete l.position, c.stop(!0, !0).animate(l, 200)) : (c.css(l), e.pos = f.extend({}, e.dim, l)))
2842        },
2843        update: function(a) {
2844            var d = a && a.originalEvent && a.originalEvent.type,
2845                e = !d || "orientationchange" === d;
2846            e && (clearTimeout(C), C = null);
2847            b.isOpen && !C && (C = setTimeout(function() {
2848                var c = b.current;
2849                c && !b.isClosing && (b.wrap.removeClass("fancybox-tmp"), (e || "load" === d || "resize" === d && c.autoResize) && b._setDimension(), "scroll" === d && c.canShrink || b.reposition(a), b.trigger("onUpdate"), C = null)
2850            }, e && !t ? 0 : 300))
2851        },
2852        toggle: function(a) {
2853            b.isOpen && (b.current.fitToView = "boolean" === f.type(a) ? a : !b.current.fitToView, t && (b.wrap.removeAttr("style").addClass("fancybox-tmp"),
2854                b.trigger("onUpdate")), b.update())
2855        },
2856        hideLoading: function() {
2857            p.unbind(".loading");
2858            f("#fancybox-loading").remove()
2859        },
2860        showLoading: function() {
2861            var a, d;
2862            b.hideLoading();
2863            a = f('<div id="fancybox-loading"><div></div></div>').click(b.cancel).appendTo("body");
2864            p.bind("keydown.loading", function(a) {
2865                27 === (a.which || a.keyCode) && (a.preventDefault(), b.cancel())
2866            });
2867            b.defaults.fixed || (d = b.getViewport(), a.css({
2868                position: "absolute",
2869                top: 0.5 * d.h + d.y,
2870                left: 0.5 * d.w + d.x
2871            }));
2872            b.trigger("onLoading")
2873        },
2874        getViewport: function() {
2875            var a = b.current &&
2876                b.current.locked || !1,
2877                d = {
2878                    x: q.scrollLeft(),
2879                    y: q.scrollTop()
2880                };
2881            a && a.length ? (d.w = a[0].clientWidth, d.h = a[0].clientHeight) : (d.w = t && s.innerWidth ? s.innerWidth : q.width(), d.h = t && s.innerHeight ? s.innerHeight : q.height());
2882            return d
2883        },
2884        unbindEvents: function() {
2885            b.wrap && u(b.wrap) && b.wrap.unbind(".fb");
2886            p.unbind(".fb");
2887            q.unbind(".fb")
2888        },
2889        bindEvents: function() {
2890            var a = b.current,
2891                d;
2892            a && (q.bind("orientationchange.fb" + (t ? "" : " resize.fb") + (a.autoCenter && !a.locked ? " scroll.fb" : ""), b.update), (d = a.keys) && p.bind("keydown.fb", function(e) {
2893                var c =
2894                    e.which || e.keyCode,
2895                    l = e.target || e.srcElement;
2896                if (27 === c && b.coming) return !1;
2897                e.ctrlKey || e.altKey || e.shiftKey || e.metaKey || l && (l.type || f(l).is("[contenteditable]")) || f.each(d, function(d, l) {
2898                    if (1 < a.group.length && l[c] !== w) return b[d](l[c]), e.preventDefault(), !1;
2899                    if (-1 < f.inArray(c, l)) return b[d](), e.preventDefault(), !1
2900                })
2901            }), f.fn.mousewheel && a.mouseWheel && b.wrap.bind("mousewheel.fb", function(d, c, l, g) {
2902                for (var h = f(d.target || null), k = !1; h.length && !(k || h.is(".fancybox-skin") || h.is(".fancybox-wrap"));) k = h[0] && !(h[0].style.overflow &&
2903                    "hidden" === h[0].style.overflow) && (h[0].clientWidth && h[0].scrollWidth > h[0].clientWidth || h[0].clientHeight && h[0].scrollHeight > h[0].clientHeight), h = f(h).parent();
2904                0 !== c && !k && 1 < b.group.length && !a.canShrink && (0 < g || 0 < l ? b.prev(0 < g ? "down" : "left") : (0 > g || 0 > l) && b.next(0 > g ? "up" : "right"), d.preventDefault())
2905            }))
2906        },
2907        trigger: function(a, d) {
2908            var e, c = d || b.coming || b.current;
2909            if (c) {
2910                f.isFunction(c[a]) && (e = c[a].apply(c, Array.prototype.slice.call(arguments, 1)));
2911                if (!1 === e) return !1;
2912                c.helpers && f.each(c.helpers, function(d, e) {
2913                    if (e &&
2914                        b.helpers[d] && f.isFunction(b.helpers[d][a])) b.helpers[d][a](f.extend(!0, {}, b.helpers[d].defaults, e), c)
2915                })
2916            }
2917            p.trigger(a)
2918        },
2919        isImage: function(a) {
2920            return r(a) && a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)
2921        },
2922        isSWF: function(a) {
2923            return r(a) && a.match(/\.(swf)((\?|#).*)?$/i)
2924        },
2925        _start: function(a) {
2926            var d = {},
2927                e, c;
2928            a = m(a);
2929            e = b.group[a] || null;
2930            if (!e) return !1;
2931            d = f.extend(!0, {}, b.opts, e);
2932            e = d.margin;
2933            c = d.padding;
2934            "number" === f.type(e) && (d.margin = [e, e, e, e]);
2935            "number" === f.type(c) && (d.padding = [c, c,
2936                c, c
2937            ]);
2938            d.modal && f.extend(!0, d, {
2939                closeBtn: !1,
2940                closeClick: !1,
2941                nextClick: !1,
2942                arrows: !1,
2943                mouseWheel: !1,
2944                keys: null,
2945                helpers: {
2946                    overlay: {
2947                        closeClick: !1
2948                    }
2949                }
2950            });
2951            d.autoSize && (d.autoWidth = d.autoHeight = !0);
2952            "auto" === d.width && (d.autoWidth = !0);
2953            "auto" === d.height && (d.autoHeight = !0);
2954            d.group = b.group;
2955            d.index = a;
2956            b.coming = d;
2957            if (!1 === b.trigger("beforeLoad")) b.coming = null;
2958            else {
2959                c = d.type;
2960                e = d.href;
2961                if (!c) return b.coming = null, b.current && b.router && "jumpto" !== b.router ? (b.current.index = a, b[b.router](b.direction)) : !1;
2962                b.isActive = !0;
2963                if ("image" ===
2964                    c || "swf" === c) d.autoHeight = d.autoWidth = !1, d.scrolling = "visible";
2965                "image" === c && (d.aspectRatio = !0);
2966                "iframe" === c && t && (d.scrolling = "scroll");
2967                d.wrap = f(d.tpl.wrap).addClass("fancybox-" + (t ? "mobile" : "desktop") + " fancybox-type-" + c + " fancybox-tmp " + d.wrapCSS).appendTo(d.parent || "body");
2968                f.extend(d, {
2969                    skin: f(".fancybox-skin", d.wrap),
2970                    outer: f(".fancybox-outer", d.wrap),
2971                    inner: f(".fancybox-inner", d.wrap)
2972                });
2973                f.each(["Top", "Right", "Bottom", "Left"], function(a, b) {
2974                    d.skin.css("padding" + b, x(d.padding[a]))
2975                });
2976                b.trigger("onReady");
2977                if ("inline" === c || "html" === c) {
2978                    if (!d.content || !d.content.length) return b._error("content")
2979                } else if (!e) return b._error("href");
2980                "image" === c ? b._loadImage() : "ajax" === c ? b._loadAjax() : "iframe" === c ? b._loadIframe() : b._afterLoad()
2981            }
2982        },
2983        _error: function(a) {
2984            f.extend(b.coming, {
2985                type: "html",
2986                autoWidth: !0,
2987                autoHeight: !0,
2988                minWidth: 0,
2989                minHeight: 0,
2990                scrolling: "no",
2991                hasError: a,
2992                content: b.coming.tpl.error
2993            });
2994            b._afterLoad()
2995        },
2996        _loadImage: function() {
2997            var a = b.imgPreload = new Image;
2998            a.onload = function() {
2999                this.onload = this.onerror = null;
3000                b.coming.width =
3001                    this.width / b.opts.pixelRatio;
3002                b.coming.height = this.height / b.opts.pixelRatio;
3003                b._afterLoad()
3004            };
3005            a.onerror = function() {
3006                this.onload = this.onerror = null;
3007                b._error("image")
3008            };
3009            a.src = b.coming.href;
3010            !0 !== a.complete && b.showLoading()
3011        },
3012        _loadAjax: function() {
3013            var a = b.coming;
3014            b.showLoading();
3015            b.ajaxLoad = f.ajax(f.extend({}, a.ajax, {
3016                url: a.href,
3017                error: function(a, e) {
3018                    b.coming && "abort" !== e ? b._error("ajax", a) : b.hideLoading()
3019                },
3020                success: function(d, e) {
3021                    "success" === e && (a.content = d, b._afterLoad())
3022                }
3023            }))
3024        },
3025        _loadIframe: function() {
3026            var a = b.coming,
3027                d = f(a.tpl.iframe.replace(/\{rnd\}/g, (new Date).getTime())).attr("scrolling", t ? "auto" : a.iframe.scrolling).attr("src", a.href);
3028            f(a.wrap).bind("onReset", function() {
3029                try {
3030                    f(this).find("iframe").hide().attr("src", "//about:blank").end().empty()
3031                } catch (a) {}
3032            });
3033            a.iframe.preload && (b.showLoading(), d.one("load", function() {
3034                f(this).data("ready", 1);
3035                t || f(this).bind("load.fb", b.update);
3036                f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();
3037                b._afterLoad()
3038            }));
3039            a.content = d.appendTo(a.inner);
3040            a.iframe.preload ||
3041                b._afterLoad()
3042        },
3043        _preloadImages: function() {
3044            var a = b.group,
3045                d = b.current,
3046                e = a.length,
3047                c = d.preload ? Math.min(d.preload, e - 1) : 0,
3048                f, g;
3049            for (g = 1; g <= c; g += 1) f = a[(d.index + g) % e], "image" === f.type && f.href && ((new Image).src = f.href)
3050        },
3051        _afterLoad: function() {
3052            var a = b.coming,
3053                d = b.current,
3054                e, c, l, g, h;
3055            b.hideLoading();
3056            if (a && !1 !== b.isActive)
3057                if (!1 === b.trigger("afterLoad", a, d)) a.wrap.stop(!0).trigger("onReset").remove(), b.coming = null;
3058                else {
3059                    d && (b.trigger("beforeChange", d), d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());
3060                    b.unbindEvents();
3061                    e = a.content;
3062                    c = a.type;
3063                    l = a.scrolling;
3064                    f.extend(b, {
3065                        wrap: a.wrap,
3066                        skin: a.skin,
3067                        outer: a.outer,
3068                        inner: a.inner,
3069                        current: a,
3070                        previous: d
3071                    });
3072                    g = a.href;
3073                    switch (c) {
3074                        case "inline":
3075                        case "ajax":
3076                        case "html":
3077                            a.selector ? e = f("<div>").html(e).find(a.selector) : u(e) && (e.data("fancybox-placeholder") || e.data("fancybox-placeholder", f('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()), e = e.show().detach(), a.wrap.bind("onReset", function() {
3078                                f(this).find(e).length && e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder", !1)
3079                            }));
3080                            break;
3081                        case "image":
3082                            e = a.tpl.image.replace(/\{href\}/g, g);
3083                            break;
3084                        case "swf":
3085                            e = '<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="' + g + '"></param>', h = "", f.each(a.swf, function(a, b) {
3086                                e += '<param name="' + a + '" value="' + b + '"></param>';
3087                                h += " " + a + '="' + b + '"'
3088                            }), e += '<embed src="' + g + '" type="application/x-shockwave-flash" width="100%" height="100%"' + h + "></embed></object>"
3089                    }
3090                    u(e) && e.parent().is(a.inner) || a.inner.append(e);
3091                    b.trigger("beforeShow");
3092                    a.inner.css("overflow", "yes" === l ? "scroll" : "no" === l ? "hidden" : l);
3093                    b._setDimension();
3094                    b.reposition();
3095                    b.isOpen = !1;
3096                    b.coming = null;
3097                    b.bindEvents();
3098                    if (!b.isOpened) f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();
3099                    else if (d.prevMethod) b.transitions[d.prevMethod]();
3100                    b.transitions[b.isOpened ? a.nextMethod : a.openMethod]();
3101                    b._preloadImages()
3102                }
3103        },
3104        _setDimension: function() {
3105            var a = b.getViewport(),
3106                d = 0,
3107                e = !1,
3108                c = !1,
3109                e = b.wrap,
3110                l = b.skin,
3111                g = b.inner,
3112                h = b.current,
3113                c = h.width,
3114                k = h.height,
3115                n = h.minWidth,
3116                v = h.minHeight,
3117                p = h.maxWidth,
3118                q = h.maxHeight,
3119                t = h.scrolling,
3120                r = h.scrollOutside ? h.scrollbarWidth : 0,
3121                y = h.margin,
3122                z = m(y[1] + y[3]),
3123                s = m(y[0] + y[2]),
3124                w, A, u, D, B, G, C, E, I;
3125            e.add(l).add(g).width("auto").height("auto").removeClass("fancybox-tmp");
3126            y = m(l.outerWidth(!0) - l.width());
3127            w = m(l.outerHeight(!0) - l.height());
3128            A = z + y;
3129            u = s + w;
3130            D = F(c) ? (a.w - A) * m(c) / 100 : c;
3131            B = F(k) ? (a.h - u) * m(k) / 100 : k;
3132            if ("iframe" === h.type) {
3133                if (I = h.content, h.autoHeight && 1 === I.data("ready")) try {
3134                    I[0].contentWindow.document.location && (g.width(D).height(9999), G = I.contents().find("body"), r && G.css("overflow-x",
3135                        "hidden"), B = G.outerHeight(!0))
3136                } catch (H) {}
3137            } else if (h.autoWidth || h.autoHeight) g.addClass("fancybox-tmp"), h.autoWidth || g.width(D), h.autoHeight || g.height(B), h.autoWidth && (D = g.width()), h.autoHeight && (B = g.height()), g.removeClass("fancybox-tmp");
3138            c = m(D);
3139            k = m(B);
3140            E = D / B;
3141            n = m(F(n) ? m(n, "w") - A : n);
3142            p = m(F(p) ? m(p, "w") - A : p);
3143            v = m(F(v) ? m(v, "h") - u : v);
3144            q = m(F(q) ? m(q, "h") - u : q);
3145            G = p;
3146            C = q;
3147            h.fitToView && (p = Math.min(a.w - A, p), q = Math.min(a.h - u, q));
3148            A = a.w - z;
3149            s = a.h - s;
3150            h.aspectRatio ? (c > p && (c = p, k = m(c / E)), k > q && (k = q, c = m(k * E)), c < n && (c = n, k = m(c /
3151                E)), k < v && (k = v, c = m(k * E))) : (c = Math.max(n, Math.min(c, p)), h.autoHeight && "iframe" !== h.type && (g.width(c), k = g.height()), k = Math.max(v, Math.min(k, q)));
3152            if (h.fitToView)
3153                if (g.width(c).height(k), e.width(c + y), a = e.width(), z = e.height(), h.aspectRatio)
3154                    for (;
3155                        (a > A || z > s) && c > n && k > v && !(19 < d++);) k = Math.max(v, Math.min(q, k - 10)), c = m(k * E), c < n && (c = n, k = m(c / E)), c > p && (c = p, k = m(c / E)), g.width(c).height(k), e.width(c + y), a = e.width(), z = e.height();
3156                else c = Math.max(n, Math.min(c, c - (a - A))), k = Math.max(v, Math.min(k, k - (z - s)));
3157            r && "auto" === t && k < B &&
3158                c + y + r < A && (c += r);
3159            g.width(c).height(k);
3160            e.width(c + y);
3161            a = e.width();
3162            z = e.height();
3163            e = (a > A || z > s) && c > n && k > v;
3164            c = h.aspectRatio ? c < G && k < C && c < D && k < B : (c < G || k < C) && (c < D || k < B);
3165            f.extend(h, {
3166                dim: {
3167                    width: x(a),
3168                    height: x(z)
3169                },
3170                origWidth: D,
3171                origHeight: B,
3172                canShrink: e,
3173                canExpand: c,
3174                wPadding: y,
3175                hPadding: w,
3176                wrapSpace: z - l.outerHeight(!0),
3177                skinSpace: l.height() - k
3178            });
3179            !I && h.autoHeight && k > v && k < q && !c && g.height("auto")
3180        },
3181        _getPosition: function(a) {
3182            var d = b.current,
3183                e = b.getViewport(),
3184                c = d.margin,
3185                f = b.wrap.width() + c[1] + c[3],
3186                g = b.wrap.height() + c[0] + c[2],
3187                c = {
3188                    position: "absolute",
3189                    top: c[0],
3190                    left: c[3]
3191                };
3192            d.autoCenter && d.fixed && !a && g <= e.h && f <= e.w ? c.position = "fixed" : d.locked || (c.top += e.y, c.left += e.x);
3193            c.top = x(Math.max(c.top, c.top + (e.h - g) * d.topRatio));
3194            c.left = x(Math.max(c.left, c.left + (e.w - f) * d.leftRatio));
3195            return c
3196        },
3197        _afterZoomIn: function() {
3198            var a = b.current;
3199            a && ((b.isOpen = b.isOpened = !0, b.wrap.css("overflow", "visible").addClass("fancybox-opened"), b.update(), (a.closeClick || a.nextClick && 1 < b.group.length) && b.inner.css("cursor", "pointer").bind("click.fb", function(d) {
3200                f(d.target).is("a") || f(d.target).parent().is("a") ||
3201                    (d.preventDefault(), b[a.closeClick ? "close" : "next"]())
3202            }), a.closeBtn && f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb", function(a) {
3203                a.preventDefault();
3204                b.close()
3205            }), a.arrows && 1 < b.group.length && ((a.loop || 0 < a.index) && f(a.tpl.prev).appendTo(b.outer).bind("click.fb", b.prev), (a.loop || a.index < b.group.length - 1) && f(a.tpl.next).appendTo(b.outer).bind("click.fb", b.next)), b.trigger("afterShow"), a.loop || a.index !== a.group.length - 1) ? b.opts.autoPlay && !b.player.isActive && (b.opts.autoPlay = !1, b.play(!0)) : b.play(!1))
3206        },
3207        _afterZoomOut: function(a) {
3208            a = a || b.current;
3209            f(".fancybox-wrap").trigger("onReset").remove();
3210            f.extend(b, {
3211                group: {},
3212                opts: {},
3213                router: !1,
3214                current: null,
3215                isActive: !1,
3216                isOpened: !1,
3217                isOpen: !1,
3218                isClosing: !1,
3219                wrap: null,
3220                skin: null,
3221                outer: null,
3222                inner: null
3223            });
3224            b.trigger("afterClose", a)
3225        }
3226    });
3227    b.transitions = {
3228        getOrigPosition: function() {
3229            var a = b.current,
3230                d = a.element,
3231                e = a.orig,
3232                c = {},
3233                f = 50,
3234                g = 50,
3235                h = a.hPadding,
3236                k = a.wPadding,
3237                n = b.getViewport();
3238            !e && a.isDom && d.is(":visible") && (e = d.find("img:first"), e.length || (e = d));
3239            u(e) ? (c = e.offset(), e.is("img") &&
3240                (f = e.outerWidth(), g = e.outerHeight())) : (c.top = n.y + (n.h - g) * a.topRatio, c.left = n.x + (n.w - f) * a.leftRatio);
3241            if ("fixed" === b.wrap.css("position") || a.locked) c.top -= n.y, c.left -= n.x;
3242            return c = {
3243                top: x(c.top - h * a.topRatio),
3244                left: x(c.left - k * a.leftRatio),
3245                width: x(f + k),
3246                height: x(g + h)
3247            }
3248        },
3249        step: function(a, d) {
3250            var e, c, f = d.prop;
3251            c = b.current;
3252            var g = c.wrapSpace,
3253                h = c.skinSpace;
3254            if ("width" === f || "height" === f) e = d.end === d.start ? 1 : (a - d.start) / (d.end - d.start), b.isClosing && (e = 1 - e), c = "width" === f ? c.wPadding : c.hPadding, c = a - c, b.skin[f](m("width" ===
3255                f ? c : c - g * e)), b.inner[f](m("width" === f ? c : c - g * e - h * e))
3256        },
3257        zoomIn: function() {
3258            var a = b.current,
3259                d = a.pos,
3260                e = a.openEffect,
3261                c = "elastic" === e,
3262                l = f.extend({
3263                    opacity: 1
3264                }, d);
3265            delete l.position;
3266            c ? (d = this.getOrigPosition(), a.openOpacity && (d.opacity = 0.1)) : "fade" === e && (d.opacity = 0.1);
3267            b.wrap.css(d).animate(l, {
3268                duration: "none" === e ? 0 : a.openSpeed,
3269                easing: a.openEasing,
3270                step: c ? this.step : null,
3271                complete: b._afterZoomIn
3272            })
3273        },
3274        zoomOut: function() {
3275            var a = b.current,
3276                d = a.closeEffect,
3277                e = "elastic" === d,
3278                c = {
3279                    opacity: 0.1
3280                };
3281            e && (c = this.getOrigPosition(), a.closeOpacity &&
3282                (c.opacity = 0.1));
3283            b.wrap.animate(c, {
3284                duration: "none" === d ? 0 : a.closeSpeed,
3285                easing: a.closeEasing,
3286                step: e ? this.step : null,
3287                complete: b._afterZoomOut
3288            })
3289        },
3290        changeIn: function() {
3291            var a = b.current,
3292                d = a.nextEffect,
3293                e = a.pos,
3294                c = {
3295                    opacity: 1
3296                },
3297                f = b.direction,
3298                g;
3299            e.opacity = 0.1;
3300            "elastic" === d && (g = "down" === f || "up" === f ? "top" : "left", "down" === f || "right" === f ? (e[g] = x(m(e[g]) - 200), c[g] = "+=200px") : (e[g] = x(m(e[g]) + 200), c[g] = "-=200px"));
3301            "none" === d ? b._afterZoomIn() : b.wrap.css(e).animate(c, {
3302                duration: a.nextSpeed,
3303                easing: a.nextEasing,
3304                complete: b._afterZoomIn
3305            })
3306        },
3307        changeOut: function() {
3308            var a = b.previous,
3309                d = a.prevEffect,
3310                e = {
3311                    opacity: 0.1
3312                },
3313                c = b.direction;
3314            "elastic" === d && (e["down" === c || "up" === c ? "top" : "left"] = ("up" === c || "left" === c ? "-" : "+") + "=200px");
3315            a.wrap.animate(e, {
3316                duration: "none" === d ? 0 : a.prevSpeed,
3317                easing: a.prevEasing,
3318                complete: function() {
3319                    f(this).trigger("onReset").remove()
3320                }
3321            })
3322        }
3323    };
3324    b.helpers.overlay = {
3325        defaults: {
3326            closeClick: !0,
3327            speedOut: 200,
3328            showEarly: !0,
3329            css: {},
3330            locked: !t,
3331            fixed: !0
3332        },
3333        overlay: null,
3334        fixed: !1,
3335        el: f("html"),
3336        create: function(a) {
3337            var d;
3338            a = f.extend({}, this.defaults, a);
3339            this.overlay &&
3340                this.close();
3341            d = b.coming ? b.coming.parent : a.parent;
3342            this.overlay = f('<div class="fancybox-overlay"></div>').appendTo(d && d.lenth ? d : "body");
3343            this.fixed = !1;
3344            a.fixed && b.defaults.fixed && (this.overlay.addClass("fancybox-overlay-fixed"), this.fixed = !0)
3345        },
3346        open: function(a) {
3347            var d = this;
3348            a = f.extend({}, this.defaults, a);
3349            this.overlay ? this.overlay.unbind(".overlay").width("auto").height("auto") : this.create(a);
3350            this.fixed || (q.bind("resize.overlay", f.proxy(this.update, this)), this.update());
3351            a.closeClick && this.overlay.bind("click.overlay",
3352                function(a) {
3353                    if (f(a.target).hasClass("fancybox-overlay")) return b.isActive ? b.close() : d.close(), !1
3354                });
3355            this.overlay.css(a.css).show()
3356        },
3357        close: function() {
3358            q.unbind("resize.overlay");
3359            this.el.hasClass("fancybox-lock") && (f(".fancybox-margin").removeClass("fancybox-margin"), this.el.removeClass("fancybox-lock"), q.scrollTop(this.scrollV).scrollLeft(this.scrollH));
3360            f(".fancybox-overlay").remove().hide();
3361            f.extend(this, {
3362                overlay: null,
3363                fixed: !1
3364            })
3365        },
3366        update: function() {
3367            var a = "100%",
3368                b;
3369            this.overlay.width(a).height("100%");
3370            J ? (b = Math.max(H.documentElement.offsetWidth, H.body.offsetWidth), p.width() > b && (a = p.width())) : p.width() > q.width() && (a = p.width());
3371            this.overlay.width(a).height(p.height())
3372        },
3373        onReady: function(a, b) {
3374            var e = this.overlay;
3375            f(".fancybox-overlay").stop(!0, !0);
3376            e || this.create(a);
3377            a.locked && this.fixed && b.fixed && (b.locked = this.overlay.append(b.wrap), b.fixed = !1);
3378            !0 === a.showEarly && this.beforeShow.apply(this, arguments)
3379        },
3380        beforeShow: function(a, b) {
3381            b.locked && !this.el.hasClass("fancybox-lock") && (!1 !== this.fixPosition && f("*").filter(function() {
3382                return "fixed" ===
3383                    f(this).css("position") && !f(this).hasClass("fancybox-overlay") && !f(this).hasClass("fancybox-wrap")
3384            }).addClass("fancybox-margin"), this.el.addClass("fancybox-margin"), this.scrollV = q.scrollTop(), this.scrollH = q.scrollLeft(), this.el.addClass("fancybox-lock"), q.scrollTop(this.scrollV).scrollLeft(this.scrollH));
3385            this.open(a)
3386        },
3387        onUpdate: function() {
3388            this.fixed || this.update()
3389        },
3390        afterClose: function(a) {
3391            this.overlay && !b.coming && this.overlay.fadeOut(a.speedOut, f.proxy(this.close, this))
3392        }
3393    };
3394    b.helpers.title = {
3395        defaults: {
3396            type: "float",
3397            position: "bottom"
3398        },
3399        beforeShow: function(a) {
3400            var d = b.current,
3401                e = d.title,
3402                c = a.type;
3403            f.isFunction(e) && (e = e.call(d.element, d));
3404            if (r(e) && "" !== f.trim(e)) {
3405                d = f('<div class="fancybox-title fancybox-title-' + c + '-wrap">' + e + "</div>");
3406                switch (c) {
3407                    case "inside":
3408                        c = b.skin;
3409                        break;
3410                    case "outside":
3411                        c = b.wrap;
3412                        break;
3413                    case "over":
3414                        c = b.inner;
3415                        break;
3416                    default:
3417                        c = b.skin, d.appendTo("body"), J && d.width(d.width()), d.wrapInner('<span class="child"></span>'), b.current.margin[2] += Math.abs(m(d.css("margin-bottom")))
3418                }
3419                d["top" === a.position ? "prependTo" :
3420                    "appendTo"](c)
3421            }
3422        }
3423    };
3424    f.fn.fancybox = function(a) {
3425        var d, e = f(this),
3426            c = this.selector || "",
3427            l = function(g) {
3428                var h = f(this).blur(),
3429                    k = d,
3430                    l, m;
3431                g.ctrlKey || g.altKey || g.shiftKey || g.metaKey || h.is(".fancybox-wrap") || (l = a.groupAttr || "data-fancybox-group", m = h.attr(l), m || (l = "rel", m = h.get(0)[l]), m && "" !== m && "nofollow" !== m && (h = c.length ? f(c) : e, h = h.filter("[" + l + '="' + m + '"]'), k = h.index(this)), a.index = k, !1 !== b.open(h, a) && g.preventDefault())
3432            };
3433        a = a || {};
3434        d = a.index || 0;
3435        c && !1 !== a.live ? p.undelegate(c, "click.fb-start").delegate(c + ":not('.fancybox-item, .fancybox-nav')",
3436            "click.fb-start", l) : e.unbind("click.fb-start").bind("click.fb-start", l);
3437        this.filter("[data-fancybox-start=1]").trigger("click");
3438        return this
3439    };
3440    p.ready(function() {
3441        var a, d;
3442        f.scrollbarWidth === w && (f.scrollbarWidth = function() {
3443            var a = f('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),
3444                b = a.children(),
3445                b = b.innerWidth() - b.height(99).innerWidth();
3446            a.remove();
3447            return b
3448        });
3449        f.support.fixedPosition === w && (f.support.fixedPosition = function() {
3450            var a = f('<div style="position:fixed;top:20px;"></div>').appendTo("body"),
3451                b = 20 === a[0].offsetTop || 15 === a[0].offsetTop;
3452            a.remove();
3453            return b
3454        }());
3455        f.extend(b.defaults, {
3456            scrollbarWidth: f.scrollbarWidth(),
3457            fixed: f.support.fixedPosition,
3458            parent: f("body")
3459        });
3460        a = f(s).width();
3461        K.addClass("fancybox-lock-test");
3462        d = f(s).width();
3463        K.removeClass("fancybox-lock-test");
3464        f("<style type='text/css'>.fancybox-margin{margin-right:" + (d - a) + "px;}</style>").appendTo("head")
3465    })
3466})(window, document, jQuery);
3467
3468
3469
3470
3471
3472
3473/*!
3474 * Media helper for fancyBox
3475 * version: 1.0.6 (Fri, 14 Jun 2013)
3476 * @requires fancyBox v2.0 or later
3477 *
3478 * Usage:
3479 *     $(".fancybox").fancybox({
3480 *         helpers : {
3481 *             media: true
3482 *         }
3483 *     });
3484 *
3485 * Set custom URL parameters:
3486 *     $(".fancybox").fancybox({
3487 *         helpers : {
3488 *             media: {
3489 *                 youtube : {
3490 *                     params : {
3491 *                         autoplay : 0
3492 *                     }
3493 *                 }
3494 *             }
3495 *         }
3496 *     });
3497 *
3498 * Or:
3499 *     $(".fancybox").fancybox({,
3500 *         helpers : {
3501 *             media: true
3502 *         },
3503 *         youtube : {
3504 *             autoplay: 0
3505 *         }
3506 *     });
3507 *
3508 *  Supports:
3509 *
3510 *      Youtube
3511 *          http://www.youtube.com/watch?v=opj24KnzrWo
3512 *          http://www.youtube.com/embed/opj24KnzrWo
3513 *          http://youtu.be/opj24KnzrWo
3514 *          http://www.youtube-nocookie.com/embed/opj24KnzrWo
3515 *      Vimeo
3516 *          http://vimeo.com/40648169
3517 *          http://vimeo.com/channels/staffpicks/38843628
vendor: 5,535 bytes, lines 3518-3666
3518 *          http://vimeo.com/groups/surrealism/videos/36516384
3519 *          http://player.vimeo.com/video/45074303
3520 *      Metacafe
3521 *          http://www.metacafe.com/watch/7635964/dr_seuss_the_lorax_movie_trailer/
3522 *          http://www.metacafe.com/watch/7635964/
3523 *      Dailymotion
3524 *          http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people
3525 *      Twitvid
3526 *          http://twitvid.com/QY7MD
3527 *      Twitpic
3528 *          http://twitpic.com/7p93st
3529 *      Instagram
3530 *          http://instagr.am/p/IejkuUGxQn/
3531 *          http://instagram.com/p/IejkuUGxQn/
3532 *      Google maps
3533 *          http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17
3534 *          http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16
3535 *          http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56
3536 */
3537(function ($) {
3538    "use strict";
3539
3540    //Shortcut for fancyBox object
3541    var F = $.fancybox,
3542        format = function( url, rez, params ) {
3543            params = params || '';
3544
3545            if ( $.type( params ) === "object" ) {
3546                params = $.param(params, true);
3547            }
3548
3549            $.each(rez, function(key, value) {
3550                url = url.replace( '$' + key, value || '' );
3551            });
3552
3553            if (params.length) {
3554                url += ( url.indexOf('?') > 0 ? '&' : '?' ) + params;
3555            }
3556
3557            return url;
3558        };
3559
3560    //Add helper object
3561    F.helpers.media = {
3562        defaults : {
3563            youtube : {
3564                matcher : /(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i,
3565                params  : {
3566                    autoplay    : 1,
3567                    autohide    : 1,
3568                    fs          : 1,
3569                    rel         : 0,
3570                    hd          : 1,
3571                    wmode       : 'opaque',
3572                    enablejsapi : 1
3573                },
3574                type : 'iframe',
3575                url  : '//www.youtube.com/embed/$3'
3576            },
3577            vimeo : {
3578                matcher : /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/,
3579                params  : {
3580                    autoplay      : 1,
3581                    hd            : 1,
3582                    show_title    : 1,
3583                    show_byline   : 1,
3584                    show_portrait : 0,
3585                    fullscreen    : 1
3586                },
3587                type : 'iframe',
3588                url  : '//player.vimeo.com/video/$1'
3589            },
3590            metacafe : {
3591                matcher : /metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/,
3592                params  : {
3593                    autoPlay : 'yes'
3594                },
3595                type : 'swf',
3596                url  : function( rez, params, obj ) {
3597                    obj.swf.flashVars = 'playerVars=' + $.param( params, true );
3598
3599                    return '//www.metacafe.com/fplayer/' + rez[1] + '/.swf';
3600                }
3601            },
3602            dailymotion : {
3603                matcher : /dailymotion.com\/video\/(.*)\/?(.*)/,
3604                params  : {
3605                    additionalInfos : 0,
3606                    autoStart : 1
3607                },
3608                type : 'swf',
3609                url  : '//www.dailymotion.com/swf/video/$1'
3610            },
3611            twitvid : {
3612                matcher : /twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i,
3613                params  : {
3614                    autoplay : 0
3615                },
3616                type : 'iframe',
3617                url  : '//www.twitvid.com/embed.php?guid=$1'
3618            },
3619            twitpic : {
3620                matcher : /twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i,
3621                type : 'image',
3622                url  : '//twitpic.com/show/full/$1/'
3623            },
3624            instagram : {
3625                matcher : /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,
3626                type : 'image',
3627                url  : '//$1/p/$2/media/?size=l'
3628            },
3629            google_maps : {
3630                matcher : /maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i,
3631                type : 'iframe',
3632                url  : function( rez ) {
3633                    return '//maps.google.' + rez[1] + '/' + rez[3] + '' + rez[4] + '&output=' + (rez[4].indexOf('layer=c') > 0 ? 'svembed' : 'embed');
3634                }
3635            }
3636        },
3637
3638        beforeLoad : function(opts, obj) {
3639            var url   = obj.href || '',
3640                type  = false,
3641                what,
3642                item,
3643                rez,
3644                params;
3645
3646            for (what in opts) {
3647                if (opts.hasOwnProperty(what)) {
3648                    item = opts[ what ];
3649                    rez  = url.match( item.matcher );
3650
3651                    if (rez) {
3652                        type   = item.type;
3653                        params = $.extend(true, {}, item.params, obj[ what ] || ($.isPlainObject(opts[ what ]) ? opts[ what ].params : null));
3654
3655                        url = $.type( item.url ) === "function" ? item.url.call( this, rez, params, obj ) : format( item.url, rez, params );
3656
3657                        break;
3658                    }
3659                }
3660            }
3661
3662            if (type) {
3663                obj.href = url;
3664                obj.type = type;
3665
3666                obj.autoHeight = false;
vendor: 4,333 bytes, lines 3667-3771
3667            }
3668        }
3669    };
3670
3671}(jQuery));;/*
3672 * jQuery FlexSlider v2.2.2
3673 * Copyright 2012 WooThemes
3674 * Contributing Author: Tyler Smith
3675 */
3676;
3677(function ($) {
3678
3679  //FlexSlider: Object Instance
3680  $.flexslider = function(el, options) {
3681    var slider = $(el);
3682
3683    // making variables public
3684    slider.vars = $.extend({}, $.flexslider.defaults, options);
3685
3686    var namespace = slider.vars.namespace,
3687        msGesture = window.navigator && window.navigator.msPointerEnabled && window.MSGesture,
3688        touch = (( "ontouchstart" in window ) || msGesture || window.DocumentTouch && document instanceof DocumentTouch) && slider.vars.touch,
3689        // depricating this idea, as devices are being released with both of these events
3690        //eventType = (touch) ? "touchend" : "click",
3691        eventType = "click touchend MSPointerUp",
3692        watchedEvent = "",
3693        watchedEventClearTimer,
3694        vertical = slider.vars.direction === "vertical",
3695        reverse = slider.vars.reverse,
3696        carousel = (slider.vars.itemWidth > 0),
3697        fade = slider.vars.animation === "fade",
3698        asNav = slider.vars.asNavFor !== "",
3699        methods = {},
3700        focused = true;
3701
3702    // Store a reference to the slider object
3703    $.data(el, "flexslider", slider);
3704
3705    // Private slider methods
3706    methods = {
3707      init: function() {
3708        slider.animating = false;
3709        // Get current slide and make sure it is a number
3710        slider.currentSlide = parseInt( ( slider.vars.startAt ? slider.vars.startAt : 0), 10 );
3711        if ( isNaN( slider.currentSlide ) ) slider.currentSlide = 0;
3712        slider.animatingTo = slider.currentSlide;
3713        slider.atEnd = (slider.currentSlide === 0 || slider.currentSlide === slider.last);
3714        slider.containerSelector = slider.vars.selector.substr(0,slider.vars.selector.search(' '));
3715        slider.slides = $(slider.vars.selector, slider);
3716        slider.container = $(slider.containerSelector, slider);
3717        slider.count = slider.slides.length;
3718        // SYNC:
3719        slider.syncExists = $(slider.vars.sync).length > 0;
3720        // SLIDE:
3721        if (slider.vars.animation === "slide") slider.vars.animation = "swing";
3722        slider.prop = (vertical) ? "top" : "marginLeft";
3723        slider.args = {};
3724        // SLIDESHOW:
3725        slider.manualPause = false;
3726        slider.stopped = false;
3727        //PAUSE WHEN INVISIBLE
3728        slider.started = false;
3729        slider.startTimeout = null;
3730        // TOUCH/USECSS:
3731        slider.transitions = !slider.vars.video && !fade && slider.vars.useCSS && (function() {
3732          var obj = document.createElement('div'),
3733              props = ['perspectiveProperty', 'WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective'];
3734          for (var i in props) {
3735            if ( obj.style[ props[i] ] !== undefined ) {
3736              slider.pfx = props[i].replace('Perspective','').toLowerCase();
3737              slider.prop = "-" + slider.pfx + "-transform";
3738              return true;
3739            }
3740          }
3741          return false;
3742        }());
3743        // CONTROLSCONTAINER:
3744        if (slider.vars.controlsContainer !== "") slider.controlsContainer = $(slider.vars.controlsContainer).length > 0 && $(slider.vars.controlsContainer);
3745        // MANUAL:
3746        if (slider.vars.manualControls !== "") slider.manualControls = $(slider.vars.manualControls).length > 0 && $(slider.vars.manualControls);
3747
3748        // RANDOMIZE:
3749        if (slider.vars.randomize) {
3750          slider.slides.sort(function() { return (Math.round(Math.random())-0.5); });
3751          slider.container.empty().append(slider.slides);
3752        }
3753
3754        slider.doMath();
3755
3756        // INIT
3757        slider.setup("init");
3758
3759        // CONTROLNAV:
3760        if (slider.vars.controlNav) methods.controlNav.setup();
3761
3762        // DIRECTIONNAV:
3763        if (slider.vars.directionNav) methods.directionNav.setup();
3764
3765        // KEYBOARD:
3766        if (slider.vars.keyboard && ($(slider.containerSelector).length === 1 || slider.vars.multipleKeyboard)) {
3767          $(document).bind('keyup', function(event) {
3768            var keycode = event.keyCode;
3769            if (!slider.animating && (keycode === 39 || keycode === 37)) {
3770              var target = (keycode === 39) ? slider.getTarget('next') :
3771                           (keycode === 37) ? slider.getTarget('prev') : false;
3772              slider.flexAnimate(target, slider.vars.pauseOnAction);
3773            }
3774          });
3775        }
3776        // MOUSEWHEEL:
3777        if (slider.vars.mousewheel) {
3778          slider.bind('mousewheel', function(event, delta, deltaX, deltaY) {
3779            event.preventDefault();
3780            var target = (delta < 0) ? slider.getTarget('next') : slider.getTarget('prev');
3781            slider.flexAnimate(target, slider.vars.pauseOnAction);
3782          });
3783        }
3784
3785        // PAUSEPLAY
3786        if (slider.vars.pausePlay) methods.pausePlay.setup();
3787
3788        //PAUSE WHEN INVISIBLE
3789        if (slider.vars.slideshow && slider.vars.pauseInvisible) methods.pauseInvisible.init();
3790
3791        // SLIDSESHOW
3792        if (slider.vars.slideshow) {
3793          if (slider.vars.pauseOnHover) {
3794            slider.hover(function() {
3795              if (!slider.manualPlay && !slider.manualPause) slider.pause();
3796            }, function() {
3797              if (!slider.manualPause && !slider.manualPlay && !slider.stopped) slider.play();
3798            });
3799          }
3800          // initialize animation
3801          //If we're visible, or we don't use PageVisibility API
3802          if(!slider.vars.pauseInvisible || !methods.pauseInvisible.isHidden()) {
3803            (slider.vars.initDelay > 0) ? slider.startTimeout = setTimeout(slider.play, slider.vars.initDelay) : slider.play();
3804          }
3805        }
3806
3807        // ASNAV:
3808        if (asNav) methods.asNav.setup();
3809
3810        // TOUCH
3811        if (touch && slider.vars.touch) methods.touch();
3812
3813        // FADE&&SMOOTHHEIGHT || SLIDE:
3814        if (!fade || (fade && slider.vars.smoothHeight)) $(window).bind("resize orientationchange focus", methods.resize);
3815
3816        slider.find("img").attr("draggable", "false");
3817
3818        // API: start() Callback
3819        setTimeout(function(){
3820          slider.vars.start(slider);
3821        }, 200);
3822      },
3823      asNav: {
3824        setup: function() {
3825          slider.asNav = true;
3826          slider.animatingTo = Math.floor(slider.currentSlide/slider.move);
3827          slider.currentItem = slider.currentSlide;
3828          slider.slides.removeClass(namespace + "active-slide").eq(slider.currentItem).addClass(namespace + "active-slide");
3829          if(!msGesture){
3830              slider.slides.on(eventType, function(e){
3831                e.preventDefault();
3832                var $slide = $(this),
3833                    target = $slide.index();
3834                var posFromLeft = $slide.offset().left - $(slider).scrollLeft(); // Find position of slide relative to left of slider container
3835                if( posFromLeft <= 0 && $slide.hasClass( namespace + 'active-slide' ) ) {
3836                  slider.flexAnimate(slider.getTarget("prev"), true);
3837                } else if (!$(slider.vars.asNavFor).data('flexslider').animating && !$slide.hasClass(namespace + "active-slide")) {
3838                  slider.direction = (slider.currentItem < target) ? "next" : "prev";
3839                  slider.flexAnimate(target, slider.vars.pauseOnAction, false, true, true);
3840                }
3841              });
3842          }else{
3843              el._slider = slider;
3844              slider.slides.each(function (){
3845                  var that = this;
3846                  that._gesture = new MSGesture();
3847                  that._gesture.target = that;
3848                  that.addEventListener("MSPointerDown", function (e){
3849                      e.preventDefault();
3850                      if(e.currentTarget._gesture)
3851                          e.currentTarget._gesture.addPointer(e.pointerId);
3852                  }, false);
3853                  that.addEventListener("MSGestureTap", function (e){
3854                      e.preventDefault();
3855                      var $slide = $(this),
3856                          target = $slide.index();
3857                      if (!$(slider.vars.asNavFor).data('flexslider').animating && !$slide.hasClass('active')) {
3858                          slider.direction = (slider.currentItem < target) ? "next" : "prev";
3859                          slider.flexAnimate(target, slider.vars.pauseOnAction, false, true, true);
3860                      }
3861                  });
3862              });
3863          }
3864        }
3865      },
3866      controlNav: {
3867        setup: function() {
3868          if (!slider.manualControls) {
vendor: 38,681 bytes, lines 3869-4736
3869            methods.controlNav.setupPaging();
3870          } else { // MANUALCONTROLS:
3871            methods.controlNav.setupManual();
3872          }
3873        },
3874        setupPaging: function() {
3875          var type = (slider.vars.controlNav === "thumbnails") ? 'control-thumbs' : 'control-paging',
3876              j = 1,
3877              item,
3878              slide;
3879
3880          slider.controlNavScaffold = $('<ol class="'+ namespace + 'control-nav ' + namespace + type + '"></ol>');
3881
3882          if (slider.pagingCount > 1) {
3883            for (var i = 0; i < slider.pagingCount; i++) {
3884              slide = slider.slides.eq(i);
3885              
3886              item = (slider.vars.controlNav === "thumbnails") ? '<img src="' + slider.slides.eq(i).attr("data-thumb") + '"/>' : '<a><i class="mk-icon-circle-blank"></i></a>';
3887              if ( 'thumbnails' === slider.vars.controlNav && true === slider.vars.thumbCaptions ) {
3888                var captn = slide.attr( 'data-thumbcaption' );
3889                if ( '' != captn && undefined != captn ) item += '<span class="' + namespace + 'caption">' + captn + '</span>';
3890              }
3891              slider.controlNavScaffold.append('<li>' + item + '</li>');
3892              j++;
3893            }
3894          }
3895
3896          // CONTROLSCONTAINER:
3897          (slider.controlsContainer) ? $(slider.controlsContainer).append(slider.controlNavScaffold) : slider.append(slider.controlNavScaffold);
3898          methods.controlNav.set();
3899
3900          methods.controlNav.active();
3901
3902          slider.controlNavScaffold.delegate('a, img', eventType, function(event) {
3903            event.preventDefault();
3904
3905            if (watchedEvent === "" || watchedEvent === event.type) {
3906              var $this = $(this),
3907                  target = slider.controlNav.index($this);
3908
3909              if (!$this.hasClass(namespace + 'active')) {
3910                slider.direction = (target > slider.currentSlide) ? "next" : "prev";
3911                slider.flexAnimate(target, slider.vars.pauseOnAction);
3912              }
3913            }
3914
3915            // setup flags to prevent event duplication
3916            if (watchedEvent === "") {
3917              watchedEvent = event.type;
3918            }
3919            methods.setToClearWatchedEvent();
3920
3921          });
3922        },
3923        setupManual: function() {
3924          slider.controlNav = slider.manualControls;
3925          methods.controlNav.active();
3926
3927          slider.controlNav.bind(eventType, function(event) {
3928            event.preventDefault();
3929
3930            if (watchedEvent === "" || watchedEvent === event.type) {
3931              var $this = $(this),
3932                  target = slider.controlNav.index($this);
3933
3934              if (!$this.hasClass(namespace + 'active')) {
3935                (target > slider.currentSlide) ? slider.direction = "next" : slider.direction = "prev";
3936                slider.flexAnimate(target, slider.vars.pauseOnAction);
3937              }
3938            }
3939
3940            // setup flags to prevent event duplication
3941            if (watchedEvent === "") {
3942              watchedEvent = event.type;
3943            }
3944            methods.setToClearWatchedEvent();
3945          });
3946        },
3947        set: function() {
3948          var selector = (slider.vars.controlNav === "thumbnails") ? 'img' : 'a';
3949          slider.controlNav = $('.' + namespace + 'control-nav li ' + selector, (slider.controlsContainer) ? slider.controlsContainer : slider);
3950        },
3951        active: function() {
3952          slider.controlNav.removeClass(namespace + "active").eq(slider.animatingTo).addClass(namespace + "active");
3953        },
3954        update: function(action, pos) {
3955          if (slider.pagingCount > 1 && action === "add") {
3956            slider.controlNavScaffold.append($('<li><a>' + slider.count + '</a></li>'));
3957          } else if (slider.pagingCount === 1) {
3958            slider.controlNavScaffold.find('li').remove();
3959          } else {
3960            slider.controlNav.eq(pos).closest('li').remove();
3961          }
3962          methods.controlNav.set();
3963          (slider.pagingCount > 1 && slider.pagingCount !== slider.controlNav.length) ? slider.update(pos, action) : methods.controlNav.active();
3964        }
3965      },
3966      directionNav: {
3967        setup: function() {
3968          var directionNavScaffold = $('<ul class="' + namespace + 'direction-nav"><li><a class="' + namespace + 'prev" href="#">' + slider.vars.directionNavArrowsLeft + slider.vars.prevText + '</a></li><li><a class="' + namespace + 'next" href="#">' + slider.vars.directionNavArrowsRight + slider.vars.nextText + '</a></li></ul>');
3969
3970          // CONTROLSCONTAINER:
3971          if (slider.controlsContainer) {
3972            $(slider.controlsContainer).append(directionNavScaffold);
3973            slider.directionNav = $('.' + namespace + 'direction-nav li a', slider.controlsContainer);
3974          } else {
3975            slider.append(directionNavScaffold);
3976            slider.directionNav = $('.' + namespace + 'direction-nav li a', slider);
3977          }
3978
3979          methods.directionNav.update();
3980
3981          slider.directionNav.bind(eventType, function(event) {
3982            event.preventDefault();
3983            var target;
3984
3985            if (watchedEvent === "" || watchedEvent === event.type) {
3986              target = ($(this).hasClass(namespace + 'next')) ? slider.getTarget('next') : slider.getTarget('prev');
3987              slider.flexAnimate(target, slider.vars.pauseOnAction);
3988            }
3989
3990            // setup flags to prevent event duplication
3991            if (watchedEvent === "") {
3992              watchedEvent = event.type;
3993            }
3994            methods.setToClearWatchedEvent();
3995          });
3996        },
3997        update: function() {
3998          var disabledClass = namespace + 'disabled';
3999          if (slider.pagingCount === 1) {
4000            slider.directionNav.addClass(disabledClass).attr('tabindex', '-1');
4001          } else if (!slider.vars.animationLoop) {
4002            if (slider.animatingTo === 0) {
4003              slider.directionNav.removeClass(disabledClass).filter('.' + namespace + "prev").addClass(disabledClass).attr('tabindex', '-1');
4004            } else if (slider.animatingTo === slider.last) {
4005              slider.directionNav.removeClass(disabledClass).filter('.' + namespace + "next").addClass(disabledClass).attr('tabindex', '-1');
4006            } else {
4007              slider.directionNav.removeClass(disabledClass).removeAttr('tabindex');
4008            }
4009          } else {
4010            slider.directionNav.removeClass(disabledClass).removeAttr('tabindex');
4011          }
4012        }
4013      },
4014      pausePlay: {
4015        setup: function() {
4016          var pausePlayScaffold = $('<div class="' + namespace + 'pauseplay"><a></a></div>');
4017
4018          // CONTROLSCONTAINER:
4019          if (slider.controlsContainer) {
4020            slider.controlsContainer.append(pausePlayScaffold);
4021            slider.pausePlay = $('.' + namespace + 'pauseplay a', slider.controlsContainer);
4022          } else {
4023            slider.append(pausePlayScaffold);
4024            slider.pausePlay = $('.' + namespace + 'pauseplay a', slider);
4025          }
4026
4027          methods.pausePlay.update((slider.vars.slideshow) ? namespace + 'pause' : namespace + 'play');
4028
4029          slider.pausePlay.bind(eventType, function(event) {
4030            event.preventDefault();
4031
4032            if (watchedEvent === "" || watchedEvent === event.type) {
4033              if ($(this).hasClass(namespace + 'pause')) {
4034                slider.manualPause = true;
4035                slider.manualPlay = false;
4036                slider.pause();
4037              } else {
4038                slider.manualPause = false;
4039                slider.manualPlay = true;
4040                slider.play();
4041              }
4042            }
4043
4044            // setup flags to prevent event duplication
4045            if (watchedEvent === "") {
4046              watchedEvent = event.type;
4047            }
4048            methods.setToClearWatchedEvent();
4049          });
4050        },
4051        update: function(state) {
4052          (state === "play") ? slider.pausePlay.removeClass(namespace + 'pause').addClass(namespace + 'play').html(slider.vars.playText) : slider.pausePlay.removeClass(namespace + 'play').addClass(namespace + 'pause').html(slider.vars.pauseText);
4053        }
4054      },
4055      touch: function() {
4056        var startX,
4057          startY,
4058          offset,
4059          cwidth,
4060          dx,
4061          startT,
4062          scrolling = false,
4063          localX = 0,
4064          localY = 0,
4065          accDx = 0;
4066
4067        if(!msGesture){
4068            el.addEventListener('touchstart', onTouchStart, false);
4069
4070            function onTouchStart(e) {
4071              if (slider.animating) {
4072                e.preventDefault();
4073              } else if ( ( window.navigator.msPointerEnabled ) || e.touches.length === 1 ) {
4074                slider.pause();
4075                // CAROUSEL:
4076                cwidth = (vertical) ? slider.h : slider. w;
4077                startT = Number(new Date());
4078                // CAROUSEL:
4079
4080                // Local vars for X and Y points.
4081                localX = e.touches[0].pageX;
4082                localY = e.touches[0].pageY;
4083
4084                offset = (carousel && reverse && slider.animatingTo === slider.last) ? 0 :
4085                         (carousel && reverse) ? slider.limit - (((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.animatingTo) :
4086                         (carousel && slider.currentSlide === slider.last) ? slider.limit :
4087                         (carousel) ? ((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.currentSlide :
4088                         (reverse) ? (slider.last - slider.currentSlide + slider.cloneOffset) * cwidth : (slider.currentSlide + slider.cloneOffset) * cwidth;
4089                startX = (vertical) ? localY : localX;
4090                startY = (vertical) ? localX : localY;
4091
4092                el.addEventListener('touchmove', onTouchMove, false);
4093                el.addEventListener('touchend', onTouchEnd, false);
4094              }
4095            }
4096
4097            function onTouchMove(e) {
4098              // Local vars for X and Y points.
4099
4100              localX = e.touches[0].pageX;
4101              localY = e.touches[0].pageY;
4102
4103              dx = (vertical) ? startX - localY : startX - localX;
4104              scrolling = (vertical) ? (Math.abs(dx) < Math.abs(localX - startY)) : (Math.abs(dx) < Math.abs(localY - startY));
4105
4106              var fxms = 500;
4107
4108              if ( ! scrolling || Number( new Date() ) - startT > fxms ) {
4109                e.preventDefault();
4110                if (!fade && slider.transitions) {
4111                  if (!slider.vars.animationLoop) {
4112                    dx = dx/((slider.currentSlide === 0 && dx < 0 || slider.currentSlide === slider.last && dx > 0) ? (Math.abs(dx)/cwidth+2) : 1);
4113                  }
4114                  slider.setProps(offset + dx, "setTouch");
4115                }
4116              }
4117            }
4118
4119            function onTouchEnd(e) {
4120              // finish the touch by undoing the touch session
4121              el.removeEventListener('touchmove', onTouchMove, false);
4122
4123              if (slider.animatingTo === slider.currentSlide && !scrolling && !(dx === null)) {
4124                var updateDx = (reverse) ? -dx : dx,
4125                    target = (updateDx > 0) ? slider.getTarget('next') : slider.getTarget('prev');
4126
4127                if (slider.canAdvance(target) && (Number(new Date()) - startT < 550 && Math.abs(updateDx) > 50 || Math.abs(updateDx) > cwidth/2)) {
4128                  slider.flexAnimate(target, slider.vars.pauseOnAction);
4129                } else {
4130                  if (!fade) slider.flexAnimate(slider.currentSlide, slider.vars.pauseOnAction, true);
4131                }
4132              }
4133              el.removeEventListener('touchend', onTouchEnd, false);
4134
4135              startX = null;
4136              startY = null;
4137              dx = null;
4138              offset = null;
4139            }
4140        }else{
4141            el.style.msTouchAction = "none";
4142            el._gesture = new MSGesture();
4143            el._gesture.target = el;
4144            el.addEventListener("MSPointerDown", onMSPointerDown, false);
4145            el._slider = slider;
4146            el.addEventListener("MSGestureChange", onMSGestureChange, false);
4147            el.addEventListener("MSGestureEnd", onMSGestureEnd, false);
4148
4149            function onMSPointerDown(e){
4150                e.stopPropagation();
4151                if (slider.animating) {
4152                    e.preventDefault();
4153                }else{
4154                    slider.pause();
4155                    el._gesture.addPointer(e.pointerId);
4156                    accDx = 0;
4157                    cwidth = (vertical) ? slider.h : slider. w;
4158                    startT = Number(new Date());
4159                    // CAROUSEL:
4160
4161                    offset = (carousel && reverse && slider.animatingTo === slider.last) ? 0 :
4162                        (carousel && reverse) ? slider.limit - (((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.animatingTo) :
4163                            (carousel && slider.currentSlide === slider.last) ? slider.limit :
4164                                (carousel) ? ((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.currentSlide :
4165                                    (reverse) ? (slider.last - slider.currentSlide + slider.cloneOffset) * cwidth : (slider.currentSlide + slider.cloneOffset) * cwidth;
4166                }
4167            }
4168
4169            function onMSGestureChange(e) {
4170                e.stopPropagation();
4171                var slider = e.target._slider;
4172                if(!slider){
4173                    return;
4174                }
4175                var transX = -e.translationX,
4176                    transY = -e.translationY;
4177
4178                //Accumulate translations.
4179                accDx = accDx + ((vertical) ? transY : transX);
4180                dx = accDx;
4181                scrolling = (vertical) ? (Math.abs(accDx) < Math.abs(-transX)) : (Math.abs(accDx) < Math.abs(-transY));
4182
4183                if(e.detail === e.MSGESTURE_FLAG_INERTIA){
4184                    setImmediate(function (){
4185                        el._gesture.stop();
4186                    });
4187
4188                    return;
4189                }
4190
4191                if (!scrolling || Number(new Date()) - startT > 500) {
4192                    e.preventDefault();
4193                    if (!fade && slider.transitions) {
4194                        if (!slider.vars.animationLoop) {
4195                            dx = accDx / ((slider.currentSlide === 0 && accDx < 0 || slider.currentSlide === slider.last && accDx > 0) ? (Math.abs(accDx) / cwidth + 2) : 1);
4196                        }
4197                        slider.setProps(offset + dx, "setTouch");
4198                    }
4199                }
4200            }
4201
4202            function onMSGestureEnd(e) {
4203                e.stopPropagation();
4204                var slider = e.target._slider;
4205                if(!slider){
4206                    return;
4207                }
4208                if (slider.animatingTo === slider.currentSlide && !scrolling && !(dx === null)) {
4209                    var updateDx = (reverse) ? -dx : dx,
4210                        target = (updateDx > 0) ? slider.getTarget('next') : slider.getTarget('prev');
4211
4212                    if (slider.canAdvance(target) && (Number(new Date()) - startT < 550 && Math.abs(updateDx) > 50 || Math.abs(updateDx) > cwidth/2)) {
4213                        slider.flexAnimate(target, slider.vars.pauseOnAction);
4214                    } else {
4215                        if (!fade) slider.flexAnimate(slider.currentSlide, slider.vars.pauseOnAction, true);
4216                    }
4217                }
4218
4219                startX = null;
4220                startY = null;
4221                dx = null;
4222                offset = null;
4223                accDx = 0;
4224            }
4225        }
4226      },
4227      resize: function() {
4228        if (!slider.animating && slider.is(':visible')) {
4229          if (!carousel) slider.doMath();
4230
4231          if (fade) {
4232            // SMOOTH HEIGHT:
4233            methods.smoothHeight();
4234          } else if (carousel) { //CAROUSEL:
4235            slider.slides.width(slider.computedW);
4236            slider.update(slider.pagingCount);
4237            slider.setProps();
4238          }
4239          else if (vertical) { //VERTICAL:
4240            slider.viewport.height(slider.h);
4241            slider.setProps(slider.h, "setTotal");
4242          } else {
4243            // SMOOTH HEIGHT:
4244            if (slider.vars.smoothHeight) methods.smoothHeight();
4245            slider.newSlides.width(slider.computedW);
4246            slider.setProps(slider.computedW, "setTotal");
4247          }
4248        }
4249      },
4250      smoothHeight: function(dur) {
4251        if (!vertical || fade) {
4252          var $obj = (fade) ? slider : slider.viewport;
4253          (dur) ? $obj.animate({"height": slider.slides.eq(slider.animatingTo).height()}, dur) : $obj.height(slider.slides.eq(slider.animatingTo).height());
4254        }
4255      },
4256      sync: function(action) {
4257        var $obj = $(slider.vars.sync).data("flexslider"),
4258            target = slider.animatingTo;
4259
4260        switch (action) {
4261          case "animate": $obj.flexAnimate(target, slider.vars.pauseOnAction, false, true); break;
4262          case "play": if (!$obj.playing && !$obj.asNav) { $obj.play(); } break;
4263          case "pause": $obj.pause(); break;
4264        }
4265      },
4266      uniqueID: function($clone) {
4267        $clone.find( '[id]' ).each(function() {
4268          var $this = $(this);
4269          $this.attr( 'id', $this.attr( 'id' ) + '_clone' );
4270        });
4271        return $clone;
4272      },
4273      pauseInvisible: {
4274        visProp: null,
4275        init: function() {
4276          var prefixes = ['webkit','moz','ms','o'];
4277
4278          if ('hidden' in document) return 'hidden';
4279          for (var i = 0; i < prefixes.length; i++) {
4280            if ((prefixes[i] + 'Hidden') in document)
4281            methods.pauseInvisible.visProp = prefixes[i] + 'Hidden';
4282          }
4283          if (methods.pauseInvisible.visProp) {
4284            var evtname = methods.pauseInvisible.visProp.replace(/[H|h]idden/,'') + 'visibilitychange';
4285            document.addEventListener(evtname, function() {
4286              if (methods.pauseInvisible.isHidden()) {
4287                if(slider.startTimeout) clearTimeout(slider.startTimeout); //If clock is ticking, stop timer and prevent from starting while invisible
4288                else slider.pause(); //Or just pause
4289              }
4290              else {
4291                if(slider.started) slider.play(); //Initiated before, just play
4292                else (slider.vars.initDelay > 0) ? setTimeout(slider.play, slider.vars.initDelay) : slider.play(); //Didn't init before: simply init or wait for it
4293              }
4294            });
4295          }
4296        },
4297        isHidden: function() {
4298          return document[methods.pauseInvisible.visProp] || false;
4299        }
4300      },
4301      setToClearWatchedEvent: function() {
4302        clearTimeout(watchedEventClearTimer);
4303        watchedEventClearTimer = setTimeout(function() {
4304          watchedEvent = "";
4305        }, 3000);
4306      }
4307    };
4308
4309    // public methods
4310    slider.flexAnimate = function(target, pause, override, withSync, fromNav) {
4311      if (!slider.vars.animationLoop && target !== slider.currentSlide) {
4312        slider.direction = (target > slider.currentSlide) ? "next" : "prev";
4313      }
4314
4315      if (asNav && slider.pagingCount === 1) slider.direction = (slider.currentItem < target) ? "next" : "prev";
4316
4317      if (!slider.animating && (slider.canAdvance(target, fromNav) || override) && slider.is(":visible")) {
4318        if (asNav && withSync) {
4319          var master = $(slider.vars.asNavFor).data('flexslider');
4320          slider.atEnd = target === 0 || target === slider.count - 1;
4321          master.flexAnimate(target, true, false, true, fromNav);
4322          slider.direction = (slider.currentItem < target) ? "next" : "prev";
4323          master.direction = slider.direction;
4324
4325          if (Math.ceil((target + 1)/slider.visible) - 1 !== slider.currentSlide && target !== 0) {
4326            slider.currentItem = target;
4327            slider.slides.removeClass(namespace + "active-slide").eq(target).addClass(namespace + "active-slide");
4328            target = Math.floor(target/slider.visible);
4329          } else {
4330            slider.currentItem = target;
4331            slider.slides.removeClass(namespace + "active-slide").eq(target).addClass(namespace + "active-slide");
4332            return false;
4333          }
4334        }
4335
4336        slider.animating = true;
4337        slider.animatingTo = target;
4338
4339        // SLIDESHOW:
4340        if (pause) slider.pause();
4341
4342        // API: before() animation Callback
4343        slider.vars.before(slider);
4344
4345        // SYNC:
4346        if (slider.syncExists && !fromNav) methods.sync("animate");
4347
4348        // CONTROLNAV
4349        if (slider.vars.controlNav) methods.controlNav.active();
4350
4351        // !CAROUSEL:
4352        // CANDIDATE: slide active class (for add/remove slide)
4353        if (!carousel) slider.slides.removeClass(namespace + 'active-slide').eq(target).addClass(namespace + 'active-slide');
4354
4355        // INFINITE LOOP:
4356        // CANDIDATE: atEnd
4357        slider.atEnd = target === 0 || target === slider.last;
4358
4359        // DIRECTIONNAV:
4360        if (slider.vars.directionNav) methods.directionNav.update();
4361
4362        if (target === slider.last) {
4363          // API: end() of cycle Callback
4364          slider.vars.end(slider);
4365          // SLIDESHOW && !INFINITE LOOP:
4366          if (!slider.vars.animationLoop) slider.pause();
4367        }
4368
4369        // SLIDE:
4370        if (!fade) {
4371          var dimension = (vertical) ? slider.slides.filter(':first').height() : slider.computedW,
4372              margin, slideString, calcNext;
4373
4374          // INFINITE LOOP / REVERSE:
4375          if (carousel) {
4376            //margin = (slider.vars.itemWidth > slider.w) ? slider.vars.itemMargin * 2 : slider.vars.itemMargin;
4377            margin = slider.vars.itemMargin;
4378            calcNext = ((slider.itemW + margin) * slider.move) * slider.animatingTo;
4379            slideString = (calcNext > slider.limit && slider.visible !== 1) ? slider.limit : calcNext;
4380          } else if (slider.currentSlide === 0 && target === slider.count - 1 && slider.vars.animationLoop && slider.direction !== "next") {
4381            slideString = (reverse) ? (slider.count + slider.cloneOffset) * dimension : 0;
4382          } else if (slider.currentSlide === slider.last && target === 0 && slider.vars.animationLoop && slider.direction !== "prev") {
4383            slideString = (reverse) ? 0 : (slider.count + 1) * dimension;
4384          } else {
4385            slideString = (reverse) ? ((slider.count - 1) - target + slider.cloneOffset) * dimension : (target + slider.cloneOffset) * dimension;
4386          }
4387          slider.setProps(slideString, "", slider.vars.animationSpeed);
4388          if (slider.transitions) {
4389            if (!slider.vars.animationLoop || !slider.atEnd) {
4390              slider.animating = false;
4391              slider.currentSlide = slider.animatingTo;
4392            }
4393            slider.container.unbind("webkitTransitionEnd transitionend");
4394            slider.container.bind("webkitTransitionEnd transitionend", function() {
4395              slider.wrapup(dimension);
4396            });
4397          } else {
4398            slider.container.animate(slider.args, slider.vars.animationSpeed, slider.vars.easing, function(){
4399              slider.wrapup(dimension);
4400            });
4401          }
4402        } else { // FADE:
4403          if (!touch) {
4404            //slider.slides.eq(slider.currentSlide).fadeOut(slider.vars.animationSpeed, slider.vars.easing);
4405            //slider.slides.eq(target).fadeIn(slider.vars.animationSpeed, slider.vars.easing, slider.wrapup);
4406
4407            slider.slides.eq(slider.currentSlide).css({"zIndex": 1}).animate({"opacity": 0}, slider.vars.animationSpeed, slider.vars.easing);
4408            slider.slides.eq(target).css({"zIndex": 2}).animate({"opacity": 1}, slider.vars.animationSpeed, slider.vars.easing, slider.wrapup);
4409
4410          } else {
4411            slider.slides.eq(slider.currentSlide).css({ "opacity": 0, "zIndex": 1 });
4412            slider.slides.eq(target).css({ "opacity": 1, "zIndex": 2 });
4413            slider.wrapup(dimension);
4414          }
4415        }
4416        // SMOOTH HEIGHT:
4417        if (slider.vars.smoothHeight) methods.smoothHeight(slider.vars.animationSpeed);
4418      }
4419    };
4420    slider.wrapup = function(dimension) {
4421      // SLIDE:
4422      if (!fade && !carousel) {
4423        if (slider.currentSlide === 0 && slider.animatingTo === slider.last && slider.vars.animationLoop) {
4424          slider.setProps(dimension, "jumpEnd");
4425        } else if (slider.currentSlide === slider.last && slider.animatingTo === 0 && slider.vars.animationLoop) {
4426          slider.setProps(dimension, "jumpStart");
4427        }
4428      }
4429      slider.animating = false;
4430      slider.currentSlide = slider.animatingTo;
4431      // API: after() animation Callback
4432      slider.vars.after(slider);
4433    };
4434
4435    // SLIDESHOW:
4436    slider.animateSlides = function() {
4437      if (!slider.animating && focused ) slider.flexAnimate(slider.getTarget("next"));
4438    };
4439    // SLIDESHOW:
4440    slider.pause = function() {
4441      clearInterval(slider.animatedSlides);
4442      slider.animatedSlides = null;
4443      slider.playing = false;
4444      // PAUSEPLAY:
4445      if (slider.vars.pausePlay) methods.pausePlay.update("play");
4446      // SYNC:
4447      if (slider.syncExists) methods.sync("pause");
4448    };
4449    // SLIDESHOW:
4450    slider.play = function() {
4451      if (slider.playing) clearInterval(slider.animatedSlides);
4452      slider.animatedSlides = slider.animatedSlides || setInterval(slider.animateSlides, slider.vars.slideshowSpeed);
4453      slider.started = slider.playing = true;
4454      // PAUSEPLAY:
4455      if (slider.vars.pausePlay) methods.pausePlay.update("pause");
4456      // SYNC:
4457      if (slider.syncExists) methods.sync("play");
4458    };
4459    // STOP:
4460    slider.stop = function () {
4461      slider.pause();
4462      slider.stopped = true;
4463    };
4464    slider.canAdvance = function(target, fromNav) {
4465      // ASNAV:
4466      var last = (asNav) ? slider.pagingCount - 1 : slider.last;
4467      return (fromNav) ? true :
4468             (asNav && slider.currentItem === slider.count - 1 && target === 0 && slider.direction === "prev") ? true :
4469             (asNav && slider.currentItem === 0 && target === slider.pagingCount - 1 && slider.direction !== "next") ? false :
4470             (target === slider.currentSlide && !asNav) ? false :
4471             (slider.vars.animationLoop) ? true :
4472             (slider.atEnd && slider.currentSlide === 0 && target === last && slider.direction !== "next") ? false :
4473             (slider.atEnd && slider.currentSlide === last && target === 0 && slider.direction === "next") ? false :
4474             true;
4475    };
4476    slider.getTarget = function(dir) {
4477      slider.direction = dir;
4478      if (dir === "next") {
4479        return (slider.currentSlide === slider.last) ? 0 : slider.currentSlide + 1;
4480      } else {
4481        return (slider.currentSlide === 0) ? slider.last : slider.currentSlide - 1;
4482      }
4483    };
4484
4485    // SLIDE:
4486    slider.setProps = function(pos, special, dur) {
4487      var target = (function() {
4488        var posCheck = (pos) ? pos : ((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.animatingTo,
4489            posCalc = (function() {
4490              if (carousel) {
4491                return (special === "setTouch") ? pos :
4492                       (reverse && slider.animatingTo === slider.last) ? 0 :
4493                       (reverse) ? slider.limit - (((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.animatingTo) :
4494                       (slider.animatingTo === slider.last) ? slider.limit : posCheck;
4495              } else {
4496                switch (special) {
4497                  case "setTotal": return (reverse) ? ((slider.count - 1) - slider.currentSlide + slider.cloneOffset) * pos : (slider.currentSlide + slider.cloneOffset) * pos;
4498                  case "setTouch": return (reverse) ? pos : pos;
4499                  case "jumpEnd": return (reverse) ? pos : slider.count * pos;
4500                  case "jumpStart": return (reverse) ? slider.count * pos : pos;
4501                  default: return pos;
4502                }
4503              }
4504            }());
4505
4506            return (posCalc * -1) + "px";
4507          }());
4508
4509      if (slider.transitions) {
4510        target = (vertical) ? "translate3d(0," + target + ",0)" : "translate3d(" + target + ",0,0)";
4511        dur = (dur !== undefined) ? (dur/1000) + "s" : "0s";
4512        slider.container.css("-" + slider.pfx + "-transition-duration", dur);
4513         slider.container.css("transition-duration", dur);
4514      }
4515
4516      slider.args[slider.prop] = target;
4517      if (slider.transitions || dur === undefined) slider.container.css(slider.args);
4518
4519      slider.container.css('transform',target);
4520    };
4521
4522    slider.setup = function(type) {
4523      // SLIDE:
4524      if (!fade) {
4525        var sliderOffset, arr;
4526
4527        if (type === "init") {
4528          slider.viewport = $('<div class="' + namespace + 'viewport"></div>').css({"overflow": "hidden", "position": "relative"}).appendTo(slider).append(slider.container);
4529          // INFINITE LOOP:
4530          slider.cloneCount = 0;
4531          slider.cloneOffset = 0;
4532          // REVERSE:
4533          if (reverse) {
4534            arr = $.makeArray(slider.slides).reverse();
4535            slider.slides = $(arr);
4536            slider.container.empty().append(slider.slides);
4537          }
4538        }
4539        // INFINITE LOOP && !CAROUSEL:
4540        if (slider.vars.animationLoop && !carousel) {
4541          slider.cloneCount = 2;
4542          slider.cloneOffset = 1;
4543          // clear out old clones
4544          if (type !== "init") slider.container.find('.clone').remove();
4545          slider.container.append(slider.slides.first().clone().addClass('clone').attr('aria-hidden', 'true')).prepend(slider.slides.last().clone().addClass('clone').attr('aria-hidden', 'true'));
4546                      methods.uniqueID( slider.slides.first().clone().addClass('clone') ).appendTo( slider.container );
4547                      methods.uniqueID( slider.slides.last().clone().addClass('clone') ).prependTo( slider.container );
4548        }
4549        slider.newSlides = $(slider.vars.selector, slider);
4550
4551        sliderOffset = (reverse) ? slider.count - 1 - slider.currentSlide + slider.cloneOffset : slider.currentSlide + slider.cloneOffset;
4552        // VERTICAL:
4553        if (vertical && !carousel) {
4554          slider.container.height((slider.count + slider.cloneCount) * 200 + "%").css("position", "absolute").width("100%");
4555          setTimeout(function(){
4556            slider.newSlides.css({"display": "block"});
4557            slider.doMath();
4558            slider.viewport.height(slider.h);
4559            slider.setProps(sliderOffset * slider.h, "init");
4560          }, (type === "init") ? 100 : 0);
4561        } else {
4562          slider.container.width((slider.count + slider.cloneCount) * 200 + "%");
4563          slider.setProps(sliderOffset * slider.computedW, "init");
4564          setTimeout(function(){
4565            slider.doMath();
4566            slider.newSlides.css({"width": slider.computedW, "float": "left", "display": "block"});
4567            // SMOOTH HEIGHT:
4568            if (slider.vars.smoothHeight) methods.smoothHeight();
4569          }, (type === "init") ? 100 : 0);
4570        }
4571      } else { // FADE:
4572        slider.slides.css({"width": "100%", "float": "left", "marginRight": "-100%", "position": "relative"});
4573        if (type === "init") {
4574          if (!touch) {
4575            //slider.slides.eq(slider.currentSlide).fadeIn(slider.vars.animationSpeed, slider.vars.easing);
4576            slider.slides.css({ "opacity": 0, "display": "block", "zIndex": 1 }).eq(slider.currentSlide).css({"zIndex": 2}).animate({"opacity": 1},slider.vars.animationSpeed,slider.vars.easing);
4577          } else {
4578            slider.slides.css({ "opacity": 0, "display": "block", "webkitTransition": "opacity " + slider.vars.animationSpeed / 1000 + "s ease", "zIndex": 1 }).eq(slider.currentSlide).css({ "opacity": 1, "zIndex": 2});
4579          }
4580        }
4581        // SMOOTH HEIGHT:
4582        if (slider.vars.smoothHeight) methods.smoothHeight();
4583      }
4584      // !CAROUSEL:
4585      // CANDIDATE: active slide
4586      if (!carousel) slider.slides.removeClass(namespace + "active-slide").eq(slider.currentSlide).addClass(namespace + "active-slide");
4587
4588      //FlexSlider: init() Callback
4589      slider.vars.init(slider);
4590    };
4591
4592    slider.doMath = function() {
4593      var slide = slider.slides.first(),
4594          slideMargin = slider.vars.itemMargin,
4595          minItems = slider.vars.minItems,
4596          maxItems = slider.vars.maxItems;
4597
4598      slider.w = (slider.viewport===undefined) ? slider.width() : slider.viewport.width();
4599      slider.h = slide.height();
4600      slider.boxPadding = slide.outerWidth() - slide.width();
4601
4602      // CAROUSEL:
4603      if (carousel) {
4604        slider.itemT = slider.vars.itemWidth + slideMargin;
4605        slider.minW = (minItems) ? minItems * slider.itemT : slider.w;
4606        slider.maxW = (maxItems) ? (maxItems * slider.itemT) - slideMargin : slider.w;
4607        slider.itemW = (slider.minW > slider.w) ? (slider.w - (slideMargin * (minItems - 1)))/minItems :
4608                       (slider.maxW < slider.w) ? (slider.w - (slideMargin * (maxItems - 1)))/maxItems :
4609                       (slider.vars.itemWidth > slider.w) ? slider.w : slider.vars.itemWidth;
4610
4611        slider.visible = Math.floor(slider.w/(slider.itemW));
4612        slider.move = (slider.vars.move > 0 && slider.vars.move < slider.visible ) ? slider.vars.move : slider.visible;
4613        slider.pagingCount = Math.ceil(((slider.count - slider.visible)/slider.move) + 1);
4614        slider.last =  slider.pagingCount - 1;
4615        slider.limit = (slider.pagingCount === 1) ? 0 :
4616                       (slider.vars.itemWidth > slider.w) ? (slider.itemW * (slider.count - 1)) + (slideMargin * (slider.count - 1)) : ((slider.itemW + slideMargin) * slider.count) - slider.w - slideMargin;
4617      } else {
4618        slider.itemW = slider.w;
4619        slider.pagingCount = slider.count;
4620        slider.last = slider.count - 1;
4621      }
4622      slider.computedW = slider.itemW - slider.boxPadding;
4623    };
4624
4625    slider.update = function(pos, action) {
4626      slider.doMath();
4627
4628      // update currentSlide and slider.animatingTo if necessary
4629      if (!carousel) {
4630        if (pos < slider.currentSlide) {
4631          slider.currentSlide += 1;
4632        } else if (pos <= slider.currentSlide && pos !== 0) {
4633          slider.currentSlide -= 1;
4634        }
4635        slider.animatingTo = slider.currentSlide;
4636      }
4637
4638      // update controlNav
4639      if (slider.vars.controlNav && !slider.manualControls) {
4640        if ((action === "add" && !carousel) || slider.pagingCount > slider.controlNav.length) {
4641          methods.controlNav.update("add");
4642        } else if ((action === "remove" && !carousel) || slider.pagingCount < slider.controlNav.length) {
4643          if (carousel && slider.currentSlide > slider.last) {
4644            slider.currentSlide -= 1;
4645            slider.animatingTo -= 1;
4646          }
4647          methods.controlNav.update("remove", slider.last);
4648        }
4649      }
4650      // update directionNav
4651      if (slider.vars.directionNav) methods.directionNav.update();
4652
4653    };
4654
4655    slider.addSlide = function(obj, pos) {
4656      var $obj = $(obj);
4657
4658      slider.count += 1;
4659      slider.last = slider.count - 1;
4660
4661      // append new slide
4662      if (vertical && reverse) {
4663        (pos !== undefined) ? slider.slides.eq(slider.count - pos).after($obj) : slider.container.prepend($obj);
4664      } else {
4665        (pos !== undefined) ? slider.slides.eq(pos).before($obj) : slider.container.append($obj);
4666      }
4667
4668      // update currentSlide, animatingTo, controlNav, and directionNav
4669      slider.update(pos, "add");
4670
4671      // update slider.slides
4672      slider.slides = $(slider.vars.selector + ':not(.clone)', slider);
4673      // re-setup the slider to accomdate new slide
4674      slider.setup();
4675
4676      //FlexSlider: added() Callback
4677      slider.vars.added(slider);
4678    };
4679    slider.removeSlide = function(obj) {
4680      var pos = (isNaN(obj)) ? slider.slides.index($(obj)) : obj;
4681
4682      // update count
4683      slider.count -= 1;
4684      slider.last = slider.count - 1;
4685
4686      // remove slide
4687      if (isNaN(obj)) {
4688        $(obj, slider.slides).remove();
4689      } else {
4690        (vertical && reverse) ? slider.slides.eq(slider.last).remove() : slider.slides.eq(obj).remove();
4691      }
4692
4693      // update currentSlide, animatingTo, controlNav, and directionNav
4694      slider.doMath();
4695      slider.update(pos, "remove");
4696
4697      // update slider.slides
4698      slider.slides = $(slider.vars.selector + ':not(.clone)', slider);
4699      // re-setup the slider to accomdate new slide
4700      slider.setup();
4701
4702      // FlexSlider: removed() Callback
4703      slider.vars.removed(slider);
4704    };
4705
4706    //FlexSlider: Initialize
4707    methods.init();
4708  };
4709
4710  // Ensure the slider isn't focussed if the window loses focus.
4711  $( window ).blur( function ( e ) {
4712    focused = false;
4713  }).focus( function ( e ) {
4714    focused = true;
4715  });
4716
4717  //FlexSlider: Default Settings
4718  $.flexslider.defaults = {
4719    namespace: "flex-",             //{NEW} String: Prefix string attached to the class of every element generated by the plugin
4720    selector: ".slides > li",       //{NEW} Selector: Must match a simple pattern. '{container} > {slide}' -- Ignore pattern at your own peril
4721    animation: "fade",              //String: Select your animation type, "fade" or "slide"
4722    easing: "swing",                //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported!
4723    direction: "horizontal",        //String: Select the sliding direction, "horizontal" or "vertical"
4724    reverse: false,                 //{NEW} Boolean: Reverse the animation direction
4725    animationLoop: true,            //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end
4726    smoothHeight: true,            //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode
4727    startAt: 0,                     //Integer: The slide that the slider should start on. Array notation (0 = first slide)
4728    slideshow: true,                //Boolean: Animate slider automatically
4729    slideshowSpeed: 7000,           //Integer: Set the speed of the slideshow cycling, in milliseconds
4730    animationSpeed: 600,            //Integer: Set the speed of animations, in milliseconds
4731    initDelay: 0,                   //{NEW} Integer: Set an initialization delay, in milliseconds
4732    randomize: false,               //Boolean: Randomize slide order
4733    thumbCaptions: false,           //Boolean: Whether or not to put captions on thumbnails when using the "thumbnails" controlNav.
4734
4735    // Usability features
4736    pauseOnAction: true,            //Boolean: Pause the slideshow when interacting with control elements, highly recommended.
4737    pauseOnHover: false,            //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering
4738    pauseInvisible: true,               //{NEW} Boolean: Pause the slideshow when tab is invisible, resume when visible. Provides better UX, lower CPU usage.
4739    useCSS: true,                   //{NEW} Boolean: Slider will use CSS3 transitions if available
4740    touch: true,                    //{NEW} Boolean: Allow touch swipe navigation of the slider on touch-enabled devices
4741    video: false,                   //{NEW} Boolean: If using video in the slider, will prevent CSS3 3D Transforms to avoid graphical glitches
4742
4743    // Primary Controls
4744    controlNav: true,               //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage
4745    directionNav: true,             //Boolean: Create navigation for previous/next navigation? (true/false)
4746    prevText: "Previous",           //String: Set the text for the "previous" directionNav item
4747    nextText: "Next",               //String: Set the text for the "next" directionNav item
4748    directionNavArrowsLeft: '<i class="mk-jupiter-icon-arrow-left"></i>',
4749    directionNavArrowsRight: '<i class="mk-jupiter-icon-arrow-right"></i>',
4750
4751    // Secondary Navigation
4752    keyboard: true,                 //Boolean: Allow slider navigating via keyboard left/right keys
4753    multipleKeyboard: false,        //{NEW} Boolean: Allow keyboard navigation to affect multiple sliders. Default behavior cuts out keyboard navigation with more than one slider present.
4754    mousewheel: false,              //{UPDATED} Boolean: Requires jquery.mousewheel.js (https://github.com/brandonaaron/jquery-mousewheel) - Allows slider navigating via mousewheel
4755    pausePlay: false,               //Boolean: Create pause/play dynamic element
4756    pauseText: "Pause",             //String: Set the text for the "pause" pausePlay item
4757    playText: "Play",               //String: Set the text for the "play" pausePlay item
4758
4759    // Special properties
4760    controlsContainer: "",          //{UPDATED} jQuery Object/Selector: Declare which container the navigation elements should be appended too. Default container is the FlexSlider element. Example use would be $(".flexslider-container"). Property is ignored if given element is not found.
4761    manualControls: "",             //{UPDATED} jQuery Object/Selector: Declare custom control navigation. Examples would be $(".flex-control-nav li") or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs.
4762    sync: "",                       //{NEW} Selector: Mirror the actions performed on this slider with another slider. Use with care.
4763    asNavFor: "",                   //{NEW} Selector: Internal property exposed for turning the slider into a thumbnail navigation for another slider
4764
4765    // Carousel Options
4766    itemWidth: 0,                   //{NEW} Integer: Box-model width of individual carousel items, including horizontal borders and padding.
4767    itemMargin: 0,                  //{NEW} Integer: Margin between carousel items.
4768    minItems: 1,                    //{NEW} Integer: Minimum number of carousel items that should be visible. Items will resize fluidly when below this.
4769    maxItems: 0,                    //{NEW} Integer: Maxmimum number of carousel items that should be visible. Items will resize fluidly when above this limit.
4770    move: 0,                        //{NEW} Integer: Number of carousel items that should move on animation. If 0, slider will move all visible items.
4771    allowOneSlide: true,           //{NEW} Boolean: Whether or not to allow a slider comprised of a single slide
4772
4773    // Callback API
4774    start: function(){},            //Callback: function(slider) - Fires when the slider loads the first slide
4775    before: function(){},           //Callback: function(slider) - Fires asynchronously with each slider animation
4776    after: function(){},            //Callback: function(slider) - Fires after each slider animation completes
4777    end: function(){},              //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous)
4778    added: function(){},            //{NEW} Callback: function(slider) - Fires after a slide is added
4779    removed: function(){},           //{NEW} Callback: function(slider) - Fires after a slide is removed
4780    init: function() {}             //{NEW}
4780 Callback: function(slider) - Fires after the slider is initially setup
4781  };
4782
4783  //FlexSlider: Plugin Function
4784  $.fn.flexslider = function(options) {
4785    if (options === undefined) options = {};
4786
4787    if (typeof options === "object") {
4788      return this.each(function() {
4789        var $this = $(this),
4790            selector = (options.selector) ? options.selector : ".slides > li",
4791            $slides = $this.find(selector);
4792
4793      if ( ( $slides.length === 1 && options.allowOneSlide === true ) || $slides.length === 0 ) {
4794          $slides.fadeIn(400);
4795          if (options.start) options.start($this);
4796        } else if ($this.data('flexslider') === undefined) {
4797          new $.flexslider(this, options);
4798        }
4799      });
4800    } else {
4801      // Helper strings to quickly perform functions on the slider
4802      var $slider = $(this).data('flexslider');
4803      switch (options) {
4804        case "play": $slider.play(); break;
4805        case "pause": $slider.pause(); break;
4806        case "stop": $slider.stop(); break;
4807        case "next": $slider.flexAnimate($slider.getTarget("next"), true); break;
4808        case "prev":
4809        case "previous": $slider.flexAnimate($slider.getTarget("prev"), true); break;
4810        default: if (typeof options === "number") $slider.flexAnimate(options, true);
4811      }
4812    }
4813  };
4814})(jQuery);
4815;;(function ( $, window) {
4816
4817  // Defaults
4818  var pluginName = "header",
4819    defaults = {
4820      headerNavigationContainer: 'mk-header-nav-container',
4821      headerPaddingWrapper: 'mk-header-padding-wrapper',
4822      innerHeaderClass: 'mk-header-inner',
4823      headerToolbarClass: 'mk-header-toolbar',
4824      classicStyleNavigationClass: 'mk-header-nav-container',
4825      fixHeaderClass: 'mk-fixed'
4826    };
4827
4828  // The actual plugin constructor
4829  function Header( element, options ) {
4830    this.element = element;
4831
4832    //merge options and defaults
4833    this.options = $.extend( {}, defaults, options) ;
4834
4835    this._defaults = defaults;
4836    this._name = pluginName;
4837
4838    this.init();
4839  }
4840
4841  Header.prototype = {
4842
4843    init: function() {
4844
4845        var that = this;
4846
4847        new ChopScroll(function () {
4848          if (that.shouldListenToScroll()) {
4849            return;
4850          }
4851
4852          that.makeSuitableHeader();
4853          that.options.onScrollCallback();
4854
4855        }, 10);
4856
4857    },
4858
4859    /**
4860    * Check whether should we listen to scroll event or not
4861    * @returns {Boolean}
4862    */
4863    shouldListenToScroll: function() {
4864        return is_touch_device() || 
4865            mk_header_sticky === false || 
4866            $(window).width() < mk_responsive_nav_width;
4867    },
4868
4869    /**
4870    * Check whether header toolbar exists or not
4871    * @returns {Boolean}
4872    */
4873    isHeaderToolbarExists: function() {
4874        var headerToolbarClass = '.' + this.options.headerToolbarClass;
4875        return $.exists(headerToolbarClass);
4876    },
4877    /**
4878    * Check whether wp-admin bar exists or not
4879    * @returns {Boolean}
4880    */
4881    isWpAdminbarExists: function() {
4882        return $.exists('#wpadminbar');
4883    },
4884
4885    /**
4886    * Check whether we should use classic navigation
4887    * @returns {Boolean}
4888    */
4889    isClassicNavigation: function() {
4890        var element = this.element,
4891            classicStyleNavigationClass = this.options.classicStyleNavigationClass;
4892
4893        return $(element).hasClass(classicStyleNavigationClass);
4894    },
4895    /**
4896    * Check whether header navigation is fix or not
4897    * @returns {Boolean}
4898    */
4899    isHeaderNavigationFixed: function() {
4900        var headerNavigationContainer = '.' + this.options.headerNavigationContainer,
4901            fixHeaderClass = this.options.fixHeaderClass;
4902        return $(headerNavigationContainer).hasClass(fixHeaderClass);
4903    },
4904
4905    /**
4906    * Check whether inner header is fix or not
4907    * @returns {Boolean}
4908    */
4909    isInnerHeaderFixed: function() {
4910        var innerHeaderClass = '.' + this.options.innerHeaderClass,
4911            fixHeaderClass = this.options.fixHeaderClass;
4912        return $(innerHeaderClass).hasClass(fixHeaderClass);
4913    },
4914
4915    /**
4916    * Get header toolbar height
4917    * @returns {Number}
4918    */
4919    getHeaderToolbarHeight: function() {
4920        var headerToolbarClass = '.' + this.options.headerToolbarClass;
4921        return parseInt($(headerToolbarClass).height());
4922    },
4923
4924    /**
4925    * Get admin bar height
4926    * @returns {Number}
4927    */
4928    getWpAdminbarHeight: function() {
4929        return parseInt($("#wpadminbar").height());
4930    },
4931
4932    /**
4933    * Get header height from its data-attribute
4934    * @returns {Number}
4935    * @see http://api.jquery.com/data/
4936    */
4937    getHeaderHeight: function() {
4938        var element = this.element;
4939        return parseInt($(element).data('height'));
4940    },
4941
4942    /**
4943    * Get inner header height from its data-attribute
4944    * @returns {Number}
4945    */
4946    getInnerHeaderHeight: function() {
4947        var innerHeaderClass = '.' + this.options.innerHeaderClass;
4948        return parseInt($(innerHeaderClass).height());
4949    },
4950
4951    /**
4952    * Get header height from its data-attribute
4953    * @returns {Number}
4954    * @see http://api.jquery.com/data/
4955    */
4956    getStickyHeaderHeight: function() {
4957        var element = this.element;
4958        return parseInt($(element).data('sticky-height'));
4959        //return parseInt($('.mk-header-inner').height());
4960    },
4961
4962    /**
4963    * Calculate appropriate height of wp-admin bar
4964    * @returns {Number}
4965    */
4966    calculateAdminbarHeight: function() {
4967        var wp_admin_height = 0;
4968        if (this.isWpAdminbarExists()) {
4969            wp_admin_height = this.getWpAdminbarHeight();
4970            if (!this.isHeaderToolbarExists() && !this.isClassicNavigation()) {
4971                wp_admin_height = 0;
4972            }
4973        }
4974        if (!this.isWpAdminbarExists() && this.isHeaderToolbarExists() 
4975            && !this.isClassicNavigation()) {
4976            wp_admin_height = this.getHeaderToolbarHeight();
4977        }
4978        return wp_admin_height;
4979    },
4980
4981    /**
4982    * Calculate limit height
4983    * @returns {Number}
4984    */
4985    getScrollLimit: function() {
4986        var mk_limit_height = 0;
4987        if (this.isClassicNavigation()) {
4988            mk_limit_height = this.calculateAdminbarHeight() + (this.getHeaderHeight() * 2);
4989        } else {
4990            mk_limit_height = this.calculateAdminbarHeight();
4991
4992        }
4993        return mk_limit_height;
4994    },
4995
4996    /**
4997    * Use $.scrollTop() method to get current scroll position
4998    * @returns {Number}
4999    * @see http://api.jquery.com/scrolltop/
5000    */
5001    getScrollPosition: function() {
5002        return $(window).scrollTop();
5003    },
5004
5005    /**
5006    * Check whether current scroll position passed limited height or not
5007    * @example 
5008    *   mk_window_y = current scroll position
5009    *   mk_limit_height = 40px
5010    *   we should fix header after 40px scroll of window
5011    *   so mk_window_y should be greather than mk_limit_height
5012    */
5013    isFarEnough: function(currentScrollPosition, scrollLimit) {
5014        return currentScrollPosition > scrollLimit;
5015    },
5016
5017    /**
5018    * Make suitable header based on classic navigation and modern navigation option
5019    */
5020    makeSuitableHeader: function() {
5021        if (this.isClassicNavigation()) {
5022            this.makeClassicHeader();
5023        } else {
5024            this.makeModernHeader();
5025        }
5026    },
5027
5028    /**
5029    * Make classic header and fix it
5030    */
5031    makeClassicHeader: function() {
5032
5033        var mk_header_height = this.getInnerHeaderHeight(),
5034            wp_admin_height = this.calculateAdminbarHeight();
5035
5036        this.stickHeader(mk_header_height, wp_admin_height);
5037    },
5038
5039    /**
5040    * Calculate appropritae top space
5041    * @returns {Object}
5042    */
5043    calculateTopSpace: function() {
5044
5045        var distance = 0,
5046            padding = 0;
5047
5048        if (this.isWpAdminbarExists()) {
5049            distance = this.getScrollLimit();
5050            if (!this.isHeaderToolbarExists()) {
5051                distance = this.getWpAdminbarHeight();
5052                padding = this.getHeaderHeight();
5053            } else {
5054                padding = $('.mk-header-inner').height();
5055            }
5056
5057        } else {
5058            if (!this.isHeaderToolbarExists()) {
5059                padding = this.getHeaderHeight();
5060            } else {
5061                padding = $('.mk-header-inner').height();
5062            }
5063        }
5064        //console.log(padding);
5065        return {
5066            distance: distance,
5067            padding: padding
5068        }
5069    },
5070
5071    /**
5072    * Update header elements properties
5073    */
5074    updateHeaderElements: function() {
5075
5076        var header_els = $('.menu-hover-style-1 .main-navigation-ul > li > a,' +
5077            '.menu-hover-style-2 .main-navigation-ul > li > a,' +
5078            '.menu-hover-style-4 .main-navigation-ul > li > a,' +
5079            //'#mk-header.header-style-3 .main-navigation-ul > li > a,' +
5080            '.header-style-1 .menu-hover-style-3 .main-navigation-ul > li,' +
5081            '.mk-header-inner #mk-header-search,' +
5082            '#mk-header .mk-header-inner .mk-header-start-tour,' +
5083            '.header-style-1 .mk-header-inner,' +
5084            '.header-style-3 .mk-header-inner,' +
5085            '.header-style-3 .header-logo,' +
5086            '#mk-header.header-style-1 .mk-search-trigger i,' +
5087            '#mk-header.header-style-1 .mk-search-trigger,' +
5088            '.shopping-cart-header');
5089
5090        var limitHeight = this.getHeaderHeight() - this.getStickyHeaderHeight(),
5091            mk_window_y = this.getScrollPosition(),
5092            newHeight = 0;
5093
5094        if ($(window).width() > mk_responsive_nav_width) {
5095            if (mk_window_y < limitHeight) {
5096                newHeight = this.getHeaderHeight() - mk_window_y;
5097            } else {
5098                newHeight = this.getStickyHeaderHeight();
5099            }
5100            header_els.css({
5101                height: newHeight + 'px',
5102                lineHeight: newHeight + 'px'
5103            });
5104        }
5105    },
5106
5107    /**
5108    * Stick header to the top
5109    */
5110    stickHeader: function(padding, distance) {
5111
5112        var headerPaddingWrapper = '.' + this.options.headerPaddingWrapper,
5113            innerHeaderClass = '.' + this.options.innerHeaderClass,
5114            headerToolbarClass = '.' + this.options.headerToolbarClass;
5115
5116        var mk_window_y = this.getScrollPosition(),
5117            mk_limit_height = this.getScrollLimit();
5118
5119        if (this.isFarEnough(mk_window_y, mk_limit_height)) {
5120            if (!this.isInnerHeaderFixed()) {
5121                $(headerPaddingWrapper).css("padding-top", padding + 'px');
5122                $(innerHeaderClass).addClass(this.options.fixHeaderClass).css({
5123                     "top": distance
5124                });
5125            }
5126        } else {
5127            if (this.isInnerHeaderFixed()) {
5128                $(headerToolbarClass).show();
5129                $(innerHeaderClass).css({
5130                    "top": 0
5131                }).removeClass(this.options.fixHeaderClass);
5132                $(headerPaddingWrapper).css("padding-top", "");
5133            }
5134        }
5135    },
5136
5137    /**
5138    * Make modern header and fix it
5139    */
5140    makeModernHeader: function() {
5141        var topSpace = this.calculateTopSpace();
5142        this.stickHeader(topSpace.padding, topSpace.distance);
5143        this.updateHeaderElements();
5144    }
5145
5146  };
5147
5148  // A really lightweight plugin wrapper around the constructor,
5149  // preventing against multiple instantiations
5150  $.fn[pluginName] = function ( options ) {
5151    return this.each(function () {
5152      if (!$.data(this, "plugin_" + pluginName)) {
5153        $.data(this, "plugin_" + pluginName,
5154          new Header( this, options ));
5155      }
5156    });
5157  };
5158
5159})( jQuery, window );;/*!
5160 * hoverIntent v1.8.0 // 2014.06.29 // jQuery v1.9.1+
5161 * http://cherne.net/brian/resources/jquery.hoverIntent.html
5162 *
5163 * You may use hoverIntent under the terms of the MIT license. Basically that
5164 * means you are free to use hoverIntent as long as this header is left intact.
5165 * Copyright 2007, 2014 Brian Cherne
5166 */
5167(function($){$.fn.hoverIntent=function(handlerIn,handlerOut,selector){var cfg={interval:100,sensitivity:6,timeout:0};if(typeof handlerIn==="object"){cfg=$.extend(cfg,handlerIn)}else{if($.isFunction(handlerOut)){cfg=$.extend(cfg,{over:handlerIn,out:handlerOut,selector:selector})}else{cfg=$.extend(cfg,{over:handlerIn,out:handlerIn,selector:handlerOut})}}var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if(Math.sqrt((pX-cX)*(pX-cX)+(pY-cY)*(pY-cY))<cfg.sensitivity){$(ob).off("mousemove.hoverIntent",track);ob.hoverIntent_s=true;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=false;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=$.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type==="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).on("mousemove.hoverIntent",track);if(!ob.hoverIntent_s){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).off("mousemove.hoverIntent",track);if(ob.hoverIntent_s){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.on({"mouseenter.hoverIntent":handleHover,"mouseleave.hoverIntent":handleHover},cfg.selector)}})(jQuery);;
5168/*jshint undef: true */
5169/*global jQuery: true */
5170
5171/*
5172   --------------------------------
5173   Infinite Scroll
5174   --------------------------------
5175   + https://github.com/paulirish/infinite-scroll
5176   + version 2.0b2.120519
5177   + Copyright 2011/12 Paul Irish & Luke Shumard
5178   + Licensed under the MIT license
5179
5180   + Documentation: http://infinite-scroll.com/
5181*/
5182
5183(function (e, t, n) {
5184        "use strict";
5185        t.infinitescroll = function (n, r, i) {
5186                this.element = t(i);
5187                if (!this._create(n, r)) {
5188                        this.failed = true
5189                }
5190        };
5191        t.infinitescroll.defaults = {
5192                loading: {
5193                        finished: n,
5194                        finishedMsg: "<em>Congratulations, you've reached the end of the internet.</em>",
5195                        img: "data:image/gif;
5195base64,R0lGODlh3AATAPQeAPDy+MnQ6LW/4N3h8MzT6rjC4sTM5r/I5NHX7N7j8c7U6tvg8OLl8uXo9Ojr9b3G5MfP6Ovu9tPZ7PT1+vX2+tbb7vf4+8/W69jd7rC73vn5/O/x+K243ai02////wAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQECgD/ACwAAAAA3AATAAAF/6AnjmRpnmiqrmzrvnAsz3Rt33iu73zv/8CgcEj0BAScpHLJbDqf0Kh0Sq1ar9isdioItAKGw+MAKYMFhbF63CW438f0mg1R2O8EuXj/aOPtaHx7fn96goR4hmuId4qDdX95c4+RBIGCB4yAjpmQhZN0YGYGXitdZBIVGAsLoq4BBKQDswm1CQRkcG6ytrYKubq8vbfAcMK9v7q7EMO1ycrHvsW6zcTKsczNz8HZw9vG3cjTsMIYqQkCLBwHCgsMDQ4RDAYIqfYSFxDxEfz88/X38Onr16+Bp4ADCco7eC8hQYMAEe57yNCew4IVBU7EGNDiRn8Z831cGLHhSIgdFf9chIeBg7oA7gjaWUWTVQAGE3LqBDCTlc9WOHfm7PkTqNCh54rePDqB6M+lR536hCpUqs2gVZM+xbrTqtGoWqdy1emValeXKzggYBBB5y1acFNZmEvXAoN2cGfJrTv3bl69Ffj2xZt3L1+/fw3XRVw4sGDGcR0fJhxZsF3KtBTThZxZ8mLMgC3fRatCbYMNFCzwLEqLgE4NsDWs/tvqdezZf13Hvk2A9Szdu2X3pg18N+68xXn7rh1c+PLksI/Dhe6cuO3ow3NfV92bdArTqC2Ebd3A8vjf5QWfH6Bg7Nz17c2fj69+fnq+8N2Lty+fuP78/eV2X13neIcCeBRwxorbZrA1ANoCDGrgoG8RTshahQ9iSKEEzUmYIYfNWViUhheCGJyIP5E4oom7WWjgCeBFAJNv1DVV01MAdJhhjdkplWNzO/5oXI846njjVEIqR2OS2B1pE5PVscajkxhMycqLJghQSwT40PgfAl4GqNSXYdZXJn5gSkmmmmJu1aZYb14V51do+pTOCmA40AqVCIhG5IJ9PvYnhIFOxmdqhpaI6GeHCtpooisuutmg+Eg62KOMKuqoTaXgicQWoIYq6qiklmoqFV0UoeqqrLbq6quwxirrrLTWauutJ4QAACH5BAUKABwALAcABADOAAsAAAX/IPd0D2dyRCoUp/k8gpHOKtseR9yiSmGbuBykler9XLAhkbDavXTL5k2oqFqNOxzUZPU5YYZd1XsD72rZpBjbeh52mSNnMSC8lwblKZGwi+0QfIJ8CncnCoCDgoVnBHmKfByGJimPkIwtiAeBkH6ZHJaKmCeVnKKTHIihg5KNq4uoqmEtcRUtEREMBggtEr4QDrjCuRC8h7/BwxENeicSF8DKy82pyNLMOxzWygzFmdvD2L3P0dze4+Xh1Arkyepi7dfFvvTtLQkZBC0T/FX3CRgCMOBHsJ+EHYQY7OinAGECgQsB+Lu3AOK+CewcWjwxQeJBihtNGHSoQOE+iQ3//4XkwBBhRZMcUS6YSXOAwIL8PGqEaSJCiYt9SNoCmnJPAgUVLChdaoFBURN8MAzl2PQphwQLfDFd6lTowglHve6rKpbjhK7/pG5VinZP1qkiz1rl4+tr2LRwWU64cFEihwEtZgbgR1UiHaMVvxpOSwBA37kzGz9e8G+B5MIEKLutOGEsAH2ATQwYfTmuX8aETWdGPZmiZcccNSzeTCA1Sw0bdiitC7LBWgu8jQr8HRzqgpK6gX88QbrB14z/kF+ELpwB8eVQj/JkqdylAudji/+ts3039vEEfK8Vz2dlvxZKG0CmbkKDBvllRd6fCzDvBLKBDSCeffhRJEFebFk1k/Mv9jVIoIJZSeBggwUaNeB+Qk34IE0cXlihcfRxkOAJFFhwGmKlmWDiakZhUJtnLBpnWWcnKaAZcxI0piFGGLBm1mc90kajSCveeBVWKeYEoU2wqeaQi0PetoE+rr14EpVC7oAbAUHqhYExbn2XHHsVqbcVew9tx8+XJKk5AZsqqdlddGpqAKdbAYBn1pcczmSTdWvdmZ17c1b3FZ99vnTdCRFM8OEcAhLwm1NdXnWcBBSMRWmfkWZqVlsmLIiAp/o1gGV2vpS4lalGYsUOqXrddcKCmK61aZ8SjEpUpVFVoCpTj4r661Km7kBHjrDyc1RAIQAAIfkEBQoAGwAsBwAEAM4ACwAABf/gtmUCd4goQQgFKj6PYKi0yrrbc8i4ohQt12EHcal+MNSQiCP8gigdz7iCioaCIvUmZLp8QBzW0EN2vSlCuDtFKaq4RyHzQLEKZNdiQDhRDVooCwkbfm59EAmKi4SGIm+AjIsKjhsqB4mSjT2IOIOUnICeCaB/mZKFNTSRmqVpmJqklSqskq6PfYYCDwYHDC4REQwGCBLGxxIQDsHMwhAIX8bKzcENgSLGF9PU1j3Sy9zX2NrgzQziChLk1BHWxcjf7N046tvN82715czn9Pryz6Ilc4ACj4EBOCZM8KEnAYYADBRKnACAYUMFv1wotIhCEcaJCisqwJFgAUSQGyX/kCSVUUTIdKMwJlyo0oXHlhskwrTJciZHEXsgaqS4s6PJiCAr1uzYU8kBBSgnWFqpoMJMUjGtDmUwkmfVmVypakWhEKvXsS4nhLW5wNjVroJIoc05wSzTr0PtiigpYe4EC2vj4iWrFu5euWIMRBhacaVJhYQBEFjA9jHjyQ0xEABwGceGAZYjY0YBOrRLCxUp29QM+bRkx5s7ZyYgVbTqwwti2ybJ+vLtDYpycyZbYOlptxdx0kV+V7lC5iJAyyRrwYKxAdiz82ng0/jnAdMJFz0cPi104Ec1Vj9/M6F173vKL/feXv156dw11tlqeMMnv4V5Ap53GmjQQH97nFfg+IFiucfgRX5Z8KAgbUlQ4IULIlghhhdOSB6AgX0IVn8eReghen3NRIBsRgnH4l4LuEidZBjwRpt6NM5WGwoW0KSjCwX6yJSMab2GwwAPDXfaBCtWpluRTQqC5JM5oUZAjUNS+VeOLWpJEQ7VYQANW0INJSZVDFSnZphjSikfmzE5N4EEbQI1QJmnWXCmHulRp2edwDXF43txukenJwvI9xyg9Q26Z3MzGUcBYFEChZh6DVTq34AU8Iflh51Sd+CnKFYQ6mmZkhqfBKfSxZWqA9DZanWjxmhrWwi0qtCrt/43K6WqVjjpmhIqgEGvculaGKklKstAACEAACH5BAUKABwALAcABADOAAsAAAX/ICdyQmaMYyAUqPgIBiHPxNpy79kqRXH8wAPsRmDdXpAWgWdEIYm2llCHqjVHU+jjJkwqBTecwItShMXkEfNWSh8e1NGAcLgpDGlRgk7EJ/6Ae3VKfoF/fDuFhohVeDeCfXkcCQqDVQcQhn+VNDOYmpSWaoqBlUSfmowjEA+iEAEGDRGztAwGCDcXEA60tXEiCrq8vREMEBLIyRLCxMWSH
5195MzExnbRvQ2Sy7vN0zvVtNfU2tLY3rPgLdnDvca4VQS/Cpk3ABwSLQkYAQwT/P309vcI7OvXr94jBQMJ/nskkGA/BQBRLNDncAIAiDcG6LsxAWOLiQzmeURBKWSLCQbv/1F0eDGinJUKR47YY1IEgQASKk7Yc7ACRwZm7mHweRJoz59BJUogisKCUaFMR0x4SlJBVBFTk8pZivTR0K73rN5wqlXEAq5Fy3IYgHbEzQ0nLy4QSoCjXLoom96VOJEeCosK5n4kkFfqXjl94wa+l1gvAcGICbewAOAxY8l/Ky/QhAGz4cUkGxu2HNozhwMGBnCUqUdBg9UuW9eUynqSwLHIBujePef1ZGQZXcM+OFuEBeBhi3OYgLyqcuaxbT9vLkf4SeqyWxSQpKGB2gQpm1KdWbu72rPRzR9Ne2Nu9Kzr/1Jqj0yD/fvqP4aXOt5sW/5qsXXVcv1Nsp8IBUAmgswGF3llGgeU1YVXXKTN1FlhWFXW3gIE+DVChApysACHHo7Q4A35lLichh+ROBmLKAzgYmYEYDAhCgxKGOOMn4WR4kkDaoBBOxJtdNKQxFmg5JIWIBnQc07GaORfUY4AEkdV6jHlCEISSZ5yTXpp1pbGZbkWmcuZmQCaE6iJ0FhjMaDjTMsgZaNEHFRAQVp3bqXnZED1qYcECOz5V6BhSWCoVJQIKuKQi2KFKEkEFAqoAo7uYSmO3jk61wUUMKmknJ4SGimBmAa0qVQBhAAAIfkEBQoAGwAsBwAEAM4ACwAABf/gJm5FmRlEqhJC+bywgK5pO4rHI0D3pii22+Mg6/0Ej96weCMAk7cDkXf7lZTTnrMl7eaYoy10JN0ZFdco0XAuvKI6qkgVFJXYNwjkIBcNBgR8TQoGfRsJCRuCYYQQiI+ICosiCoGOkIiKfSl8mJkHZ4U9kZMbKaI3pKGXmJKrngmug4WwkhA0lrCBWgYFCCMQFwoQDRHGxwwGCBLMzRLEx8iGzMMO0cYNeCMKzBDW19lnF9DXDIY/48Xg093f0Q3s1dcR8OLe8+Y91OTv5wrj7o7B+7VNQqABIoRVCMBggsOHE36kSoCBIcSH3EbFangxogJYFi8CkJhqQciLJEf/LDDJEeJIBT0GsOwYUYJGBS0fjpQAMidGmyVP6sx4Y6VQhzs9VUwkwqaCCh0tmKoFtSMDmBOf9phg4SrVrROuasRQAaxXpVUhdsU6IsECZlvX3kwLUWzRt0BHOLTbNlbZG3vZinArge5Dvn7wbqtQkSYAAgtKmnSsYKVKo2AfW048uaPmG386i4Q8EQMBAIAnfB7xBxBqvapJ9zX9WgRS2YMpnvYMGdPK3aMjt/3dUcNI4blpj7iwkMFWDXDvSmgAlijrt9RTR78+PS6z1uAJZIe93Q8g5zcsWCi/4Y+C8bah5zUv3vv89uft30QP23punGCx5954oBBwnwYaNCDY/wYrsYeggnM9B2Fpf8GG2CEUVWhbWAtGouEGDy7Y4IEJVrbSiXghqGKIo7z1IVcXIkKWWR361QOLWWnIhwERpLaaCCee5iMBGJQmJGyPFTnbkfHVZGRtIGrg5HALEJAZbu39BuUEUmq1JJQIPtZilY5hGeSWsSk52G9XqsmgljdIcABytq13HyIM6RcUA+r1qZ4EBF3WHWB29tBgAzRhEGhig8KmqKFv8SeCeo+mgsF7YFXa1qWSbkDpom/mqR1PmHCqJ3fwNRVXjC7S6CZhFVCQ2lWvZiirhQq42SACt25IK2hv8TprriUV1usGgeka7LFcNmCldMLi6qZMgFLgpw16Cipb7bC1knXsBiEAACH5BAUKABsALAcABADOAAsAAAX/4FZsJPkUmUGsLCEUTywXglFuSg7fW1xAvNWLF6sFFcPb42C8EZCj24EJdCp2yoegWsolS0Uu6fmamg8n8YYcLU2bXSiRaXMGvqV6/KAeJAh8VgZqCX+BexCFioWAYgqNi4qAR4ORhRuHY408jAeUhAmYYiuVlpiflqGZa5CWkzc5fKmbbhIpsAoQDRG8vQwQCBLCwxK6vb5qwhfGxxENahvCEA7NzskSy7vNzzzK09W/PNHF1NvX2dXcN8K55cfh69Luveol3vO8zwi4Yhj+AQwmCBw4IYclDAAJDlQggVOChAoLKkgFkSCAHDwWLKhIEOONARsDKryogFPIiAUb/95gJNIiw4wnI778GFPhzBKFOAq8qLJEhQpiNArjMcHCmlTCUDIouTKBhApELSxFWiGiVKY4E2CAekPgUphDu0742nRrVLJZnyrFSqKQ2ohoSYAMW6IoDpNJ4bLdILTnAj8KUF7UeENjAKuDyxIgOuGiOI0EBBMgLNew5AUrDTMGsFixwBIaNCQuAXJB57qNJ2OWm2Aj4skwCQCIyNkhhtMkdsIuodE0AN4LJDRgfLPtn5YDLdBlraAByuUbBgxQwICxMOnYpVOPej074OFdlfc0TqC62OIbcppHjV4o+LrieWhfT8JC/I/T6W8oCl29vQ0XjLdBaA3s1RcPBO7lFvpX8BVoG4O5jTXRQRDuJ6FDTzEWF1/BCZhgbyAKE9qICYLloQYOFtahVRsWYlZ4KQJHlwHS/IYaZ6sZd9tmu5HQm2xi1UaTbzxYwJk/wBF5g5EEYOBZeEfGZmNdFyFZmZIR4jikbLThlh5kUUVJGmRT7sekkziRWUIACABk3T4qCsedgO4xhgGcY7q5pHJ4klBBTQRJ0CeHcoYHHUh6wgfdn9uJdSdMiebGJ0zUPTcoS286FCkrZxnYoYYKWLkBowhQoBeaOlZAgVhLidrXqg2G
5195iqpQpZ4apwSwRtjqrB3muoF9BboaXKmshlqWqsWiGt2wphJkQbAU5hoCACH5BAUKABsALAcABADOAAsAAAX/oGFw2WZuT5oZROsSQnGaKjRvilI893MItlNOJ5v5gDcFrHhKIWcEYu/xFEqNv6B1N62aclysF7fsZYe5aOx2yL5aAUGSaT1oTYMBwQ5VGCAJgYIJCnx1gIOBhXdwiIl7d0p2iYGQUAQBjoOFSQR/lIQHnZ+Ue6OagqYzSqSJi5eTpTxGcjcSChANEbu8DBAIEsHBChe5vL13G7fFuscRDcnKuM3H0La3EA7Oz8kKEsXazr7Cw9/Gztar5uHHvte47MjktznZ2w0G1+D3BgirAqJmJMAQgMGEgwgn5Ei0gKDBhBMALGRYEOJBb5QcWlQo4cbAihZz3GgIMqFEBSM1/4ZEOWPAgpIIJXYU+PIhRG8ja1qU6VHlzZknJNQ6UanCjQkWCIGSUGEjAwVLjc44+DTqUQtPPS5gejUrTa5TJ3g9sWCr1BNUWZI161StiQUDmLYdGfesibQ3XMq1OPYthrwuA2yU2LBs2cBHIypYQPPlYAKFD5cVvNPtW8eVGbdcQADATsiNO4cFAPkvHpedPzc8kUcPgNGgZ5RNDZG05reoE9s2vSEP79MEGiQGy1qP8LA4ZcdtsJE48ONoLTBtTV0B9LsTnPceoIDBDQvS7W7vfjVY3q3eZ4A339J4eaAmKqU/sV58HvJh2RcnIBsDUw0ABqhBA5aV5V9XUFGiHfVeAiWwoFgJJrIXRH1tEMiDFV4oHoAEGlaWhgIGSGBO2nFomYY3mKjVglidaNYJGJDkWW2xxTfbjCbVaOGNqoX2GloR8ZeTaECS9pthRGJH2g0b3Agbk6hNANtteHD2GJUucfajCQBy5OOTQ25ZgUPvaVVQmbKh9510/qQpwXx3SQdfk8tZJOd5b6JJFplT3ZnmmX3qd5l1eg5q00HrtUkUn0AKaiGjClSAgKLYZcgWXwocGRcCFGCKwSB6ceqphwmYRUFYT/1WKlOdUpipmxW0mlCqHjYkAaeoZlqrqZ4qd+upQKaapn/AmgAegZ8KUtYtFAQQAgAh+QQFCgAbACwHAAQAzgALAAAF/+C2PUcmiCiZGUTrEkKBis8jQEquKwU5HyXIbEPgyX7BYa5wTNmEMwWsSXsqFbEh8DYs9mrgGjdK6GkPY5GOeU6ryz7UFopSQEzygOGhJBjoIgMDBAcBM0V/CYqLCQqFOwobiYyKjn2TlI6GKC2YjJZknouaZAcQlJUHl6eooJwKooobqoewrJSEmyKdt59NhRKFMxLEEA4RyMkMEAjDEhfGycqAG8TQx9IRDRDE3d3R2ctD1RLg0ttKEnbY5wZD3+zJ6M7X2RHi9Oby7u/r9g38UFjTh2xZJBEBMDAboogAgwkQI07IMUORwocSJwCgWDFBAIwZOaJIsOBjRogKJP8wTODw5ESVHVtm3AhzpEeQElOuNDlTZ0ycEUWKWFASqEahGwYUPbnxoAgEdlYSqDBkgoUNClAlIHbSAoOsqCRQnQHxq1axVb06FWFxLIqyaze0Tft1JVqyE+pWXMD1pF6bYl3+HTqAWNW8cRUFzmih0ZAAB2oGKukSAAGGRHWJgLiR6AylBLpuHKKUMlMCngMpDSAa9QIUggZVVvDaJobLeC3XZpvgNgCmtPcuwP3WgmXSq4do0DC6o2/guzcseECtUoO0hmcsGKDgOt7ssBd07wqesAIGZC1YIBa7PQHvb1+SFo+++HrJSQfB33xfav3i5eX3Hnb4CTJgegEq8tH/YQEOcIJzbm2G2EoYRLgBXFpVmFYDcREV4HIcnmUhiGBRouEMJGJGzHIspqgdXxK0yCKHRNXoIX4uorCdTyjkyNtdPWrA4Up82EbAbzMRxxZRR54WXVLDIRmRcag5d2R6ugl3ZXzNhTecchpMhIGVAKAYpgJjjsSklBEd99maZoo535ZvdamjBEpusJyctg3h4X8XqodBMx0tiNeg/oGJaKGABpogS40KSqiaEgBqlQWLUtqoVQnytekEjzo0hHqhRorppOZt2p923M2AAV+oBtpAnnPNoB6HaU6mAAIU+IXmi3j2mtFXuUoHKwXpzVrsjcgGOauKEjQrwq157hitGq2NoWmjh7z6Wmxb0m5w66+2VRAuXN/yFUAIACH5BAUKABsALAcABADOAAsAAAX/4CZuRiaM45MZqBgIRbs9AqTcuFLE7VHLOh7KB5ERdjJaEaU4ClO/lgKWjKKcMiJQ8KgumcieVdQMD8cbBeuAkkC6LYLhOxoQ2PF5Ys9PKPBMen17f0CCg4VSh32JV4t8jSNqEIOEgJKPlkYBlJWRInKdiJdkmQlvKAsLBxdABA4RsbIMBggtEhcQsLKxDBC2TAS6vLENdJLDxMZAubu8vjIbzcQRtMzJz79S08oQEt/guNiyy7fcvMbh4OezdAvGrakLAQwyABsELQkY9BP+//ckyPDD4J9BfAMh1GsBoImMeQUN+lMgUJ9CiRMa5msxoB9Gh/o8GmxYMZXIgxtR/yQ46S/gQAURR0pDwYDfywoyLPip5AdnCwsMFPBU4BPFhKBDi444quCmDKZOfwZ9KEGpCKgcN1jdALSpPqIYsabS+nSqvqplvYqQYAeDPgwKwjaMtiDl0oaqUAyo+3TuWwUAMPpVCfee0cEjVBGQq2ABx7oTWmQk4FglZMGN9fGVDMCuiH2AOVOu/PmyxM630gwM0CCn6q8LjVJ8GXvpa5Uwn95OTC/nNxkda1/dLSK475IjCD6dHbK1ZOa4hXP9DXs5chJ00UpVm5xo2qRpoxptwF2E4/IbJpB/SDz9+q9b1aNfQH08+p4a8uvX8B53fLP+ycAfemjsRUBgp1H20K+BghHgVgt1GXZXZpZ5lt4ECjxYR4ScUWiShEtZqBiIInRGWnERNnjiBglw+JyGnxUmGowsyiiZg189lNtPGACjV2+S9UjbU0JWF6SPvEk3QZEqsZYTk3UAaRSUnznJI5LmESCdBVSyaOWUWLK4I5gDUYVeV1T9l+FZClCAUVA09uSmRHBCKAECFEhW51ht6rnmWBXkaR+NjuHpJ40D3DmnQXt2F+ihZxlqVKOfQRACACH5BAUKABwALAcABADOAAsAAAX/ICdyUCkUo/g8mUG8MCGkKgspeC6j6XEIEBpBUeCNfECaglBcOVfJFK7YQwZHQ6JRZBUqTrSuVEuD3nI45pYjFuWKvjjSkCoRaBUMWxkwBGgJCXspQ36Bh4EEB0oKhoiBgyNLjo8Ki4QElIiWfJqHnISNEI+Ql5J9o6SgkqKkgqYihamPkW6oNBgSfiMMDQkGCBLCwxIQDhHIyQwQCGMKxsnKVyPCF9DREQ3MxMPX0cu4wt7J2uHWx9jlKd3o39MiuefYEcvNkuLt5O8c1ePI2tyELXGQwoGDAQf+iEC2xByDCRAjTlAgIUWCBRgCPJQ4AQBFXAs0coT40WLIjRxL/47AcHLkxIomRXL0CHPERZkpa4q4iVKiyp0tR/7kwHMkTUBBJR5dOCEBAVcKKtCAyOHpowXCpk7goABqBZdcvWploACpBKkpIJI1q5OD2rIWE0R1uTZu1LFwbWL9OlKuWb4c6+o9i3dEgw0RCGDUG9KlRw56gDY2qmCByZBaASi+TACA0TucAaTteCcy0ZuOK3N2vJlx58+LRQyY3Xm0ZsgjZg+oPQLi7dUcNXi0LOJw1pgNtB7XG6CBy+U75SYfPTSQAgZTNUDnQHt67wnbZyvwLgKiMN3oCZB3C76tdewpLFgIP2C88rbi4Y+QT3+8S5USMICZXWj1pkEDeUU3lOYGB3alSoEiMIjgX4WlgNF2EibIwQIXauWXSRg2SAOHIU5IIIMoZkhhWiJaiFVbKo6AQEgQXrTAazO1JhkBrBG3Y2Y6EsUhaGn95hprSN0oWpFE7rhkeaQBchGOEWnwEmc0uKWZj0LeuNV3W4Y2lZHFlQCSRjTIl8uZ+kG5HU/3sRlnTG2ytyadytnD3HrmuRcSn+0h1dycexIK1KCjYaCnjCCVqOFFJTZ5GkUUjESWaUIKU2lgCmAKKQIUjHapXRKE+t2og1VgankNYnohqKJ2CmKplso6GKz7WYCgqxeuyoF8u9IQAgA7",
5196                        msg: null,
5197                        msgText: "<em>Loading the next set of posts...</em>",
5198                        selector: null,
5199                        speed: "fast",
5200                        start: n
5201                },
5202                state: {
5203                        isDuringAjax: false,
5204                        isInvalidPage: false,
5205                        isDestroyed: false,
5206                        isDone: false,
5207                        isPaused: false,
5208                        isBeyondMaxPage: false,
5209                        currPage: 1
5210                },
5211                debug: false,
5212                behavior: n,
5213                binder: t(e),
5214                nextSelector: "div.navigation a:first",
5215                navSelector: "div.navigation",
5216                contentSelector: null,
5217                extraScrollPx: 150,
5218                itemSelector: "div.post",
5219                animate: false,
5220                pathParse: n,
5221                dataType: "html",
5222                appendCallback: true,
5223                bufferPx: 40,
5224                errorCallback: function () {},
5225                infid: 0,
5226                pixelsFromNavToBottom: n,
5227                path: n,
5228                prefill: false,
5229                maxPage: n
5230        };
5231        t.infinitescroll.prototype = {
5232                _binding: function (t) {
5233                        var r = this,
5234                                i = r.options;
5235                        i.v = "2.0b2.120520";
5236                        if ( !! i.behavior && this["_binding_" + i.behavior] !== n) {
5237                                this["_binding_" + i.behavior].call(this);
5238                                return
5239                        }
5240                        if (t !== "bind" && t !== "unbind") {
5241                                this._debug("Binding value  " + t + " not valid");
5242                                return false
5243                        }
5244                        if (t === "unbind") {
5245                                this.options.binder.unbind("smartscroll.infscr." + r.options.infid)
5246                        } else {
5247                                this.options.binder[t]("smartscroll.infscr." + r.options.infid, function () {
5248                                        r.scroll()
5249                                })
5250                        }
5251                        this._debug("Binding", t)
5252                },
5253                _create: function (i, s) {
5254                        var o = t.extend(true, {}, t.infinitescroll.defaults, i);
5255                        this.options = o;
5256                        var u = t(e);
5257                        var a = this;
5258                        if (!a._validate(i)) {
5259                                return false
5260                        }
5261                        var f = t(o.nextSelector).attr("href");
5262                        if (!f) {
5263                                this._debug("Navigation selector not found");
5264                                return false
5265                        }
5266                        o.path = o.path || this._determinepath(f);
5267                        o.contentSelector = o.contentSelector || this.element;
5268                        o.loading.selector = o.loading.selector || o.contentSelector;
5269                        o.loading.msg = o.loading.msg || t('<div id="infscr-loading"><img alt="Loading..." src="' + o.loading.img + '" /><div>' + o.loading.msgText + "</div></div>");
5270                        (new Image).src = o.loading.img;
5271                        if (o.pixelsFromNavToBottom === n) {
5272                                o.pixelsFromNavToBottom = t(document).height() - t(o.navSelector).offset().top;
5273                                this._debug("pixelsFromNavToBottom: " + o.pixelsFromNavToBottom)
5274                        }
5275                        var l = this;
5276                        o.loading.start = o.loading.start ||
5277                        function () {
5278                                t(o.navSelector).hide();
5279                                o.loading.msg.appendTo(o.loading.selector).show(o.loading.speed, t.proxy(function () {
5280                                        this.beginAjax(o)
5281                                }, l))
5282                        };
5283                        o.loading.finished = o.loading.finished ||
5284                        function () {
5285                                if (!o.state.isBeyondMaxPage) o.loading.msg.fadeOut(o.loading.speed)
5286                        };
5287                        o.callback = function (e, r, i) {
5288                                if ( !! o.behavior && e["_callback_" + o.behavior] !== n) {
5289                                        e["_callback_" + o.behavior].call(t(o.contentSelector)[0], r, i)
5290                                }
5291                                if (s) {
5292                                        s.call(t(o.contentSelector)[0], r, o, i)
5293                                }
5294                                if (o.prefill) {
5295                                        u.bind("resize.infinite-scroll", e._prefill)
5296                                }
5297                        };
5298                        if (i.debug) {
5299                                if (Function.prototype.bind && (typeof console === "object" || typeof console === "function") && typeof console.log === "object") {
5300                                        ["log", "info", "warn", "error", "assert", "dir", "clear", "profile", "profileEnd"].forEach(function (e) {
5301                                                console[e] = this.call(console[e], console)
5302                                        }, Function.prototype.bind)
5303                                }
5304                        }
5305                        this._setup();
5306                        if (o.prefill) {
5307                                this._prefill()
5308                        }
5309                        return true
5310                },
5311                _prefill: function () {
5312                        function s() {
5313                                return r.options.contentSelector.height() <= i.height()
5314                        }
5315                        var r = this;
5316                        var i = t(e);
5317                        this._prefill = function () {
5318                                if (s()) {
5319                                        r.scroll()
5320                                }
5321                                i.bind("resize.infinite-scroll", function () {
5322                                        if (s()) {
5323                                                i.unbind("resize.infinite-scroll");
5324                                                r.scroll()
5325                                        }
5326                                })
5327                        };
5328                        this._prefill()
5329                },
5330                _debug: function () {
5331                        if (true !== this.options.debug) {
5332                                return
5333                        }
5334                        if (typeof console !== "undefined" && typeof console.log === "function") {
5335                                if (Array.prototype.slice.call(arguments).length === 1 && typeof Array.prototype.slice.call(arguments)[0] === "string") {
5336                                        console.log(Array.prototype.slice.call(arguments).toString())
5337                                } else {
5338                                        console.log(Array.prototype.slice.call(arguments))
5339                                }
5340                        } else if (!Function.prototype.bind && typeof console !== "undefined" && typeof console.log === "object") {
5341                                Function.prototype.call.call(console.log, console, Array.prototype.slice.call(arguments))
5342                        }
5343                },
5344                _determinepath: function (t) {
5345                        var r = this.options;
5346                        if ( !! r.behavior && this["_determinepath_" + r.behavior] !== n) {
5347                                return this["_determinepath_" + r.behavior].call(this, t)
5348                        }
5349                        if ( !! r.pathParse) {
5350                                this._debug("pathParse manual");
5351                                return r.pathParse(t, this.options.state.currPage + 1)
5352                        } else if (t.match(/^(.*?)\b2\b(.*?$)/)) {
5353                                t = t.match(/^(.*?)\b2\b(.*?$)/).slice(1)
5354                        } else if (t.match(/^(.*?)2(.*?$)/)) {
5355                                if (t.match(/^(.*?page=)2(\/.*|$)/)) {
5356                                        t = t.match(/^(.*?page=)2(\/.*|$)/).slice(1);
5357                                        return t
5358                                }
5359                                t = t.match(/^(.*?)2(.*?$)/).slice(1)
5360                        } else {
5361                                if (t.match(/^(.*?page=)1(\/.*|$)/)) {
5362                                        t = t.match(/^(.*?page=)1(\/.*|$)/).slice(1);
5363                                        return t
5364                                } else {
5365                                        this._debug("Sorry, we couldn't parse your Next (Previous Posts) URL. Verify your the css selector points to the correct A tag. If you still get this error: yell, scream, and kindly ask for help at infinite-scroll.com.");
5366                                        r.state.isInvalidPage = true
5367                                }
5368                        }
5369                        this._debug("determinePath", t);
5370                        return t
5371                },
5372                _error: function (t) {
5373                        var r = this.options;
5374                        if ( !! r.behavior && this["_error_" + r.behavior] !== n) {
5375                                this["_error_" + r.behavior].call(this, t);
5376                                return
5377                        }
5378                        if (t !== "destroy" && t !== "end") {
5379                                t = "unknown"
5380                        }
5381                        this._debug("Error", t);
5382                        if (t === "end" || r.state.isBeyondMaxPage) {
5383                                this._showdonemsg()
5384                        }
5385                        r.state.isDone = true;
5386                        r.state.currPage = 1;
5387                        r.state.isPaused = false;
5388                        r.state.isBeyondMaxPage = false;
5389                        this._binding("unbind")
5390                },
5391                _loadcallback: function (i, s, o) {
5392                        var u = this.options,
5393                                a = this.options.callback,
5394                                f = u.state.isDone ? "done" : !u.appendCallback ? "no-append" : "append",
5395                                l;
5396                        if ( !! u.behavior && this["_loadcallback_" + u.behavior] !== n) {
5397                                this["_loadcallback_" + u.behavior].call(this, i, s);
5398                                return
5399                        }
5400                        switch (f) {
5401                        case "done":
5402                                this._showdonemsg();
5403                                return false;
5404                        case "no-append":
5405                                if (u.dataType === "html") {
5406                                        s = "<div>" + s + "</div>";
5407                                        s = t(s).find(u.itemSelector)
5408                                }
5409                                break;
5410                        case "append":
5411                                var c = i.children();
5412                                if (c.length === 0) {
5413                                        return this._error("end")
5414                                }
5415                                l = document.createDocumentFragment();
5416                                while (i[0].firstChild) {
5417                                        l.appendChild(i[0].firstChild)
5418                                }
5419                                this._debug("contentSelector", t(u.contentSelector)[0]);
5420                                t(u.contentSelector)[0].appendChild(l);
5421                                s = c.get();
5422                                break
5423                        }
5424                        u.loading.finished.call(t(u.contentSelector)[0], u);
5425                        if (u.animate) {
5426                                var h = t(e).scrollTop() + t(u.loading.msg).height() + u.extraScrollPx + "px";
5427                                t("html,body").animate({
5428                                        scrollTop: h
5429                                }, 800, function () {
5430                                        u.state.isDuringAjax = false
5431                                })
5432                        }
5433                        if (!u.animate) {
5434                                u.state.isDuringAjax = false
5435                        }
5436                        a(this, s, o);
5437                        if (u.prefill) {
5438                                this._prefill()
5439                        }
5440                },
5441                _nearbottom: function () {
5442                        var i = this.options,
5443                                s = 0 + t(document).height() - i.binder.scrollTop() - t(e).height();
5444                        if ( !! i.behavior && this["_nearbottom_" + i.behavior] !== n) {
5445                                return this["_nearbottom_" + i.behavior].call(this)
5446                        }
5447                        this._debug("math:", s, i.pixelsFromNavToBottom);
5448                        return s - i.bufferPx < i.pixelsFromNavToBottom
5449                },
5450                _pausing: function (t) {
5451                        var r = this.options;
5452                        if ( !! r.behavior && this["_pausing_" + r.behavior] !== n) {
5453                                this["_pausing_" + r.behavior].call(this, t);
5454                                return
5455                        }
5456                        if (t !== "pause" && t !== "resume" && t !== null) {
5457                                this._debug("Invalid argument. Toggling pause value instead")
5458                        }
5459                        t = t && (t === "pause" || t === "resume") ? t : "toggle";
5460                        switch (t) {
5461                        case "pause":
5462                                r.state.isPaused = true;
5463                                break;
5464                        case "resume":
5465                                r.state.isPaused = false;
5466                                break;
5467                        case "toggle":
5468                                r.state.isPaused = !r.state.isPaused;
5469                                break
5470                        }
5471                        this._debug("Paused", r.state.isPaused);
5472                        return false
5473                },
5474                _setup: function () {
5475                        var t = this.options;
5476                        if ( !! t.behavior && this["_setup_" + t.behavior] !== n) {
5477                                this["_setup_" + t.behavior].call(this);
5478                                return
5479                        }
5480                        this._binding("bind");
5481                        return false
5482                },
5483                _showdonemsg: function () {
5484                        var r = this.options;
5485                        if ( !! r.behavior && this["_showdonemsg_" + r.behavior] !== n) {
5486                                this["_showdonemsg_" + r.behavior].call(this);
5487                                return
5488                        }
5489                        r.loading.msg.find("img").hide().parent().find("div").html(r.loading.finishedMsg).animate({
5490                                opacity: 1
5491                        }, 2e3, function () {
5492                                t(this).parent().fadeOut(r.loading.speed)
5493                        });
5494                        r.errorCallback.call(t(r.contentSelector)[0], "done")
5495                },
5496                _validate: function (n) {
5497                        for (var r in n) {
5498                                if (r.indexOf && r.indexOf("Selector") > -1 && t(n[r]).length === 0) {
5499                                        this._debug("Your " + r + " found no elements.");
5500                                        return false
5501                                }
5502                        }
5503                        return true
5504                },
5505                bind: function () {
5506                        this._binding("bind")
5507                },
5508                destroy: function () {
5509                        this.options.state.isDestroyed = true;
5510                        this.options.loading.finished();
5511                        return this._error("destroy")
5512                },
5513                pause: function () {
5514                        this._pausing("pause")
5515                },
5516                resume: function () {
5517                        this._pausing("resume")
5518                },
5519                beginAjax: function (r) {
5520                        var i = this,
5521                                s = r.path,
5522                                o, u, a, f;
5523                        r.state.currPage++;
5524                        if (r.maxPage != n && r.state.currPage > r.maxPage) {
5525                                r.state.isBeyondMaxPage = true;
5526                                this.destroy();
5527                                return
5528                        }
5529                        o = t(r.contentSelector).is("table, tbody") ? t("<tbody/>") : t("<div/>");
5530                        u = typeof s === "function" ? s(r.state.currPage) : s.join(r.state.currPage);
5531                        i._debug("heading into ajax", u);
5532                        a = r.dataType === "html" || r.dataType === "json" ? r.dataType : "html+callback";
5533                        if (r.appendCallback && r.dataType === "html") {
5534                                a += "+callback"
5535                        }
5536                        switch (a) {
5537                        case "html+callback":
5538                                i._debug("Using HTML via .load() method");
5539                                o.load(u + " " + r.itemSelector, n, function (t) {
5540                                        i._loadcallback(o, t, u)
5541                                });
5542                                break;
5543                        case "html":
5544                                i._debug("Using " + a.toUpperCase() + " via $.ajax() method");
5545                                t.ajax({
5546                                        url: u,
5547                                        dataType: r.dataType,
5548                                        complete: function (t, n) {
5549                                                f = typeof t.isResolved !== "undefined" ? t.isResolved() : n === "success" || n === "
5549notmodified";
5550                                                if (f) {
5551                                                        i._loadcallback(o, t.responseText, u)
5552                                                } else {
5553                                                        i._error("end")
5554                                                }
5555                                        }
5556                                });
5557                                break;
5558                        case "json":
5559                                i._debug("Using " + a.toUpperCase() + " via $.ajax() method");
5560                                t.ajax({
5561                                        dataType: "json",
5562                                        type: "GET",
5563                                        url: u,
5564                                        success: function (e, t, s) {
5565                                                f = typeof s.isResolved !== "undefined" ? s.isResolved() : t === "success" || t === "notmodified";
5566                                                if (r.appendCallback) {
5567                                                        if (r.template !== n) {
5568                                                                var a = r.template(e);
5569                                                                o.append(a);
5570                                                                if (f) {
5571                                                                        i._loadcallback(o, a)
5572                                                                } else {
5573                                                                        i._error("end")
5574                                                                }
5575                                                        } else {
5576                                                                i._debug("template must be defined.");
5577                                                                i._error("end")
5578                                                        }
5579                                                } else {
5580                                                        if (f) {
5581                                                                i._loadcallback(o, e, u)
5582                                                        } else {
5583                                                                i._error("end")
5584                                                        }
5585                                                }
5586                                        },
5587                                        error: function () {
5588                                                i._debug("JSON ajax request failed.");
5589                                                i._error("end")
5590                                        }
5591                                });
5592                                break
5593                        }
5594                },
5595                retrieve: function (r) {
5596                        r = r || null;
5597                        var i = this,
5598                                s = i.options;
5599                        if ( !! s.behavior && this["retrieve_" + s.behavior] !== n) {
5600                                this["retrieve_" + s.behavior].call(this, r);
5601                                return
5602                        }
5603                        if (s.state.isDestroyed) {
5604                                this._debug("Instance is destroyed");
5605                                return false
5606                        }
5607                        s.state.isDuringAjax = true;
5608                        s.loading.start.call(t(s.contentSelector)[0], s)
5609                },
5610                scroll: function () {
5611                        var t = this.options,
5612                                r = t.state;
5613                        if ( !! t.behavior && this["scroll_" + t.behavior] !== n) {
5614                                this["scroll_" + t.behavior].call(this);
5615                                return
5616                        }
5617                        if (r.isDuringAjax || r.isInvalidPage || r.isDone || r.isDestroyed || r.isPaused) {
5618                                return
5619                        }
5620                        if (!this._nearbottom()) {
5621                                return
5622                        }
5623                        this.retrieve()
5624                },
5625                toggle: function () {
5626                        this._pausing()
5627                },
5628                unbind: function () {
5629                        this._binding("unbind")
5630                },
5631                update: function (n) {
5632                        if (t.isPlainObject(n)) {
5633                                this.options = t.extend(true, this.options, n)
5634                        }
5635                }
5636        };
5637        t.fn.infinitescroll = function (n, r) {
5638                var i = typeof n;
5639                switch (i) {
5640                case "string":
5641                        var s = Array.prototype.slice.call(arguments, 1);
5642                        this.each(function () {
5643                                var e = t.data(this, "infinitescroll");
5644                                if (!e) {
5645                                        return false
5646                                }
5647                                if (!t.isFunction(e[n]) || n.charAt(0) === "_") {
5648                                        return false
5649                                }
5650                                e[n].apply(e, s)
5651                        });
5652                        break;
5653                case "object":
5654                        this.each(function () {
5655                                var e = t.data(this, "infinitescroll");
5656                                if (e) {
5657                                        e.update(n)
5658                                } else {
5659                                        e = new t.infinitescroll(n, r, this);
5660                                        if (!e.failed) {
5661                                                t.data(this, "infinitescroll", e)
5662                                        }
5663                                }
5664                        });
5665                        break
5666                }
5667                return this
5668        };
5669        var r = t.event,
5670                i;
5671        r.special.smartscroll = {
5672                setup: function () {
5673                        t(this).bind("scroll", r.special.smartscroll.handler)
5674                },
5675                teardown: function () {
5676                        t(this).unbind("scroll", r.special.smartscroll.handler)
5677                },
5678                handler: function (e, n) {
5679                        var r = this,
5680                                s = arguments;
5681                        e.type = "smartscroll";
5682                        if (i) {
5683                                clearTimeout(i)
5684                        }
5685                        i = setTimeout(function () {
5686                                t(r).trigger("smartscroll", s)
5687                        }, n === "execAsap" ? 0 : 100)
5688                }
5689        };
5690        t.fn.smartscroll = function (e) {
5691                return e ? this.bind("smartscroll", e) : this.trigger("smartscroll", ["execAsap"])
5692        }
5693})(window, jQuery)
5694
5695
5696;(function (a, b, c) {
5697        "use strict";
5698        var d = a.document,
5699                e = a.Modernizr,
5700                f = function (a) {
5701                        return a.charAt(0).toUpperCase() + a.slice(1)
5702                },
5703                g = "Moz Webkit O Ms".split(" "),
5704                h = function (a) {
5705                        var b = d.documentElement.style,
5706                                c;
5707                        if (typeof b[a] == "string") return a;
5708                        a = f(a);
5709                        for (var e = 0, h = g.length; e < h; e++) {
5710                                c = g[e] + a;
5711                                if (typeof b[c] == "string") return c
5712                        }
5713                },
5714                i = h("transform"),
5715                j = h("transitionProperty"),
5716                k = {
5717                        csstransforms: function () {
5718                                return !!i
5719                        },
5720                        csstransforms3d: function () {
5721                                var a = !! h("perspective");
5722                                if (a) {
5723                                        var c = " -o- -moz- -ms- -webkit- -khtml- ".split(" "),
5724                                                d = "@media (" + c.join("transform-3d),(") + "modernizr)",
5725                                                e = b("<style>" + d + "{#modernizr{height:3px}}" + "</style>").appendTo("head"),
5726                                                f = b('<div id="modernizr" />').appendTo("html");
5727                                        a = f.height() === 3, f.remove(), e.remove()
5728                                }
5729                                return a
5730                        },
5731                        csstransitions: function () {
5732                                return !!j 
5733                        }
5734                },
5735                l;
5736        if (e) for (l in k) e.hasOwnProperty(l) || e.addTest(l, k[l]);
5737        else {
5738                e = a.Modernizr = {
5739                        _version: "1.6ish: miniModernizr for Isotope"
5740                };
5741                var m = " ",
5742                        n;
5743                for (l in k) n = k[l](), e[l] = n, m += " " + (n ? "" : "no-") + l;
5744                b("html").addClass(m)
5745        }
5746        if (e.csstransforms) {
5747                var o = e.csstransforms3d ? {
5748                        translate: function (a) {
5749                                return "translate3d(" + a[0] + "px, " + a[1] + "px, 0) "
5750                        },
5751                        scale: function (a) {
5752                                return "scale3d(" + a + ", " + a + ", 1) "
5753                        }
5754                } : {
5755                        translate: function (a) {
5756                                return "translate(" + a[0] + "px, " + a[1] + "px) "
5757                        },
5758                        scale: function (a) {
5759                                return "scale(" + a + ") "
5760                        }
5761                },
5762                        p = function (a, c, d) {
5763                                var e = b.data(a, "isoTransform") || {},
5764                                        f = {},
5765                                        g, h = {},
5766                                        j;
5767                                f[c] = d, b.extend(e, f);
5768                                for (g in e) j = e[g], h[g] = o[g](j);
5769                                var k = h.translate || "",
5770                                        l = h.scale || "",
5771                                        m = k + l;
5772                                b.data(a, "isoTransform", e), a.style[i] = m
5773                        };
5774                b.cssNumber.scale = !0, b.cssHooks.scale = {
5775                        set: function (a, b) {
5776                                p(a, "scale", b)
5777                        },
5778                        get: function (a, c) {
5779                                var d = b.data(a, "isoTransform");
5780                                return d && d.scale ? d.scale : 1
5781                        }
5782                }, b.fx.step.scale = function (a) {
5783                        b.cssHooks.scale.set(a.elem, a.now + a.unit)
5784                }, b.cssNumber.translate = !0, b.cssHooks.translate = {
5785                        set: function (a, b) {
5786                                p(a, "translate", b)
5787                        },
5788                        get: function (a, c) {
5789                                var d = b.data(a, "isoTransform");
5790                                return d && d.translate ? d.translate : [0, 0]
5791                        }
5792                }
5793        }
5794        var q, r;
5795        e.csstransitions && (q = {
5796                WebkitTransitionProperty: "webkitTransitionEnd",
5797                MozTransitionProperty: "transitionend",
5798                OTransitionProperty: "oTransitionEnd otransitionend",
5799                transitionProperty: "transitionend"
5800        }[j], r = h("transitionDuration"));
5801        var s = b.event,
5802                t = b.event.handle ? "handle" : "dispatch",
5803                u;
5804        s.special.smartresize = {
5805                setup: function () {
5806                        b(this).bind("resize", s.special.smartresize.handler)
5807                },
5808                teardown: function () {
5809                        b(this).unbind("resize", s.special.smartresize.handler)
5810                },
5811                handler: function (a, b) {
5812                        var c = this,
5813                                d = arguments;
5814                        a.type = "smartresize", u && clearTimeout(u), u = setTimeout(function () {
5815                                s[t].apply(c, d)
5816                        }, b === "execAsap" ? 0 : 100)
5817                }
5818        }, b.fn.smartresize = function (a) {
5819                return a ? this.bind("smartresize", a) : this.trigger("smartresize", ["execAsap"])
5820        }, b.Isotope = function (a, c, d) {
5821                this.element = b(c), this._create(a), this._init(d)
5822        };
5823        var v = ["width", "height"],
5824                w = b(a);
5825        b.Isotope.settings = {
5826                resizable: !0,
5827                layoutMode: "masonry",
5828                containerClass: "isotope",
5829                itemClass: "isotope-item",
5830                hiddenClass: "isotope-hidden",
5831                hiddenStyle: {
5832                        opacity: 0,
5833                        scale: .001
5834                },
5835                visibleStyle: {
5836                        opacity: 1,
5837                        scale: 1
5838                },
5839                containerStyle: {
5840                        position: "relative",
5841                        overflow: "hidden"
5842                },
5843                animationEngine: "best-available",
5844                animationOptions: {
5845                        queue: !1,
vendor: 29,645 bytes, lines 5846-6420
5846                        duration: 800
5847                },
5848                sortBy: "original-order",
5849                sortAscending: !0,
5850                resizesContainer: !0,
5851                transformsEnabled: !0,
5852                itemPositionDataEnabled: !1
5853        }, b.Isotope.prototype = {
5854                _create: function (a) {
5855                        this.options = b.extend({}, b.Isotope.settings, a), this.styleQueue = [], this.elemCount = 0;
5856                        var c = this.element[0].style;
5857                        this.originalStyle = {};
5858                        var d = v.slice(0);
5859                        for (var e in this.options.containerStyle) d.push(e);
5860                        for (var f = 0, g = d.length; f < g; f++) e = d[f], this.originalStyle[e] = c[e] || "";
5861                        this.element.css(this.options.containerStyle), this._updateAnimationEngine(), this._updateUsingTransforms();
5862                        var h = {
5863                                "original-order": function (a, b) {
5864                                        return b.elemCount++, b.elemCount
5865                                },
5866                                random: function () {
5867                                        return Math.random()
5868                                }
5869                        };
5870                        this.options.getSortData = b.extend(this.options.getSortData, h), this.reloadItems(), this.offset = {
5871                                left: parseInt(this.element.css("padding-left") || 0, 10),
5872                                top: parseInt(this.element.css("padding-top") || 0, 10)
5873                        };
5874                        var i = this;
5875                        setTimeout(function () {
5876                                i.element.addClass(i.options.containerClass)
5877                        }, 0), this.options.resizable && w.bind("smartresize.isotope", function () {
5878                                i.resize()
5879                        }), this.element.delegate("." + this.options.hiddenClass, "click", function () {
5880                                return !1
5881                        })
5882                },
5883                _getAtoms: function (a) {
5884                        var b = this.options.itemSelector,
5885                                c = b ? a.filter(b).add(a.find(b)) : a,
5886                                d = {
5887                                        position: "absolute"
5888                                };
5889                        return c = c.filter(function (a, b) {
5890                                return b.nodeType === 1
5891                        }), this.usingTransforms && (d.left = 0, d.top = 0), c.css(d).addClass(this.options.itemClass), this.updateSortData(c, !0), c
5892                },
5893                _init: function (a) {
5894                        this.$filteredAtoms = this._filter(this.$allAtoms), this._sort(), this.reLayout(a)
5895                },
5896                option: function (a) {
5897                        if (b.isPlainObject(a)) {
5898                                this.options = b.extend(!0, this.options, a);
5899                                var c;
5900                                for (var d in a) c = "_update" + f(d), this[c] && this[c]()
5901                        }
5902                },
5903                _updateAnimationEngine: function () {
5904                        var a = this.options.animationEngine.toLowerCase().replace(/[ _\-]/g, ""),
5905                                b;
5906                        switch (a) {
5907                        case "css":
5908                        case "none":
5909                                b = !1;
5910                                break;
5911                        case "jquery":
5912                                b = !0;
5913                                break;
5914                        default:
5915                                b = !e.csstransitions
5916                        }
5917                        this.isUsingJQueryAnimation = b, this._updateUsingTransforms()
5918                },
5919                _updateTransformsEnabled: function () {
5920                        this._updateUsingTransforms()
5921                },
5922                _updateUsingTransforms: function () {
5923                        var a = this.usingTransforms = this.options.transformsEnabled && e.csstransforms && e.csstransitions && !this.isUsingJQueryAnimation;
5924                        a || (delete this.options.hiddenStyle.scale, delete this.options.visibleStyle.scale), this.getPositionStyles = a ? this._translate : this._positionAbs
5925                },
5926                _filter: function (a) {
5927                        var b = this.options.filter === "" ? "*" : this.options.filter;
5928                        if (!b) return a;
5929                        var c = this.options.hiddenClass,
5930                                d = "." + c,
5931                                e = a.filter(d),
5932                                f = e;
5933                        if (b !== "*") {
5934                                f = e.filter(b);
5935                                var g = a.not(d).not(b).addClass(c);
5936                                this.styleQueue.push({
5937                                        $el: g,
5938                                        style: this.options.hiddenStyle
5939                                })
5940                        }
5941                        return this.styleQueue.push({
5942                                $el: f,
5943                                style: this.options.visibleStyle
5944                        }), f.removeClass(c), a.filter(b)
5945                },
5946                updateSortData: function (a, c) {
5947                        var d = this,
5948                                e = this.options.getSortData,
5949                                f, g;
5950                        a.each(function () {
5951                                f = b(this), g = {};
5952                                for (var a in e)!c && a === "original-order" ? g[a] = b.data(this, "isotope-sort-data")[a] : g[a] = e[a](f, d);
5953                                b.data(this, "isotope-sort-data", g)
5954                        })
5955                },
5956                _sort: function () {
5957                        var a = this.options.sortBy,
5958                                b = this._getSorter,
5959                                c = this.options.sortAscending ? 1 : -1,
5960                                d = function (d, e) {
5961                                        var f = b(d, a),
5962                                                g = b(e, a);
5963                                        return f === g && a !== "original-order" && (f = b(d, "original-order"), g = b(e, "original-order")), (f > g ? 1 : f < g ? -1 : 0) * c
5964                                };
5965                        this.$filteredAtoms.sort(d)
5966                },
5967                _getSorter: function (a, c) {
5968                        return b.data(a, "isotope-sort-data")[c]
5969                },
5970                _translate: function (a, b) {
5971                        return {
5972                                translate: [a, b]
5973                        }
5974                },
5975                _positionAbs: function (a, b) {
5976                        return {
5977                                left: a,
5978                                top: b
5979                        }
5980                },
5981                _pushPosition: function (a, b, c) {
5982                        b = Math.round(b + this.offset.left), c = Math.round(c + this.offset.top);
5983                        var d = this.getPositionStyles(b, c);
5984                        this.styleQueue.push({
5985                                $el: a,
5986                                style: d
5987                        }), this.options.itemPositionDataEnabled && a.data("isotope-item-position", {
5988                                x: b,
5989                                y: c
5990                        })
5991                },
5992                layout: function (a, b) {
5993                        var c = this.options.layoutMode;
5994                        this["_" + c + "Layout"](a);
5995                        if (this.options.resizesContainer) {
5996                                var d = this["_" + c + "GetContainerSize"]();
5997                                this.styleQueue.push({
5998                                        $el: this.element,
5999                                        style: d
6000                                })
6001                        }
6002                        this._processStyleQueue(a, b), this.isLaidOut = !0
6003                },
6004                _processStyleQueue: function (a, c) {
6005                        var d = this.isLaidOut ? this.isUsingJQueryAnimation ? "animate" : "css" : "css",
6006                                f = this.options.animationOptions,
6007                                g = this.options.onLayout,
6008                                h, i, j, k;
6009                        i = function (a, b) {
6010                                b.$el[d](b.style, f)
6011                        };
6012                        if (this._isInserting && this.isUsingJQueryAnimation) i = function (a, b) {
6013                                h = b.$el.hasClass("no-transition") ? "css" : d, b.$el[h](b.style, f)
6014                        };
6015                        else if (c || g || f.complete) {
6016                                var l = !1,
6017                                        m = [c, g, f.complete],
6018                                        n = this;
6019                                j = !0, k = function () {
6020                                        if (l) return;
6021                                        var b;
6022                                        for (var c = 0, d = m.length; c < d; c++) b = m[c], typeof b == "function" && b.call(n.element, a, n);
6023                                        l = !0
6024                                };
6025                                if (this.isUsingJQueryAnimation && d === "animate") f.complete = k, j = !1;
6026                                else if (e.csstransitions) {
6027                                        var o = 0,
6028                                                p = this.styleQueue[0],
6029                                                s = p && p.$el,
6030                                                t;
6031                                        while (!s || !s.length) {
6032                                                t = this.styleQueue[o++];
6033                                                if (!t) return;
6034                                                s = t.$el
6035                                        }
6036                                        var u = parseFloat(getComputedStyle(s[0])[r]);
6037                                        u > 0 && (i = function (a, b) {
6038                                                b.$el[d](b.style, f).one(q, k)
6039                                        }, j = !1)
6040                                }
6041                        }
6042                        b.each(this.styleQueue, i), j && k(), this.styleQueue = []
6043                },
6044                resize: function () {
6045                        this["_" + this.options.layoutMode + "ResizeChanged"]() && this.reLayout()
6046                },
6047                reLayout: function (a) {
6048                        this["_" + this.options.layoutMode + "Reset"](), this.layout(this.$filteredAtoms, a)
6049                },
6050                addItems: function (a, b) {
6051                        var c = this._getAtoms(a);
6052                        this.$allAtoms = this.$allAtoms.add(c), b && b(c)
6053                },
6054                insert: function (a, b) {
6055                        this.element.append(a);
6056                        var c = this;
6057                        this.addItems(a, function (a) {
6058                                var d = c._filter(a);
6059                                c._addHideAppended(d), c._sort(), c.reLayout(), c._revealAppended(d, b)
6060                        })
6061                },
6062                appended: function (a, b) {
6063                        var c = this;
6064                        this.addItems(a, function (a) {
6065                                c._addHideAppended(a), c.layout(a), c._revealAppended(a, b)
6066                        })
6067                },
6068                _addHideAppended: function (a) {
6069                        this.$filteredAtoms = this.$filteredAtoms.add(a), a.addClass("no-transition"), this._isInserting = !0, this.styleQueue.push({
6070                                $el: a,
6071                                style: this.options.hiddenStyle
6072                        })
6073                },
6074                _revealAppended: function (a, b) {
6075                        var c = this;
6076                        setTimeout(function () {
6077                                a.removeClass("no-transition"), c.styleQueue.push({
6078                                        $el: a,
6079                                        style: c.options.visibleStyle
6080                                }), c._isInserting = !1, c._processStyleQueue(a, b)
6081                        }, 10)
6082                },
6083                reloadItems: function () {
6084                        this.$allAtoms = this._getAtoms(this.element.children())
6085                },
6086                remove: function (a, b) {
6087                        this.$allAtoms = this.$allAtoms.not(a), this.$filteredAtoms = this.$filteredAtoms.not(a);
6088                        var c = this,
6089                                d = function () {
6090                                        a.remove(), b && b.call(c.element)
6091                                };
6092                        a.filter(":not(." + this.options.hiddenClass + ")").length ? (this.styleQueue.push({
6093                                $el: a,
6094                                style: this.options.hiddenStyle
6095                        }), this._sort(), this.reLayout(d)) : d()
6096                },
6097                shuffle: function (a) {
6098                        this.updateSortData(this.$allAtoms), this.options.sortBy = "random", this._sort(), this.reLayout(a)
6099                },
6100                destroy: function () {
6101                        var a = this.usingTransforms,
6102                                b = this.options;
6103                        this.$allAtoms.removeClass(b.hiddenClass + " " + b.itemClass).each(function () {
6104                                var b = this.style;
6105                                b.position = "", b.top = "", b.left = "", b.opacity = "", a && (b[i] = "")
6106                        });
6107                        var c = this.element[0].style;
6108                        for (var d in this.originalStyle) c[d] = this.originalStyle[d];
6109                        this.element.unbind(".isotope").undelegate("." + b.hiddenClass, "click").removeClass(b.containerClass).removeData("isotope"), w.unbind(".isotope")
6110                },
6111                _getSegments: function (a) {
6112                        var b = this.options.layoutMode,
6113                                c = a ? "rowHeight" : "columnWidth",
6114                                d = a ? "height" : "width",
6115                                e = a ? "rows" : "cols",
6116                                g = this.element[d](),
6117                                h, i = this.options[b] && this.options[b][c] || this.$filteredAtoms["outer" + f(d)](!0) || g;
6118                        h = Math.floor(g / i), h = Math.max(h, 1), this[b][e] = h, this[b][c] = i
6119                },
6120                _checkIfSegmentsChanged: function (a) {
6121                        var b = this.options.layoutMode,
6122                                c = a ? "rows" : "cols",
6123                                d = this[b][c];
6124                        return this._getSegments(a), this[b][c] !== d
6125                },
6126                _masonryReset: function () {
6127                        this.masonry = {}, this._getSegments();
6128                        var a = this.masonry.cols;
6129                        this.masonry.colYs = [];
6130                        while (a--) this.masonry.colYs.push(0)
6131                },
6132                _masonryLayout: function (a) {
6133                        var c = this,
6134                                d = c.masonry;
6135                        a.each(function () {
6136                                var a = b(this),
6137                                        e = Math.ceil(a.outerWidth(!0) / d.columnWidth);
6138                                e = Math.min(e, d.cols);
6139                                if (e === 1) c._masonryPlaceBrick(a, d.colYs);
6140                                else {
6141                                        var f = d.cols + 1 - e,
6142                                                g = [],
6143                                                h, i;
6144                                        for (i = 0; i < f; i++) h = d.colYs.slice(i, i + e), g[i] = Math.max.apply(Math, h);
6145                                        c._masonryPlaceBrick(a, g)
6146                                }
6147                        })
6148                },
6149                _masonryPlaceBrick: function (a, b) {
6150                        var c = Math.min.apply(Math, b),
6151                                d = 0;
6152                        for (var e = 0, f = b.length; e < f; e++)
6153                        if (b[e] === c) {
6154                                d = e;
6155                                break
6156                        }
6157                        var g = this.masonry.columnWidth * d,
6158                                h = c;
6159                        this._pushPosition(a, g, h);
6160                        var i = c + a.outerHeight(!0),
6161                                j = this.masonry.cols + 1 - f;
6162                        for (e = 0; e < j; e++) this.masonry.colYs[d + e] = i
6163                },
6164                _masonryGetContainerSize: function () {
6165                        var a = Math.max.apply(Math, this.masonry.colYs);
6166                        return {
6167                                height: a
6168                        }
6169                },
6170                _masonryResizeChanged: function () {
6171                        return this._checkIfSegmentsChanged()
6172                },
6173                _fitRowsReset: function () {
6174                        this.fitRows = {
6175                                x: 0,
6176                                y: 0,
6177                                height: 0
6178                        }
6179                },
6180                _fitRowsLayout: function (a) {
6181                        var c = this,
6182                                d = this.element.width(),
6183                                e = this.fitRows;
6184                        a.each(function () {
6185                                var a = b(this),
6186                                        f = a.outerWidth(!0),
6187                                        g = a.outerHeight(!0);
6188                                e.x !== 0 && f + e.x > d && (e.x = 0, e.y = e.height), c._pushPosition(a, e.x, e.y), e.height = Math.max(e.y + g, e.height), e.x += f
6189                        })
6190                },
6191                _fitRowsGetContainerSize: function () {
6192                        return {
6193                                height: this.fitRows.height
6194                        }
6195                },
6196                _fitRowsResizeChanged: function () {
6197                        return !0
6198                },
6199                _cellsByRowReset: function () {
6200                        this.cellsByRow = {
6201                                index: 0
6202                        }, this._getSegments(), this._getSegments(!0)
6203                },
6204                _cellsByRowLayout: function (a) {
6205                        var c = this,
6206                                d = this.cellsByRow;
6207                        a.each(function () {
6208                                var a = b(this),
6209                                        e = d.index % d.cols,
6210                                        f = Math.floor(d.index / d.cols),
6211                                        g = (e + .5) * d.columnWidth - a.outerWidth(!0) / 2,
6212                                        h = (f + .5) * d.rowHeight - a.outerHeight(!0) / 2;
6213                                c._pushPosition(a, g, h), d.index++
6214                        })
6215                },
6216                _cellsByRowGetContainerSize: function () {
6217                        return {
6218                                height: Math.ceil(this.$filteredAtoms.length / this.cellsByRow.cols) * this.cellsByRow.rowHeight + this.offset.top
6219                        }
6220                },
6221                _cellsByRowResizeChanged: function () {
6222                        return this._checkIfSegmentsChanged()
6223                },
6224                _straightDownReset: function () {
6225                        this.straightDown = {
6226                                y: 0
6227                        }
6228                },
6229                _straightDownLayout: function (a) {
6230                        var c = this;
6231                        a.each(function (a) {
6232                                var d = b(this);
6233                                c._pushPosition(d, 0, c.straightDown.y), c.straightDown.y += d.outerHeight(!0)
6234                        })
6235                },
6236                _straightDownGetContainerSize: function () {
6237                        return {
6238                                height: this.straightDown.y
6239                        }
6240                },
6241                _straightDownResizeChanged: function () {
6242                        return !0
6243                },
6244                _masonryHorizontalReset: function () {
6245                        this.masonryHorizontal = {}, this._getSegments(!0);
6246                        var a = this.masonryHorizontal.rows;
6247                        this.masonryHorizontal.rowXs = [];
6248                        while (a--) this.masonryHorizontal.rowXs.push(0)
6249                },
6250                _masonryHorizontalLayout: function (a) {
6251                        var c = this,
6252                                d = c.masonryHorizontal;
6253                        a.each(function () {
6254                                var a = b(this),
6255                                        e = Math.ceil(a.outerHeight(!0) / d.rowHeight);
6256                                e = Math.min(e, d.rows);
6257                                if (e === 1) c._masonryHorizontalPlaceBrick(a, d.rowXs);
6258                                else {
6259                                        var f = d.rows + 1 - e,
6260                                                g = [],
6261                                                h, i;
6262                                        for (i = 0; i < f; i++) h = d.rowXs.slice(i, i + e), g[i] = Math.max.apply(Math, h);
6263                                        c._masonryHorizontalPlaceBrick(a, g)
6264                                }
6265                        })
6266                },
6267                _masonryHorizontalPlaceBrick: function (a, b) {
6268                        var c = Math.min.apply(Math, b),
6269                                d = 0;
6270                        for (var e = 0, f = b.length; e < f; e++)
6271                        if (b[e] === c) {
6272                                d = e;
6273                                break
6274                        }
6275                        var g = c,
6276                                h = this.masonryHorizontal.rowHeight * d;
6277                        this._pushPosition(a, g, h);
6278                        var i = c + a.outerWidth(!0),
6279                                j = this.masonryHorizontal.rows + 1 - f;
6280                        for (e = 0; e < j; e++) this.masonryHorizontal.rowXs[d + e] = i
6281                },
6282                _masonryHorizontalGetContainerSize: function () {
6283                        var a = Math.max.apply(Math, this.masonryHorizontal.rowXs);
6284                        return {
6285                                width: a
6286                        }
6287                },
6288                _masonryHorizontalResizeChanged: function () {
6289                        return this._checkIfSegmentsChanged(!0)
6290                },
6291                _fitColumnsReset: function () {
6292                        this.fitColumns = {
6293                                x: 0,
6294                                y: 0,
6295                                width: 0
6296                        }
6297                },
6298                _fitColumnsLayout: function (a) {
6299                        var c = this,
6300                                d = this.element.height(),
6301                                e = this.fitColumns;
6302                        a.each(function () {
6303                                var a = b(this),
6304                                        f = a.outerWidth(!0),
6305                                        g = a.outerHeight(!0);
6306                                e.y !== 0 && g + e.y > d && (e.x = e.width, e.y = 0), c._pushPosition(a, e.x, e.y), e.width = Math.max(e.x + f, e.width), e.y += g
6307                        })
6308                },
6309                _fitColumnsGetContainerSize: function () {
6310                        return {
6311                                width: this.fitColumns.width
6312                        }
6313                },
6314                _fitColumnsResizeChanged: function () {
6315                        return !0
6316                },
6317                _cellsByColumnReset: function () {
6318                        this.cellsByColumn = {
6319                                index: 0
6320                        }, this._getSegments(), this._getSegments(!0)
6321                },
6322                _cellsByColumnLayout: function (a) {
6323                        var c = this,
6324                                d = this.cellsByColumn;
6325                        a.each(function () {
6326                                var a = b(this),
6327                                        e = Math.floor(d.index / d.rows),
6328                                        f = d.index % d.rows,
6329                                        g = (e + .5) * d.columnWidth - a.outerWidth(!0) / 2,
6330                                        h = (f + .5) * d.rowHeight - a.outerHeight(!0) / 2;
6331                                c._pushPosition(a, g, h), d.index++
6332                        })
6333                },
6334                _cellsByColumnGetContainerSize: function () {
6335                        return {
6336                                width: Math.ceil(this.$filteredAtoms.length / this.cellsByColumn.rows) * this.cellsByColumn.columnWidth
6337                        }
6338                },
6339                _cellsByColumnResizeChanged: function () {
6340                        return this._checkIfSegmentsChanged(!0)
6341                },
6342                _straightAcrossReset: function () {
6343                        this.straightAcross = {
6344                                x: 0
6345                        }
6346                },
6347                _straightAcrossLayout: function (a) {
6348                        var c = this;
6349                        a.each(function (a) {
6350                                var d = b(this);
6351                                c._pushPosition(d, c.straightAcross.x, 0), c.straightAcross.x += d.outerWidth(!0)
6352                        })
6353                },
6354                _straightAcrossGetContainerSize: function () {
6355                        return {
6356                                width: this.straightAcross.x
6357                        }
6358                },
6359                _straightAcrossResizeChanged: function () {
6360                        return !0
6361                }
6362        }, b.fn.imagesLoaded = function (a) {
6363                function h() {
6364                        a.call(c, d)
6365                }
6366
6367                function i(a) {
6368                        var c = a.target;
6369                        c.src !== f && b.inArray(c, g) === -1 && (g.push(c), --e <= 0 && (setTimeout(h), d.unbind(".imagesLoaded", i)))
6370                }
6371                var c = this,
6372                        d = c.find("img").add(c.filter("img")),
6373                        e = d.length,
6374                        f = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",
6375                        g = [];
6376                return e || h(), d.bind("load.imagesLoaded error.imagesLoaded", i).each(function () {
6377                        var a = this.src;
6378                        this.src = f, this.src = a
6379                }), c
6380        };
6381        var x = function (b) {
6382                        a.console && a.console.error(b)
6383                };
6384        b.fn.isotope = function (a, c) {
6385                if (typeof a == "string") {
6386                        var d = Array.prototype.slice.call(arguments, 1);
6387                        this.each(function () {
6388                                var c = b.data(this, "isotope");
6389                                if (!c) {
6390                                        x("cannot call methods on isotope prior to initialization; attempted to call method '" + a + "'");
6391                                        return
6392                                }
6393                                if (!b.isFunction(c[a]) || a.charAt(0) === "_") {
6394                                        x("no such method '" + a + "' for isotope instance");
6395                                        return
6396                                }
6397                                c[a].apply(c, d)
6398                        })
6399                } else this.each(function () {
6400                        var d = b.data(this, "isotope");
6401                        d ? (d.option(a), d._init(c)) : b.data(this, "isotope", new b.Isotope(a, this, c))
6402                });
6403                return this
6404        }
6405})(window, jQuery);
6406
6407;/*
6408 * jPlayer Plugin for jQuery JavaScript Library
6409 * http://www.jplayer.org
6410 *
6411 * Copyright (c) 2009 - 2013 Happyworm Ltd
6412 * Dual licensed under the MIT and GPL licenses.
6413 *  - http://www.opensource.org/licenses/mit-license.php
6414 *  - http://www.gnu.org/copyleft/gpl.html
6415 *
6416 * Author: Mark J Panaghiston
6417 * Version: 2.3.0
6418 * Date: 20th April 2013
6419 */
6420(function(b,f){"function"===typeof define&&define.amd?define(["jquery"],f):f(b.jQuery)})(this,function(b,f){b.fn.jPlayer=function(a){var c="string"===typeof a,d=Array.prototype.slice.call(arguments,1
6420),e=this;a=!c&&d.length?b.extend.apply(null,[!0,a].concat(d)):a;if(c&&"_"===a.charAt(0))return e;c?this.each(function(){var c=b.data(this,"jPlayer"),h=c&&b.isFunction(c[a])?c[a].apply(c,d):c;if(h!==c&&h!==f)return e=h,!1}):this.each(function(){var c=b.data(this,"jPlayer");c?c.option(a||{}):b.data(this,
6421"jPlayer",new b.jPlayer(a,this))});return e};b.jPlayer=function(a,c){if(arguments.length){this.element=b(c);this.options=b.extend(!0,{},this.options,a);var d=this;this.element.bind("remove.jPlayer",function(){d.destroy()});this._init()}};b.jPlayer.emulateMethods="load play pause";b.jPlayer.emulateStatus="src readyState networkState currentTime duration paused ended playbackRate";b.jPlayer.emulateOptions="muted volume";b.jPlayer.reservedEvent="ready flashreset resize repeat error warning";b.jPlayer.event=
6422{};b.each("ready flashreset resize repeat click error warning loadstart progress suspend abort emptied stalled play pause loadedmetadata loadeddata waiting playing canplay canplaythrough seeking seeked timeupdate ended ratechange durationchange volumechange".split(" "),function(){b.jPlayer.event[this]="jPlayer_"+this});b.jPlayer.htmlEvent="loadstart abort emptied stalled loadedmetadata loadeddata canplay canplaythrough ratechange".split(" ");b.jPlayer.pause=function(){b.each(b.jPlayer.prototype.instances,
6423function(a,c){c.data("jPlayer").status.srcSet&&c.jPlayer("pause")})};b.jPlayer.timeFormat={showHour:!1,showMin:!0,showSec:!0,padHour:!1,padMin:!0,padSec:!0,sepHour:":",sepMin:":",sepSec:""};var l=function(){this.init()};l.prototype={init:function(){this.options={timeFormat:b.jPlayer.timeFormat}},time:function(a){var c=new Date(1E3*(a&&"number"===typeof a?a:0)),b=c.getUTCHours();a=this.options.timeFormat.showHour?c.getUTCMinutes():c.getUTCMinutes()+60*b;c=this.options.timeFormat.showMin?c.getUTCSeconds():
6424c.getUTCSeconds()+60*a;b=this.options.timeFormat.padHour&&10>b?"0"+b:b;a=this.options.timeFormat.padMin&&10>a?"0"+a:a;c=this.options.timeFormat.padSec&&10>c?"0"+c:c;b=""+(this.options.timeFormat.showHour?b+this.options.timeFormat.sepHour:"");b+=this.options.timeFormat.showMin?a+this.options.timeFormat.sepMin:"";return b+=this.options.timeFormat.showSec?c+this.options.timeFormat.sepSec:""}};var m=new l;b.jPlayer.convertTime=function(a){return m.time(a)};b.jPlayer.uaBrowser=function(a){a=a.toLowerCase();
6425var b=/(opera)(?:.*version)?[ \/]([\w.]+)/,d=/(msie) ([\w.]+)/,e=/(mozilla)(?:.*? rv:([\w.]+))?/;a=/(webkit)[ \/]([\w.]+)/.exec(a)||b.exec(a)||d.exec(a)||0>a.indexOf("compatible")&&e.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}};b.jPlayer.uaPlatform=function(a){var b=a.toLowerCase(),d=/(android)/,e=/(mobile)/;a=/(ipad|iphone|ipod|android|blackberry|playbook|windows ce|webos)/.exec(b)||[];b=/(ipad|playbook)/.exec(b)||!e.exec(b)&&d.exec(b)||[];a[1]&&(a[1]=a[1].replace(/\s/g,"_"));return{platform:a[1]||
6426"",tablet:b[1]||""}};b.jPlayer.browser={};b.jPlayer.platform={};var j=b.jPlayer.uaBrowser(navigator.userAgent);j.browser&&(b.jPlayer.browser[j.browser]=!0,b.jPlayer.browser.version=j.version);j=b.jPlayer.uaPlatform(navigator.userAgent);j.platform&&(b.jPlayer.platform[j.platform]=!0,b.jPlayer.platform.mobile=!j.tablet,b.jPlayer.platform.tablet=!!j.tablet);b.jPlayer.getDocMode=function(){var a;b.jPlayer.browser.msie&&(document.documentMode?a=document.documentMode:(a=5,document.compatMode&&"CSS1Compat"===
6427document.compatMode&&(a=7)));return a};b.jPlayer.browser.documentMode=b.jPlayer.getDocMode();b.jPlayer.nativeFeatures={init:function(){var a=document,b=a.createElement("video"),d={w3c:"fullscreenEnabled fullscreenElement requestFullscreen exitFullscreen fullscreenchange fullscreenerror".split(" "),moz:"mozFullScreenEnabled mozFullScreenElement mozRequestFullScreen mozCancelFullScreen mozfullscreenchange mozfullscreenerror".split(" "),webkit:" webkitCurrentFullScreenElement webkitRequestFullScreen webkitCancelFullScreen webkitfullscreenchange ".split(" "),
6428webkitVideo:"webkitSupportsFullscreen webkitDisplayingFullscreen webkitEnterFullscreen webkitExitFullscreen  ".split(" ")},e=["w3c","moz","webkit","webkitVideo"],g,h;this.fullscreen=b={support:{w3c:!!a[d.w3c[0]],moz:!!a[d.moz[0]],webkit:"function"===typeof a[d.webkit[3]],webkitVideo:"function"===typeof b[d.webkitVideo[2]]},used:{}};g=0;for(h=e.length;g<h;g++){var f=e[g];if(b.support[f]){b.spec=f;b.used[f]=!0;break}}if(b.spec){var k=d[b.spec];b.api={fullscreenEnabled:!0,fullscreenElement:function(b){b=
6429b?b:a;return b[k[1]]},requestFullscreen:function(a){return a[k[2]]()},exitFullscreen:function(b){b=b?b:a;return b[k[3]]()}};b.event={fullscreenchange:k[4],fullscreenerror:k[5]}}else b.api={fullscreenEnabled:!1,fullscreenElement:function(){return null},requestFullscreen:function(){},exitFullscreen:function(){}},b.event={}}};b.jPlayer.nativeFeatures.init();b.jPlayer.focus=null;b.jPlayer.keyIgnoreElementNames="INPUT TEXTAREA";var n=function(a){var c=b.jPlayer.focus,d;c&&(b.each(b.jPlayer.keyIgnoreElementNames.split(/\s+/g),
6430function(b,c){if(a.target.nodeName.toUpperCase()===c.toUpperCase())return d=!0,!1}),d||b.each(c.options.keyBindings,function(d,g){if(g&&a.which===g.key&&b.isFunction(g.fn))return a.preventDefault(),g.fn(c),!1}))};
6430b.jPlayer.keys=function(a){b(document.documentElement).unbind("keydown.jPlayer");a&&b(document.documentElement).bind("keydown.jPlayer",n)};b.jPlayer.keys(!0);b.jPlayer.prototype={count:0,version:{script:"2.3.0",needFlash:"2.3.0",flash:"unknown"},options:{swfPath:"js",solution:"html, flash",
6431supplied:"mp3",preload:"metadata",volume:0.8,muted:!1,wmode:"opaque",backgroundColor:"#000000",cssSelectorAncestor:"#jp_container_1",cssSelector:{videoPlay:".jp-video-play",play:".jp-play",pause:".jp-pause",stop:".jp-stop",seekBar:".jp-seek-bar",playBar:".jp-play-bar",mute:".jp-mute",unmute:".jp-unmute",volumeBar:".jp-volume-bar",volumeBarValue:".jp-volume-bar-value",volumeMax:".jp-volume-max",currentTime:".jp-current-time",duration:".jp-duration",fullScreen:".jp-full-screen",restoreScreen:".jp-restore-screen",
6432repeat:".jp-repeat",repeatOff:".jp-repeat-off",gui:".jp-gui",noSolution:".jp-no-solution"},smoothPlayBar:!1,fullScreen:!1,fullWindow:!1,autohide:{restored:!1,full:!0,fadeIn:200,fadeOut:600,hold:1E3},loop:!1,repeat:function(a){a.jPlayer.options.loop?b(this).unbind(".jPlayerRepeat").bind(b.jPlayer.event.ended+".jPlayer.jPlayerRepeat",function(){b(this).jPlayer("play")}):b(this).unbind(".jPlayerRepeat")},nativeVideoControls:{},noFullWindow:{msie:/msie [0-6]\./,ipad:/ipad.*?os [0-4]\./,iphone:/iphone/,
6433ipod:/ipod/,android_pad:/android [0-3]\.(?!.*?mobile)/,android_phone:/android.*?mobile/,blackberry:/blackberry/,windows_ce:/windows ce/,iemobile:/iemobile/,webos:/webos/},noVolume:{ipad:/ipad/,iphone:/iphone/,ipod:/ipod/,android_pad:/android(?!.*?mobile)/,android_phone:/android.*?mobile/,blackberry:/blackberry/,windows_ce:/windows ce/,iemobile:/iemobile/,webos:/webos/,playbook:/playbook/},timeFormat:{},keyEnabled:!1,audioFullScreen:!1,keyBindings:{play:{key:32,fn:function(a){a.status.paused?a.play():
6434a.pause()}},fullScreen:{key:13,fn:function(a){(a.status.video||a.options.audioFullScreen)&&a._setOption("fullScreen",!a.options.fullScreen)}},muted:{key:8,fn:function(a){a._muted(!a.options.muted)}},volumeUp:{key:38,fn:function(a){a.volume(a.options.volume+0.1)}},volumeDown:{key:40,fn:function(a){a.volume(a.options.volume-0.1)}}},verticalVolume:!1,idPrefix:"jp",noConflict:"jQuery",emulateHtml:!1,errorAlerts:!1,warningAlerts:!1},optionsAudio:{size:{width:"0px",height:"0px",cssClass:""},sizeFull:{width:"0px",
6435height:"0px",cssClass:""}},optionsVideo:{size:{width:"480px",height:"270px",cssClass:"jp-video-270p"},sizeFull:{width:"100%",height:"100%",cssClass:"jp-video-full"}},instances:{},status:{src:"",media:{},paused:!0,format:{},formatType:"",waitForPlay:!0,waitForLoad:!0,srcSet:!1,video:!1,seekPercent:0,currentPercentRelative:0,currentPercentAbsolute:0,currentTime:0,duration:0,videoWidth:0,videoHeight:0,readyState:0,networkState:0,playbackRate:1,ended:0},internal:{ready:!1},solution:{html:!0,flash:!0},
6436format:{mp3:{codec:'audio/mpeg; codecs="mp3"',flashCanPlay:!0,media:"audio"},m4a:{codec:'audio/mp4; codecs="mp4a.40.2"',flashCanPlay:!0,media:"audio"},oga:{codec:'audio/ogg; codecs="vorbis"',flashCanPlay:!1,media:"audio"},wav:{codec:'audio/wav; codecs="1"',flashCanPlay:!1,media:"audio"},webma:{codec:'audio/webm; codecs="vorbis"',flashCanPlay:!1,media:"audio"},fla:{codec:"audio/x-flv",flashCanPlay:!0,media:"audio"},rtmpa:{codec:'audio/rtmp; codecs="rtmp"',flashCanPlay:!0,media:"audio"},m4v:{codec:'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',
6437flashCanPlay:!0,media:"video"},ogv:{codec:'video/ogg; codecs="theora, vorbis"',flashCanPlay:!1,media:"video"},webmv:{codec:'video/webm; codecs="vorbis, vp8"',flashCanPlay:!1,media:"video"},flv:{codec:"video/x-flv",flashCanPlay:!0,media:"video"},rtmpv:{codec:'video/rtmp; codecs="rtmp"',flashCanPlay:!0,media:"video"}},_init:function(){var a=this;this.element.empty();this.status=b.extend({},this.status);this.internal=b.extend({},this.internal);this.options.timeFormat=b.extend({},b.jPlayer.timeFormat,
6438this.options.timeFormat);this.internal.cmdsIgnored=b.jPlayer.platform.ipad||b.jPlayer.platform.iphone||b.jPlayer.platform.ipod;this.internal.domNode=this.element.get(0);
6438this.options.keyEnabled&&!b.jPlayer.focus&&(b.jPlayer.focus=this);this.formats=[];this.solutions=[];this.require={};this.htmlElement={};this.html={};this.html.audio={};this.html.video={};this.flash={};this.css={};this.css.cs={};this.css.jq={};this.ancestorJq=[];this.options.volume=this._limitValue(this.options.volume,0,1);b.each(this.options.supplied.toLowerCase().split(","),
6439function(c,d){var e=d.replace(/^\s+|\s+$/g,"");if(a.format[e]){var f=!1;b.each(a.formats,function(a,b){if(e===b)return f=!0,!1});f||a.formats.push(e)}});b.each(this.options.solution.toLowerCase().split(","),function(c,d){var e=d.replace(/^\s+|\s+$/g,"");if(a.solution[e]){var f=!1;b.each(a.solutions,function(a,b){if(e===b)return f=!0,!1});f||a.solutions.push(e)}});this.internal.instance="jp_"+this.count;this.instances[this.internal.instance]=this.element;this.element.attr("id")||this.element.attr("id",
6440this.options.idPrefix+"_jplayer_"+this.count);this.internal.self=b.extend({},{id:this.element.attr("id"),jq:this.element});this.internal.audio=b.extend({},{id:this.options.idPrefix+"_audio_"+this.count,jq:f});this.internal.video=b.extend({},{id:this.options.idPrefix+"_video_"+this.count,jq:f});this.internal.flash=b.extend({},{id:this.options.idPrefix+"_flash_"+this.count,jq:f,swf:this.options.swfPath+(".swf"!==this.options.swfPath.toLowerCase().slice(-4)?(this.options.swfPath&&"/"!==this.options.swfPath.slice(-1)?
6441"/":"")+"Jplayer.swf":"")});this.internal.poster=b.extend({},{id:this.options.idPrefix+"_poster_"+this.count,jq:f});b.each(b.jPlayer.event,function(b,c){a.options[b]!==f&&(a.element.bind(c+".jPlayer",a.options[b]),a.options[b]=f)});this.require.audio=!1;this.require.video=!1;b.each(this.formats,function(b,c){a.require[a.format[c].media]=!0});this.options=this.require.video?b.extend(!0,{},this.optionsVideo,this.options):b.extend(!0,{},this.optionsAudio,this.options);this._setSize();this.status.nativeVideoControls=
6442this._uaBlocklist(this.options.nativeVideoControls);this.status.noFullWindow=this._uaBlocklist(this.options.noFullWindow);this.status.noVolume=this._uaBlocklist(this.options.noVolume);b.jPlayer.nativeFeatures.fullscreen.api.fullscreenEnabled&&this._fullscreenAddEventListeners();this._restrictNativeVideoControls();this.htmlElement.poster=document.createElement("img");this.htmlElement.poster.id=this.internal.poster.id;this.htmlElement.poster.onload=function(){(!a.status.video||a.status.waitForPlay)&&
6443a.internal.poster.jq.show()};this.element.append(this.htmlElement.poster);this.internal.poster.jq=b("#"+this.internal.poster.id);this.internal.poster.jq.css({width:this.status.width,height:this.status.height});this.internal.poster.jq.hide();this.internal.poster.jq.bind("click.jPlayer",function(){a._trigger(b.jPlayer.event.click)});this.html.audio.available=!1;this.require.audio&&(this.htmlElement.audio=document.createElement("audio"),this.htmlElement.audio.id=this.internal.audio.id,this.html.audio.available=
6444!!this.htmlElement.audio.canPlayType&&this._testCanPlayType(this.htmlElement.audio));this.html.video.available=!1;this.require.video&&(this.htmlElement.video=document.createElement("video"),this.htmlElement.video.id=this.internal.video.id,this.html.video.available=!!this.htmlElement.video.canPlayType&&this._testCanPlayType(this.htmlElement.video));this.flash.available=this._checkForFlash(10.1);this.html.canPlay={};this.flash.canPlay={};b.each(this.formats,function(b,c){a.html.canPlay[c]=a.html[a.format[c].media].available&&
6445""!==a.htmlElement[a.format[c].media].canPlayType(a.format[c].codec);a.flash.canPlay[c]=a.format[c].flashCanPlay&&a.flash.available});this.html.desired=!1;this.flash.desired=!1;b.each(this.solutions,function(c,d){if(0===c)a[d].desired=!0;else{var e=!1,f=!1;b.each(a.formats,function(b,c){a[a.solutions[0]].canPlay[c]&&("video"===a.format[c].media?f=!0:e=!0)});a[d].desired=a.require.audio&&!e||a.require.video&&!f}});this.html.support={};this.flash.support={};b.each(this.formats,function(b,c){a.html.support[c]=
6446a.html.canPlay[c]&&a.html.desired;a.flash.support[c]=a.flash.canPlay[c]&&a.flash.desired});this.html.used=!1;this.flash.used=!1;b.each(this.solutions,function(c,d){b.each(a.formats,function(b,c){if(a[d].support[c])return a[d].used=!0,!1})});this._resetActive();this._resetGate();this._cssSelectorAncestor(this.options.cssSelectorAncestor);!this.html.used&&!this.flash.used?(this._error({type:b.jPlayer.error.NO_SOLUTION,context:"{solution:'"+this.options.solution+"', supplied:'"+this.options.supplied+
6447"'}",message:b.jPlayer.errorMsg.NO_SOLUTION,hint:b.jPlayer.errorHint.NO_SOLUTION}),this.css.jq.noSolution.length&&this.css.jq.noSolution.show()):this.css.jq.noSolution.length&&this.css.jq.noSolution.hide();if(this.flash.used){var c,d="jQuery="+encodeURI(this.options.noConflict)+"&id="+encodeURI(this.internal.self.id)+"&vol="+this.options.volume+"&muted="+this.options.muted;if(b.jPlayer.browser.msie&&(9>Number(b.jPlayer.browser.version)||9>b.jPlayer.browser.documentMode)){d=['<param name="movie" value="'+
6448this.internal.flash.swf+'" />','<param name="FlashVars" value="'+d+'" />','<param name="allowScriptAccess" value="always" />','<param name="bgcolor" value="'+this.options.backgroundColor+'" />','<param name="wmode" value="'+this.options.wmode+'" />'];c=document.createElement('<object id="'+this.internal.flash.id+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="0" height="0" tabindex="-1"></object>');for(var e=0;e<d.length;e++)c.appendChild(document.createElement(d[e]))}else e=function(a,
6449b,c){var d=document.createElement("param");d.setAttribute("name",b);d.setAttribute("value",c);a.appendChild(d)},c=document.createElement("object"),c.setAttribute("id",this.internal.flash.id),c.setAttribute("data",this.internal.flash.swf),c.setAttribute("type","application/x-shockwave-flash"),c.setAttribute("width","1"),c.setAttribute("height","1"),c.setAttribute("tabindex","-1"),e(c,"flashvars",d),e(c,"allowscriptaccess","always"),e(c,"bgcolor",this.options.backgroundColor),e(c,"wmode",this.options.wmode);
6450this.element.append(c);this.internal.flash.jq=b(c)}this.html.used&&(this.html.audio.available&&(this._addHtmlEventListeners(this.htmlElement.audio,this.html.audio),this.element.append(this.htmlElement.audio),this.internal.audio.jq=b("#"+this.internal.audio.id)),this.html.video.available&&(this._addHtmlEventListeners(this.htmlElement.video,this.html.video),this.element.append(this.htmlElement.video),this.internal.video.jq=b("#"+this.internal.video.id),this.status.nativeVideoControls?this.internal.video.jq.css({width:this.status.width,
6451height:this.status.height}):this.internal.video.jq.css({width:"0px",height:"0px"}),this.internal.video.jq.bind("click.jPlayer",function(){a._trigger(b.jPlayer.event.click)})));this.options.emulateHtml&&this._emulateHtmlBridge();this.html.used&&!this.flash.used&&setTimeout(function(){a.internal.ready=!0;a.version.flash="n/a";a._trigger(b.jPlayer.event.repeat);a._trigger(b.jPlayer.event.ready)},100);this._updateNativeVideoControls();this._updateInterface();this._updateButtons(!1);this._updateAutohide();
6452this._updateVolume(this.options.volume);this._updateMute(this.options.muted);this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide();b.jPlayer.prototype.count++},destroy:function(){this.clearMedia();this._removeUiClass();this.css.jq.currentTime.length&&this.css.jq.currentTime.text("");this.css.jq.duration.length&&this.css.jq.duration.text("");b.each(this.css.jq,function(a,b){b.length&&b.unbind(".jPlayer")});this.internal.poster.jq.unbind(".jPlayer");this.internal.video.jq&&this.internal.video.jq.unbind(".jPlayer");
6453this._fullscreenRemoveEventListeners();
6453this===b.jPlayer.focus&&(b.jPlayer.focus=null);this.options.emulateHtml&&this._destroyHtmlBridge();this.element.removeData("jPlayer");this.element.unbind(".jPlayer");this.element.empty();delete this.instances[this.internal.instance]},enable:function(){},disable:function(){},_testCanPlayType:function(a){try{return a.canPlayType(this.format.mp3.codec),!0}catch(b){return!1}},_uaBlocklist:function(a){var c=navigator.userAgent.toLowerCase(),d=!1;b.each(a,function(a,
6454b){if(b&&b.test(c))return d=!0,!1});return d},_restrictNativeVideoControls:function(){this.require.audio&&this.status.nativeVideoControls&&(this.status.nativeVideoControls=!1,this.status.noFullWindow=!0)},_updateNativeVideoControls:function(){this.html.video.available&&this.html.used&&(this.htmlElement.video.controls=this.status.nativeVideoControls,this._updateAutohide(),this.status.nativeVideoControls&&this.require.video?(this.internal.poster.jq.hide(),this.internal.video.jq.css({width:this.status.width,
6455height:this.status.height})):this.status.waitForPlay&&this.status.video&&(this.internal.poster.jq.show(),this.internal.video.jq.css({width:"0px",height:"0px"})))},_addHtmlEventListeners:function(a,c){var d=this;a.preload=this.options.preload;a.muted=this.options.muted;a.volume=this.options.volume;a.addEventListener("progress",function(){c.gate&&(d.internal.cmdsIgnored&&0<this.readyState&&(d.internal.cmdsIgnored=!1),d._getHtmlStatus(a),d._updateInterface(),d._trigger(b.jPlayer.event.progress))},!1);
6456a.addEventListener("timeupdate",function(){c.gate&&(d._getHtmlStatus(a),d._updateInterface(),d._trigger(b.jPlayer.event.timeupdate))},!1);a.addEventListener("durationchange",function(){c.gate&&(d._getHtmlStatus(a),d._updateInterface(),d._trigger(b.jPlayer.event.durationchange))},!1);a.addEventListener("play",function(){c.gate&&(d._updateButtons(!0),d._html_checkWaitForPlay(),d._trigger(b.jPlayer.event.play))},!1);a.addEventListener("playing",function(){c.gate&&(d._updateButtons(!0),d._seeked(),d._trigger(b.jPlayer.event.playing))},
6457!1);a.addEventListener("pause",function(){c.gate&&(d._updateButtons(!1),d._trigger(b.jPlayer.event.pause))},!1);a.addEventListener("waiting",function(){c.gate&&(d._seeking(),d._trigger(b.jPlayer.event.waiting))},!1);a.addEventListener("seeking",function(){c.gate&&(d._seeking(),d._trigger(b.jPlayer.event.seeking))},!1);a.addEventListener("seeked",function(){c.gate&&(d._seeked(),d._trigger(b.jPlayer.event.seeked))},!1);a.addEventListener("volumechange",function(){c.gate&&(d.options.volume=a.volume,
6458d.options.muted=a.muted,d._updateMute(),d._updateVolume(),d._trigger(b.jPlayer.event.volumechange))},!1);a.addEventListener("suspend",function(){c.gate&&(d._seeked(),d._trigger(b.jPlayer.event.suspend))},!1);a.addEventListener("ended",function(){c.gate&&(b.jPlayer.browser.webkit||(d.htmlElement.media.currentTime=0),d.htmlElement.media.pause(),d._updateButtons(!1),d._getHtmlStatus(a,!0),d._updateInterface(),d._trigger(b.jPlayer.event.ended))},!1);a.addEventListener("error",function(){c.gate&&(d._updateButtons(!1),
6459d._seeked(),d.status.srcSet&&(clearTimeout(d.internal.htmlDlyCmdId),d.status.waitForLoad=!0,d.status.waitForPlay=!0,d.status.video&&!d.status.nativeVideoControls&&d.internal.video.jq.css({width:"0px",height:"0px"}),d._validString(d.status.media.poster)&&!d.status.nativeVideoControls&&d.internal.poster.jq.show(),d.css.jq.videoPlay.length&&d.css.jq.videoPlay.show(),d._error({type:b.jPlayer.error.URL,context:d.status.src,message:b.jPlayer.errorMsg.URL,hint:b.jPlayer.errorHint.URL})))},!1);b.each(b.jPlayer.htmlEvent,
6460function(e,g){a.addEventListener(this,function(){c.gate&&d._trigger(b.jPlayer.event[g])},!1)})},_getHtmlStatus:function(a,b){var d=0,e=0,g=0,f=0;isFinite(a.duration)&&(this.status.duration=a.duration);d=a.currentTime;e=0<this.status.duration?100*d/this.status.duration:0;"object"===typeof a.seekable&&0<a.seekable.length?(g=0<this.status.duration?100*a.seekable.end(a.seekable.length-1)/this.status.duration:100,f=0<this.status.duration?100*a.currentTime/a.seekable.end(a.seekable.length-1):0):(g=100,
6461f=e);b&&(e=f=d=0);this.status.seekPercent=g;this.status.currentPercentRelative=f;this.status.currentPercentAbsolute=e;this.status.currentTime=d;this.status.videoWidth=a.videoWidth;this.status.videoHeight=a.videoHeight;this.status.readyState=a.readyState;this.status.networkState=a.networkState;this.status.playbackRate=a.playbackRate;this.status.ended=a.ended},_resetStatus:function(){this.status=b.extend({},this.status,b.jPlayer.prototype.status)},_trigger:function(a,c,d){a=b.Event(a);a.jPlayer={};
6462a.jPlayer.version=b.extend({},this.version);a.jPlayer.options=b.extend(!0,{},this.options);a.jPlayer.status=b.extend(!0,{},this.status);a.jPlayer.html=b.extend(!0,{},this.html);a.jPlayer.flash=b.extend(!0,{},this.flash);c&&(a.jPlayer.error=b.extend({},c));d&&(a.jPlayer.warning=b.extend({},d));this.element.trigger(a)},jPlayerFlashEvent:function(a,c){if(a===b.jPlayer.event.ready)if(this.internal.ready){if(this.flash.gate){if(this.status.srcSet){var d=this.status.currentTime,e=this.status.paused;this.setMedia(this.status.media);
64630<d&&(e?this.pause(d):this.play(d))}this._trigger(b.jPlayer.event.flashreset)}}else this.internal.ready=!0,this.internal.flash.jq.css({width:"0px",height:"0px"}),this.version.flash=c.version,this.version.needFlash!==this.version.flash&&this._error({type:b.jPlayer.error.VERSION,context:this.version.flash,message:b.jPlayer.errorMsg.VERSION+this.version.flash,hint:b.jPlayer.errorHint.VERSION}),this._trigger(b.jPlayer.event.repeat),this._trigger(a);if(this.flash.gate)switch(a){case b.jPlayer.event.progress:this._getFlashStatus(c);
6464this._updateInterface();this._trigger(a);break;case b.jPlayer.event.timeupdate:this._getFlashStatus(c);this._updateInterface();this._trigger(a);break;case b.jPlayer.event.play:this._seeked();this._updateButtons(!0);this._trigger(a);break;case b.jPlayer.event.pause:this._updateButtons(!1);this._trigger(a);break;case b.jPlayer.event.ended:this._updateButtons(!1);this._trigger(a);break;case b.jPlayer.event.click:this._trigger(a);break;case b.jPlayer.event.error:this.status.waitForLoad=!0;this.status.waitForPlay=
6465!0;this.status.video&&this.internal.flash.jq.css({width:"0px",height:"0px"});
6465this._validString(this.status.media.poster)&&this.internal.poster.jq.show();this.css.jq.videoPlay.length&&this.status.video&&this.css.jq.videoPlay.show();this.status.video?this._flash_setVideo(this.status.media):this._flash_setAudio(this.status.media);this._updateButtons(!1);this._error({type:b.jPlayer.error.URL,context:c.src,message:b.jPlayer.errorMsg.URL,hint:b.jPlayer.errorHint.URL});break;case b.jPlayer.event.seeking:this._seeking();
6466this._trigger(a);break;case b.jPlayer.event.seeked:this._seeked();this._trigger(a);break;case b.jPlayer.event.ready:break;default:this._trigger(a)}return!1},_getFlashStatus:function(a){this.status.seekPercent=a.seekPercent;this.status.currentPercentRelative=a.currentPercentRelative;this.status.currentPercentAbsolute=a.currentPercentAbsolute;this.status.currentTime=a.currentTime;this.status.duration=a.duration;this.status.videoWidth=a.videoWidth;this.status.videoHeight=a.videoHeight;this.status.readyState=
64674;this.status.networkState=0;this.status.playbackRate=1;this.status.ended=!1},_updateButtons:function(a){a!==f&&(this.status.paused=!a,this.css.jq.play.length&&this.css.jq.pause.length&&(a?(this.css.jq.play.hide(),this.css.jq.pause.show()):(this.css.jq.play.show(),this.css.jq.pause.hide())));this.css.jq.restoreScreen.length&&this.css.jq.fullScreen.length&&(this.status.noFullWindow?(this.css.jq.fullScreen.hide(),this.css.jq.restoreScreen.hide()):this.options.fullWindow?(this.css.jq.fullScreen.hide(),
6468this.css.jq.restoreScreen.show()):(this.css.jq.fullScreen.show(),this.css.jq.restoreScreen.hide()));this.css.jq.repeat.length&&this.css.jq.repeatOff.length&&(this.options.loop?(this.css.jq.repeat.hide(),this.css.jq.repeatOff.show()):(this.css.jq.repeat.show(),this.css.jq.repeatOff.hide()))},_updateInterface:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.width(this.status.seekPercent+"%");this.css.jq.playBar.length&&(this.options.smoothPlayBar?this.css.jq.playBar.stop().animate({width:this.status.currentPercentAbsolute+
6469"%"},250,"linear"):this.css.jq.playBar.width(this.status.currentPercentRelative+"%"));this.css.jq.currentTime.length&&this.css.jq.currentTime.text(this._convertTime(this.status.currentTime));this.css.jq.duration.length&&this.css.jq.duration.text(this._convertTime(this.status.duration))},_convertTime:l.prototype.time,_seeking:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.addClass("jp-seeking-bg")},_seeked:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.removeClass("jp-seeking-bg")},
6470_resetGate:function(){this.html.audio.gate=!1;this.html.video.gate=!1;this.flash.gate=!1},_resetActive:function(){this.html.active=!1;this.flash.active=!1},setMedia:function(a){var c=this,d=!1,e=this.status.media.poster!==a.poster;this._resetMedia();this._resetGate();this._resetActive();b.each(this.formats,function(e,f){var j="video"===c.format[f].media;b.each(c.solutions,function(b,e){if(c[e].support[f]&&c._validString(a[f])){var g="html"===e;j?(g?(c.html.video.gate=!0,c._html_setVideo(a),c.html.active=
6471!0):(c.flash.gate=!0,c._flash_setVideo(a),c.flash.active=!0),c.css.jq.videoPlay.length&&c.css.jq.videoPlay.show(),c.status.video=!0):(g?(c.html.audio.gate=!0,c._html_setAudio(a),c.html.active=!0):(c.flash.gate=!0,c._flash_setAudio(a),c.flash.active=!0),c.css.jq.videoPlay.length&&c.css.jq.videoPlay.hide(),c.status.video=!1);d=!0;return!1}});if(d)return!1});if(d){if((!this.status.nativeVideoControls||!this.html.video.gate)&&this._validString(a.poster))e?this.htmlElement.poster.src=a.poster:this.internal.poster.jq.show();
6472this.status.srcSet=!0;this.status.media=b.extend({},a);this._updateButtons(!1);this._updateInterface()}else this._error({type:b.jPlayer.error.NO_SUPPORT,context:"{supplied:'"+this.options.supplied+"'}",message:b.jPlayer.errorMsg.NO_SUPPORT,hint:b.jPlayer.errorHint.NO_SUPPORT})},_resetMedia:function(){this._resetStatus();this._updateButtons(!1);this._updateInterface();this._seeked();this.internal.poster.jq.hide();clearTimeout(this.internal.htmlDlyCmdId);this.html.active?this._html_resetMedia():this.flash.active&&
6473this._flash_resetMedia()},clearMedia:function(){this._resetMedia();this.html.active?this._html_clearMedia():this.flash.active&&this._flash_clearMedia();this._resetGate();this._resetActive()},load:function(){this.status.srcSet?this.html.active?this._html_load():this.flash.active&&this._flash_load():this._urlNotSetError("load")},focus:function(){this.options.keyEnabled&&(b.jPlayer.focus=this)},play:function(a){a="number"===typeof a?a:NaN;this.status.srcSet?(this.focus(),this.html.active?this._html_play(a):
6474this.flash.active&&this._flash_play(a)):this._urlNotSetError("play")},videoPlay:function(){this.play()},pause:function(a){a="number"===typeof a?a:NaN;this.status.srcSet?this.html.active?this._html_pause(a):this.flash.active&&this._flash_pause(a):this._urlNotSetError("pause")},pauseOthers:function(){var a=this;b.each(this.instances,function(b,d){a.element!==d&&d.data("jPlayer").status.srcSet&&d.jPlayer("pause")})},stop:function(){this.status.srcSet?this.html.active?this._html_pause(0):this.flash.active&&
6475this._flash_pause(0):this._urlNotSetError("stop")},playHead:function(a){a=this._limitValue(a,0,100);
6475this.status.srcSet?this.html.active?this._html_playHead(a):this.flash.active&&this._flash_playHead(a):this._urlNotSetError("playHead")},_muted:function(a){this.options.muted=a;this.html.used&&this._html_mute(a);this.flash.used&&this._flash_mute(a);!this.html.video.gate&&!this.html.audio.gate&&(this._updateMute(a),this._updateVolume(this.options.volume),this._trigger(b.jPlayer.event.volumechange))},
6476mute:function(a){a=a===f?!0:!!a;this._muted(a)},unmute:function(a){a=a===f?!0:!!a;this._muted(!a)},_updateMute:function(a){a===f&&(a=this.options.muted);this.css.jq.mute.length&&this.css.jq.unmute.length&&(this.status.noVolume?(this.css.jq.mute.hide(),this.css.jq.unmute.hide()):a?(this.css.jq.mute.hide(),this.css.jq.unmute.show()):(this.css.jq.mute.show(),this.css.jq.unmute.hide()))},volume:function(a){a=this._limitValue(a,0,1);this.options.volume=a;this.html.used&&this._html_volume(a);this.flash.used&&
6477this._flash_volume(a);!this.html.video.gate&&!this.html.audio.gate&&(this._updateVolume(a),this._trigger(b.jPlayer.event.volumechange))},volumeBar:function(a){if(this.css.jq.volumeBar.length){var b=this.css.jq.volumeBar.offset(),d=a.pageX-b.left,e=this.css.jq.volumeBar.width();a=this.css.jq.volumeBar.height()-a.pageY+b.top;b=this.css.jq.volumeBar.height();this.options.verticalVolume?this.volume(a/b):this.volume(d/e)}this.options.muted&&this._muted(!1)},volumeBarValue:function(a){this.volumeBar(a)},
6478_updateVolume:function(a){a===f&&(a=this.options.volume);a=this.options.muted?0:a;this.status.noVolume?(this.css.jq.volumeBar.length&&this.css.jq.volumeBar.hide(),this.css.jq.volumeBarValue.length&&this.css.jq.volumeBarValue.hide(),this.css.jq.volumeMax.length&&this.css.jq.volumeMax.hide()):(this.css.jq.volumeBar.length&&this.css.jq.volumeBar.show(),this.css.jq.volumeBarValue.length&&(this.css.jq.volumeBarValue.show(),this.css.jq.volumeBarValue[this.options.verticalVolume?"height":"width"](100*a+
6479"%")),this.css.jq.volumeMax.length&&this.css.jq.volumeMax.show())},volumeMax:function(){this.volume(1);this.options.muted&&this._muted(!1)},_cssSelectorAncestor:function(a){var c=this;this.options.cssSelectorAncestor=a;this._removeUiClass();this.ancestorJq=a?b(a):[];a&&1!==this.ancestorJq.length&&this._warning({type:b.jPlayer.warning.CSS_SELECTOR_COUNT,context:a,message:b.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.ancestorJq.length+" found for cssSelectorAncestor.",hint:b.jPlayer.warningHint.CSS_SELECTOR_COUNT});
6480this._addUiClass();b.each(this.options.cssSelector,function(a,b){c._cssSelector(a,b)})},_cssSelector:function(a,c){var d=this;"string"===typeof c?b.jPlayer.prototype.options.cssSelector[a]?(this.css.jq[a]&&this.css.jq[a].length&&this.css.jq[a].unbind(".jPlayer"),this.options.cssSelector[a]=c,this.css.cs[a]=this.options.cssSelectorAncestor+" "+c,this.css.jq[a]=c?b(this.css.cs[a]):[],this.css.jq[a].length&&this.css.jq[a].bind("click.jPlayer",function(c){c.preventDefault();d[a](c);b(this).blur()}),c&&
64811!==this.css.jq[a].length&&this._warning({type:b.jPlayer.warning.CSS_SELECTOR_COUNT,context:this.css.cs[a],message:b.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.css.jq[a].length+" found for "+a+" method.",hint:b.jPlayer.warningHint.CSS_SELECTOR_COUNT})):this._warning({type:b.jPlayer.warning.CSS_SELECTOR_METHOD,context:a,message:b.jPlayer.warningMsg.CSS_SELECTOR_METHOD,hint:b.jPlayer.warningHint.CSS_SELECTOR_METHOD}):this._warning({type:b.jPlayer.warning.CSS_SELECTOR_STRING,context:c,message:b.jPlayer.warningMsg.CSS_SELECTOR_STRING,
6482hint:b.jPlayer.warningHint.CSS_SELECTOR_STRING})},seekBar:function(a){if(this.css.jq.seekBar){var b=this.css.jq.seekBar.offset();a=a.pageX-b.left;b=this.css.jq.seekBar.width();this.playHead(100*a/b)}},playBar:function(a){this.seekBar(a)},repeat:function(){this._loop(!0)},repeatOff:function(){this._loop(!1)},_loop:function(a){this.options.loop!==a&&(this.options.loop=a,this._updateButtons(),this._trigger(b.jPlayer.event.repeat))},currentTime:function(){},duration:function(){},gui:function(){},noSolution:function(){},
6483option:function(a,c){var d=a;if(0===arguments.length)return b.extend(!0,{},this.options);if("string"===typeof a){var e=a.split(".");if(c===f){for(var d=b.extend(!0,{},this.options),g=0;g<e.length;g++)if(d[e[g]]!==f)d=d[e[g]];else return this._warning({type:b.jPlayer.warning.OPTION_KEY,context:a,message:b.jPlayer.warningMsg.OPTION_KEY,hint:b.jPlayer.warningHint.OPTION_KEY}),f;return d}for(var g=d={},h=0;h<e.length;h++)h<e.length-1?(g[e[h]]={},g=g[e[h]]):g[e[h]]=c}this._setOptions(d);return this},_setOptions:function(a){var c=
6484this;b.each(a,function(a,b){c._setOption(a,b)});return this},_setOption:function(a,c){var d=this;switch(a){case "volume":this.volume(c);break;case "muted":this._muted(c);break;case "cssSelectorAncestor":this._cssSelectorAncestor(c);break;case "cssSelector":b.each(c,function(a,b){d._cssSelector(a,b)});break;case "fullScreen":if(this.options[a]!==c){var e=b.jPlayer.nativeFeatures.fullscreen.used.webkitVideo;if(!e||e&&!this.status.waitForPlay)e||(this.options[a]=c),c?this._requestFullscreen():this._exitFullscreen(),
6485e||this._setOption("fullWindow",c)}break;case "fullWindow":this.options[a]!==c&&(this._removeUiClass(),this.options[a]=c,this._refreshSize());break;case "size":!this.options.fullWindow&&this.options[a].cssClass!==c.cssClass&&this._removeUiClass();this.options[a]=b.extend({},this.options[a],c);this._refreshSize();break;case "sizeFull":this.options.fullWindow&&this.options[a].cssClass!==c.cssClass&&this._removeUiClass();this.options[a]=b.extend({},this.options[a],c);this._refreshSize();break;case "autohide":this.options[a]=
6486b.extend({},this.options[a],c);this._updateAutohide();break;case "loop":this._loop(c);break;case "nativeVideoControls":this.options[a]=b.extend({},this.options[a],c);this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls);this._restrictNativeVideoControls();this._updateNativeVideoControls();break;case "noFullWindow":this.options[a]=b.extend({},this.options[a],c);this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls);this.status.noFullWindow=
6487this._uaBlocklist(this.options.noFullWindow);this._restrictNativeVideoControls();this._updateButtons();break;case "noVolume":this.options[a]=b.extend({},this.options[a],c);this.status.noVolume=this._uaBlocklist(this.options.noVolume);this._updateVolume();this._updateMute();break;case "emulateHtml":this.options[a]!==c&&((this.options[a]=c)?this._emulateHtmlBridge():this._destroyHtmlBridge());break;case "timeFormat":this.options[a]=b.extend({},this.options[a],c);break;case "keyEnabled":this.options[a]=
6488c;
6488!c&&this===b.jPlayer.focus&&(b.jPlayer.focus=null);break;case "keyBindings":this.options[a]=b.extend(!0,{},this.options[a],c);break;case "audioFullScreen":this.options[a]=c}return this},_refreshSize:function(){this._setSize();this._addUiClass();this._updateSize();this._updateButtons();this._updateAutohide();this._trigger(b.jPlayer.event.resize)},_setSize:function(){this.options.fullWindow?(this.status.width=this.options.sizeFull.width,this.status.height=this.options.sizeFull.height,this.status.cssClass=
6489this.options.sizeFull.cssClass):(this.status.width=this.options.size.width,this.status.height=this.options.size.height,this.status.cssClass=this.options.size.cssClass);this.element.css({width:this.status.width,height:this.status.height})},_addUiClass:function(){this.ancestorJq.length&&this.ancestorJq.addClass(this.status.cssClass)},_removeUiClass:function(){this.ancestorJq.length&&this.ancestorJq.removeClass(this.status.cssClass)},_updateSize:function(){this.internal.poster.jq.css({width:this.status.width,
6490height:this.status.height});!this.status.waitForPlay&&this.html.active&&this.status.video||this.html.video.available&&this.html.used&&this.status.nativeVideoControls?this.internal.video.jq.css({width:this.status.width,height:this.status.height}):!this.status.waitForPlay&&(this.flash.active&&this.status.video)&&this.internal.flash.jq.css({width:this.status.width,height:this.status.height})},_updateAutohide:function(){var a=this,b=function(){a.css.jq.gui.fadeIn(a.options.autohide.fadeIn,function(){clearTimeout(a.internal.autohideId);
6491a.internal.autohideId=setTimeout(function(){a.css.jq.gui.fadeOut(a.options.autohide.fadeOut)},a.options.autohide.hold)})};this.css.jq.gui.length&&(this.css.jq.gui.stop(!0,!0),clearTimeout(this.internal.autohideId),this.element.unbind(".jPlayerAutohide"),this.css.jq.gui.unbind(".jPlayerAutohide"),this.status.nativeVideoControls?this.css.jq.gui.hide():this.options.fullWindow&&this.options.autohide.full||!this.options.fullWindow&&this.options.autohide.restored?(this.element.bind("mousemove.jPlayer.jPlayerAutohide",
6492b),this.css.jq.gui.bind("mousemove.jPlayer.jPlayerAutohide",b),this.css.jq.gui.hide()):this.css.jq.gui.show())},fullScreen:function(){this._setOption("fullScreen",!0)},restoreScreen:function(){this._setOption("fullScreen",!1)},_fullscreenAddEventListeners:function(){var a=this,c=b.jPlayer.nativeFeatures.fullscreen;c.api.fullscreenEnabled&&c.event.fullscreenchange&&("function"!==typeof this.internal.fullscreenchangeHandler&&(this.internal.fullscreenchangeHandler=function(){a._fullscreenchange()}),
6493document.addEventListener(c.event.fullscreenchange,this.internal.fullscreenchangeHandler,!1))},_fullscreenRemoveEventListeners:function(){var a=b.jPlayer.nativeFeatures.fullscreen;this.internal.fullscreenchangeHandler&&document.addEventListener(a.event.fullscreenchange,this.internal.fullscreenchangeHandler,!1)},_fullscreenchange:function(){this.options.fullScreen&&!b.jPlayer.nativeFeatures.fullscreen.api.fullscreenElement()&&this._setOption("fullScreen",!1)},_requestFullscreen:function(){var a=this.ancestorJq.length?
6494this.ancestorJq[0]:this.element[0],c=b.jPlayer.nativeFeatures.fullscreen;c.used.webkitVideo&&(a=this.htmlElement.video);c.api.fullscreenEnabled&&c.api.requestFullscreen(a)},_exitFullscreen:function(){var a=b.jPlayer.nativeFeatures.fullscreen,c;a.used.webkitVideo&&(c=this.htmlElement.video);a.api.fullscreenEnabled&&a.api.exitFullscreen(c)},_html_initMedia:function(a){var c=b(this.htmlElement.media).empty();b.each(a.track||[],function(a,b){var g=document.createElement("track");g.setAttribute("kind",
6495b.kind?b.kind:"");g.setAttribute("src",b.src?b.src:"");g.setAttribute("srclang",b.srclang?b.srclang:"");g.setAttribute("label",b.label?b.label:"");b.def&&g.setAttribute("default",b.def);c.append(g)});this.htmlElement.media.src=this.status.src;"none"!==this.options.preload&&this._html_load();this._trigger(b.jPlayer.event.timeupdate)},_html_setFormat:function(a){var c=this;b.each(this.formats,function(b,e){if(c.html.support[e]&&a[e])return c.status.src=a[e],c.status.format[e]=!0,c.status.formatType=
6496e,!1})},_html_setAudio:function(a){this._html_setFormat(a);this.htmlElement.media=this.htmlElement.audio;this._html_initMedia(a)},_html_setVideo:function(a){this._html_setFormat(a);this.status.nativeVideoControls&&(this.htmlElement.video.poster=this._val
6496idString(a.poster)?a.poster:"");this.htmlElement.media=this.htmlElement.video;this._html_initMedia(a)},_html_resetMedia:function(){this.htmlElement.media&&(this.htmlElement.media.id===this.internal.video.id&&!this.status.nativeVideoControls&&this.internal.video.jq.css({width:"0px",
6497height:"0px"}),this.htmlElement.media.pause())},_html_clearMedia:function(){this.htmlElement.media&&(this.htmlElement.media.src="about:blank",this.htmlElement.media.load())},_html_load:function(){this.status.waitForLoad&&(this.status.waitForLoad=!1,this.htmlElement.media.load());clearTimeout(this.internal.htmlDlyCmdId)},_html_play:function(a){var b=this,d=this.htmlElement.media;this._html_load();if(isNaN(a))d.play();else{this.internal.cmdsIgnored&&d.play();try{if(!d.seekable||"object"===typeof d.seekable&&
64980<d.seekable.length)d.currentTime=a,d.play();else throw 1;}catch(e){this.internal.htmlDlyCmdId=setTimeout(function(){b.play(a)},250);return}}this._html_checkWaitForPlay()},_html_pause:function(a){var b=this,d=this.htmlElement.media;0<a?this._html_load():clearTimeout(this.internal.htmlDlyCmdId);d.pause();
6498if(!isNaN(a))try{if(!d.seekable||"object"===typeof d.seekable&&0<d.seekable.length)d.currentTime=a;else throw 1;}catch(e){this.internal.htmlDlyCmdId=setTimeout(function(){b.pause(a)},250);return}0<
6499a&&this._html_checkWaitForPlay()},_html_playHead:function(a){var b=this,d=this.htmlElement.media;this._html_load();try{if("object"===typeof d.seekable&&0<d.seekable.length)d.currentTime=a*d.seekable.end(d.seekable.length-1)/100;else if(0<d.duration&&!isNaN(d.duration))d.currentTime=a*d.duration/100;else throw"e";}catch(e){this.internal.htmlDlyCmdId=setTimeout(function(){b.playHead(a)},250);return}this.status.waitForLoad||this._html_checkWaitForPlay()},_html_checkWaitForPlay:function(){this.status.waitForPlay&&
6500(this.status.waitForPlay=!1,this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide(),this.status.video&&(this.internal.poster.jq.hide(),this.internal.video.jq.css({width:this.status.width,height:this.status.height})))},_html_volume:function(a){this.html.audio.available&&(this.htmlElement.audio.volume=a);this.html.video.available&&(this.htmlElement.video.volume=a)},_html_mute:function(a){this.html.audio.available&&(this.htmlElement.audio.muted=a);this.html.video.available&&(this.htmlElement.video.muted=
6501a)},_flash_setAudio:function(a){var c=this;try{b.each(this.formats,function(b,d){if(c.flash.support[d]&&a[d]){switch(d){case "m4a":case "fla":c._getMovie().fl_setAudio_m4a(a[d]);break;case "mp3":c._getMovie().fl_setAudio_mp3(a[d]);break;case "rtmpa":c._getMovie().fl_setAudio_rtmp(a[d])}c.status.src=a[d];c.status.format[d]=!0;c.status.formatType=d;return!1}}),"auto"===this.options.preload&&(this._flash_load(),this.status.waitForLoad=!1)}catch(d){this._flashError(d)}},_flash_setVideo:function(a){var c=
6502this;try{b.each(this.formats,function(b,d){if(c.flash.support[d]&&a[d]){switch(d){case "m4v":case "flv":c._getMovie().fl_setVideo_m4v(a[d]);break;case "rtmpv":c._getMovie().fl_setVideo_rtmp(a[d])}c.status.src=a[d];c.status.format[d]=!0;c.status.formatType=d;return!1}}),"auto"===this.options.preload&&(this._flash_load(),this.status.waitForLoad=!1)}catch(d){this._flashError(d)}},_flash_resetMedia:function(){this.internal.flash.jq.css({width:"0px",height:"0px"});this._flash_pause(NaN)},_flash_clearMedia:function(){try{this._getMovie().fl_clearMedia()}catch(a){this._flashError(a)}},
6503_flash_load:function(){try{this._getMovie().fl_load()}catch(a){this._flashError(a)}this.status.waitForLoad=!1},_flash_play:function(a){try{this._getMovie().fl_play(a)}catch(b){this._flashError(b)}this.status.waitForLoad=!1;this._flash_checkWaitForPlay()},_flash_pause:function(a){try{this._getMovie().fl_pause(a)}catch(b){this._flashError(b)}0<a&&(this.status.waitForLoad=!1,this._flash_checkWaitForPlay())},_flash_playHead:function(a){try{this._getMovie().fl_play_head(a)}catch(b){this._flashError(b)}this.status.waitForLoad||
6504this._flash_checkWaitForPlay()},_flash_checkWaitForPlay:function(){this.status.waitForPlay&&(this.status.waitForPlay=!1,this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide(),this.status.video&&(this.internal.poster.jq.hide(),this.internal.flash.jq.css({width:this.status.width,height:this.status.height})))},_flash_volume:function(a){try{this._getMovie().fl_volume(a)}catch(b){this._flashError(b)}},_flash_mute:function(a){try{this._getMovie().fl_mute(a)}catch(b){this._flashError(b)}},_getMovie:function(){return document[this.internal.flash.id]},
6505_getFlashPluginVersion:function(){var a=0,b;if(window.ActiveXObject)try{if(b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")){var d=b.GetVariable("$version");d&&(d=d.split(" ")[1].split(","),a=parseInt(d[0],10)+"."+parseInt(d[1],10))}}catch(e){}else navigator.plugins&&0<navigator.mimeTypes.length&&(b=navigator.plugins["Shockwave Flash"])&&(a=navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/,"$1"));return 1*a},_checkForFlash:function(a){var b=!1;this._getFlashPluginVersion()>=
6506a&&(b=!0);return b},_validString:function(a){return a&&"string"===typeof a},_limitValue:function(a,b,d){return a<b?b:a>d?d:a},_urlNotSetError:function(a){this._error({type:b.jPlayer.error.URL_NOT_SET,context:a,message:b.jPlayer.errorMsg.URL_NOT_SET,hint:b.jPlayer.errorHint.URL_NOT_SET})},_flashError:function(a){var c;c=this.internal.ready?"FLASH_DISABLED":"FLASH";this._error({type:b.jPlayer.error[c],context:this.internal.flash.swf,message:b.jPlayer.errorMsg[c]+a.message,hint:b.jPlayer.errorHint[c]});
6507this.internal.flash.jq.css({width:"1px",height:"1px"})},_error:function(a){this._trigger(b.jPlayer.event.error,a);this.options.errorAlerts&&this._alert("Error!"+(a.message?"\n\n"+a.message:"")+(a.hint?"\n\n"+a.hint:"")+"\n\nContext: "+a.context)},_warning:function(a){this._trigger(b.jPlayer.event.warning,f,a);this.options.warningAlerts&&this._alert("Warning!"+(a.message?"\n\n"+a.message:"")+(a.hint?"\n\n"+a.hint:"")+"\n\nContext: "+a.context)},_alert:function(a){alert("jPlayer "+this.version.script+
6508" : id='"+this.internal.self.id+"' : "+a)},_emulateHtmlBridge:function(){var a=this;b.each(b.jPlayer.emulateMethods.split(/\s+/g),function(b,d){a.internal.domNode[d]=function(b){a[d](b)}});b.each(b.jPlayer.event,function(c,d){var e=!0;b.each(b.jPlayer.reservedEvent.split(/\s+/g),function(a,b){if(b===c)return e=!1});e&&a.element.bind(d+".jPlayer.jPlayerHtml",function(){a._emulateHtmlUpdate();var b=document.createEvent("Event");
6508b.initEvent(c,!1,!0);a.internal.domNode.dispatchEvent(b)})})},_emulateHtmlUpdate:function(){var a=
6509this;b.each(b.jPlayer.emulateStatus.split(/\s+/g),function(b,d){a.internal.domNode[d]=a.status[d]});b.each(b.jPlayer.emulateOptions.split(/\s+/g),function(b,d){a.internal.domNode[d]=a.options[d]})},_destroyHtmlBridge:function(){var a=this;this.element.unbind(".jPlayerHtml");b.each((b.jPlayer.emulateMethods+" "+b.jPlayer.emulateStatus+" "+b.jPlayer.emulateOptions).split(/\s+/g),function(b,d){delete a.internal.domNode[d]})}};b.jPlayer.error={FLASH:"e_flash",FLASH_DISABLED:"e_flash_disabled",NO_SOLUTION:"e_no_solution",
6510NO_SUPPORT:"e_no_support",URL:"e_url",URL_NOT_SET:"e_url_not_set",VERSION:"e_version"};b.jPlayer.errorMsg={FLASH:"jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ",FLASH_DISABLED:"jPlayer's Flash fallback has been disabled by the browser due to the CSS rules you have used. Details: ",NO_SOLUTION:"No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.",NO_SUPPORT:"It is not possible to play any media format provided in setMedia() on this browser using your current options.",
6511URL:"Media URL could not be loaded.",URL_NOT_SET:"Attempt to issue media playback commands, while no media url is set.",VERSION:"jPlayer "+b.jPlayer.prototype.version.script+" needs Jplayer.swf version "+b.jPlayer.prototype.version.needFlash+" but found "};
6511b.jPlayer.errorHint={FLASH:"Check your swfPath option and that Jplayer.swf is there.",FLASH_DISABLED:"Check that you have not display:none; the jPlayer entity or any ancestor.",NO_SOLUTION:"Review the jPlayer options: support and supplied.",NO_SUPPORT:"Video or audio formats defined in the supplied option are missing.",
6512URL:"Check media URL is valid.",URL_NOT_SET:"Use setMedia() to set the media URL.",VERSION:"Update jPlayer files."};b.jPlayer.warning={CSS_SELECTOR_COUNT:"e_css_selector_count",CSS_SELECTOR_METHOD:"e_css_selector_method",CSS_SELECTOR_STRING:"e_css_selector_string",OPTION_KEY:"e_option_key"};b.jPlayer.warningMsg={CSS_SELECTOR_COUNT:"The number of css selectors found did not equal one: ",CSS_SELECTOR_METHOD:"The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.",CSS_SELECTOR_STRING:"The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.",
6513OPTION_KEY:"The option requested in jPlayer('option') is undefined."};b.jPlayer.warningHint={CSS_SELECTOR_COUNT:"Check your css selector and the ancestor.",CSS_SELECTOR_METHOD:"Check your method name.",CSS_SELECTOR_STRING:"Check your css selector is a string.",OPTION_KEY:"Check your option name."}});;;
6514(function ($, window, document, undefined) {
6515
6516  var pluginName = "MegaMenu",
6517    defaults = {
6518      propertyName: "value"
6519    };
6520  var DELAY = 250;
6521
6522  // the list of menus
6523  var menus = [];
6524
6525  function CustomMenu(element, options) {
6526    this.element = element;
6527
6528    this.options = $.extend({}, defaults, options);
6529
6530    this._defaults = defaults;
6531    this._name = pluginName;
6532
6533    this.init();
6534  }
6535
6536  CustomMenu.prototype = {
6537    isOpen: false,
6538    timeout: null,
6539    init: function () {
6540
6541      var that = this;
6542
6543      $(".main-navigation-ul").each(function(index, menu) {
6544
6545        that.node = menu;
6546        that.addListeners(menu);
6547
6548        $(menu).addClass("dropdownJavascript");
6549        menus.push(menu);
6550
6551        $(menu).find('ul > li').each(function(index, submenu) {
6552          if ($(submenu).find('ul').length > 0 ) {
6553            $(submenu).addClass('with-menu');
6554          }
6555        });
6556      });
6557    },
6558    addListeners: function(menu) {
6559      var that = this;
6560      $(menu).mouseover(function(e) {
6561        that.handleMouseOver.call(that, e);
6562      }).mouseout(function(e) {
6563          that.handleMouseOut.call(that, e);
6564        });
6565    },
6566    handleMouseOver: function (e) {
6567      var that = this;
6568      // clear the timeout
6569      this.clearTimeout();
6570
6571      // find the parent list item
6572      //var item = ('target' in e ? e.target : e.srcElement);
6573      var item = e.target || e.srcElement;
6574      while (item.nodeName != 'LI' && item != this.node) {
6575        item = item.parentNode;
6576      }
6577
6578      // if the target is within a list item, set the timeout
6579      if (item.nodeName == 'LI') {
6580        this.toOpen = item;
6581        this.timeout = setTimeout(function() {
6582          that.open.call(that);
6583        }, this.options.delay);
6584      }
6585
6586    },
6587    handleMouseOut: function () {
6588      var that = this;
6589      // clear the timeout
6590      this.clearTimeout();
6591
6592      this.timeout = setTimeout(function() {
6593        that.close.call(that);
6594      }, this.options.delay);
6595
6596    },
6597    clearTimeout: function () {
6598
6599      // clear the timeout
6600      if (this.timeout) {
6601        clearTimeout(this.timeout);
6602        this.timeout = null;
6603      }
6604
6605    },
6606    open: function () {
6607
6608      var that = this;
6609      // store that the menu is open
6610      this.isOpen = true;
6611
6612      // loop over the list items with the same parent
6613      var items = $(this.toOpen).parent().children('li');
6614      $(items).each(function(index, item) {
6615        $(item).find("ul").each(function(index, submenu) {
6616          if (item != that.toOpen) {
6617            // close the submenu
6618            $(item).removeClass("dropdownOpen");
6619            that.close(item);
6620
6621          } else if (!$(item).hasClass('dropdownOpen')) {
6622
6623            // open the submenu
6624            //if ( !$(item).parents('li').hasClass('has-mega-menu') ) {
6625              $(item).addClass("dropdownOpen");
6626            //}
6627
6628
6629            // determine the location of the edges of the submenu
6630            var left = 0;
6631            var node = submenu;
6632            while (node) {
6633              //abs is because when you make menus right to left
6634              //the offsetLeft would be negative
6635              left += Math.abs(node.offsetLeft);
6636              node = node.offsetParent;
6637            }
6638            var right = left + submenu.offsetWidth;
6639
6640
6641            //We should refactor this code to execute only when menu is vertical
6642            var menuHeight = $(submenu).outerHeight();
6643            var parentTop = $(submenu).offset().top - $(window).scrollTop();
6644            var totalHeight = menuHeight + parentTop;
6645            var windowHeight = window.innerHeight;
6646
6647           /* if (totalHeight > windowHeight) {
6648              var bestTop = (windowHeight - totalHeight) - 20;
6649              $(submenu).css('margin-top', bestTop + "px");
6650            }*/
6651
6652            //remove any previous classes
6653            $(item).removeClass('dropdownRightToLeft');
6654
6655            // move the submenu to the right of the item if appropriate
6656            if (left < 0) $(item).addClass('dropdownLeftToRight');
6657
6658            // move the submenu to the left of the item if appropriate
6659            if (right > document.body.clientWidth) {
6660              $(item).addClass('dropdownRightToLeft');
6661            }
6662
6663          }
6664        });
6665      });
6666
6667    },
6668
6669
6670    close: function (node) {
6671
6672      // if no node was specified, close all menus
6673      if (!node) {
6674        this.isOpen = false;
vendor: 13,812 bytes, lines 6675-7104
6675        node = this.node;
6676      }
6677
6678      // loop over the items, closing their submenus
6679      $(node).find('li').each(function(index, item) {
6680        $(item).removeClass('dropdownOpen');
6681      });
6682
6683    }
6684  };
6685
6686  $.fn[pluginName] = function (options) {
6687    return this.each(function () {
6688      if (!$.data(this, "plugin_" + pluginName)) {
6689        $.data(this, "plugin_" + pluginName,
6690          new CustomMenu(this, options));
6691      }
6692    });
6693  };
6694
6695})(jQuery, window, document);
6696;/* Modernizr 2.6.2 (Custom Build) | MIT & BSD
6697 * Build: http://modernizr.com/download/#-cssanimations-csstransitions-touch-shiv-cssclasses-prefixed-teststyles-testprop-testallprops-prefixes-domprefixes-load
6698 */
6699;
6700window.Modernizr = function(a, b, c) {
6701	function z(a) {
6702		j.cssText = a
6703	}
6704
6705	function A(a, b) {
6706		return z(m.join(a + ";") + (b || ""))
6707	}
6708
6709	function B(a, b) {
6710		return typeof a === b
6711	}
6712
6713	function C(a, b) {
6714		return !!~("" + a).indexOf(b)
6715	}
6716
6717	function D(a, b) {
6718		for (var d in a) {
6719			var e = a[d];
6720			if (!C(e, "-") && j[e] !== c) return b == "pfx" ? e : !0
6721		}
6722		return !1
6723	}
6724
6725	function E(a, b, d) {
6726		for (var e in a) {
6727			var f = b[a[e]];
6728			if (f !== c) return d === !1 ? a[e] : B(f, "function") ? f.bind(d || b) : f
6729		}
6730		return !1
6731	}
6732
6733	function F(a, b, c) {
6734		var d = a.charAt(0).toUpperCase() + a.slice(1),
6735			e = (a + " " + o.join(d + " ") + d).split(" ");
6736		return B(b, "string") || B(b, "undefined") ? D(e, b) : (e = (a + " " + p.join(d + " ") + d).split(" "), E(e, b, c))
6737	}
6738	var d = "2.6.2",
6739		e = {},
6740		f = !0,
6741		g = b.documentElement,
6742		h = "modernizr",
6743		i = b.createElement(h),
6744		j = i.style,
6745		k, l = {}.toString,
6746		m = " -webkit- -moz- -o- -ms- ".split(" "),
6747		n = "Webkit Moz O ms",
6748		o = n.split(" "),
6749		p = n.toLowerCase().split(" "),
6750		q = {},
6751		r = {},
6752		s = {},
6753		t = [],
6754		u = t.slice,
6755		v, w = function(a, c, d, e) {
6756			var f, i, j, k, l = b.createElement("div"),
6757				m = b.body,
6758				n = m || b.createElement("body");
6759			if (parseInt(d, 10))
6760				while (d--) j = b.createElement("div"), j.id = e ? e[d] : h + (d + 1), l.appendChild(j);
6761			return f = ["&#173;", '<style id="s', h, '">', a, "</style>"].join(""), l.id = h, (m ? l : n).innerHTML += f, n.appendChild(l), m || (n.style.background = "", n.style.overflow = "hidden", k = g.style.overflow, g.style.overflow = "hidden", g.appendChild(n)), i = c(l, a), m ? l.parentNode.removeChild(l) : (n.parentNode.removeChild(n), g.style.overflow = k), !!i
6762		},
6763		x = {}.hasOwnProperty,
6764		y;
6765	!B(x, "undefined") && !B(x.call, "undefined") ? y = function(a, b) {
6766		return x.call(a, b)
6767	} : y = function(a, b) {
6768		return b in a && B(a.constructor.prototype[b], "undefined")
6769	}, Function.prototype.bind || (Function.prototype.bind = function(b) {
6770		var c = this;
6771		if (typeof c != "function") throw new TypeError;
6772		var d = u.call(arguments, 1),
6773			e = function() {
6774				if (this instanceof e) {
6775					var a = function() {};
6776					a.prototype = c.prototype;
6777					var f = new a,
6778						g = c.apply(f, d.concat(u.call(arguments)));
6779					return Object(g) === g ? g : f
6780				}
6781				return c.apply(b, d.concat(u.call(arguments)))
6782			};
6783		return e
6784	}), q.touch = function() {
6785		var c;
6786		return "ontouchstart" in a || a.DocumentTouch && b instanceof DocumentTouch ? c = !0 : w(["@media (", m.join("touch-enabled),("), h, ")", "{#modernizr{top:9px;position:absolute}}"].join(""), function(a) {
6787			c = a.offsetTop === 9
6788		}), c
6789	}, q.cssanimations = function() {
6790		return F("animationName")
6791	}, q.csstransitions = function() {
6792		return F("transition")
6793	};
6794	for (var G in q) y(q, G) && (v = G.toLowerCase(), e[v] = q[G](), t.push((e[v] ? "" : "no-") + v));
6795	return e.addTest = function(a, b) {
6796			if (typeof a == "object")
6797				for (var d in a) y(a, d) && e.addTest(d, a[d]);
6798			else {
6799				a = a.toLowerCase();
6800				if (e[a] !== c) return e;
6801				b = typeof b == "function" ? b() : b, typeof f != "undefined" && f && (g.className += " " + (b ? "" : "no-") + a), e[a] = b
6802			}
6803			return e
6804		}, z(""), i = k = null,
6805		function(a, b) {
6806			function k(a, b) {
6807				var c = a.createElement("p"),
6808					d = a.getElementsByTagName("head")[0] || a.documentElement;
6809				return c.innerHTML = "x<style>" + b + "</style>", d.insertBefore(c.lastChild, d.firstChild)
6810			}
6811
6812			function l() {
6813				var a = r.elements;
6814				return typeof a == "string" ? a.split(" ") : a
6815			}
6816
6817			function m(a) {
6818				var b = i[a[g]];
6819				return b || (b = {}, h++, a[g] = h, i[h] = b), b
6820			}
6821
6822			function n(a, c, f) {
6823				c || (c = b);
6824				if (j) return c.createElement(a);
6825				f || (f = m(c));
6826				var g;
6827				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
6828			}
6829
6830			function o(a, c) {
6831				a || (a = b);
6832				if (j) return a.createDocumentFragment();
6833				c = c || m(a);
6834				var d = c.frag.cloneNode(),
6835					e = 0,
6836					f = l(),
6837					g = f.length;
6838				for (; e < g; e++) d.createElement(f[e]);
6839				return d
6840			}
6841
6842			function p(a, b) {
6843				b.cache || (b.cache = {}, b.createElem = a.createElement, b.createFrag = a.createDocumentFragment, b.frag = b.createFrag()), a.createElement = function(c) {
6844					return r.shivMethods ? n(c, a, b) : b.createElem(c)
6845				}, a.createDocumentFragment = Function("h,f", "return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&(" + l().join().replace(/\w+/g, function(a) {
6846					return b.createElem(a), b.frag.createElement(a), 'c("' + a + '")'
6847				}) + ");return n}")(r, b.frag)
6848			}
6849
6850			function q(a) {
6851				a || (a = b);
6852				var c = m(a);
6853				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
6854			}
6855			var c = a.html5 || {},
6856				d = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,
6857				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,
6858				f, g = "_html5shiv",
6859				h = 0,
6860				i = {},
6861				j;
6862			(function() {
6863				try {
6864					var a = b.createElement("a");
6865					a.innerHTML = "<xyz></xyz>", f = "hidden" in a, j = a.childNodes.length == 1 || function() {
6866						b.createElement("a");
6867						var a = b.createDocumentFragment();
6868						return typeof a.cloneNode == "undefined" || typeof a.createDocumentFragment == "undefined" || typeof a.createElement == "undefined"
6869					}()
6870				} catch (c) {
6871					f = !0, j = !0
6872				}
6873			})();
6874			var r = {
6875				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",
6876				shivCSS: c.shivCSS !== !1,
6877				supportsUnknownElements: j,
6878				shivMethods: c.shivMethods !== !1,
6879				type: "default",
6880				shivDocument: q,
6881				createElement: n,
6882				createDocumentFragment: o
6883			};
6884			a.html5 = r, q(b)
6885		}(this, b), e._version = d, e._prefixes = m, e._domPrefixes = p, e._cssomPrefixes = o, e.testProp = function(a) {
6886			return D([a])
6887		}, e.testAllProps = F, e.testStyles = w, e.prefixed = function(a, b, c) {
6888			return b ? F(a, b, c) : F(a, "pfx")
6889		}, g.className = g.className.replace(/(^|\s)no-js(\s|$)/, "$1$2") + (f ? " js " + t.join(" ") : ""), e
6890}(this, this.document),
6891function(a, b, c) {
6892	function d(a) {
6893		return "[object Function]" == o.call(a)
6894	}
6895
6896	function e(a) {
6897		return "string" == typeof a
6898	}
6899
6900	function f() {}
6901
6902	function g(a) {
6903		return !a || "loaded" == a || "complete" == a || "uninitialized" == a
6904	}
6905
6906	function h() {
6907		var a = p.shift();
6908		q = 1, a ? a.t ? m(function() {
6909			("c" == a.t ? B.injectCss : B.injectJs)(a.s, 0, a.a, a.x, a.e, 1)
6910		}, 0) : (a(), h()) : q = 0
6911	}
6912
6913	function i(a, c, d, e, f, i, j) {
6914		function k(b) {
6915			if (!o && g(l.readyState) && (u.r = o = 1, !q && h(), l.onload = l.onreadystatechange = null, b)) {
6916				"img" != a && m(function() {
6917					t.removeChild(l)
6918				}, 50);
6919				for (var d in y[c]) y[c].hasOwnProperty(d) && y[c][d].onload()
6920			}
6921		}
6922		var j = j || B.errorTimeout,
6923			l = b.createElement(a),
6924			o = 0,
6925			r = 0,
6926			u = {
6927				t: d,
6928				s: c,
6929				e: f,
6930				a: i,
6931				x: j
6932			};
6933		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() {
6934			k.call(this, r)
6935		}, p.splice(e, 0, u), "img" != a && (r || 2 === y[c] ? (t.insertBefore(l, s ? null : n), m(k, j)) : y[c].push(l))
6936	}
6937
6938	function j(a, b, c, d, f) {
6939		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
6940	}
6941
6942	function k() {
6943		var a = B;
6944		return a.loader = {
6945			load: j,
6946			i: 0
6947		}, a
6948	}
6949	var l = b.documentElement,
6950		m = a.setTimeout,
6951		n = b.getElementsByTagName("script")[0],
6952		o = {}.toString,
6953		p = [],
6954		q = 0,
6955		r = "MozAppearance" in l.style,
6956		s = r && !!b.createRange().compareNode,
6957		t = s ? l : n.parentNode,
6958		l = a.opera && "[object Opera]" == o.call(a.opera),
6959		l = !!b.attachEvent && !l,
6960		u = r ? "object" : l ? "script" : "img",
6961		v = l ? "script" : u,
6962		w = Array.isArray || function(a) {
6963			return "[object Array]" == o.call(a)
6964		},
6965		x = [],
6966		y = {},
6967		z = {
6968			timeout: function(a, b) {
6969				return b.length && (a.timeout = b[0]), a
6970			}
6971		},
6972		A, B;
6973	B = function(a) {
6974		function b(a) {
6975			var a = a.split("!"),
6976				b = x.length,
6977				c = a.pop(),
6978				d = a.length,
6979				c = {
6980					url: c,
6981					origUrl: c,
6982					prefixes: a
6983				},
6984				e, f, g;
6985			for (f = 0; f < d; f++) g = a[f].split("="), (e = z[g.shift()]) && (c = e(c, g));
6986			for (f = 0; f < b; f++) c = x[f](c);
6987			return c
6988		}
6989
6990		function g(a, e, f, g, h) {
6991			var i = b(a),
6992				j = i.autoCallback;
6993			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() {
6994				k(), e && e(i.origUrl, h, g), j && j(i.origUrl, h, g), y[i.url] = 2
6995			})))
6996		}
6997
6998		function h(a, b) {
6999			function c(a, c) {
7000				if (a) {
7001					if (e(a)) c || (j = function() {
7002						var a = [].slice.call(arguments);
7003						k.apply(this, a), l()
7004					}), g(a, j, b, 0, h);
7005					else if (Object(a) === a)
7006						for (n in m = function() {
7007							var b = 0,
7008								c;
7009							for (c in a) a.hasOwnProperty(c) && b++;
7010							return b
7011						}(), a) a.hasOwnProperty(n) && (!c && !--m && (d(j) ? j = function() {
7012							var a = [].slice.call(arguments);
7013							k.apply(this, a), l()
7014						} : j[n] = function(a) {
7015							return function() {
7016								var b = [].slice.call(arguments);
7017								a && a.apply(this, b), l()
7018							}
7019						}(k[n])), g(a[n], j, b, n, h))
7020				} else !c && l()
7021			}
7022			var h = !!a.test,
7023				i = a.load || a.both,
7024				j = a.callback || f,
7025				k = j,
7026				l = a.complete || f,
7027				m, n;
7028			c(h ? a.yep : a.nope, !!i), i && c(i)
7029		}
7030		var i, j, l = this.yepnope.loader;
7031		if (e(a)) g(a, 0, l, 0);
7032		else if (w(a))
7033			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);
7034		else Object(a) === a && h(a, l)
7035	}, B.addPrefix = function(a, b) {
7036		z[a] = b
7037	}, B.addFilter = function(a) {
7038		x.push(a)
7039	}, B.errorTimeout = 1e4, null == b.readyState && b.addEventListener && (b.readyState = "loading", b.addEventListener("DOMContentLoaded", A = function() {
7040		b.removeEventListener("DOMContentLoaded", A, 0), b.readyState = "complete"
7041	}, 0)), a.yepnope = k(), a.yepnope.executeStack = h, a.yepnope.injectJs = function(a, c, d, e, i, j) {
7042		var k = b.createElement("script"),
7043			l, o, e = e || B.errorTimeout;
7044		k.src = a;
7045		for (o in d) k.setAttribute(o, d[o]);
7046		c = j ? h : c || f, k.onreadystatechange = k.onload = function() {
7047			!l && g(k.readyState) && (l = 1, c(), k.onload = k.onreadystatechange = null)
7048		}, m(function() {
7049			l || (l = 1, c(1))
7050		}, e), i ? k.onload() : n.parentNode.insertBefore(k, n)
7051	}, a.yepnope.injectCss = function(a, c, d, e, g, i) {
7052		var e = b.createElement("link"),
7053			j, c = i ? h : c || f;
7054		e.href = a, e.rel = "stylesheet", e.type = "text/css";
7055		for (j in d) e.setAttribute(j, d[j]);
7056		g || (n.parentNode.insertBefore(e, n), m(c, 0))
7057	}
7058}(this, document), Modernizr.load = function() {
7059	yepnope.apply(window, [].slice.call(arguments, 0))
7060};
7061
7062;/*
7063Plugin: jQuery Parallax
7064Version 1.1.3
7065Author: Ian Lunn
7066Twitter: @IanLunn
7067Author URL: http://www.ianlunn.co.uk/
7068Plugin URL: http://www.ianlunn.co.uk/plugins/jquery-parallax/
7069
7070Dual licensed under the MIT and GPL licenses:
7071http://www.opensource.org/licenses/mit-license.php
7072http://www.gnu.org/licenses/gpl.html
7073*/
7074(function ($) {
7075        var $window = $(window);
7076        var windowHeight = $window.height();
7077
7078        $window.resize(function () {
7079                windowHeight = $window.height();
7080        });
7081
7082        $.fn.parallax = function (xpos, speedFactor) {
7083                var $this = $(this);
7084                var getHeight;
7085                var firstTop;
7086                var paddingTop = 0;
7087
7088                //get the starting position of each element to have parallax applied to it      
7089                $this.each(function () {
7090                        firstTop = $this.offset().top;
7091                });
7092
7093                getHeight = function (jqo) {
7094                        return jqo.outerHeight(true);
7095                };
7096
7097                // setup defaults if arguments aren't specified
7098                if (arguments.length < 1 || xpos === null) xpos = "50%";
7099                if (arguments.length < 2 || speedFactor === null) speedFactor = 0.1;
7100                if (arguments.length < 3 || outerHeight === null) outerHeight = true;
7101
7102                // function to be called whenever the window is scrolled or resized
7103
7104
7105                function update() {
7106                        var pos = $window.scrollTop();
7107
7108                        $this.each(function () {
7109                                var $element = $(this);
7110                                var top = $element.offset().top;
7111                                var height = getHeight($element);
7112
7113                                // Check if totally above or totally below viewport
7114                                if (top + height < pos || top > pos + windowHeight) {
7115                                        return;
7116                                }
7117
7118                                $this.css('backgroundPosition', xpos + " " + Math.round((firstTop - pos) * speedFactor) + "px");
7119                        });
7120                }
7121
7122                $window.bind('scroll', update).resize(update);
7123                update();
7124        };
7125})(jQuery);;
7126
7127/**
7128 * @depends jquery
7129 * @name jquery.scrollto
7130 * @package jquery-scrollto {@link http://balupton.com/projects/jquery-scrollto}
7131 */
7132
7133/**
7134 * jQuery Aliaser
7135 */
7136(function (window, undefined) {
7137        // Prepare
7138        var jQuery, $, ScrollTo;
7139        jQuery = $ = window.jQuery;
7140
7141        /**
7142         * jQuery ScrollTo (balupton edition)
7143         * @version 1.2.0
7144         * @date July 9, 2012
7145         * @since 0.1.0, August 27, 2010
7146         * @package jquery-scrollto {@link http://balupton.com/projects/jquery-scrollto}
7147         * @author Benjamin "balupton" Lupton {@link http://balupton.com}
7148         * @copyright (c) 2010 Benjamin Arthur Lupton {@link http://balupton.com}
7149         * @license MIT License {@link http://creativecommons.org/licenses/MIT/}
7150         */
7151        ScrollTo = $.ScrollTo = $.ScrollTo || {
7152                /**
7153                 * The Default Configuration
7154                 */
7155                config: {
7156                        duration: 400,
7157                        easing: 'swing',
7158                        callback: undefined,
7159                        durationMode: 'each',
7160                        offsetTop: 0,
7161                        offsetLeft: 0
7162                },
7163
7164                /**
7165                 * Configure ScrollTo
7166                 */
7167                configure: function (options) {
7168                        // Apply Options to Config
7169                        $.extend(ScrollTo.config, options || {});
7170
7171                        // Chain
7172                        return this;
7173                },
7174
7175                /**
7176                 * Perform the Scroll Animation for the Collections
7177                 * We use $inline here, so we can determine the actual offset start for each overflow:scroll item
7178                 * Each collection is for each overflow:scroll item
7179                 */
7180                scroll: function (collections, config) {
7181                        // Prepare
7182                        var collection, $container, container, $target, $inline, position, containerScrollTop, containerScrollLeft, containerScrollTopEnd, containerScrollLeftEnd, startOffsetTop, targetOffsetTop, targetOffsetTopAdjusted, startOffsetLeft, targetOffsetLeft, targetOffsetLeftAdjusted, scrollOptions, callback;
7183
7184                        // Determine the Scroll
7185                        collection = collections.pop();
7186                        $container = collection.$container;
7187                        container = $container.get(0);
7188                        $target = collection.$target;
7189
7190                        // Prepare the Inline Element of the Container
7191                        $inline = $('<span/>').css({
7192                                'position': 'absolute',
7193                                'top': '0px',
7194                                'left': '0px'
7195                        });
7196                        position = $container.css('position');
7197
7198                        // Insert the Inline Element of the Container
7199                        $container.css('position', 'relative');
7200                        $inline.appendTo($container);
7201
7202                        // Determine the top offset
7203                        startOffsetTop = $inline.offset().top;
7204                        targetOffsetTop = $target.offset().top;
7205                        targetOffsetTopAdjusted = targetOffsetTop - startOffsetTop - parseInt(config.offsetTop, 10);
7206
7207                        // Determine the left offset
7208                        startOffsetLeft = $inline.offset().left;
7209                        targetOffsetLeft = $target.offset().left;
7210                        targetOffsetLeftAdjusted = targetOffsetLeft - startOffsetLeft - parseInt(config.offsetLeft, 10);
7211
7212                        // Determine current scroll positions
7213                        containerScrollTop = container.scrollTop;
7214                        containerScrollLeft = container.scrollLeft;
7215
7216                        // Reset the Inline Element of the Container
7217                        $inline.remove();
7218                        $container.css('position', position);
7219
7220                        // Prepare the scroll options
7221                        scrollOptions = {};
7222
7223                        // Prepare the callback
7224                        callback = function (event) {
7225                                // Check
7226                                if (collections.length === 0) {
7227                                        // Callback
7228                                        if (typeof config.callback === 'function') {
7229                                                config.callback.apply(this, [event]);
7230                                        }
7231                                } else {
7232                                        // Recurse
7233                                        ScrollTo.scroll(collections, config);
7234                                }
7235                                // Return true
7236                                return true;
7237                        };
7238
7239                        // Handle if we only want to scroll if we are outside the viewport
7240                        if (config.onlyIfOutside) {
7241                                // Determine current scroll positions
7242                                containerScrollTopEnd = containerScrollTop + $container.height();
7243                                containerScrollLeftEnd = containerScrollLeft + $container.width();
7244
7245                                // Check if we are in the range of the visible area of the container
7246                                if (containerScrollTop < targetOffsetTopAdjusted && targetOffsetTopAdjusted < containerScrollTopEnd) {
7247                                        targetOffsetTopAdjusted = containerScrollTop;
7248                                }
7249                                if (containerScrollLeft < targetOffsetLeftAdjusted && targetOffsetLeftAdjusted < containerScrollLeftEnd) {
7250                                        targetOffsetLeftAdjusted = containerScrollLeft;
7251                                }
7252                        }
7253
7254                        // Determine the scroll options
7255                        if (targetOffsetTopAdjusted !== containerScrollTop) {
7256                                scrollOptions.scrollTop = targetOffsetTopAdjusted;
7257                        }
7258                        if (targetOffsetLeftAdjusted !== containerScrollLeft) {
7259                                scrollOptions.scrollLeft = targetOffsetLeftAdjusted;
7260                        }
7261
7262                        // Perform the scroll
7263                        if ($.browser.safari && container === document.body) {
7264                                window.scrollTo(scrollOptions.scrollLeft, scrollOptions.scrollTop);
7265                                callback();
7266                        } else if (scrollOptions.scrollTop || scrollOptions.scrollLeft) {
7267                                $container.animate(scrollOptions, config.duration, config.easing, callback);
7268                        } else {
7269                                callback();
7270                        }
7271
7272                        // Return true
7273                        return true;
7274                },
7275
7276                /**
7277                 * ScrollTo the Element using the Options
7278                 */
7279                fn: function (options) {
7280                        // Prepare
7281                        var collections, config, $container, container;
7282                        collections = [];
7283
7284                        // Prepare
7285                        var $target = $(this);
7286                        if ($target.length === 0) {
7287                                // Chain
7288                                return this;
7289                        }
7290
7291                        // Handle Options
7292                        config = $.extend({}, ScrollTo.config, options);
7293
7294                        // Fetch
7295                        $container = $target.parent();
7296                        container = $container.get(0);
7297
7298                        // Cycle through the containers
7299                        while (($container.length === 1) && (container !== document.body) && (container !== document)) {
7300                                // Check Container for scroll differences
7301                                var scrollTop, scrollLeft;
7302                                scrollTop = $container.css('overflow-y') !== 'visible' && container.scrollHeight !== container.clientHeight;
7303                                scrollLeft = $container.css('overflow-x') !== 'visible' && container.scrollWidth !== container.clientWidth;
7304                                if (scrollTop || scrollLeft) {
7305                                        // Push the Collection
7306                                        collections.push({
7307                                                '$container': $container,
7308                                                '$target': $target
7309                                        });
7310                                        // Update the Target
7311                                        $target = $container;
7312                                }
7313                                // Update the Container
7314                                $container = $container.parent();
7315                                container = $container.get(0);
7316                        }
7317
7318                        // Add the final collection
7319                        collections.push({
7320                                '$container': $(($.browser.msie || $.browser.mozilla) ? 'html' : 'body'),
7321                                '$target': $target
7322                        });
7323
7324                        // Adjust the Config
7325                        if (config.durationMode === 'all') {
7326                                config.duration /= collections.length;
7327                        }
7328
7329                        // Handle
7330                        ScrollTo.scroll(collections, config);
7331
7332                        // Chain
7333                        return this;
7334                }
7335        };
7336
7337        // Apply our jQuery Prototype Function
7338        $.fn.ScrollTo = $.ScrollTo.fn;
7339
7340})(window);
7341
7342
7343
7344;;(function ($, window, document, undefined) {
7345
7346  // Defaults
7347  var pluginName = "sectiontrans",
7348    defaults = {
7349      effect: "fade"
7350    };
7351
7352  // The actual plugin constructor
7353  function Plugin(element, options) {
7354    this.element = element;
7355
7356    //merge options and defaults
7357    this.options = $.extend({}, defaults, options);
7358
7359    this._defaults = defaults;
7360    this._name = pluginName;
7361
7362    this.effectClassName = 'intro-effect-' + this.options.effect;
7363
7364    this.init();
7365  }
7366
7367  Plugin.prototype = {
7368
7369    init: function () {
7370      // refreshing the page...
7371      var pageScroll = this.scrollY();
7372      this.noscroll = pageScroll === 0;
7373
7374      this.disable_scroll();
7375
7376      $(this.element).addClass(this.effectClassName);
7377
7378      if (pageScroll) {
7379        this.isRevealed = true;
7380        $(this.element).addClass('notrans');
7381        $(this.element).addClass('modify');
7382      }
7383
7384      var that = this;
7385
7386      window.addEventListener('scroll', function(e) {
7387        that.scrollPage.call(that, e);
7388      });
7389    },
7390    keys: [32, 37, 38, 39, 40],
7391    docElem: window.document.documentElement,
7392    scrollVal: 0,
7393    isRevealed: false,
7394    noscroll: false,
7395    isAnimating: false,
7396    trigger: $('button.trigger'),
7397    preventDefault: function (e) {
7398      e = e || window.event;
7399      if (e.preventDefault)
7400        e.preventDefault();
7401      e.returnValue = false;
7402    },
7403    ie: (function () {
7404      var undef, rv = -1; // Return value assumes failure.
7405      var ua = window.navigator.userAgent;
7406      var msie = ua.indexOf('MSIE ');
7407      var trident = ua.indexOf('Trident/');
7408
7409      if (msie > 0) {
7410        // IE 10 or older => return version number
7411        rv = parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
7412      } else if (trident > 0) {
7413        // IE 11 (or newer) => return version number
7414        var rvNum = ua.indexOf('rv:');
7415        rv = parseInt(ua.substring(rvNum + 3, ua.indexOf('.', rvNum)), 10);
7416      }
7417
7418      return ((rv > -1) ? rv : undef);
7419    }()),
7420    wheel: function (e) {
7421      // for IE
7422      //if( ie ) {
7423      //preventDefault(e);
7424      //}
7425    },
7426    disable_scroll: function () {
7427      window.onmousewheel = document.onmousewheel = this.wheel;
7428    },
7429    enable_scroll: function () {
7430      window.onmousewheel = document.onmousewheel = document.onkeydown = document.body.ontouchmove = null;
7431    },
7432    scrollY: function () {
7433      return window.pageYOffset || this.docElem.scrollTop;
7434    },
7435    scrollPage: function () {
7436      this.scrollVal = this.scrollY();
7437
7438      if (this.noscroll && !this.ie) {
7439        if (this.scrollVal < 0) return false;
7440        // keep it that way
7441        window.scrollTo(0, 0);
7442      }
7443
7444      if ($(this.element).hasClass('notrans')) {
7445        $(this.element).removeClass('notrans');
7446        return false;
7447      }
7448
7449      if (this.isAnimating) {
7450        return false;
7451      }
7452
7453      if (this.scrollVal <= 0 && this.isRevealed) {
7454        this.toggle(0);
7455      }
7456      else if (this.scrollVal > 0 && !this.isRevealed) {
7457        this.toggle(1);
7458      }
7459    },
7460    toggle: function (reveal) {
7461      this.isAnimating = true;
7462
7463      if (reveal) {
7464        $(this.element).addClass('mk-intro-triggered');
7465        $('.' + this.effectClassName).next().next().addClass('mk-intro-triggered' + ' ' + 'page-effect-'+this.options.effect);
7466        $('body').addClass('mk-intro-triggered').trigger('page_intro');
7467      }
7468      else {
7469        this.noscroll = true;
7470        this.disable_scroll();
7471        $(this.element).removeClass('mk-intro-triggered');
7472        $('.' + this.effectClassName).next().next().removeClass('mk-intro-triggered' + ' ' + 'page-effect-'+this.options.effect);
7473        $('body').removeClass('mk-intro-triggered').trigger('page_outro');
7474      }
7475
7476      var that = this;
7477      // simulating the end of the transition:
7478      setTimeout(function () {
7479        that.isRevealed = !that.isRevealed;
7480        that.isAnimating = false;
7481        if (reveal) {
7482          that.noscroll = false;
7483          that.enable_scroll();
7484        }
7485      }, 1200);
7486    }
7487
7488  };
7489
7490  // A really lightweight plugin wrapper around the constructor,
7491  // preventing against multiple instantiations
7492  $.fn[pluginName] = function (options) {
7493    return this.each(function () {
7494      if (!$.data(this, "plugin_" + pluginName)) {
7495        $.data(this, "plugin_" + pluginName,
7496          new Plugin(this, options));
7497      }
7498    });
7499  };
7500
7501})(jQuery, window, document);;;(function ( $, window, document, undefined ) {
7502
7503  // Defaults
7504  var pluginName = "stickify",
7505    defaults = {
7506      offset: 200
7507    };
7508
7509  // The actual plugin constructor
7510  function Plugin( element, options ) {
7511    this.element = element;
7512
7513    //merge options and defaults
7514    this.options = $.extend( {}, defaults, options) ;
7515
7516    this._defaults = defaults;
7517    this._name = pluginName;
7518
7519    this.init();
7520  }
7521
7522  Plugin.prototype = {
7523
7524    init: function() {
7525      var _this = this;
7526      this.options.offset = $(this.element).position().top;
7527
7528      new ChopScroll(function () {
7529        if ( $(window).scrollTop() >= _this.options.offset ) {
7530          if (!_this.isFixed(_this.element)) {
7531            //raise stickyfied event
7532            $(window).trigger('stickyfied');
7533            //trigger fixedCallback
7534            if (typeof _this.options.fixedCallback === 'function') {
7535              _this.options.fixedCallback();
7536            }
7537          }
7538          _this.makeFix(_this.element);
7539        } else {
7540          if (_this.isFixed(_this.element)) {
7541            //raise unstickified event
7542            $(window).trigger('unstickyfied');
7543            //trigger unfixedCallback
7544            if (typeof _this.options.unfixedCallback === 'function') {
7545              _this.options.unfixedCallback();
7546            }
7547          }
7548          _this.unfix(_this.element);
7549        }
7550      }, 10, 'sticky');
7551
7552      /*
7553      onThrottledScroll('sticky', function () {
7554        if ( $(window).scrollTop() >= _this.options.offset ) {
7555          if (!_this.isFixed(_this.element)) {
7556            //raise stickyfied event
7557            $(window).trigger('stickyfied');
7558            //trigger fixedCallback
7559            if (typeof _this.options.fixedCallback === 'function') {
7560              _this.options.fixedCallback();
7561            }
7562          }
7563          _this.makeFix(_this.element);
7564        } else {
7565          if (_this.isFixed(_this.element)) {
7566            //raise unstickified event
7567            $(window).trigger('unstickyfied');
7568            //trigger unfixedCallback
7569            if (typeof _this.options.unfixedCallback === 'function') {
7570              _this.options.unfixedCallback();
7571            }
7572          }
7573          _this.unfix(_this.element);
7574        }
7575      });
7576      */
7577
7578    },
7579
7580    makeFix: function(el) {
7581      $(el).addClass(this.options.fixClass);
7582    },
7583
7584    unfix: function (el) {
7585      $(el).removeClass(this.options.fixClass);
7586    },
7587
7588    isFixed: function (el) {
7589      return $(el).hasClass(this.options.fixClass);
7590    }
7591
7592
7593
7594  };
7595
7596  // A really lightweight plugin wrapper around the constructor,
7597  // preventing against multiple instantiations
7598  $.fn[pluginName] = function ( options ) {
7599    return this.each(function () {
7600      if (!$.data(this, "plugin_" + pluginName)) {
7601        $.data(this, "plugin_" + pluginName,
7602          new Plugin( this, options ));
7603      }
7604    });
7605  };
7606
7607})( jQuery, window, document );;
7608
7609/*
7610 * Swiper 2.4+ - Mobile Touch Slider
7611 * http://www.idangero.us/sliders/swiper/
7612 *
7613 * Copyright 2012-2013, Vladimir Kharlampidi
7614 * The iDangero.us
7615 * http://www.idangero.us/
7616 *
7617 * Licensed under GPL & MIT
7618 *
7619 * Updated on: December 6, 2013
7620 */
7621var Swiper = function (selector, params) {
7622    'use strict';
7623
7624    /*=========================
7625      A little bit dirty but required part for IE8 and old FF support
7626      ===========================*/
7627    if (document.body.__defineGetter__) {
7628        if (HTMLElement) {
7629            var element = HTMLElement.prototype;
7630            if (element.__defineGetter__) {
7631                element.__defineGetter__('outerHTML', function () { return new XMLSerializer().serializeToString(this); });
7632            }
7633        }
7634    }
7635
7636    if (!window.getComputedStyle) {
7637        window.getComputedStyle = function (el, pseudo) {
7638            this.el = el;
7639            this.getPropertyValue = function (prop) {
7640                var re = /(\-([a-z]){1})/g;
7641                if (prop === 'float') prop = 'styleFloat';
7642                if (re.test(prop)) {
7643                    prop = prop.replace(re, function () {
7644                        return arguments[2].toUpperCase();
7645                    });
7646                }
7647                return el.currentStyle[prop] ? el.currentStyle[prop] : null;
7648            };
7649            return this;
7650        };
7651    }
7652    if (!Array.prototype.indexOf) {
7653        Array.prototype.indexOf = function (obj, start) {
7654            for (var i = (start || 0), j = this.length; i < j; i++) {
7655                if (this[i] === obj) { return i; }
7656            }
7657            return -1;
7658        };
7659    }
7660    if (!document.querySelectorAll) {
7661        if (!window.jQuery) return;
7662    }
7663    function $$(selector, context) {
7664        if (document.querySelectorAll)
7665            return (context || document).querySelectorAll(selector);
7666        else
7667            return jQuery(selector, context);
7668    }
7669
7670    /*=========================
7671      Check for correct selector
7672      ===========================*/
7673    if (typeof selector === 'undefined') return;
7674
7675    if (!(selector.nodeType)) {
7676        if ($$(selector).length === 0) return;
7677    }
7678
7679     /*=========================
7680      _this
7681      ===========================*/
7682    var _this = this;
7683
7684     /*=========================
7685      Default Flags and vars
7686      ===========================*/
7687    _this.touches = {
7688        start: 0,
7689        startX: 0,
7690        startY: 0,
7691        current: 0,
7692        currentX: 0,
7693        currentY: 0,
7694        diff: 0,
7695        abs: 0
7696    };
7697    _this.positions = {
7698        start: 0,
7699        abs: 0,
7700        diff: 0,
7701        current: 0
7702    };
7703    _this.times = {
7704        start: 0,
7705        end: 0
7706    };
7707
7708    _this.id = (new Date()).getTime();
7709    _this.container = (selector.nodeType) ? selector : $$(selector)[0];
7710    _this.isTouched = false;
7711    _this.isMoved = false;
7712    _this.activeIndex = 0;
7713    _this.centerIndex = 0;
7714    _this.activeLoaderIndex = 0;
7715    _this.activeLoopIndex = 0;
7716    _this.previousIndex = null;
7717    _this.velocity = 0;
7718    _this.snapGrid = [];
7719    _this.slidesGrid = [];
7720    _this.imagesToLoad = [];
7721    _this.imagesLoaded = 0;
7722    _this.wrapperLeft = 0;
7723    _this.wrapperRight = 0;
7724    _this.wrapperTop = 0;
7725    _this.wrapperBottom = 0;
7726    _this.isAndroid = navigator.userAgent.toLowerCase().indexOf('android') >= 0;
7727    var wrapper, slideSize, wrapperSize, direction, isScrolling, containerSize;
7728
7729    /*=========================
7730      Default Parameters
7731      ===========================*/
7732    var defaults = {
7733        eventTarget: 'wrapper', // or 'container'
7734        mode : 'horizontal', // or 'vertical'
7735        touchRatio : 1,
7736        speed : 300,
7737        freeMode : false,
7738        freeModeFluid : false,
7739        momentumRatio: 1,
7740        momentumBounce: true,
7741        momentumBounceRatio: 1,
7742        slidesPerView : 1,
7743        slidesPerGroup : 1,
7744        slidesPerViewFit: true, //Fit to slide when spv "auto" and slides larger than container
7745        simulateTouch : true,
7746        followFinger : true,
7747        shortSwipes : true,
7748        longSwipesRatio: 0.5,
7749        moveStartThreshold: false,
7750        onlyExternal : false,
7751        createPagination : true,
7752        pagination : false,
7753        paginationElement: 'span',
7754        paginationClickable: false,
7755        paginationAsRange: true,
7756        resistance : true, // or false or 100%
7757        scrollContainer : false,
7758        preventLinks : true,
7759        preventLinksPropagation: false,
7760        noSwiping : false, // or class
7761        noSwipingClass : 'swiper-no-swiping', //:)
7762        initialSlide: 0,
7763        keyboardControl: false,
7764        mousewheelControl : false,
7765        mousewheelControlForceToAxis : false,
7766        useCSS3Transforms : true,
7767        // Autoplay
7768        autoplay: false,
7769        autoplayDisableOnInteraction: true,
7770        autoplayStopOnLast: false,
7771        //Loop mode
7772        loop: false,
7773        loopAdditionalSlides: 0,
7774        // Round length values
7775        roundLengths: false,
7776        //Auto Height
7777        calculateHeight: false,
7778        cssWidthAndHeight: false,
7779        //Images Preloader
7780        updateOnImagesReady : true,
7781        //Form elements
7782        releaseFormElements : true,
7783        //Watch for active slide, useful when use effects on different slide states
7784        watchActiveIndex: false,
7785        //Slides Visibility Fit
7786        visibilityFullFit : false,
7787        //Slides Offset
7788        offsetPxBefore : 0,
7789        offsetPxAfter : 0,
7790        offsetSlidesBefore : 0,
7791        offsetSlidesAfter : 0,
7792        centeredSlides: false,
7793        //Queue callbacks
7794        queueStartCallbacks : false,
7795        queueEndCallbacks : false,
7796        //Auto Resize
7797        autoResize : true,
7798        resizeReInit : false,
7799        //DOMAnimation
7800        DOMAnimation : true,
7801        //Slides Loader
7802        loader: {
7803            slides: [], //array with slides
7804            slidesHTMLType: 'inner', // or 'outer'
7805            surroundGroups: 1, //keep preloaded slides groups around view
7806            logic: 'reload', //or 'change'
7807            loadAllSlides: false
7808        },
7809        //Namespace
7810        slideElement: 'div',
7811        slideClass: 'swiper-slide',
7812        slideActiveClass: 'swiper-slide-active',
7813        slideVisibleClass: 'swiper-slide-visible',
7814        slideDuplicateClass: 'swiper-slide-duplicate',
7815        wrapperClass: 'mk-swiper-wrapper',
7816        paginationElementClass: 'swiper-pagination-switch',
7817        paginationActiveClass: 'swiper-active-switch',
7818        paginationVisibleClass: 'swiper-visible-switch'
7819    };
7820    params = params || {};
7821    for (var prop in defaults) {
7822        if (prop in params && typeof params[prop] === 'object') {
7823            for (var subProp in defaults[prop]) {
7824                if (! (subProp in params[prop])) {
7825                    params[prop][subProp] = defaults[prop][subProp];
7826                }
7827            }
7828        }
7829        else if (! (prop in params)) {
7830            params[prop] = defaults[prop];
7831        }
7832    }
7833    _this.params = params;
7834    if (params.scrollContainer) {
7835        params.freeMode = true;
7836        params.freeModeFluid = true;
7837    }
7838    if (params.loop) {
7839        params.resistance = '100%';
7840    }
7841    var isH = params.mode === 'horizontal';
7842
7843    /*=========================
7844      Define Touch Events
7845      ===========================*/
7846    var desktopEvents = ['mousedown', 'mousemove', 'mouseup'];
7847    if (_this.browser.ie10) desktopEvents = ['MSPointerDown', 'MSPointerMove', 'MSPointerUp'];
7848    if (_this.browser.ie11) desktopEvents = ['pointerdown', 'pointermove', 'pointerup'];
7849
7850    _this.touchEvents = {
7851        touchStart : _this.support.touch || !params.simulateTouch  ? 'touchstart' : desktopEvents[0],
7852        touchMove : _this.support.touch || !params.simulateTouch ? 'touchmove' : desktopEvents[1],
7853        touchEnd : _this.support.touch || !params.simulateTouch ? 'touchend' : desktopEvents[2]
7854    };
7855
7856    /*=========================
7857      Wrapper
7858      ===========================*/
7859    for (var i = _this.container.childNodes.length - 1; i >= 0; i--) {
7860        if (_this.container.childNodes[i].className) {
7861            var _wrapperClasses = _this.container.childNodes[i].className.split(/\s+/);
7862            for (var j = 0; j < _wrapperClasses.length; j++) {
7863                if (_wrapperClasses[j] === params.wrapperClass) {
7864                    wrapper = _this.container.childNodes[i];
7865                }
7866            }
7867        }
7868    }
7869
7870    _this.wrapper = wrapper;
7871    /*=========================
7872      Slide API
7873      ===========================*/
7874    _this._extendSwiperSlide = function  (el) {
7875        el.append = function () {
7876            if (params.loop) {
7877                el.insertAfter(_this.slides.length - _this.loopedSlides);
7878            }
7879            else {
7880                _this.wrapper.appendChild(el);
7881                _this.reInit();
7882            }
7883
7884            return el;
7885        };
7886        el.prepend = function () {
7887            if (params.loop) {
7888                _this.wrapper.insertBefore(el, _this.slides[_this.loopedSlides]);
7889                _this.removeLoopedSlides();
7890                _this.calcSlides();
7891                _this.createLoop();
7892            }
7893            else {
7894                _this.wrapper.insertBefore(el, _this.wrapper.firstChild);
7895            }
7896            _this.reInit();
7897            return el;
7898        };
7899        el.insertAfter = function (index) {
7900            if (typeof index === 'undefined') return false;
7901            var beforeSlide;
7902
7903            if (params.loop) {
7904                beforeSlide = _this.slides[index + 1 + _this.loopedSlides];
7905                if (beforeSlide) {
7906                    _this.wrapper.insertBefore(el, beforeSlide);
7907                }
7908                else {
7909                    _this.wrapper.appendChild(el);
7910                }
7911                _this.removeLoopedSlides();
7912                _this.calcSlides();
7913                _this.createLoop();
7914            }
7915            else {
7916                beforeSlide = _this.slides[index + 1];
7917                _this.wrapper.insertBefore(el, beforeSlide);
7918            }
7919            _this.reInit();
7920            return el;
7921        };
7922        el.clone = function () {
7923            return _this._extendSwiperSlide(el.cloneNode(true));
7924        };
7925        el.remove = function () {
7926            _this.wrapper.removeChild(el);
7927            _this.reInit();
7928        };
7929        el.html = function (html) {
7930            if (typeof html === 'undefined') {
7931                return el.innerHTML;
7932            }
7933            else {
7934                el.innerHTML = html;
7935                return el;
7936            }
7937        };
7938        el.index = function () {
7939            var index;
7940            for (var i = _this.slides.length - 1; i >= 0; i--) {
7941                if (el === _this.slides[i]) index = i;
7942            }
7943            return index;
7944        };
7945        el.isActive = function () {
7946            if (el.index() === _this.activeIndex) return true;
7947            else return false;
7948        };
7949        if (!el.swiperSlideDataStorage) el.swiperSlideDataStorage = {};
7950        el.getData = function (name) {
7951            return el.swiperSlideDataStorage[name];
7952        };
7953        el.setData = function (name, value) {
7954            el.swiperSlideDataStorage[name] = value;
7955            return el;
7956        };
7957        el.data = function (name, value) {
7958            if (typeof value === 'undefined') {
7959                return el.getAttribute('data-' + name);
7960            }
7961            else {
7962                el.setAttribute('data-' + name, value);
7963                return el;
7964            }
7965        };
7966        el.getWidth = function (outer, round) {
7967            return _this.h.getWidth(el, outer, round);
7968        };
7969        el.getHeight = function (outer, round) {
7970            return _this.h.getHeight(el, outer, round);
7971        };
7972        el.getOffset = function () {
7973            return _this.h.getOffset(el);
7974        };
7975        return el;
7976    };
7977
7978    //Calculate information about number of slides
7979    _this.calcSlides = function (forceCalcSlides) {
7980        var oldNumber = _this.slides ? _this.slides.length : false;
7981        _this.slides = [];
7982        _this.displaySlides = [];
7983        for (var i = 0; i < _this.wrapper.childNodes.length; i++) {
7984            if (_this.wrapper.childNodes[i].className) {
7985                var _className = _this.wrapper.childNodes[i].className;
7986                var _slideClasses = _className.split(/\s+/);
7987                for (var j = 0; j < _slideClasses.length; j++) {
7988                    if (_slideClasses[j] === params.slideClass) {
7989                        _this.slides.push(_this.wrapper.childNodes[i]);
7990                    }
7991                }
7992            }
7993        }
7994        for (i = _this.slides.length - 1; i >= 0; i--) {
7995            _this._extendSwiperSlide(_this.slides[i]);
7996        }
7997        if (oldNumber === false) return;
7998        if (oldNumber !== _this.slides.length || forceCalcSlides) {
7999
8000            // Number of slides has been changed
8001            removeSlideEvents();
8002            addSlideEvents();
8003            _this.updateActiveSlide();
8004            if (_this.params.pagination) _this.createPagination();
8005            _this.callPlugins('numberOfSlidesChanged');
8006        }
8007    };
8008
8009    //Create Slide
8010    _this.createSlide = function (html, slideClassList, el) {
8011        slideClassList = slideClassList || _this.params.slideClass;
8012        el = el || params.slideElement;
8013        var newSlide = document.createElement(el);
8014        newSlide.innerHTML = html || '';
8015        newSlide.className = slideClassList;
8016        return _this._extendSwiperSlide(newSlide);
8017    };
8018
8019    //Append Slide
8020    _this.appendSlide = function (html, slideClassList, el) {
8021        if (!html) return;
8022        if (html.nodeType) {
8023            return _this._extendSwiperSlide(html).append();
8024        }
8025        else {
8026            return _this.createSlide(html, slideClassList, el).append();
8027        }
8028    };
8029    _this.prependSlide = function (html, slideClassList, el) {
8030        if (!html) return;
8031        if (html.nodeType) {
8032            return _this._extendSwiperSlide(html).prepend();
8033        }
8034        else {
8035            return _this.createSlide(html, slideClassList, el).prepend();
8036        }
8037    };
8038    _this.insertSlideAfter = function (index, html, slideClassList, el) {
8039        if (typeof index === 'undefined') return false;
8040        if (html.nodeType) {
8041            return _this._extendSwiperSlide(html).insertAfter(index);
8042        }
8043        else {
8044            return _this.createSlide(html, slideClassList, el).insertAfter(index);
8045        }
8046    };
8047    _this.removeSlide = function (index) {
8048        if (_this.slides[index]) {
8049            if (params.loop) {
8050                if (!_this.slides[index + _this.loopedSlides]) return false;
8051                _this.slides[index + _this.loopedSlides].remove();
8052                _this.removeLoopedSlides();
8053                _this.calcSlides();
8054                _this.createLoop();
8055            }
8056            else _this.slides[index].remove();
8057            return true;
8058        }
8059        else return false;
8060    };
8061    _this.removeLastSlide = function () {
8062        if (_this.slides.length > 0) {
8063            if (params.loop) {
8064                _this.slides[_this.slides.length - 1 - _this.loopedSlides].remove();
8065                _this.removeLoopedSlides();
8066                _this.calcSlides();
8067                _this.createLoop();
8068            }
8069            else _this.slides[_this.slides.length - 1].remove();
8070            return true;
8071        }
8072        else {
8073            return false;
8074        }
8075    };
8076    _this.removeAllSlides = function () {
8077        for (var i = _this.slides.length - 1; i >= 0; i--) {
8078            _this.slides[i].remove();
8079        }
8080    };
8081    _this.getSlide = function (index) {
8082        return _this.slides[index];
8083    };
8084    _this.getLastSlide = function () {
8085        return _this.slides[_this.slides.length - 1];
8086    };
8087    _this.getFirstSlide = function () {
8088        return _this.slides[0];
8089    };
8090
8091    //Currently Active Slide
8092    _this.activeSlide = function () {
8093        return _this.slides[_this.activeIndex];
8094    };
8095
8096    /*=========================
8097     Wrapper for Callbacks : Allows additive callbacks via function arrays
8098     ===========================*/
8099    _this.fireCallback = function () {
8100        var callback = arguments[0];
8101        if (Object.prototype.toString.call(callback) === '[object Array]') {
8102            for (var i = 0; i < callback.length; i++) {
8103                if (typeof callback[i] === 'function') {
8104                    callback[i](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
8105                }
8106            }
8107        } else if (Object.prototype.toString.call(callback) === '[object String]') {
8108            if (params['on' + callback]) _this.fireCallback(params['on' + callback]);
8109        } else {
8110            callback(arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
8111        }
8112    };
8113    function isArray(obj) {
8114        if (Object.prototype.toString.apply(obj) === '[object Array]') return true;
8115        return false;
8116    }
8117
8118    /**
8119     * Allows user to add callbacks, rather than replace them
8120     * @param callback
8121     * @param func
8122     * @return {*}
8123     */
8124    _this.addCallback = function (callback, func) {
8125        var _this = this, tempFunc;
8126        if (_this.params['on' + callback]) {
8127            if (isArray(this.params['on' + callback])) {
8128                return this.params['on' + callback].push(func);
8129            } else if (typeof this.params['on' + callback] === 'function') {
8130                tempFunc = this.params['on' + callback];
8131                this.params['on' + callback] = [];
8132                this.params['on' + callback].push(tempFunc);
8133                return this.params['on' + callback].push(func);
8134            }
8135        } else {
8136            this.params['on' + callback] = [];
8137            return this.params['on' + callback].push(func);
8138        }
8139    };
8140    _this.removeCallbacks = function (callback) {
8141        if (_this.params['on' + callback]) {
8142            _this.params['on' + callback] = null;
8143        }
8144    };
8145
8146    /*=========================
8147      Plugins API
8148      ===========================*/
8149    var _plugins = [];
8150    for (var plugin in _this.plugins) {
8151        if (params[plugin]) {
8152            var p = _this.plugins[plugin](_this, params[plugin]);
8153            if (p) _plugins.push(p);
8154        }
8155    }
8156    _this.callPlugins = function (method, args) {
8157        if (!args) args = {};
8158        for (var i = 0; i < _plugins.length; i++) {
8159            if (method in _plugins[i]) {
8160                _plugins[i][method](args);
8161            }
8162        }
8163    };
8164
8165    /*=========================
8166      Windows Phone 8 Fix
8167      ===========================*/
8168    if ((_this.browser.ie10 || _this.browser.ie11) && !params.onlyExternal) {
8169        _this.wrapper.classList.add('swiper-wp8-' + (isH ? 'horizontal' : 'vertical'));
8170    }
8171
8172    /*=========================
8173      Free Mode Class
8174      ===========================*/
8175    if (params.freeMode) {
8176        _this.container.className += ' swiper-free-mode';
8177    }
8178
8179    /*==================================================
8180        Init/Re-init/Resize Fix
8181    ====================================================*/
8182    _this.initialized = false;
8183    _this.init = function (force, forceCalcSlides) {
8184        var _width = _this.h.getWidth(_this.container, false, params.roundLengths);
8185        var _height = _this.h.getHeight(_this.container, false, params.roundLengths);
8186        if (_width === _this.width && _height === _this.height && !force) return;
8187        
8188        _this.width = _width;
8189        _this.height = _height;
8190
8191        var slideWidth, slideHeight, slideMaxHeight, wrapperWidth, wrapperHeight, slideLeft;
8192        var i; // loop index variable to avoid JSHint W004 / W038
8193        containerSize = isH ? _width : _height;
8194        var wrapper = _this.wrapper;
8195
8196        if (force) {
8197            _this.calcSlides(forceCalcSlides);
8198        }
8199
8200        if (params.slidesPerView === 'auto') {
8201            //Auto mode
8202            var slidesWidth = 0;
8203            var slidesHeight = 0;
8204
8205            //Unset Styles
8206            if (params.slidesOffset > 0) {
8207                wrapper.style.paddingLeft = '';
8208                wrapper.style.paddingRight = '';
8209                wrapper.style.paddingTop = '';
8210                wrapper.style.paddingBottom = '';
8211            }
8212            wrapper.style.width = '';
8213            wrapper.style.height = '';
8214            if (params.offsetPxBefore > 0) {
8215                if (isH) _this.wrapperLeft = params.offsetPxBefore;
8216                else _this.wrapperTop = params.offsetPxBefore;
8217            }
8218            if (params.offsetPxAfter > 0) {
8219                if (isH) _this.wrapperRight = params.offsetPxAfter;
8220                else _this.wrapperBottom = params.offsetPxAfter;
8221            }
8222
8223            if (params.centeredSlides) {
8224                if (isH) {
8225                    _this.wrapperLeft = (containerSize - this.slides[0].getWidth(true, params.roundLengths)) / 2;
8226                    _this.wrapperRight = (containerSize - _this.slides[_this.slides.length - 1].getWidth(true, params.roundLengths)) / 2;
8227                }
8228                else {
8229                    _this.wrapperTop = (containerSize - _this.slides[0].getHeight(true, params.roundLengths)) / 2;
8230                    _this.wrapperBottom = (containerSize - _this.slides[_this.slides.length - 1].getHeight(true, params.roundLengths)) / 2;
8231                }
8232            }
8233
8234            if (isH) {
8235                if (_this.wrapperLeft >= 0) wrapper.style.paddingLeft = _this.wrapperLeft + 'px';
8236                if (_this.wrapperRight >= 0) wrapper.style.paddingRight = _this.wrapperRight + 'px';
8237            }
8238            else {
8239                if (_this.wrapperTop >= 0) wrapper.style.paddingTop = _this.wrapperTop + 'px';
8240                if (_this.wrapperBottom >= 0) wrapper.style.paddingBottom = _this.wrapperBottom + 'px';
8241            }
8242            slideLeft = 0;
8243            var centeredSlideLeft = 0;
8244            _this.snapGrid = [];
8245            _this.slidesGrid = [];
8246
8247            slideMaxHeight = 0;
8248            for (i = 0; i < _this.slides.length; i++) {
8249                slideWidth = _this.slides[i].getWidth(true, params.roundLengths);
8250                slideHeight = _this.slides[i].getHeight(true, params.roundLengths);
8251                if (params.calculateHeight) {
8252                    slideMaxHeight = Math.max(slideMaxHeight, slideHeight);
8253                }
8254                var _slideSize = isH ? slideWidth : slideHeight;
8255                if (params.centeredSlides) {
8256                    var nextSlideWidth = i === _this.slides.length - 1 ? 0 : _this.slides[i + 1].getWidth(true, params.roundLengths);
8257                    var nextSlideHeight = i === _this.slides.length - 1 ? 0 : _this.slides[i + 1].getHeight(true, params.roundLengths);
8258                    var nextSlideSize = isH ? nextSlideWidth : nextSlideHeight;
8259                    if (_slideSize > containerSize) {
8260                        if (params.slidesPerViewFit) {
8261                            _this.snapGrid.push(slideLeft + _this.wrapperLeft);
8262                            _this.snapGrid.push(slideLeft + _slideSize - containerSize + _this.wrapperLeft);
8263                        }
8264                        else {
8265                            for (var j = 0; j <= Math.floor(_slideSize / (containerSize + _this.wrapperLeft)); j++) {
8266                                if (j === 0) _this.snapGrid.push(slideLeft + _this.wrapperLeft);
8267                                else _this.snapGrid.push(slideLeft + _this.wrapperLeft + containerSize * j);
8268                            }
8269                        }
8270                        _this.slidesGrid.push(slideLeft + _this.wrapperLeft);
8271                    }
8272                    else {
8273                        _this.snapGrid.push(centeredSlideLeft);
8274                        _this.slidesGrid.push(centeredSlideLeft);
8275                    }
8276                    centeredSlideLeft += _slideSize / 2 + nextSlideSize / 2;
8277                }
8278                else {
8279                    if (_slideSize > containerSize) {
8280                        if (params.slidesPerViewFit) {
8281                            _this.snapGrid.push(slideLeft);
8282                            _this.snapGrid.push(slideLeft + _slideSize - containerSize);
8283                        }
8284                        else {
8285                            if (containerSize !== 0) {
8286                                for (var k = 0; k <= Math.floor(_slideSize / containerSize); k++) {
8287                                    _this.snapGrid.push(slideLeft + containerSize * k);
8288                                }
8289                            }
8290                            else {
8291                                _this.snapGrid.push(slideLeft);
8292                            }
8293                        }
8294                            
8295                    }
8296                    else {
8297                        _this.snapGrid.push(slideLeft);
8298                    }
8299                    _this.slidesGrid.push(slideLeft);
8300                }
8301
8302                slideLeft += _slideSize;
8303
8304                slidesWidth += slideWidth;
8305                slidesHeight += slideHeight;
8306            }
8307            if (params.calculateHeight) _this.height = slideMaxHeight;
8308            if (isH) {
8309                wrapperSize = slidesWidth + _this.wrapperRight + _this.wrapperLeft;
8310                wrapper.style.width = (slidesWidth) + 'px';
8311                wrapper.style.height = (_this.height) + 'px';
8312            }
8313            else {
8314                wrapperSize = slidesHeight + _this.wrapperTop + _this.wrapperBottom;
8315                wrapper.style.width = (_this.width) + 'px';
8316                wrapper.style.height = (slidesHeight) + 'px';
8317            }
8318
8319        }
8320        else if (params.scrollContainer) {
8321            //Scroll Container
8322            wrapper.style.width = '';
8323            wrapper.style.height = '';
8324            wrapperWidth = _this.slides[0].getWidth(true, params.roundLengths);
8325            wrapperHeight = _this.slides[0].getHeight(true, params.roundLengths);
8326            wrapperSize = isH ? wrapperWidth : wrapperHeight;
8327            wrapper.style.width = wrapperWidth + 'px';
8328            wrapper.style.height = wrapperHeight + 'px';
8329            slideSize = isH ? wrapperWidth : wrapperHeight;
8330
8331        }
8332        else {
8333            //For usual slides
8334            if (params.calculateHeight) {
8335                slideMaxHeight = 0;
8336                wrapperHeight = 0;
8337                //ResetWrapperSize
8338                if (!isH) _this.container.style.height = '';
8339                wrapper.style.height = '';
8340
8341                for (i = 0; i < _this.slides.length; i++) {
8342                    //ResetSlideSize
8343                    _this.slides[i].style.height = '';
8344                    slideMaxHeight = Math.max(_this.slides[i].getHeight(true), slideMaxHeight);
8345                    if (!isH) wrapperHeight += _this.slides[i].getHeight(true);
8346                }
8347                slideHeight = slideMaxHeight;
8348                _this.height = slideHeight;
8349
8350                if (isH) wrapperHeight = slideHeight;
8351                else {
8352                    containerSize = slideHeight;
8353                    _this.container.style.height = containerSize + 'px';
8354                }
8355            }
8356            else {
8357                slideHeight = isH ? _this.height : _this.height / params.slidesPerView;
8358                if (params.roundLengths) slideHeight = Math.round(slideHeight);
8359                wrapperHeight = isH ? _this.height : _this.slides.length * slideHeight;
8360            }
8361            slideWidth = isH ? _this.width / params.slidesPerView : _this.width;
8362            if (params.roundLengths) slideWidth = Math.round(slideWidth);
8363            wrapperWidth = isH ? _this.slides.length * slideWidth : _this.width;
8364            slideSize = isH ? slideWidth : slideHeight;
8365
8366            if (params.offsetSlidesBefore > 0) {
8367                if (isH) _this.wrapperLeft = slideSize * params.offsetSlidesBefore;
8368                else _this.wrapperTop = slideSize * params.offsetSlidesBefore;
8369            }
8370            if (params.offsetSlidesAfter > 0) {
8371                if (isH) _this.wrapperRight = slideSize * params.offsetSlidesAfter;
8372                else _this.wrapperBottom = slideSize * params.offsetSlidesAfter;
8373            }
8374            if (params.offsetPxBefore > 0) {
8375                if (isH) _this.wrapperLeft = params.offsetPxBefore;
8376                else _this.wrapperTop = params.offsetPxBefore;
8377            }
8378            if (params.offsetPxAfter > 0) {
8379                if (isH) _this.wrapperRight = params.offsetPxAfter;
8380                else _this.wrapperBottom = params.offsetPxAfter;
8381            }
8382            if (params.centeredSlides) {
8383                if (isH) {
8384                    _this.wrapperLeft = (containerSize - slideSize) / 2;
8385                    _this.wrapperRight = (containerSize - slideSize) / 2;
8386                }
8387                else {
8388                    _this.wrapperTop = (containerSize - slideSize) / 2;
8389                    _this.wrapperBottom = (containerSize - slideSize) / 2;
8390                }
8391            }
8392            if (isH) {
8393                if (_this.wrapperLeft > 0) wrapper.style.paddingLeft = _this.wrapperLeft + 'px';
8394                if (_this.wrapperRight > 0) wrapper.style.paddingRight = _this.wrapperRight + 'px';
8395            }
8396            else {
8397                if (_this.wrapperTop > 0) wrapper.style.paddingTop = _this.wrapperTop + 'px';
8398                if (_this.wrapperBottom > 0) wrapper.style.paddingBottom = _this.wrapperBottom + 'px';
8399            }
8400
8401            wrapperSize = isH ? wrapperWidth + _this.wrapperRight + _this.wrapperLeft : wrapperHeight + _this.wrapperTop + _this.wrapperBottom;
8402            if (!params.cssWidthAndHeight) {
8403                if (parseFloat(wrapperWidth) > 0) {
8404                    wrapper.style.width = wrapperWidth + 'px';
8405                }
8406                if (parseFloat(wrapperHeight) > 0) {
8407                    wrapper.style.height = wrapperHeight + 'px';
8408                }
8409            }
8410            slideLeft = 0;
8411            _this.snapGrid = [];
8412            _this.slidesGrid = [];
8413            for (i = 0; i < _this.slides.length; i++) {
8414                _this.snapGrid.push(slideLeft);
8415                _this.slidesGrid.push(slideLeft);
8416                slideLeft += slideSize;
8417                if (!params.cssWidthAndHeight) {
8418                    if (parseFloat(slideWidth) > 0) {
8419                        _this.slides[i].style.width = slideWidth + 'px';
8420                    }
8421                    if (parseFloat(slideHeight) > 0) {
8422                        _this.slides[i].style.height = slideHeight + 'px';
8423                    }
8424                }
8425            }
8426
8427        }
8428
8429        if (!_this.initialized) {
8430            _this.callPlugins('onFirstInit');
8431            if (params.onFirstInit) _this.fireCallback(params.onFirstInit, _this);
8432        }
8433        else {
8434            _this.callPlugins('onInit');
8435            if (params.onInit) _this.fireCallback(params.onInit, _this);
8436        }
8437        _this.initialized = true;
8438    };
8439
8440    _this.reInit = function (forceCalcSlides) {
8441        _this.init(true, forceCalcSlides);
8442    };
8443
8444    _this.resizeFix = function (reInit) {
8445        _this.callPlugins('beforeResizeFix');
8446
8447        _this.init(params.resizeReInit || reInit);
8448
8449        // swipe to active slide in fixed mode
8450        if (!params.freeMode) {
8451            _this.swipeTo((params.loop ? _this.activeLoopIndex : _this.activeIndex), 0, false);
8452            // Fix autoplay
8453            if (params.autoplay) {
8454                if (_this.support.transitions && typeof autoplayTimeoutId !== 'undefined') {
8455                    if (typeof autoplayTimeoutId !== 'undefined') {
8456                        clearTimeout(autoplayTimeoutId);
8457                        autoplayTimeoutId = undefined;
8458                        _this.startAutoplay();
8459                    }
8460                }
8461                else {
8462                    if (typeof autoplayIntervalId !== 'undefined') {
8463                        clearInterval(autoplayIntervalId);
8464                        autoplayIntervalId = undefined;
8465                        _this.startAutoplay();
8466                    }
8467                }
8468            }
8469        }
8470        // move wrapper to the beginning in free mode
8471        else if (_this.getWrapperTranslate() < -maxWrapperPosition()) {
8472            _this.setWrapperTransition(0);
8473            _this.setWrapperTranslate(-maxWrapperPosition());
8474        }
8475
8476        _this.callPlugins('afterResizeFix');
8477    };
8478
8479    /*==========================================
8480        Max and Min Positions
8481    ============================================*/
8482    function maxWrapperPosition() {
8483        var a = (wrapperSize - containerSize);
8484        if (params.freeMode) {
8485            a = wrapperSize - containerSize;
8486        }
8487        // if (params.loop) a -= containerSize;
8488        if (params.slidesPerView > _this.slides.length && !params.centeredSlides) {
8489            a = 0;
8490        }
8491        if (a < 0) a = 0;
8492        return a;
8493    }
8494
8495    /*==========================================
8496        Event Listeners
8497    ============================================*/
8498    function initEvents() {
8499        var bind = _this.h.addEventListener;
8500        var eventTarget = params.eventTarget === 'wrapper' ? _this.wrapper : _this.container;
8501        //Touch Events
8502        if (! (_this.browser.ie10 || _this.browser.ie11)) {
8503            if (_this.support.touch) {
8504                bind(eventTarget, 'touchstart', onTouchStart);
8505                bind(eventTarget, 'touchmove', onTouchMove);
8506                bind(eventTarget, 'touchend', onTouchEnd);
8507            }
8508            if (params.simulateTouch) {
8509                bind(eventTarget, 'mousedown', onTouchStart);
8510                bind(document, 'mousemove', onTouchMove);
8511                bind(document, 'mouseup', onTouchEnd);
8512            }
8513        }
8514        else {
8515            bind(eventTarget, _this.touchEvents.touchStart, onTouchStart);
8516            bind(document, _this.touchEvents.touchMove, onTouchMove);
8517            bind(document, _this.touchEvents.touchEnd, onTouchEnd);
8518        }
8519
8520        //Resize Event
8521        if (params.autoResize) {
8522            bind(window, 'resize', _this.resizeFix);
8523        }
8524        //Slide Events
8525        addSlideEvents();
8526        //Mousewheel
8527        _this._wheelEvent = false;
8528        if (params.mousewheelControl) {
8529            if (document.onmousewheel !== undefined) {
8530                _this._wheelEvent = 'mousewheel';
8531            }
8532            if (!_this._wheelEvent) {
8533                try {
8534                    new WheelEvent('wheel');
8535                    _this._wheelEvent = 'wheel';
8536                } catch (e) {}
8537            }
8538            if (!_this._wheelEvent) {
8539                _this._wheelEvent = 'DOMMouseScroll';
8540            }
8541            if (_this._wheelEvent) {
8542                bind(_this.container, _this._wheelEvent, handleMousewheel);
8543            }
8544        }
8545
8546        //Keyboard
8547        function _loadImage(src) {
8548            var image = new Image();
8549            image.onload = function () {
8550                if (_this && _this.imagesLoaded !== undefined) _this.imagesLoaded++;
8551                if (_this.imagesLoaded === _this.imagesToLoad.length) {
8552                    _this.reInit();
8553                    if (params.onImagesReady) _this.fireCallback(params.onImagesReady, _this);
8554                }
8555            };
8556            image.src = src;
8557        }
8558
8559        if (params.keyboardControl) {
8560            bind(document, 'keydown', handleKeyboardKeys);
8561        }
8562        if (params.updateOnImagesReady) {
8563            _this.imagesToLoad = $$('img', _this.container);
8564
8565            for (var i = 0; i < _this.imagesToLoad.length; i++) {
8566                _loadImage(_this.imagesToLoad[i].getAttribute('src'));
8567            }
8568        }
8569    }
8570
8571    //Remove Event Listeners
8572    _this.destroy = function () {
8573        var unbind = _this.h.removeEventListener;
8574        var eventTarget = params.eventTarget === 'wrapper' ? _this.wrapper : _this.container;
8575        //Touch Events
8576        if (! (_this.browser.ie10 || _this.browser.ie11)) {
8577            if (_this.support.touch) {
8578                unbind(eventTarget, 'touchstart', onTouchStart);
8579                unbind(eventTarget, 'touchmove', onTouchMove);
8580                unbind(eventTarget, 'touchend', onTouchEnd);
8581            }
8582            if (params.simulateTouch) {
8583                unbind(eventTarget, 'mousedown', onTouchStart);
8584                unbind(document, 'mousemove', onTouchMove);
8585                unbind(document, 'mouseup', onTouchEnd);
8586            }
8587        }
8588        else {
8589            unbind(eventTarget, _this.touchEvents.touchStart, onTouchStart);
8590            unbind(document, _this.touchEvents.touchMove, onTouchMove);
8591            unbind(document, _this.touchEvents.touchEnd, onTouchEnd);
8592        }
8593
8594        //Resize Event
8595        if (params.autoResize) {
8596            unbind(window, 'resize', _this.resizeFix);
8597        }
8598
8599        //Init Slide Events
8600        removeSlideEvents();
8601
8602        //Pagination
8603        if (params.paginationClickable) {
8604            removePaginationEvents();
8605        }
8606
8607        //Mousewheel
8608        if (params.mousewheelControl && _this._wheelEvent) {
8609            unbind(_this.container, _this._wheelEvent, handleMousewheel);
8610        }
8611
8612        //Keyboard
8613        if (params.keyboardControl) {
8614            unbind(document, 'keydown', handleKeyboardKeys);
8615        }
8616
8617        //Stop autoplay
8618        if (params.autoplay) {
8619            _this.stopAutoplay();
8620        }
8621        _this.callPlugins('onDestroy');
8622
8623        //Destroy variable
8624        _this = null;
8625    };
8626
8627    function addSlideEvents() {
8628        var bind = _this.h.addEventListener,
8629            i;
8630
8631        //Prevent Links Events
8632        if (params.preventLinks) {
8633            var links = $$('a', _this.container);
8634            for (i = 0; i < links.length; i++) {
8635                bind(links[i], 'click', preventClick);
8636            }
8637        }
8638        //Release Form Elements
8639        if (params.releaseFormElements) {
8640            var formElements = $$('input, textarea, select', _this.container);
8641            for (i = 0; i < formElements.length; i++) {
8642                bind(formElements[i], _this.touchEvents.touchStart, releaseForms, true);
8643            }
8644        }
8645
8646        //Slide Clicks & Touches
8647        if (params.onSlideClick) {
8648            for (i = 0; i < _this.slides.length; i++) {
8649                bind(_this.slides[i], 'click', slideClick);
8650            }
8651        }
8652        if (params.onSlideTouch) {
8653            for (i = 0; i < _this.slides.length; i++) {
8654                bind(_this.slides[i], _this.touchEvents.touchStart, slideTouch);
8655            }
8656        }
8657    }
8658    function removeSlideEvents() {
8659        var unbind = _this.h.removeEventListener,
8660            i;
8661
8662        //Slide Clicks & Touches
8663        if (params.onSlideClick) {
8664            for (i = 0; i < _this.slides.length; i++) {
8665                unbind(_this.slides[i], 'click', slideClick);
8666            }
8667        }
8668        if (params.onSlideTouch) {
8669            for (i = 0; i < _this.slides.length; i++) {
8670                unbind(_this.slides[i], _this.touchEvents.touchStart, slideTouch);
8671            }
8672        }
8673        //Release Form Elements
8674        if (params.releaseFormElements) {
8675            var formElements = $$('input, textarea, select', _this.container);
8676            for (i = 0; i < formElements.length; i++) {
8677                unbind(formElements[i], _this.touchEvents.touchStart, releaseForms, true);
8678            }
8679        }
8680        //Prevent Links Events
8681        if (params.preventLinks) {
8682            var links = $$('a', _this.container);
8683            for (i = 0; i < links.length; i++) {
8684                unbind(links[i], 'click', preventClick);
8685            }
8686        }
8687    }
8688    /*==========================================
8689        Keyboard Control
8690    ============================================*/
8691    function handleKeyboardKeys(e) {
8692        var kc = e.keyCode || e.charCode;
8693        if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) return;
8694        if (kc === 37 || kc === 39 || kc === 38 || kc === 40) {
8695            var inView = false;
8696            //Check that swiper should be inside of visible area of window
8697            var swiperOffset = _this.h.getOffset(_this.container);
8698            var scrollLeft = _this.h.windowScroll().left;
8699            var scrollTop = _this.h.windowScroll().top;
8700            var windowWidth = _this.h.windowWidth();
8701            var windowHeight = _this.h.windowHeight();
8702            var swiperCoord = [
8703                [swiperOffset.left, swiperOffset.top],
8704                [swiperOffset.left + _this.width, swiperOffset.top],
8705                [swiperOffset.left, swiperOffset.top + _this.height],
8706                [swiperOffset.left + _this.width, swiperOffset.top + _this.height]
8707            ];
8708            for (var i = 0; i < swiperCoord.length; i++) {
8709                var point = swiperCoord[i];
8710                if (
8711                    point[0] >= scrollLeft && point[0] <= scrollLeft + windowWidth &&
8712                    point[1] >= scrollTop && point[1] <= scrollTop + windowHeight
8713                ) {
8714                    inView = true;
8715                }
8716
8717            }
8718            if (!inView) return;
8719        }
8720        if (isH) {
8721            if (kc === 37 || kc === 39) {
8722                if (e.preventDefault) e.preventDefault();
8723                else e.returnValue = false;
8724            }
8725            if (kc === 39) _this.swipeNext();
8726            if (kc === 37) _this.swipePrev();
8727        }
8728        else {
8729            if (kc === 38 || kc === 40) {
8730                if (e.preventDefault) e.preventDefault();
8731                else e.returnValue = false;
8732            }
8733            if (kc === 40) _this.swipeNext();
8734            if (kc === 38) _this.swipePrev();
8735        }
8736    }
8737
8738    _this.disableKeyboardControl = function () {
8739        params.keyboardControl = false;
8740        _this.h.removeEventListener(document, 'keydown', handleKeyboardKeys);
8741    };
8742
8743    _this.enableKeyboardControl = function () {
8744        params.keyboardControl = true;
8745        _this.h.addEventListener(document, 'keydown', handleKeyboardKeys);
8746    };
8747
8748    /*==========================================
8749        Mousewheel Control
8750    ============================================*/
8751    var lastScrollTime = (new Date()).getTime();
8752    function handleMousewheel(e) {
8753        var we = _this._wheelEvent;
8754        var delta = 0;
8755
8756        //Opera & IE
8757        if (e.detail) delta = -e.detail;
8758        //WebKits
8759        else if (we === 'mousewheel') {
8760            if (params.mousewheelControlForceToAxis) {
8761                if (isH) {
8762                    if (Math.abs(e.wheelDeltaX) > Math.abs(e.wheelDeltaY)) delta = e.wheelDeltaX;
8763                    else return;
8764                }
8765                else {
8766                    if (Math.abs(e.wheelDeltaY) > Math.abs(e.wheelDeltaX)) delta = e.wheelDeltaY;
8767                    else return;
8768                }
8769            }
8770            else {
8771                delta = e.wheelDelta;
8772            }
8773        }
8774        //Old FireFox
8775        else if (we === 'DOMMouseScroll') delta = -e.detail;
8776        //New FireFox
8777        else if (we === 'wheel') {
8778            if (params.mousewheelControlForceToAxis) {
8779                if (isH) {
8780                    if (Math.abs(e.deltaX) > Math.abs(e.deltaY)) delta = -e.deltaX;
8781                    else return;
8782                }
8783                else {
8784                    if (Math.abs(e.deltaY) > Math.abs(e.deltaX)) delta = -e.deltaY;
8785                    else return;
8786                }
8787            }
8788            else {
8789                delta = Math.abs(e.deltaX) > Math.abs(e.deltaY) ? - e.deltaX : - e.deltaY;
8790            }
8791        }
8792
8793        if (!params.freeMode) {
8794            if ((new Date()).getTime() - lastScrollTime > 60) {
8795                if (delta < 0) _this.swipeNext();
8796                else _this.swipePrev();
8797            }
8798            lastScrollTime = (new Date()).getTime();
8799
8800        }
8801        else {
8802            //Freemode or scrollContainer:
8803            var position = _this.getWrapperTranslate() + delta;
8804
8805            if (position > 0) position = 0;
8806            if (position < -maxWrapperPosition()) position = -maxWrapperPosition();
8807
8808            _this.setWrapperTransition(0);
8809            _this.setWrapperTranslate(position);
8810            _this.updateActiveSlide(position);
8811
8812            // Return page scroll on edge positions
8813            if (position === 0 || position === -maxWrapperPosition()) return;
8814        }
8815        if (params.autoplay) _this.stopAutoplay(true);
8816
8817        if (e.preventDefault) e.preventDefault();
8818        else e.returnValue = false;
8819        return false;
8820    }
8821    _this.disableMousewheelControl = function () {
8822        if (!_this._wheelEvent) return false;
8823        params.mousewheelControl = false;
8824        _this.h.removeEventListener(_this.container, _this._wheelEvent, handleMousewheel);
8825        return true;
8826    };
8827
8828    _this.enableMousewheelControl = function () {
8829        if (!_this._wheelEvent) return false;
8830        params.mousewheelControl = true;
8831        _this.h.addEventListener(_this.container, _this._wheelEvent, handleMousewheel);
8832        return true;
8833    };
8834
8835    /*=========================
8836      Grab Cursor
8837      ===========================*/
8838    if (params.grabCursor) {
8839        var containerStyle = _this.container.style;
8840        containerStyle.cursor = 'move';
8841        containerStyle.cursor = 'grab';
8842        containerStyle.cursor = '-moz-grab';
8843        containerStyle.cursor = '-webkit-grab';
8844    }
8845
8846    /*=========================
8847      Slides Events Handlers
8848      ===========================*/
8849
8850    _this.allowSlideClick = true;
8851    function slideClick(event) {
8852        if (_this.allowSlideClick) {
8853            setClickedSlide(event);
8854            _this.fireCallback(params.onSlideClick, _this, event);
8855        }
8856    }
8857
8858    function slideTouch(event) {
8859        setClickedSlide(event);
8860        _this.fireCallback(params.onSlideTouch, _this, event);
8861    }
8862
8863    function setClickedSlide(event) {
8864
8865        // IE 6-8 support
8866        if (!event.currentTarget) {
8867            var element = event.srcElement;
8868            do {
8869                if (element.className.indexOf(params.slideClass) > -1) {
8870                    break;
8871                }
8872                element = element.parentNode;
8873            } while (element);
8874            _this.clickedSlide = element;
8875        }
8876        else {
8877            _this.clickedSlide = event.currentTarget;
8878        }
8879
8880        _this.clickedSlideIndex     = _this.slides.indexOf(_this.clickedSlide);
8881        _this.clickedSlideLoopIndex = _this.clickedSlideIndex - (_this.loopedSlides || 0);
8882    }
8883
8884    _this.allowLinks = true;
8885    function preventClick(e) {
8886        if (!_this.allowLinks) {
8887            if (e.preventDefault) e.preventDefault();
8888            else e.returnValue = false;
8889            if (params.preventLinksPropagation && 'stopPropagation' in e) {
8890                e.stopPropagation();
8891            }
8892            return false;
8893        }
8894    }
8895    function releaseForms(e) {
8896        if (e.stopPropagation) e.stopPropagation();
8897        else e.returnValue = false;
8898        return false;
8899
8900    }
8901
8902    /*==================================================
8903        Event Handlers
8904    ====================================================*/
8905    var isTouchEvent = false;
8906    var allowThresholdMove;
8907    var allowMomentumBounce = true;
8908    function onTouchStart(event) {
8909        if (params.preventLinks) _this.allowLinks = true;
8910        //Exit if slider is already was touched
8911        if (_this.isTouched || params.onlyExternal) {
8912            return false;
8913        }
8914
8915        if (params.noSwiping && (event.target || event.srcElement) && noSwipingSlide(event.target || event.srcElement)) return false;
8916        allowMomentumBounce = false;
8917        //Check For Nested Swipers
8918        _this.isTouched = true;
8919        isTouchEvent = event.type === 'touchstart';
8920
8921        if (!isTouchEvent || event.targetTouches.length === 1) {
8922            _this.callPlugins('onTouchStartBegin');
8923
8924            if (!isTouchEvent && !_this.isAndroid) {
8925                if (event.preventDefault) event.preventDefault();
8926                else event.returnValue = false;
8927            }
8928
8929            var pageX = isTouchEvent ? event.targetTouches[0].pageX : (event.pageX || event.clientX);
8930            var pageY = isTouchEvent ? event.targetTouches[0].pageY : (event.pageY || event.clientY);
8931
8932            //Start Touches to check the scrolling
8933            _this.touches.startX = _this.touches.currentX = pageX;
8934            _this.touches.startY = _this.touches.currentY = pageY;
8935
8936            _this.touches.start = _this.touches.current = isH ? pageX : pageY;
8937
8938            //Set Transition Time to 0
8939            _this.setWrapperTransition(0);
8940
8941            //Get Start Translate Position
8942            _this.positions.start = _this.positions.current = _this.getWrapperTranslate();
8943
8944            //Set Transform
8945            _this.setWrapperTranslate(_this.positions.start);
8946
8947            //TouchStartTime
8948            _this.times.start = (new Date()).getTime();
8949
8950            //Unset Scrolling
8951            isScrolling = undefined;
8952
8953            //Set Treshold
8954            if (params.moveStartThreshold > 0) {
8955                allowThresholdMove = false;
8956            }
8957
8958            //CallBack
8959            if (params.onTouchStart) _this.fireCallback(params.onTouchStart, _this, event);
8960            _this.callPlugins('onTouchStartEnd');
8961
8962        }
8963    }
8964    var velocityPrevPosition, velocityPrevTime;
8965    function onTouchMove(event) {
8966        // If slider is not touched - exit
8967        if (!_this.isTouched || params.onlyExternal) return;
8968        if (isTouchEvent && event.type === 'mousemove') return;
8969
8970        var pageX = isTouchEvent ? event.targetTouches[0].pageX : (event.pageX || event.clientX);
8971        var pageY = isTouchEvent ? event.targetTouches[0].pageY : (event.pageY || event.clientY);
8972
8973        //check for scrolling
8974        if (typeof isScrolling === 'undefined' && isH) {
8975            isScrolling = !!(isScrolling || Math.abs(pageY - _this.touches.startY) > Math.abs(pageX - _this.touches.startX));
8976        }
8977        if (typeof isScrolling === 'undefined' && !isH) {
8978            isScrolling = !!(isScrolling || Math.abs(pageY - _this.touches.startY) < Math.abs(pageX - _this.touches.startX));
8979        }
8980        if (isScrolling) {
8981            _this.isTouched = false;
8982            return;
8983        }
8984
8985        //Check For Nested Swipers
8986        if (event.assignedToSwiper) {
8987            _this.isTouched = false;
8988            return;
8989        }
8990        event.assignedToSwiper = true;
8991
8992        //Block inner links
8993        if (params.preventLinks) {
8994            _this.allowLinks = false;
8995        }
8996        if (params.onSlideClick) {
8997            _this.allowSlideClick = false;
8998        }
8999
9000        //Stop AutoPlay if exist
9001        if (params.autoplay) {
9002            _this.stopAutoplay(true);
9003        }
9004        if (!isTouchEvent || event.touches.length === 1) {
9005
9006            //Moved Flag
9007            if (!_this.isMoved) {
9008                _this.callPlugins('onTouchMoveStart');
9009
9010                if (params.loop) {
9011                    _this.fixLoop();
9012                    _this.positions.start = _this.getWrapperTranslate();
9013                }
9014                if (params.onTouchMoveStart) _this.fireCallback(params.onTouchMoveStart, _this);
9015            }
9016            _this.isMoved = true;
9017
9018            // cancel event
9019            if (event.preventDefault) event.preventDefault();
9020            else event.returnValue = false;
9021
9022            _this.touches.current = isH ? pageX : pageY;
9023
9024            _this.positions.current = (_this.touches.current - _this.touches.start) * params.touchRatio + _this.positions.start;
9025
9026            //Resistance Callbacks
9027            if (_this.positions.current > 0 && params.onResistanceBefore) {
9028                _this.fireCallback(params.onResistanceBefore, _this, _this.positions.current);
9029            }
9030            if (_this.positions.current < -maxWrapperPosition() && params.onResistanceAfter) {
9031                _this.fireCallback(params.onResistanceAfter, _this, Math.abs(_this.positions.current + maxWrapperPosition()));
9032            }
9033            //Resistance
9034            if (params.resistance && params.resistance !== '100%') {
9035                var resistance;
9036                //Resistance for Negative-Back sliding
9037                if (_this.positions.current > 0) {
9038                    resistance = 1 - _this.positions.current / containerSize / 2;
9039                    if (resistance < 0.5)
9040                        _this.positions.current = (containerSize / 2);
9041                    else
9042                        _this.positions.current = _this.positions.current * resistance;
9043                }
9044                //Resistance for After-End Sliding
9045                if (_this.positions.current < -maxWrapperPosition()) {
9046
9047                    var diff = (_this.touches.current - _this.touches.start) * params.touchRatio + (maxWrapperPosition() + _this.positions.start);
9048                    resistance = (containerSize + diff) / (containerSize);
9049                    var newPos = _this.positions.current - diff * (1 - resistance) / 2;
9050                    var stopPos = -maxWrapperPosition() - containerSize / 2;
9051
9052                    if (newPos < stopPos || resistance <= 0)
9053                        _this.positions.current = stopPos;
9054                    else
9055                        _this.positions.current = newPos;
9056                }
9057            }
9058            if (params.resistance && params.resistance === '100%') {
9059                //Resistance for Negative-Back sliding
9060                if (_this.positions.current > 0 && !(params.freeMode && !params.freeModeFluid)) {
9061                    _this.positions.current = 0;
9062                }
9063                //Resistance for After-End Sliding
9064                if (_this.positions.current < -maxWrapperPosition() && !(params.freeMode && !params.freeModeFluid)) {
9065                    _this.positions.current = -maxWrapperPosition();
9066                }
9067            }
9068            //Move Slides
9069            if (!params.followFinger) return;
9070
9071            if (!params.moveStartThreshold) {
9072                _this.setWrapperTranslate(_this.positions.current);
9073            }
9074            else {
9075                if (Math.abs(_this.touches.current - _this.touches.start) > params.moveStartThreshold || allowThresholdMove) {
9076                    if (!allowThresholdMove) {
9077                        allowThresholdMove = true;
9078                        _this.touches.start = _this.touches.current;
9079                        return;
9080                    }
9081                    _this.setWrapperTranslate(_this.positions.current);
9082                }
9083                else {
9084                    _this.positions.current = _this.positions.start;
9085                }
9086            }
9087
9088            if (params.freeMode || params.watchActiveIndex) {
9089                _this.updateActiveSlide(_this.positions.current);
9090            }
9091
9092            //Grab Cursor
9093            if (params.grabCursor) {
9094                _this.container.style.cursor = 'move';
9095                _this.container.style.cursor = 'grabbing';
9096                _this.container.style.cursor = '-moz-grabbin';
9097                _this.container.style.cursor = '-webkit-grabbing';
9098            }
9099            //Velocity
9100            if (!velocityPrevPosition) velocityPrevPosition = _this.touches.current;
9101            if (!velocityPrevTime) velocityPrevTime = (new Date()).getTime();
9102            _this.velocity = (_this.touches.current - velocityPrevPosition) / ((new Date()).getTime() - velocityPrevTime) / 2;
9103            if (Math.abs(_this.touches.current - velocityPrevPosition) < 2) _this.velocity = 0;
9104            velocityPrevPosition = _this.touches.current;
9105            velocityPrevTime = (new Date()).getTime();
9106            //Callbacks
9107            _this.callPlugins('onTouchMoveEnd');
9108            if (params.onTouchMove) _this.fireCallback(params.onTouchMove, _this, event);
9109
9110            return false;
9111        }
9112    }
9113    function onTouchEnd(event) {
9114        //Check For scrolling
9115        if (isScrolling) {
9116            _this.swipeReset();
9117        }
9118        // If slider is not touched exit
9119        if (params.onlyExternal || !_this.isTouched) return;
9120        _this.isTouched = false;
9121
9122        //Return Grab Cursor
9123        if (params.grabCursor) {
9124            _this.container.style.cursor = 'move';
9125            _this.container.style.cursor = 'grab';
9126            _this.container.style.cursor = '-moz-grab';
9127            _this.container.style.cursor = '-webkit-grab';
9128        }
9129
9130        //Check for Current Position
9131        if (!_this.positions.current && _this.positions.current !== 0) {
9132            _this.positions.current = _this.positions.start;
9133        }
9134
9135        //For case if slider touched but not moved
9136        if (params.followFinger) {
9137            _this.setWrapperTranslate(_this.positions.current);
9138        }
9139
9140        // TouchEndTime
9141        _this.times.end = (new Date()).getTime();
9142
9143        //Difference
9144        _this.touches.diff = _this.touches.current - _this.touches.start;
9145        _this.touches.abs = Math.abs(_this.touches.diff);
9146
9147        _this.positions.diff = _this.positions.current - _this.positions.start;
9148        _this.positions.abs = Math.abs(_this.positions.diff);
9149
9150        var diff = _this.positions.diff;
9151        var diffAbs = _this.positions.abs;
9152        var timeDiff = _this.times.end - _this.times.start;
9153
9154        if (diffAbs < 5 && (timeDiff) < 300 && _this.allowLinks === false) {
9155            if (!params.freeMode && diffAbs !== 0) _this.swipeReset();
9156            //Release inner links
9157            if (params.preventLinks) {
9158                _this.allowLinks = true;
9159            }
9160            if (params.onSlideClick) {
9161                _this.allowSlideClick = true;
9162            }
9163        }
9164
9165        setTimeout(function () {
9166            //Release inner links
9167            if (params.preventLinks) {
9168                _this.allowLinks = true;
9169            }
9170            if (params.onSlideClick) {
9171                _this.allowSlideClick = true;
9172            }
9173        }, 100);
9174
9175        var maxPosition = maxWrapperPosition();
9176
9177        //Not moved or Prevent Negative Back Sliding/After-End Sliding
9178        if (!_this.isMoved && params.freeMode) {
9179            _this.isMoved = false;
9180            if (params.onTouchEnd) _this.fireCallback(params.onTouchEnd, _this, event);
9181            _this.callPlugins('onTouchEnd');
9182            return;
9183        }
9184        if (!_this.isMoved || _this.positions.current > 0 || _this.positions.current < -maxPosition) {
9185            _this.swipeReset();
9186            if (params.onTouchEnd) _this.fireCallback(params.onTouchEnd, _this, event);
9187            _this.callPlugins('onTouchEnd');
9188            return;
9189        }
9190
9191        _this.isMoved = false;
9192
9193        //Free Mode
9194        if (params.freeMode) {
9195            if (params.freeModeFluid) {
9196                var momentumDuration = 1000 * params.momentumRatio;
9197                var momentumDistance = _this.velocity * momentumDuration;
9198                var newPosition = _this.positions.current + momentumDistance;
9199                var doBounce = false;
9200                var afterBouncePosition;
9201                var bounceAmount = Math.abs(_this.velocity) * 20 * params.momentumBounceRatio;
9202                if (newPosition < -maxPosition) {
9203                    if (params.momentumBounce && _this.support.transitions) {
9204                        if (newPosition + maxPosition < -bounceAmount) newPosition = -maxPosition - bounceAmount;
9205                        afterBouncePosition = -maxPosition;
9206                        doBounce = true;
9207                        allowMomentumBounce = true;
9208                    }
9209                    else newPosition = -maxPosition;
9210                }
9211                if (newPosition > 0) {
9212                    if (params.momentumBounce && _this.support.transitions) {
9213                        if (newPosition > bounceAmount) newPosition = bounceAmount;
9214                        afterBouncePosition = 0;
9215                        doBounce = true;
9216                        allowMomentumBounce = true;
9217                    }
9218                    else newPosition = 0;
9219                }
9220                //Fix duration
9221                if (_this.velocity !== 0) momentumDuration = Math.abs((newPosition - _this.positions.current) / _this.velocity);
9222
9223                _this.setWrapperTranslate(newPosition);
9224
9225                _this.setWrapperTransition(momentumDuration);
9226
9227                if (params.momentumBounce && doBounce) {
9228                    _this.wrapperTransitionEnd(function () {
9229                        if (!allowMomentumBounce) return;
9230                        if (params.onMomentumBounce) _this.fireCallback(params.onMomentumBounce, _this);
9231                        _this.callPlugins('onMomentumBounce');
9232
9233                        _this.setWrapperTranslate(afterBouncePosition);
9234                        _this.setWrapperTransition(300);
9235                    });
9236                }
9237
9238                _this.updateActiveSlide(newPosition);
9239            }
9240            if (!params.freeModeFluid || timeDiff >= 300) _this.updateActiveSlide(_this.positions.current);
9241
9242            if (params.onTouchEnd) _this.fireCallback(params.onTouchEnd, _this, event);
9243            _this.callPlugins('onTouchEnd');
9244            return;
9245        }
9246
9247        //Direction
9248        direction = diff < 0 ? 'toNext' : 'toPrev';
9249
9250        //Short Touches
9251        if (direction === 'toNext' && (timeDiff <= 300)) {
9252            if (diffAbs < 30 || !params.shortSwipes) _this.swipeReset();
9253            else _this.swipeNext(true);
9254        }
9255
9256        if (direction === 'toPrev' && (timeDiff <= 300)) {
9257            if (diffAbs < 30 || !params.shortSwipes) _this.swipeReset();
9258            else _this.swipePrev(true);
9259        }
9260
9261        //Long Touches
9262        var targetSlideSize = 0;
9263        if (params.slidesPerView === 'auto') {
9264            //Define current slide's width
9265            var currentPosition = Math.abs(_this.getWrapperTranslate());
9266            var slidesOffset = 0;
9267            var _slideSize;
9268            for (var i = 0; i < _this.slides.length; i++) {
9269                _slideSize = isH ? _this.slides[i].getWidth(true, params.roundLengths) : _this.slides[i].getHeight(true, params.roundLengths);
9270                slidesOffset += _slideSize;
9271                if (slidesOffset > currentPosition) {
9272                    targetSlideSize = _slideSize;
9273                    break;
9274                }
9275            }
9276            if (targetSlideSize > containerSize) targetSlideSize = containerSize;
9277        }
9278        else {
9279            targetSlideSize = slideSize * params.slidesPerView;
9280        }
9281        if (direction === 'toNext' && (timeDiff > 300)) {
9282            if (diffAbs >= targetSlideSize * params.longSwipesRatio) {
9283                _this.swipeNext(true);
9284            }
9285            else {
9286                _this.swipeReset();
9287            }
9288        }
9289        if (direction === 'toPrev' && (timeDiff > 300)) {
9290            if (diffAbs >= targetSlideSize * params.longSwipesRatio) {
9291                _this.swipePrev(true);
9292            }
9293            else {
9294                _this.swipeReset();
9295            }
9296        }
9297        if (params.onTouchEnd) _this.fireCallback(params.onTouchEnd, _this, event);
9298        _this.callPlugins('onTouchEnd');
9299    }
9300
9301
9302    /*==================================================
9303        noSwiping Bubble Check by Isaac Strack
9304    ====================================================*/
9305    function noSwipingSlide(el) {
9306        /*This function is specifically designed to check the parent elements for the noSwiping class, up to the wrapper.
9307        We need to check parents because while onTouchStart bubbles, _this.isTouched is checked in onTouchStart, which stops the bubbling.
9308        So, if a text box, for example, is the initial target, and the parent slide container has the noSwiping class, the _this.isTouched
9309        check will never find it, and what was supposed to be noSwiping is able to be swiped.
9310        This function will iterate up and check for the noSwiping class in parents, up through the wrapperClass.*/
9311
9312        // First we create a truthy variable, which is that swiping is allowd (noSwiping = false)
9313        var noSwiping = false;
9314
9315        // Now we iterate up (parentElements) until we reach the node with the wrapperClass.
9316        do {
9317
9318            // Each time, we check to see if there's a 'swiper-no-swiping' class (noSwipingClass).
9319            if (el.className.indexOf(params.noSwipingClass) > -1)
9320            {
9321                noSwiping = true; // If there is, we set noSwiping = true;
9322            }
9323
9324            el = el.parentElement;  // now we iterate up (parent node)
9325
9326        } while (!noSwiping && el.parentElement && el.className.indexOf(params.wrapperClass) === -1); // also include el.parentElement truthy, just in case.
9327
9328        // because we didn't check the wrapper itself, we do so now, if noSwiping is false:
9329        if (!noSwiping && el.className.indexOf(params.wrapperClass) > -1 && el.className.indexOf(params.noSwipingClass) > -1)
9330            noSwiping = true; // if the wrapper has the noSwipingClass, we set noSwiping = true;
9331
9332        return noSwiping;
9333    }
9334
9335    function addClassToHtmlString(klass, outerHtml) {
9336        var par = document.createElement('div');
9337        var child;
9338
9339        par.innerHTML = outerHtml;
9340        child = par.firstChild;
9341        child.className += ' ' + klass;
9342
9343        return child.outerHTML;
9344    }
9345
9346
9347    /*==================================================
9348        Swipe Functions
9349    ====================================================*/
9350    _this.swipeNext = function (internal) {
9351        if (!internal && params.loop) _this.fixLoop();
9352        if (!internal && params.autoplay) _this.stopAutoplay(true);
9353        _this.callPlugins('onSwipeNext');
9354        var currentPosition = _this.getWrapperTranslate();
9355        var newPosition = currentPosition;
9356        if (params.slidesPerView === 'auto') {
9357            for (var i = 0; i < _this.snapGrid.length; i++) {
9358                if (-currentPosition >= _this.snapGrid[i] && -currentPosition < _this.snapGrid[i + 1]) {
9359                    newPosition = -_this.snapGrid[i + 1];
9360                    break;
9361                }
9362            }
9363        }
9364        else {
9365            var groupSize = slideSize * params.slidesPerGroup;
9366            newPosition = -(Math.floor(Math.abs(currentPosition) / Math.floor(groupSize)) * groupSize + groupSize);
9367        }
9368        if (newPosition < -maxWrapperPosition()) {
9369            newPosition = -maxWrapperPosition();
9370        }
9371        if (newPosition === currentPosition) return false;
9372        swipeToPosition(newPosition, 'next');
9373        return true;
9374    };
9375    _this.swipePrev = function (internal) {
9376        if (!internal && params.loop) _this.fixLoop();
9377        if (!internal && params.autoplay) _this.stopAutoplay(true);
9378        _this.callPlugins('onSwipePrev');
9379
9380        var currentPosition = Math.ceil(_this.getWrapperTranslate());
9381        var newPosition;
9382        if (params.slidesPerView === 'auto') {
9383            newPosition = 0;
9384            for (var i = 1; i < _this.snapGrid.length; i++) {
9385                if (-currentPosition === _this.snapGrid[i]) {
9386                    newPosition = -_this.snapGrid[i - 1];
9387                    break;
9388                }
9389                if (-currentPosition > _this.snapGrid[i] && -currentPosition < _this.snapGrid[i + 1]) {
9390                    newPosition = -_this.snapGrid[i];
9391                    break;
9392                }
9393            }
9394        }
9395        else {
9396            var groupSize = slideSize * params.slidesPerGroup;
9397            newPosition = -(Math.ceil(-currentPosition / groupSize) - 1) * groupSize;
9398        }
9399
9400        if (newPosition > 0) newPosition = 0;
9401
9402        if (newPosition === currentPosition) return false;
9403        swipeToPosition(newPosition, 'prev');
9404        return true;
9405
9406    };
9407    _this.swipeReset = function () {
9408        _this.callPlugins('onSwipeReset');
9409        var currentPosition = _this.getWrapperTranslate();
9410        var groupSize = slideSize * params.slidesPerGroup;
9411        var newPosition;
9412        var maxPosition = -maxWrapperPosition();
9413        if (params.slidesPerView === 'auto') {
9414            newPosition = 0;
9415            for (var i = 0; i < _this.snapGrid.length; i++) {
9416                if (-currentPosition === _this.snapGrid[i]) return;
9417                if (-currentPosition >= _this.snapGrid[i] && -currentPosition < _this.snapGrid[i + 1]) {
9418                    if (_this.positions.diff > 0) newPosition = -_this.snapGrid[i + 1];
9419                    else newPosition = -_this.snapGrid[i];
9420                    break;
9421                }
9422            }
9423            if (-currentPosition >= _this.snapGrid[_this.snapGrid.length - 1]) newPosition = -_this.snapGrid[_this.snapGrid.length - 1];
9424            if (currentPosition <= -maxWrapperPosition()) newPosition = -maxWrapperPosition();
9425        }
9426        else {
9427            newPosition = currentPosition < 0 ? Math.round(currentPosition / groupSize) * groupSize : 0;
9428        }
9429        if (params.scrollContainer)  {
9430            newPosition = currentPosition < 0 ? currentPosition : 0;
9431        }
9432        if (newPosition < -maxWrapperPosition()) {
9433            newPosition = -maxWrapperPosition();
9434        }
9435        if (params.scrollContainer && (containerSize > slideSize)) {
9436            newPosition = 0;
9437        }
9438
9439        if (newPosition === currentPosition) return false;
9440
9441        swipeToPosition(newPosition, 'reset');
9442        return true;
9443    };
9444
9445    _this.swipeTo = function (index, speed, runCallbacks) {
9446        index = parseInt(index, 10);
9447        _this.callPlugins('onSwipeTo', {index: index, speed: speed});
9448        if (params.loop) index = index + _this.loopedSlides;
9449        var currentPosition = _this.getWrapperTranslate();
9450        if (index > (_this.slides.length - 1) || index < 0) return;
9451        var newPosition;
9452        if (params.slidesPerView === 'auto') {
9453            newPosition = -_this.slidesGrid[index];
9454        }
9455        else {
9456            newPosition = -index * slideSize;
9457        }
9458        if (newPosition < - maxWrapperPosition()) {
9459            newPosition = - maxWrapperPosition();
9460        }
9461
9462        if (newPosition === currentPosition) return false;
9463
9464        runCallbacks = runCallbacks === false ? false : true;
9465        swipeToPosition(newPosition, 'to', {index: index, speed: speed, runCallbacks: runCallbacks});
9466        return true;
9467    };
9468
9469    function swipeToPosition(newPosition, action, toOptions) {
9470        var speed = (action === 'to' && toOptions.speed >= 0) ? toOptions.speed : params.speed;
9471        var timeOld = + new Date();
9472
9473        function anim() {
9474            var timeNew = + new Date();
9475            var time = timeNew - timeOld;
9476            currentPosition += animationStep * time / (1000 / 60);
9477            condition = direction === 'toNext' ? currentPosition > newPosition : currentPosition < newPosition;
9478            if (condition) {
9479                _this.setWrapperTranslate(Math.round(currentPosition));
9480                _this._DOMAnimating = true;
9481                window.setTimeout(function () {
9482                    anim();
9483                }, 1000 / 60);
9484            }
9485            else {
9486                if (params.onSlideChangeEnd) {
9487                    if (action === 'to') {
9488                        if (toOptions.runCallbacks === true) _this.fireCallback(params.onSlideChangeEnd, _this);
9489                    }
9490                    else {
9491                        _this.fireCallback(params.onSlideChangeEnd, _this);
9492                    }
9493                    
9494                }
9495                _this.setWrapperTranslate(newPosition);
9496                _this._DOMAnimating = false;
9497            }
9498        }
9499
9500        if (_this.support.transitions || !params.DOMAnimation) {
9501            _this.setWrapperTranslate(newPosition);
9502            _this.setWrapperTransition(speed);
9503        }
9504        else {
9505            //Try the DOM animation
9506            var currentPosition = _this.getWrapperTranslate();
9507            var animationStep = Math.ceil((newPosition - currentPosition) / speed * (1000 / 60));
9508            var direction = currentPosition > newPosition ? 'toNext' : 'toPrev';
9509            var condition = direction === 'toNext' ? currentPosition > newPosition : currentPosition < newPosition;
9510            if (_this._DOMAnimating) return;
9511
9512            anim();
9513        }
9514
9515        //Update Active Slide Index
9516        _this.updateActiveSlide(newPosition);
9517
9518        //Callbacks
9519        if (params.onSlideNext && action === 'next') {
9520            _this.fireCallback(params.onSlideNext, _this, newPosition);
9521        }
9522        if (params.onSlidePrev && action === 'prev') {
9523            _this.fireCallback(params.onSlidePrev, _this, newPosition);
9524        }
9525        //'Reset' Callback
9526        if (params.onSlideReset && action === 'reset') {
9527            _this.fireCallback(params.onSlideReset, _this, newPosition);
9528        }
9529
9530        //'Next', 'Prev' and 'To' Callbacks
9531        if (action === 'next' || action === 'prev' || (action === 'to' && toOptions.runCallbacks === true))
9532            slideChangeCallbacks(action);
9533    }
9534    /*==================================================
9535        Transition Callbacks
9536    ====================================================*/
9537    //Prevent Multiple Callbacks
9538    _this._queueStartCallbacks = false;
9539    _this._queueEndCallbacks = false;
9540    function slideChangeCallbacks(direction) {
9541        //Transition Start Callback
9542        _this.callPlugins('onSlideChangeStart');
9543        if (params.onSlideChangeStart) {
9544            if (params.queueStartCallbacks && _this.support.transitions) {
9545                if (_this._queueStartCallbacks) return;
9546                _this._queueStartCallbacks = true;
9547                _this.fireCallback(params.onSlideChangeStart, _this, direction);
9548                _this.wrapperTransitionEnd(function () {
9549                    _this._queueStartCallbacks = false;
9550                });
9551            }
9552            else _this.fireCallback(params.onSlideChangeStart, _this, direction);
9553        }
9554        //Transition End Callback
9555        if (params.onSlideChangeEnd) {
9556            if (_this.support.transitions) {
9557                if (params.queueEndCallbacks) {
9558                    if (_this._queueEndCallbacks) return;
9559                    _this._queueEndCallbacks = true;
9560                    _this.wrapperTransitionEnd(function (swiper) {
9561                        _this.fireCallback(params.onSlideChangeEnd, swiper, direction);
9562                    });
9563                }
9564                else {
9565                    _this.wrapperTransitionEnd(function (swiper) {
9566                        _this.fireCallback(params.onSlideChangeEnd, swiper, direction);
9567                    });
9568                }
9569            }
9570            else {
9571                if (!params.DOMAnimation) {
9572                    setTimeout(function () {
9573                        _this.fireCallback(params.onSlideChangeEnd, _this, direction);
9574                    }, 10);
9575                }
9576            }
9577        }
9578    }
9579
9580    /*==================================================
9581        Update Active Slide Index
9582    ====================================================*/
9583    _this.updateActiveSlide = function (position) {
9584        if (!_this.initialized) return;
9585        if (_this.slides.length === 0) return;
9586        _this.previousIndex = _this.activeIndex;
9587        if (typeof position === 'undefined') position = _this.getWrapperTranslate();
9588        if (position > 0) position = 0;
9589        var i;
9590        if (params.slidesPerView === 'auto') {
9591            var slidesOffset = 0;
9592            _this.activeIndex = _this.slidesGrid.indexOf(-position);
9593            if (_this.activeIndex < 0) {
9594                for (i = 0; i < _this.slidesGrid.length - 1; i++) {
9595                    if (-position > _this.slidesGrid[i] && -position < _this.slidesGrid[i + 1]) {
9596                        break;
9597                    }
9598                }
9599                var leftDistance = Math.abs(_this.slidesGrid[i] + position);
9600                var rightDistance = Math.abs(_this.slidesGrid[i + 1] + position);
9601                if (leftDistance <= rightDistance) _this.activeIndex = i;
9602                else _this.activeIndex = i + 1;
9603            }
9604        }
9605        else {
9606            _this.activeIndex = Math[params.visibilityFullFit ? 'ceil' : 'round'](-position / slideSize);
9607        }
9608
9609        if (_this.activeIndex === _this.slides.length) _this.activeIndex = _this.slides.length - 1;
9610        if (_this.activeIndex < 0) _this.activeIndex = 0;
9611
9612        // Check for slide
9613        if (!_this.slides[_this.activeIndex]) return;
9614
9615        // Calc Visible slides
9616        _this.calcVisibleSlides(position);
9617
9618        // Mark visible and active slides with additonal classes
9619        if (_this.support.classList) {
9620            var slide;
9621            for (i = 0; i < _this.slides.length; i++) {
9622                slide = _this.slides[i];
9623                slide.classList.remove(params.slideActiveClass);
9624                if (_this.visibleSlides.indexOf(slide) >= 0) {
9625                    slide.classList.add(params.slideVisibleClass);
9626                } else {
9627                    slide.classList.remove(params.slideVisibleClass);
9628                }
9629            }
9630            _this.slides[_this.activeIndex].classList.add(params.slideActiveClass);
9631        } else {
9632            var activeClassRegexp = new RegExp('\\s*' + params.slideActiveClass);
9633            var inViewClassRegexp = new RegExp('\\s*' + params.slideVisibleClass);
9634
9635            for (i = 0; i < _this.slides.length; i++) {
9636                _this.slides[i].className = _this.slides[i].className.replace(activeClassRegexp, '').replace(inViewClassRegexp, '');
9637                if (_this.visibleSlides.indexOf(_this.slides[i]) >= 0) {
9638                    _this.slides[i].className += ' ' + params.slideVisibleClass;
9639                }
9640            }
9641            _this.slides[_this.activeIndex].className += ' ' + params.slideActiveClass;
9642        }
9643
9644        //Update loop index
9645        if (params.loop) {
9646            var ls = _this.loopedSlides;
9647            _this.activeLoopIndex = _this.activeIndex - ls;
9648            if (_this.activeLoopIndex >= _this.slides.length - ls * 2) {
9649                _this.activeLoopIndex = _this.slides.length - ls * 2 - _this.activeLoopIndex;
9650            }
9651            if (_this.activeLoopIndex < 0) {
9652                _this.activeLoopIndex = _this.slides.length - ls * 2 + _this.activeLoopIndex;
9653            }
9654            if (_this.activeLoopIndex < 0) _this.activeLoopIndex = 0;
9655        }
9656        else {
9657            _this.activeLoopIndex = _this.activeIndex;
9658        }
9659        //Update Pagination
9660        if (params.pagination) {
9661            _this.updatePagination(position);
9662        }
9663    };
9664    /*==================================================
9665        Pagination
9666    ====================================================*/
9667    _this.createPagination = function (firstInit) {
9668        if (params.paginationClickable && _this.paginationButtons) {
9669            removePaginationEvents();
9670        }
9671        _this.paginationContainer = params.pagination.nodeType ? params.pagination : $$(params.pagination)[0];
9672        if (params.createPagination) {
9673            var paginationHTML = '';
9674            var numOfSlides = _this.slides.length;
9675            var numOfButtons = numOfSlides;
9676            if (params.loop) numOfButtons -= _this.loopedSlides * 2;
9677            for (var i = 0; i < numOfButtons; i++) {
9678                paginationHTML += '<' + params.paginationElement + ' class="' + params.paginationElementClass + '"></' + params.paginationElement + '>';
9679            }
9680            _this.paginationContainer.innerHTML = paginationHTML;
9681        }
9682        _this.paginationButtons = $$('.' + params.paginationElementClass, _this.paginationContainer);
9683        if (!firstInit) _this.updatePagination();
9684        _this.callPlugins('onCreatePagination');
9685        if (params.paginationClickable) {
9686            addPaginationEvents();
9687        }
9688    };
9689    function removePaginationEvents() {
9690        var pagers = _this.paginationButtons;
9691        if (pagers) {
9692            for (var i = 0; i < pagers.length; i++) {
9693                _this.h.removeEventListener(pagers[i], 'click', paginationClick);
9694            }
9695        }
9696    }
9697    function addPaginationEvents() {
9698        var pagers = _this.paginationButtons;
9699        if (pagers) {
9700            for (var i = 0; i < pagers.length; i++) {
9701                _this.h.addEventListener(pagers[i], 'click', paginationClick);
9702            }
9703        }
9704    }
9705    function paginationClick(e) {
9706        var index;
9707        var target = e.target || e.srcElement;
9708        var pagers = _this.paginationButtons;
9709        for (var i = 0; i < pagers.length; i++) {
9710            if (target === pagers[i]) index = i;
9711        }
9712        _this.swipeTo(index);
9713    }
9714    _this.updatePagination = function (position) {
9715        if (!params.pagination) return;
9716        if (_this.slides.length < 1) return;
9717        var activePagers = $$('.' + params.paginationActiveClass, _this.paginationContainer);
9718        if (!activePagers) return;
9719
9720        //Reset all Buttons' class to not active
9721        var pagers = _this.paginationButtons;
9722        if (pagers.length === 0) return;
9723        for (var i = 0; i < pagers.length; i++) {
9724            pagers[i].className = params.paginationElementClass;
9725        }
9726
9727        var indexOffset = params.loop ? _this.loopedSlides : 0;
9728        if (params.paginationAsRange) {
9729            if (!_this.visibleSlides) _this.calcVisibleSlides(position);
9730            //Get Visible Indexes
9731            var visibleIndexes = [];
9732            var j; // lopp index - avoid JSHint W004 / W038
9733            for (j = 0; j < _this.visibleSlides.length; j++) {
9734                var visIndex = _this.slides.indexOf(_this.visibleSlides[j]) - indexOffset;
9735
9736                if (params.loop && visIndex < 0) {
9737                    visIndex = _this.slides.length - _this.loopedSlides * 2 + visIndex;
9738                }
9739                if (params.loop && visIndex >= _this.slides.length - _this.loopedSlides * 2) {
9740                    visIndex = _this.slides.length - _this.loopedSlides * 2 - visIndex;
9741                    visIndex = Math.abs(visIndex);
9742                }
9743                visibleIndexes.push(visIndex);
9744            }
9745
9746            for (j = 0; j < visibleIndexes.length; j++) {
9747                if (pagers[visibleIndexes[j]]) pagers[visibleIndexes[j]].className += ' ' + params.paginationVisibleClass;
9748            }
9749
9750            if (params.loop) {
9751                if (pagers[_this.activeLoopIndex] !== undefined) {
9752                    pagers[_this.activeLoopIndex].className += ' ' + params.paginationActiveClass;
9753                }
9754            }
9755            else {
9756                pagers[_this.activeIndex].className += ' ' + params.paginationActiveClass;
9757            }
9758        }
9759        else {
9760            if (params.loop) {
9761                if (pagers[_this.activeLoopIndex]) pagers[_this.activeLoopIndex].className += ' ' + params.paginationActiveClass + ' ' + params.paginationVisibleClass;
9762            }
9763            else {
9764                pagers[_this.activeIndex].className += ' ' + params.paginationActiveClass + ' ' + params.paginationVisibleClass;
9765            }
9766        }
9767    };
9768    _this.calcVisibleSlides = function (position) {
9769        var visibleSlides = [];
9770        var _slideLeft = 0, _slideSize = 0, _slideRight = 0;
9771        if (isH && _this.wrapperLeft > 0) position = position + _this.wrapperLeft;
9772        if (!isH && _this.wrapperTop > 0) position = position + _this.wrapperTop;
9773
9774        for (var i = 0; i < _this.slides.length; i++) {
9775            _slideLeft += _slideSize;
9776            if (params.slidesPerView === 'auto')
9777                _slideSize  = isH ? _this.h.getWidth(_this.slides[i], true, params.roundLengths) : _this.h.getHeight(_this.slides[i], true, params.roundLengths);
9778            else _slideSize = slideSize;
9779
9780            _slideRight = _slideLeft + _slideSize;
9781            var isVisibile = false;
9782            if (params.visibilityFullFit) {
9783                if (_slideLeft >= -position && _slideRight <= -position + containerSize) isVisibile = true;
9784                if (_slideLeft <= -position && _slideRight >= -position + containerSize) isVisibile = true;
9785            }
9786            else {
9787                if (_slideRight > -position && _slideRight <= ((-position + containerSize))) isVisibile = true;
9788                if (_slideLeft >= -position && _slideLeft < ((-position + containerSize))) isVisibile = true;
9789                if (_slideLeft < -position && _slideRight > ((-position + containerSize))) isVisibile = true;
9790            }
9791
9792            if (isVisibile) visibleSlides.push(_this.slides[i]);
9793
9794        }
9795        if (visibleSlides.length === 0) visibleSlides = [_this.slides[_this.activeIndex]];
9796
9797        _this.visibleSlides = visibleSlides;
9798    };
9799
9800    /*==========================================
9801        Autoplay
9802    ============================================*/
9803    var autoplayTimeoutId, autoplayIntervalId;
9804    _this.startAutoplay = function () {
9805        if (_this.support.transitions) {
9806            if (typeof autoplayTimeoutId !== 'undefined') return false;
9807            if (!params.autoplay) return;
9808            _this.callPlugins('onAutoplayStart');
9809            if (params.onAutoplayStart) _this.fireCallback(params.onAutoplayStart, _this);
9810            autoplay();
9811        }
9812        else {
9813            if (typeof autoplayIntervalId !== 'undefined') return false;
9814            if (!params.autoplay) return;
9815            _this.callPlugins('onAutoplayStart');
9816            if (params.onAutoplayStart) _this.fireCallback(params.onAutoplayStart, _this);
9817            autoplayIntervalId = setInterval(function () {
9818                if (params.loop) {
9819                    _this.fixLoop();
9820                    _this.swipeNext(true);
9821                }
9822                else if (!_this.swipeNext(true)) {
9823                    if (!params.autoplayStopOnLast) _this.swipeTo(0);
9824                    else {
9825                        clearInterval(autoplayIntervalId);
9826                        autoplayIntervalId = undefined;
9827                    }
9828                }
9829            }, params.autoplay);
9830        }
9831    };
9832    _this.stopAutoplay = function (internal) {
9833        if (_this.support.transitions) {
9834            if (!autoplayTimeoutId) return;
9835            if (autoplayTimeoutId) clearTimeout(autoplayTimeoutId);
9836            autoplayTimeoutId = undefined;
9837            if (internal && !params.autoplayDisableOnInteraction) {
9838                _this.wrapperTransitionEnd(function () {
9839                    autoplay();
9840                });
9841            }
9842            _this.callPlugins('onAutoplayStop');
9843            if (params.onAutoplayStop) _this.fireCallback(params.onAutoplayStop, _this);
9844        }
9845        else {
9846            if (autoplayIntervalId) clearInterval(autoplayIntervalId);
9847            autoplayIntervalId = undefined;
9848            _this.callPlugins('onAutoplayStop');
9849            if (params.onAutoplayStop) _this.fireCallback(params.onAutoplayStop, _this);
9850        }
9851    };
9852    function autoplay() {
9853        autoplayTimeoutId = setTimeout(function () {
9854            if (params.loop) {
9855                _this.fixLoop();
9856                _this.swipeNext(true);
9857            }
9858            else if (!_this.swipeNext(true)) {
9859                if (!params.autoplayStopOnLast) _this.swipeTo(0);
9860                else {
9861                    clearTimeout(autoplayTimeoutId);
9862                    autoplayTimeoutId = undefined;
9863                }
9864            }
9865            _this.wrapperTransitionEnd(function () {
9866                if (typeof autoplayTimeoutId !== 'undefined') autoplay();
9867            });
9868        }, params.autoplay);
9869    }
9870    /*==================================================
9871        Loop
9872    ====================================================*/
9873    _this.loopCreated = false;
9874    _this.removeLoopedSlides = function () {
9875        if (_this.loopCreated) {
9876            for (var i = 0; i < _this.slides.length; i++) {
9877                if (_this.slides[i].getData('looped') === true) _this.wrapper.removeChild(_this.slides[i]);
9878            }
9879        }
9880    };
9881
9882    _this.createLoop = function () {
9883        if (_this.slides.length === 0) return;
9884        if (params.slidesPerView === 'auto') {
9885            _this.loopedSlides = params.loopedSlides || 1;
9886        }
9887        else {
9888            _this.loopedSlides = params.slidesPerView + params.loopAdditionalSlides;
9889        }
9890
9891        if (_this.loopedSlides > _this.slides.length) {
9892            _this.loopedSlides = _this.slides.length;
9893        }
9894
9895        var slideFirstHTML = '',
9896            slideLastHTML = '',
9897            i;
9898        var slidesSetFullHTML = '';
9899        /**
9900                loopedSlides is too large if loopAdditionalSlides are set.
9901                Need to divide the slides by maximum number of slides existing.
9902
9903                @author        Tomaz Lovrec <[email protected]>
9904        */
9905        var numSlides = _this.slides.length;
9906        var fullSlideSets = Math.floor(_this.loopedSlides / numSlides);
9907        var remainderSlides = _this.loopedSlides % numSlides;
9908        // assemble full sets of slides
9909        for (i = 0; i < (fullSlideSets * numSlides); i++) {
9910            var j = i;
9911            if (i >= numSlides) {
9912                var over = Math.floor(i / numSlides);
9913                j = i - (numSlides * over);
9914            }
9915            slidesSetFullHTML += _this.slides[j].outerHTML;
9916        }
9917        // assemble remainder slides
9918        // assemble remainder appended to existing slides
9919        for (i = 0; i < remainderSlides;i++) {
9920            slideLastHTML += addClassToHtmlString(params.slideDuplicateClass, _this.slides[i].outerHTML);
9921        }
9922        // assemble slides that get preppended to existing slides
9923        for (i = numSlides - remainderSlides; i < numSlides;i++) {
9924            slideFirstHTML += addClassToHtmlString(params.slideDuplicateClass, _this.slides[i].outerHTML);
9925        }
9926        // assemble all slides
9927        var slides = slideFirstHTML + slidesSetFullHTML + wrapper.innerHTML + slidesSetFullHTML + slideLastHTML;
9928        // set the slides
9929        wrapper.innerHTML = slides;
9930
9931        _this.loopCreated = true;
9932        _this.calcSlides();
9933
9934        //Update Looped Slides with special class
9935        for (i = 0; i < _this.slides.length; i++) {
9936            if (i < _this.loopedSlides || i >= _this.slides.length - _this.loopedSlides) _this.slides[i].setData('looped', true);
9937        }
9938        _this.callPlugins('onCreateLoop');
9939
9940    };
9941
9942    _this.fixLoop = function () {
9943        var newIndex;
9944        //Fix For Negative Oversliding
9945        if (_this.activeIndex < _this.loopedSlides) {
9946            newIndex = _this.slides.length - _this.loopedSlides * 3 + _this.activeIndex;
9947            _this.swipeTo(newIndex, 0, false);
9948        }
9949        //Fix For Positive Oversliding
9950        else if ((params.slidesPerView === 'auto' && _this.activeIndex >= _this.loopedSlides * 2) || (_this.activeIndex > _this.slides.length - params.slidesPerView * 2)) {
9951            newIndex = -_this.slides.length + _this.activeIndex + _this.loopedSlides;
9952            _this.swipeTo(newIndex, 0, false);
9953        }
9954    };
9955
9956    /*==================================================
9957        Slides Loader
9958    ====================================================*/
9959    _this.loadSlides = function () {
9960        var slidesHTML = '';
9961        _this.activeLoaderIndex = 0;
9962        var slides = params.loader.slides;
9963        var slidesToLoad = params.loader.loadAllSlides ? slides.length : params.slidesPerView * (1 + params.loader.surroundGroups);
9964        for (var i = 0; i < slidesToLoad; i++) {
9965            if (params.loader.slidesHTMLType === 'outer') slidesHTML += slides[i];
9966            else {
9967                slidesHTML += '<' + params.slideElement + ' class="' + params.slideClass + '" data-swiperindex="' + i + '">' + slides[i] + '</' + params.slideElement + '>';
9968            }
9969        }
9970        _this.wrapper.innerHTML = slidesHTML;
9971        _this.calcSlides(true);
9972        //Add permanent transitionEnd callback
9973        if (!params.loader.loadAllSlides) {
9974            _this.wrapperTransitionEnd(_this.reloadSlides, true);
9975        }
9976    };
9977
9978    _this.reloadSlides = function () {
9979        var slides = params.loader.slides;
9980        var newActiveIndex = parseInt(_this.activeSlide().data('swiperindex'), 10);
9981        if (newActiveIndex < 0 || newActiveIndex > slides.length - 1) return; //<-- Exit
9982        _this.activeLoaderIndex = newActiveIndex;
9983        var firstIndex = Math.max(0, newActiveIndex - params.slidesPerView * params.loader.surroundGroups);
9984        var lastIndex = Math.min(newActiveIndex + params.slidesPerView * (1 + params.loader.surroundGroups) - 1, slides.length - 1);
9985        //Update Transforms
9986        if (newActiveIndex > 0) {
9987            var newTransform = -slideSize * (newActiveIndex - firstIndex);
9988            _this.setWrapperTranslate(newTransform);
9989            _this.setWrapperTransition(0);
9990        }
9991        var i; // loop index
9992        //New Slides
9993        if (params.loader.logic === 'reload') {
9994            _this.wrapper.innerHTML = '';
9995            var slidesHTML = '';
9996            for (i = firstIndex; i <= lastIndex; i++) {
9997                slidesHTML += params.loader.slidesHTMLType === 'outer' ? slides[i] : '<' + params.slideElement + ' class="' + params.slideClass + '" data-swiperindex="' + i + '">' + slides[i] + '</' + params.slideElement + '>';
9998            }
9999            _this.wrapper.innerHTML = slidesHTML;
10000        }
10001        else {
10002            var minExistIndex = 1000;
10003            var maxExistIndex = 0;
10004
10005            for (i = 0; i < _this.slides.length; i++) {
10006                var index = _this.slides[i].data('swiperindex');
10007                if (index < firstIndex || index > lastIndex) {
10008                    _this.wrapper.removeChild(_this.slides[i]);
10009                }
10010                else {
10011                    minExistIndex = Math.min(index, minExistIndex);
10012                    maxExistIndex = Math.max(index, maxExistIndex);
10013                }
10014            }
10015            for (i = firstIndex; i <= lastIndex; i++) {
10016                var newSlide;
10017                if (i < minExistIndex) {
10018                    newSlide = document.createElement(params.slideElement);
10019                    newSlide.className = params.slideClass;
10020                    newSlide.setAttribute('data-swiperindex', i);
10021                    newSlide.innerHTML = slides[i];
10022                    _this.wrapper.insertBefore(newSlide, _this.wrapper.firstChild);
10023                }
10024                if (i > maxExistIndex) {
10025                    newSlide = document.createElement(params.slideElement);
10026                    newSlide.className = params.slideClass;
10027                    newSlide.setAttribute('data-swiperindex', i);
10028                    newSlide.innerHTML = slides[i];
10029                    _this.wrapper.appendChild(newSlide);
10030                }
10031            }
10032        }
10033        //reInit
10034        _this.reInit(true);
10035    };
10036
10037    /*==================================================
10038        Make Swiper
10039    ====================================================*/
10040    function makeSwiper() {
10041        _this.calcSlides();
10042        if (params.loader.slides.length > 0 && _this.slides.length === 0) {
10043            _this.loadSlides();
10044        }
10045        if (params.loop) {
10046            _this.createLoop();
10047        }
10048        _this.init();
10049        initEvents();
10050        if (params.pagination) {
10051            _this.createPagination(true);
10052        }
10053
10054        if (params.loop || params.initialSlide > 0) {
10055            _this.swipeTo(params.initialSlide, 0, false);
10056        }
10057        else {
10058            _this.updateActiveSlide(0);
10059        }
10060        if (params.autoplay) {
10061            _this.startAutoplay();
10062        }
10063        /**
10064         * Set center slide index.
10065         *
10066         * @author        Tomaz Lovrec <[email protected]>
10067         */
10068        _this.centerIndex = _this.activeIndex;
10069
10070        // Callbacks
10071        if (params.onSwiperCreated) _this.fireCallback(params.onSwiperCreated, _this);
10072        _this.callPlugins('onSwiperCreated');
10073    }
10074
10075    makeSwiper();
10076};
10077
10078Swiper.prototype = {
10079    plugins : {},
10080
10081    /*==================================================
10082        Wrapper Operations
10083    ====================================================*/
10084    wrapperTransitionEnd : function (callback, permanent) {
10085        'use strict';
10086        var a = this,
10087            el = a.wrapper,
10088            events = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'],
10089            i;
10090
10091        function fireCallBack() {
10092            callback(a);
10093            if (a.params.queueEndCallbacks) a._queueEndCallbacks = false;
10094            if (!permanent) {
10095                for (i = 0; i < events.length; i++) {
10096                    a.h.removeEventListener(el, events[i], fireCallBack);
10097                }
10098            }
10099        }
10100
10101        if (callback) {
10102            for (i = 0; i < events.length; i++) {
10103                a.h.addEventListener(el, events[i], fireCallBack);
10104            }
10105        }
10106    },
10107
10108    getWrapperTranslate : function (axis) {
10109        'use strict';
10110        var el = this.wrapper,
10111            matrix, curTransform, curStyle, transformMatrix;
10112
10113        // automatic axis detection
10114        if (typeof axis === 'undefined') {
10115            axis = this.params.mode === 'horizontal' ? 'x' : 'y';
10116        }
10117
10118        if (this.support.transforms && this.params.useCSS3Transforms) {
10119            curStyle = window.getComputedStyle(el, null);
10120            if (window.WebKitCSSMatrix) {
10121                // Some old versions of Webkit choke when 'none' is passed; pass
10122                // empty string instead in this case
10123                transformMatrix = new WebKitCSSMatrix(curStyle.webkitTransform === 'none' ? '' : curStyle.webkitTransform);
10124            }
10125            else {
10126                transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform  || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');
10127                matrix = transformMatrix.toString().split(',');
10128            }
10129
10130            if (axis === 'x') {
10131                //Latest Chrome and webkits Fix
10132                if (window.WebKitCSSMatrix)
10133                    curTransform = transformMatrix.m41;
10134                //Crazy IE10 Matrix
10135                else if (matrix.length === 16)
10136                    curTransform = parseFloat(matrix[12]);
10137                //Normal Browsers
10138                else
10139                    curTransform = parseFloat(matrix[4]);
10140            }
10141            if (axis === 'y') {
10142                //Latest Chrome and webkits Fix
10143                if (window.WebKitCSSMatrix)
10144                    curTransform = transformMatrix.m42;
10145                //Crazy IE10 Matrix
10146                else if (matrix.length === 16)
10147                    curTransform = parseFloat(matrix[13]);
10148                //Normal Browsers
10149                else
10150                    curTransform = parseFloat(matrix[5]);
10151            }
10152        }
10153        else {
10154            if (axis === 'x') curTransform = parseFloat(el.style.left, 10) || 0;
10155            if (axis === 'y') curTransform = parseFloat(el.style.top, 10) || 0;
10156        }
10157        return curTransform || 0;
10158    },
10159
10160    setWrapperTranslate : function (x, y, z) {
10161        'use strict';
10162        var es = this.wrapper.style,
10163            coords = {x: 0, y: 0, z: 0},
10164            translate;
10165
10166        // passed all coordinates
10167        if (arguments.length === 3) {
10168            coords.x = x;
10169            coords.y = y;
10170            coords.z = z;
10171        }
10172
10173        // passed one coordinate and optional axis
10174        else {
10175            if (typeof y === 'undefined') {
10176                y = this.params.mode === 'horizontal' ? 'x' : 'y';
10177            }
10178            coords[y] = x;
10179        }
10180
10181        if (this.support.transforms && this.params.useCSS3Transforms) {
10182            translate = this.support.transforms3d ? 'translate3d(' + coords.x + 'px, ' + coords.y + 'px, ' + coords.z + 'px)' : 'translate(' + coords.x + 'px, ' + coords.y + 'px)';
10183            es.webkitTransform = es.MsTransform = es.msTransform = es.MozTransform = es.OTransform = es.transform = translate;
10184        }
10185        else {
10186            es.left = coords.x + 'px';
10187            es.top  = coords.y + 'px';
10188        }
10189        this.callPlugins('onSetWrapperTransform', coords);
10190        if (this.params.onSetWrapperTransform) this.fireCallback(this.params.onSetWrapperTransform, this, coords);
10191    },
10192
10193    setWrapperTransition : function (duration) {
10194        'use strict';
10195        var es = this.wrapper.style;
10196        es.webkitTransitionDuration = es.MsTransitionDuration = es.msTransitionDuration = es.MozTransitionDuration = es.OTransitionDuration = es.transitionDuration = (duration / 1000) + 's';
10197        this.callPlugins('onSetWrapperTransition', {duration: duration});
10198        if (this.params.onSetWrapperTransition) this.fireCallback(this.params.onSetWrapperTransition, this, duration);
10199
10200    },
10201
10202    /*==================================================
10203        Helpers
10204    ====================================================*/
10205    h : {
10206        getWidth: function (el, outer, round) {
10207            'use strict';
10208            var width = window.getComputedStyle(el, null).getPropertyValue('width');
10209            var returnWidth = parseFloat(width);
10210            //IE Fixes
10211            if (isNaN(returnWidth) || width.indexOf('%') > 0) {
10212                returnWidth = el.offsetWidth - parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-left')) - parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-right'));
10213            }
10214            if (outer) returnWidth += parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-left')) + parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-right'));
10215            if (round) return Math.round(returnWidth);
10216            else return returnWidth;
10217        },
10218        getHeight: function (el, outer, round) {
10219            'use strict';
10220            if (outer) return el.offsetHeight;
10221
10222            var height = window.getComputedStyle(el, null).getPropertyValue('height');
10223            var returnHeight = parseFloat(height);
10224            //IE Fixes
10225            if (isNaN(returnHeight) || height.indexOf('%') > 0) {
10226                returnHeight = el.offsetHeight - parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-top')) - parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-bottom'));
10227            }
10228            if (outer) returnHeight += parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-top')) + parseFloat(window.getComputedStyle(el, null).getPropertyValue('padding-bottom'));
10229            if (round) return Math.round(returnHeight);
10230            else return returnHeight;
10231        },
10232        getOffset: function (el) {
10233            'use strict';
10234            var box = el.getBoundingClientRect();
10235            var body = document.body;
10236            var clientTop  = el.clientTop  || body.clientTop  || 0;
10237            var clientLeft = el.clientLeft || body.clientLeft || 0;
10238            var scrollTop  = window.pageYOffset || el.scrollTop;
10239            var scrollLeft = window.pageXOffset || el.scrollLeft;
10240            if (document.documentElement && !window.pageYOffset) {
10241                //IE7-8
10242                scrollTop  = document.documentElement.scrollTop;
10243                scrollLeft = document.documentElement.scrollLeft;
10244            }
10245            return {
10246                top: box.top  + scrollTop  - clientTop,
10247                left: box.left + scrollLeft - clientLeft
10248            };
10249        },
10250        windowWidth : function () {
10251            'use strict';
10252            if (window.innerWidth) return window.innerWidth;
10253            else if (document.documentElement && document.documentElement.clientWidth) return document.documentElement.clientWidth;
10254        },
10255        windowHeight : function () {
10256            'use strict';
10257            if (window.innerHeight) return window.innerHeight;
10258            else if (document.documentElement && document.documentElement.clientHeight) return document.documentElement.clientHeight;
10259        },
10260        windowScroll : function () {
10261            'use strict';
10262            if (typeof pageYOffset !== 'undefined') {
10263                return {
10264                    left: window.pageXOffset,
10265                    top: window.pageYOffset
10266                };
10267            }
10268            else if (document.documentElement) {
10269                return {
10270                    left: document.documentElement.scrollLeft,
10271                    top: document.documentElement.scrollTop
10272                };
10273            }
10274        },
10275
10276        addEventListener : function (el, event, listener, useCapture) {
10277            'use strict';
10278            if (typeof useCapture === 'undefined') {
10279                useCapture = false;
10280            }
10281
10282            if (el.addEventListener) {
10283                el.addEventListener(event, listener, useCapture);
10284            }
10285            else if (el.attachEvent) {
10286                el.attachEvent('on' + event, listener);
10287            }
10288        },
10289
10290        removeEventListener : function (el, event, listener, useCapture) {
10291            'use strict';
10292            if (typeof useCapture === 'undefined') {
10293                useCapture = false;
10294            }
10295
10296            if (el.removeEventListener) {
10297                el.removeEventListener(event, listener, useCapture);
10298            }
10299            else if (el.detachEvent) {
10300                el.detachEvent('on' + event, listener);
10301            }
10302        }
10303    },
10304    setTransform : function (el, transform) {
10305        'use strict';
10306        var es = el.style;
10307        es.webkitTransform = es.MsTransform = es.msTransform = es.MozTransform = es.OTransform = es.transform = transform;
10308    },
10309    setTranslate : function (el, translate) {
10310        'use strict';
10311        var es = el.style;
10312        var pos = {
10313            x : translate.x || 0,
10314            y : translate.y || 0,
10315            z : translate.z || 0
10316        };
10317        var transformString = this.support.transforms3d ? 'translate3d(' + (pos.x) + 'px,' + (pos.y) + 'px,' + (pos.z) + 'px)' : 'translate(' + (pos.x) + 'px,' + (pos.y) + 'px)';
10318        es.webkitTransform = es.MsTransform = es.msTransform = es.MozTransform = es.OTransform = es.transform = transformString;
10319        if (!this.support.transforms) {
10320            es.left = pos.x + 'px';
10321            es.top = pos.y + 'px';
10322        }
10323    },
10324    setTransition : function (el, duration) {
10325        'use strict';
10326        var es = el.style;
10327        es.webkitTransitionDuration = es.MsTransitionDuration = es.msTransitionDuration = es.MozTransitionDuration = es.OTransitionDuration = es.transitionDuration = duration + 'ms';
10328    },
10329    /*==================================================
10330        Feature Detection
10331    ====================================================*/
10332    support: {
10333
10334        touch : (window.Modernizr && Modernizr.touch === true) || (function () {
10335            'use strict';
10336            return !!(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch);
10337        })(),
10338
10339        transforms3d : (window.Modernizr && Modernizr.csstransforms3d === true) || (function () {
10340            'use strict';
10341            var div = document.createElement('div').style;
10342            return ('webkitPerspective' in div || 'MozPerspective' in div || 'OPerspective' in div || 'MsPerspective' in div || 'perspective' in div);
10343        })(),
10344
10345        transforms : (window.Modernizr && Modernizr.csstransforms === true) || (function () {
10346            'use strict';
10347            var div = document.createElement('div').style;
10348            return ('transform' in div || 'WebkitTransform' in div || 'MozTransform' in div || 'msTransform' in div || 'MsTransform' in div || 'OTransform' in div);
10349        })(),
10350
10351        transitions : (window.Modernizr && Modernizr.csstransitions === true) || (function () {
10352            'use strict';
10353            var div = document.createElement('div').style;
10354            return ('transition' in div || 'WebkitTransition' in div || 'MozTransition' in div || 'msTransition' in div || 'MsTransition' in div || 'OTransition' in div);
10355        })(),
10356
10357        classList : (function () {
10358            'use strict';
10359            var div = document.createElement('div').style;
10360            return 'classList' in div;
10361        })()
10362    },
10363
10364    browser : {
10365
10366        ie8 : (function () {
10367            'use strict';
10368            var rv = -1; // Return value assumes failure.
10369            if (navigator.appName === 'Microsoft Internet Explorer') {
10370                var ua = navigator.userAgent;
10371                var re = new RegExp(/MSIE ([0-9]{1,}[\.0-9]{0,})/);
10372                if (re.exec(ua) !== null)
10373                    rv = parseFloat(RegExp.$1);
10374            }
10375            return rv !== -1 && rv < 9;
10376        })(),
10377
10378        ie10 : window.navigator.msPointerEnabled,
10379        ie11 : window.navigator.pointerEnabled
10380    }
10381};
10382
10383/*=========================
10384  jQuery & Zepto Plugins
10385  ===========================*/
10386if (window.jQuery || window.Zepto) {
10387    (function ($) {
10388        'use strict';
10389        $.fn.swiper = function (params) {
10390            var s = new Swiper($(this)[0], params);
10391            $(this).data('swiper', s);
10392            return s;
10393        };
10394    })(window.jQuery || window.Zepto);
10395}
10396
10397// component
10398if (typeof(module) !== 'undefined')
10399{
10400    module.exports = Swiper;
10401}
10402
10403// requirejs support
10404if (typeof define === 'function' && define.amd) {
10405    define([], function () {
10406        'use strict';
10407        return Swiper;
10408    });
10409}
10410
10411
10412
10413/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
10414 * Licensed under the MIT License (LICENSE.txt).
10415 *
10416 * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
10417 * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
10418 * Thanks to: Seamus Leahy for adding deltaX and deltaY
10419 *
10420 * Version: 3.0.6
10421 * 
10422 * Requires: 1.2.2+
10423 */
10424
10425(function ($) {
10426
10427        var types = ['DOMMouseScroll', 'mousewheel'];
10428
10429        if ($.event.fixHooks) {
10430                for (var i = types.length; i;) {
10431                        $.event.fixHooks[types[--i]] = $.event.mouseHooks;
10432                }
10433        }
10434
10435        $.event.special.mousewheel = {
10436                setup: function () {
10437                        if (this.addEventListener) {
10438                                for (var i = types.length; i;) {
10439                                        this.addEventListener(types[--i], handler, false);
10440                                }
10441                        } else {
10442                                this.onmousewheel = handler;
10443                        }
10444                },
10445
10446                teardown: function () {
10447                        if (this.removeEventListener) {
10448                                for (var i = types.length; i;) {
10449                                        this.removeEventListener(types[--i], handler, false);
10450                                }
10451                        } else {
10452                                this.onmousewheel = null;
10453                        }
10454                }
10455        };
10456
10457        $.fn.extend({
10458                mousewheel: function (fn) {
10459                        return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
10460                },
10461
10462                unmousewheel: function (fn) {
10463                        return this.unbind("mousewheel", fn);
10464                }
10465        });
10466
10467
10468        function handler(event) {
10469                var orgEvent = event || window.event,
10470                        args = [].slice.call(arguments, 1),
10471                        delta = 0,
10472                        returnValue = true,
10473                        deltaX = 0,
10474                        deltaY = 0;
10475                event = $.event.fix(orgEvent);
10476                event.type = "mousewheel";
10477
10478                // Old school scrollwheel delta
10479                if (orgEvent.wheelDelta) {
10480                        delta = orgEvent.wheelDelta / 120;
10481                }
10482                if (orgEvent.detail) {
10483                        delta = -orgEvent.detail / 3;
10484                }
10485
10486                // New school multidimensional scroll (touchpads) deltas
10487                deltaY = delta;
10488
10489                // Gecko
10490                if (orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS) {
10491                        deltaY = 0;
10492                        deltaX = -1 * delta;
10493                }
10494
10495                // Webkit
10496                if (orgEvent.wheelDeltaY !== undefined) {
10497                        deltaY = orgEvent.wheelDeltaY / 120;
10498                }
10499                if (orgEvent.wheelDeltaX !== undefined) {
10500                        deltaX = -1 * orgEvent.wheelDeltaX / 120;
10501                }
10502
10503                // Add event and delta to the front of the arguments
10504                args.unshift(event, delta, deltaX, deltaY);
10505
10506                return ($.event.dispatch || $.event.handle).apply(this, args);
10507        }
10508
10509})(jQuery);
10510
10511
10512
10513(function ($, window, undefined) {
10514        // http://paulirish.com/2011/requestanimationframe-for-smart-animating/
10515        // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
10516        // requestAnimationFrame polyfill by Erik Möller
10517        // fixes from Paul Irish and Tino Zijdel
10518        var lastTime = 0,
10519                running, animate = function (elem) {
10520                        if (running) {
10521                                window.requestAnimationFrame(animate, elem);
10522                                jQuery.fx.tick();
10523                        }
10524                },
10525                vendors = ['ms', 'moz', 'webkit', 'o'];
10526
10527        for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
10528                window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
10529                window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
10530        }
10531
10532        if (!window.requestAnimationFrame) window.requestAnimationFrame = function (fn, element) {
10533                var currTime = new Date().getTime(),
10534                        delta = currTime - lastTime,
10535                        timeToCall = Math.max(0, 16 - delta);
10536
10537                var id = window.setTimeout(function () {
10538                        fn(currTime + timeToCall);
10539                }, timeToCall);
10540
10541                lastTime = currTime + timeToCall;
10542
10543                return id;
10544        };
10545
10546        if (!window.cancelAnimationFrame) {
10547                window.cancelAnimationFrame = function (id) {
10548                        clearTimeout(id);
10549                };
10550        }
10551
10552        jQuery.fx.timer = function (timer) {
10553                if (timer() && jQuery.timers.push(timer) && !running) {
10554                        running = true;
10555                        animate(timer.elem);
10556                }
10557        };
10558
10559        jQuery.fx.stop = function () {
10560                running = false;
10561        };
10562
10563}(jQuery, this));
10564
10565
10566
10567
10568
10569/* Copyright 2012, Ben Lin (http://dreamerslab.com/)
10570 * Licensed under the MIT License (LICENSE.txt).
10571 *
10572 * Version: 1.0.15
10573 *
10574 * Requires: jQuery >= 1.2.3
10575 */
10576(function (a) {
10577        a.fn.addBack = a.fn.addBack || a.fn.andSelf;
10578        a.fn.extend({
10579                actual: function (b, l) {
10580                        if (!this[b]) {
10581                                throw '$.actual => The jQuery method "' + b + '" you called does not exist';
10582                        }
10583                        var f = {
10584                                absolute: false,
10585                                clone: false,
10586                                includeMargin: false
10587                        };
10588                        var i = a.extend(f, l);
10589                        var e = this.eq(0);
10590                        var h, j;
10591                        if (i.clone === true) {
10592                                h = function () {
10593                                        var m = "position: absolute !important; top: -1000 !important; ";
10594                                        e = e.clone().attr("style", m).appendTo("body")
10595                                };
10596                                j = function () {
10597                                        e.remove()
10598                                }
10599                        } else {
10600                                var g = [];
10601                                var d = "";
10602                                var c;
10603                                h = function () {
10604                                        c = e.parents().addBack().filter(":hidden");
10605                                        d += "visibility: hidden !important; display: block !important; ";
10606                                        if (i.absolute === true) {
10607                                                d += "position: absolute !important; "
10608                                        }
10609                                        c.each(function () {
10610                                                var m = a(this);
10611                                                g.push(m.attr("style"));
10612                                                m.attr("style", d)
10613                                        })
10614                                };
10615                                j = function () {
10616                                        c.each(function (m) {
10617                                                var o = a(this);
10618                                                var n = g[m];
10619                                                if (n === undefined) {
10620                                                        o.removeAttr("style")
10621                                                } else {
10622                                                        o.attr("style", n)
10623                                                }
10624                                        })
10625                                }
10626                        }
10627                        h();
10628                        var k = /(outer)/.test(b) ? e[b](i.includeMargin) : e[b]();
10629                        j();
10630                        return k
10631                }
10632        })
10633})(jQuery);
10634
10635
10636
10637Swiper.prototype.plugins.progress = function (swiper, params) {
10638    'use strict';
10639
10640    var isH = swiper.params.mode === 'horizontal';
10641    var wrapperMaxPosition;
10642    function initSlides() {
10643        for (var i = 0; i < swiper.slides.length; i++) {
10644            var slide = swiper.slides[i];
10645            slide.progressSlideSize = isH ? swiper.h.getWidth(slide) : swiper.h.getHeight(slide);
10646            if ('offsetLeft' in slide) {
10647                slide.progressSlideOffset = isH ? slide.offsetLeft : slide.offsetTop;
10648            }
10649            else {
10650                slide.progressSlideOffset = isH ? slide.getOffset().left - swiper.h.getOffset(swiper.container).left : slide.getOffset().top - swiper.h.getOffset(swiper.container).top;
10651            }
10652        }
10653        if (isH) {
10654            wrapperMaxPosition = swiper.h.getWidth(swiper.wrapper) + swiper.wrapperLeft + swiper.wrapperRight - swiper.width;
10655        }
10656        else {
10657            wrapperMaxPosition = swiper.h.getHeight(swiper.wrapper) + swiper.wrapperTop + swiper.wrapperBottom - swiper.height;
10658        }
10659    }
10660    function calcProgress(transform) {
10661        transform = transform || {x: 0, y: 0, z: 0};
10662        var offsetCenter;
10663        if (swiper.params.centeredSlides === true) offsetCenter = isH ? -transform.x + swiper.width / 2 : -transform.y + swiper.height / 2;
10664        else offsetCenter = isH ? -transform.x : -transform.y;
10665        //Each slide offset from offset center
10666        for (var i = 0; i < swiper.slides.length; i++) {
10667            var slide = swiper.slides[i];
10668            var slideCenterOffset = (swiper.params.centeredSlides === true) ? slide.progressSlideSize / 2 : 0;
10669
10670            var offsetMultiplier = (offsetCenter - slide.progressSlideOffset - slideCenterOffset) / slide.progressSlideSize;
10671            slide.progress = offsetMultiplier;
10672
10673        }
10674        // Global Swiper Progress
10675        swiper.progress = isH ? -transform.x / wrapperMaxPosition : -transform.y / wrapperMaxPosition;
10676        // Callback
10677        if (swiper.params.onProgressChange) swiper.fireCallback(swiper.params.onProgressChange, swiper);
10678    }
10679
10680    //Plugin Hooks
10681    return {
10682        onFirstInit: function (args) {
10683            initSlides();
10684            calcProgress({
10685                x: swiper.getWrapperTranslate('x'),
10686                y: swiper.getWrapperTranslate('y')
10687            });
10688        },
10689        onInit: function (args) {
10690            initSlides();
10691        },
10692        onSetWrapperTransform: function (transform) {
10693            calcProgress(transform);
10694        }
10695    };
10696};
10697;
10698
10699/*
10700 
10701 jQuery Tools 1.2.5 Tabs- The basics of UI design.
10702
10703 NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
10704
10705 http://flowplayer.org/tools/tabs/
10706
10707 Since: November 2008
10708 Date:    Wed Sep 22 06:02:10 2010 +0000 
10709*/
10710(function (c) {
10711        function p(d, b, a) {
10712                var e = this,
10713                        l = d.add(this),
10714                        h = d.find(a.toolsTabs),
10715                        i = b.jquery ? b : d.children(b),
10716                        j;
10717                h.length || (h = d.children());
10718                i.length || (i = d.parent().find(b));
10719                i.length || (i = c(b));
10720                c.extend(this, {
10721                        click: function (f, g) {
10722                                var k = h.eq(f);
10723                                if (typeof f == "string" && f.replace("#", "")) {
10724                                        k = h.filter("[href*=" + f.replace("#", "") + "]");
10725                                        f = Math.max(h.index(k), 0)
10726                                }
10727                                if (a.rotate) {
10728                                        var n = h.length - 1;
10729                                        if (f < 0) return e.click(n, g);
10730                                        if (f > n) return e.click(0, g)
10731                                }
10732                                if (!k.length) {
10733                                        if (j >= 0) return e;
10734                                        f = a.initialIndex;
10735                                        k = h.eq(f)
10736                                }
10737                                if (f === j) return e;
10738                                g = g || c.Event();
10739                                g.type = "onBeforeClick";
10740                                l.trigger(g, [f]);
10741                                if (!g.isDefaultPrevented()) {
10742                                        o[a.effect].call(e, f, function () {
10743                                                g.type = "onClick";
10744                                                l.trigger(g, [f])
10745                                        });
10746                                        j = f;
10747                                        h.removeClass(a.current);
10748                                        k.addClass(a.current);
10749                                        return e
10750                                }
10751                        },
10752                        getConf: function () {
10753                                return a
10754                        },
10755                        getTabs: function () {
10756                                return h
10757                        },
10758                        getPanes: function () {
10759                                return i
10760                        },
10761                        getCurrentPane: function () {
10762                                return i.eq(j)
10763                        },
10764                        getCurrentTab: function () {
10765                                return h.eq(j)
10766                        },
10767                        getIndex: function () {
10768                                return j
10769                        },
10770                        next: function () {
10771                                return e.click(j + 1)
10772                        },
10773                        prev: function () {
10774                                return e.click(j - 1)
10775                        },
10776                        destroy: function () {
10777                                h.unbind(a.event).removeClass(a.current);
10778                                i.find("a[href^=#]").unbind("click.T");
10779                                return e
10780                        }
10781                });
10782                c.each("onBeforeClick,onClick".split(","), function (f, g) {
10783                        c.isFunction(a[g]) && c(e).bind(g, a[g]);
10784                        e[g] = function (k) {
10785                                k && c(e).bind(g, k);
10786                                return e
10787                        }
10788                });
10789                if (a.history && c.fn.history) {
10790                        c.tools.history.init(h);
10791                        a.event = "history"
10792                }
10793                h.each(function (f) {
10794                        c(this).bind(a.event, function (g) {
10795                                e.click(f, g);
10796                                //return g.preventDefault()
10797                        })
10798                });
10799                i.find("a[href^=#]").bind("click.T", function (f) {
10800                        e.click(c(this).attr("href"), f)
10801                });
10802                if (location.hash && a.toolsTabs == "a" && d.find("[href=" + location.hash + "]").length) e.click(location.hash);
10803                else if (a.initialIndex === 0 || a.initialIndex > 0) e.click(a.initialIndex)
10804        }
10805        c.tools = c.tools || {
10806                version: "1.2.5"
10807        };
10808        c.tools.toolsTabs = {
10809                conf: {
10810                        toolsTabs: "a",
10811                        current: "current",
10812                        onBeforeClick: null,
10813                        onClick: null,
10814                        effect: "default",
10815                        initialIndex: 0,
10816                        event: "click",
10817                        rotate: false,
10818                        history: false
10819                },
10820                addEffect: function (d, b) {
10821                        o[d] = b
10822                }
10823        };
10824        var o = {
10825                "default": function (d, b) {
10826                        this.getPanes().addClass('visuallyhidden').eq(d).removeClass('visuallyhidden');
10827                        b.call()
10828                },
10829                fade: function (d, b) {
10830                        var a = this.getConf(),
10831                                e = a.fadeOutSpeed,
10832                                l = this.getPanes();
10833                        e ? l.fadeOut(e) : l.hide();
10834                        l.eq(d).fadeIn(a.fadeInSpeed, b)
10835                },
10836                slide: function (d, b) {
10837                        this.getPanes().slideUp(100);
10838                        this.getPanes().eq(d).slideDown(100, b)
10839                },
10840                ajax: function (d, b) {
10841                        this.getPanes().eq(0).load(this.getTabs().eq(d).attr("href"), b)
10842                }
10843        },
10844                m;
10845        c.tools.toolsTabs.addEffect("horizontal", function (d, b) {
10846                m || (m = this.getPanes().eq(0).width());
10847                this.getCurrentPane().animate({
10848                        width: 0
10849                }, function () {
10850                        c(this).hide()
10851                });
10852                this.getPanes().eq(d).animate({
10853                        width: m
10854                }, function () {
10855                        c(this).show();
10856                        b.call()
10857                })
10858        });
10859        c.fn.toolsTabs = function (d, b) {
10860                var a = this.data("toolsTabs");
10861                if (a) {
10862                        a.destroy();
10863                        this.removeData("toolsTabs")
10864                }
10865                if (c.isFunction(b)) b = {
10866                        onBeforeClick: b
10867                };
10868                b = c.extend({}, c.tools.toolsTabs.conf, b);
10869                this.each(function () {
10870                        a = new p(c(this), d, b);
10871                        c(this).data("toolsTabs", a)
10872                });
10873                return b.api ? a : this
10874        }
10875})(jQuery);
10876
10877;
10878
10879/*
10880 
10881 jQuery Tools Validator 1.2.5 - HTML5 is here. Now use it.
10882
10883 NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
10884
10885 http://flowplayer.org/tools/form/validator/
10886
10887 Since: Mar 2010
10888 Date:    Wed Sep 22 06:02:10 2010 +0000 
10889*/
10890(function (e) {
10891        function t(a, b, c) {
10892                var k = a.offset().top,
10893                        f = a.offset().left,
10894                        l = c.position.split(/,?\s+/),
10895                        p = l[0];
10896                l = l[1];
10897                k -= b.outerHeight() - c.offset[0];
10898                f += a.outerWidth() + c.offset[1];
10899                if (/iPad/i.test(navigator.userAgent)) k -= e(window).scrollTop();
10900                c = b.outerHeight() + a.outerHeight();
10901                if (p == "center") k += c / 2;
10902                if (p == "bottom") k += c;
10903                a = a.outerWidth();
10904                if (l == "center") f -= (a + b.outerWidth()) / 2;
10905                if (l == "left") f -= a;
10906                return {
10907                        top: k,
10908                        left: f
10909                }
10910        }
10911        function y(a) {
10912                function b() {
10913                        return this.getAttribute("type") == a
10914                }
10915                b.key = "[type=" + a + "]";
10916                return b
10917        }
10918        function u(a, b, c) {
10919                function k(g, d, i) {
10920                        if (!(!c.grouped && g.length)) {
10921                                var j;
10922                                if (i === false || e.isArray(i)) {
10923                                        j = h.messages[d.key || d] || h.messages["*"];
10924                                        j = j[c.lang] || h.messages["*"].en;
10925                                        (d = j.match(/\$\d/g)) && e.isArray(i) && e.each(d, function (m) {
10926                                                j = j.replace(this, i[m])
10927                                        })
10928                                } else j = i[c.lang] || i;
10929                                g.push(j)
10930                        }
10931                }
10932                var f = this,
10933                        l = b.add(f);
10934                a = a.not(":button, :image, :reset, :submit");
10935                e.extend(f, {
10936                        getConf: function () {
10937                                return c
10938                        },
10939                        getForm: function () {
10940                                return b
10941                        },
10942                        getInputs: function () {
10943                                return a
10944                        },
10945                        reflow: function () {
10946                                a.each(function () {
10947                                        var g = e(this),
10948                                                d = g.data("msg.el");
10949                                        if (d) {
10950                                                g = t(g, d, c);
10951                                                d.css({
10952                                                        top: g.top,
10953                                                        left: g.left
10954                                                })
10955                                        }
10956                                });
10957                                return f
10958                        },
10959                        invalidate: function (g, d) {
10960                                if (!d) {
10961                                        var i = [];
10962                                        e.each(g, function (j, m) {
10963                                                j = a.filter("[name='" + j + "']");
10964                                                if (j.length) {
10965                                                        j.trigger("OI", [m]);
10966                                                        i.push({
10967                                                                input: j,
10968                                                                messages: [m]
10969                                                        })
10970                                                }
10971                                        });
10972                                        g = i;
10973                                        d = e.Event()
10974                                }
10975                                d.type = "onFail";
10976                                l.trigger(d, [g]);
10977                                d.isDefaultPrevented() || q[c.effect][0].call(f, g, d);
10978                                return f
10979                        },
10980                        reset: function (g) {
10981                                g = g || a;
10982                                g.removeClass(c.errorClass).each(function () {
10983                                        var d = e(this).data("msg.el");
10984                                        if (d) {
10985                                                d.remove();
10986                                                e(this).data("msg.el", null)
10987                                        }
10988                                }).unbind(c.errorInputEvent || "");
10989                                return f
10990                        },
10991                        destroy: function () {
10992                                b.unbind(c.formEvent + ".V").unbind("reset.V");
10993                                a.unbind(c.inputEvent + ".V").unbind("change.V");
10994                                return f.reset()
10995                        },
10996                        checkValidity: function (g, d) {
10997                                g = g || a;
10998                                g = g.not(":disabled");
10999                                if (!g.length) return true;
11000                                d = d || e.Event();
11001                                d.type = "onBeforeValidate";
11002                                l.trigger(d, [g]);
11003                                if (d.isDefaultPrevented()) return d.result;
11004                                var i = [];
11005                                g.not(":radio:not(:checked)").each(function () {
11006                                        var m = [],
11007                                                n = e(this).data("messages", m),
11008                                                v = r && n.is(":date") ? "onHide.v" : c.errorInputEvent + ".v";
11009                                        n.unbind(v);
11010                                        e.each(w, function () {
11011                                                var o = this,
11012                                                        s = o[0];
11013                                                if (n.filter(s).length) {
11014                                                        o = o[1].call(f, n, n.val());
11015                                                        if (o !== true) {
11016                                                                d.type = "onBeforeFail";
11017                                                                l.trigger(d, [n, s]);
11018                                                                if (d.isDefaultPrevented()) return false;
11019                                                                var x = n.attr(c.messageAttr);
11020                                                                if (x) {
11021                                                                        m = [x];
11022                                                                        return false
11023                                                                } else k(m, s, o)
11024                                                        }
11025                                                }
11026                                        });
11027                                        if (m.length) {
11028                                                i.push({
11029                                                        input: n,
11030                                                        messages: m
11031                                                });
11032                                                n.trigger("OI", [m]);
11033                                                c.errorInputEvent && n.bind(v, function (o) {
11034                                                        f.checkValidity(n, o)
11035                                                })
11036                                        }
11037                                        if (c.singleError && i.length) return false
11038                                });
11039                                var j = q[c.effect];
11040                                if (!j) throw 'Validator: cannot find effect "' + c.effect + '"';
11041                                if (i.length) {
11042                                        f.invalidate(i, d);
11043                                        return false
11044                                } else {
11045                                        j[1].call(f, g, d);
11046                                        d.type = "onSuccess";
11047                                        l.trigger(d, [g]);
11048                                        g.unbind(c.errorInputEvent + ".v")
11049                                }
11050                                return true
11051                        }
11052                });
11053                e.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","), function (g, d) {
11054                        e.isFunction(c[d]) && e(f).bind(d, c[d]);
11055                        f[d] = function (i) {
11056                                i && e(f).bind(d, i);
11057                                return f
11058                        }
11059                });
11060                c.formEvent && b.bind(c.formEvent + ".V", function (g) {
11061                        if (!f.checkValidity(null, g)) return g.preventDefault()
11062                });
11063                b.bind("reset.V", function () {
11064                        f.reset()
11065                });
11066                a[0] && a[0].validity && a.each(function () {
11067                        this.oninvalid = function () {
11068                                return false
11069                        }
11070                });
11071                if (b[0]) b[0].checkValidity = f.checkValidity;
11072                c.inputEvent && a.bind(c.inputEvent + ".V", function (g) {
11073                        f.checkValidity(e(this), g)
11074                });
11075                a.filter(":checkbox, select").filter("[required]").bind("change.V", function (g) {
11076                        var d = e(this);
11077                        if (this.checked || d.is("select") && e(this).val()) q[c.effect][1].call(f, d, g)
11078                });
11079                var p = a.filter(":radio").change(function (g) {
11080                        f.checkValidity(p, g)
11081                });
11082                e(window).resize(function () {
11083                        f.reflow()
11084                })
11085        }
11086        e.tools = e.tools || {
11087                version: "1.2.5"
11088        };
11089        var z = /\[type=([a-z]+)\]/,
11090                A = /^-?[0-9]*(\.[0-9]+)?$/,
11091                r = e.tools.dateinput,
11092                B = /^([a-z0-9_\.\-\+]+)@([\da-z\.\-]+)\.([a-z\.]{2,6})$/i,
11093                C = /^(https?:\/\/)?[\da-z\.\-]+\.[a-z\.]{2,6}[#&+_\?\/\w \.\-=]*$/i,
11094                h;
11095        h = e.tools.validator = {
11096                conf: {
11097                        grouped: false,
11098                        effect: "default",
11099                        errorClass: "invalid",
11100                        inputEvent: null,
11101                        errorInputEvent: "keyup",
11102                        formEvent: "submit",
11103                        lang: "en",
11104                        message: "<div/>",
11105                        messageAttr: "data-message",
11106                        messageClass: "error",
11107                        offset: [0, 0],
11108                        position: "center right",
11109                        singleError: false,
11110                        speed: "normal"
11111                },
11112                messages: {
11113                        "*": {
11114                                en: "Please correct this value"
11115                        }
11116                },
11117                localize: function (a, b) {
11118                        e.each(b, function (c, k) {
11119                                h.messages[c] = h.messages[c] || {};
11120                                h.messages[c][a] = k
11121                        })
11122                },
11123                localizeFn: function (a, b) {
11124                        h.messages[a] = h.messages[a] || {};
11125                        e.extend(h.messages[a], b)
11126                },
11127                fn: function (a, b, c) {
11128                        if (e.isFunction(b)) c = b;
11129                        else {
11130                                if (typeof b == "string") b = {
11131                                        en: b
11132                                };
11133                                this.messages[a.key || a] = b
11134                        }
11135                        if (b = z.exec(a)) a = y(b[1]);
11136                        w.push([a, c])
11137                },
11138                addEffect: function (a, b, c) {
11139                        q[a] = [b, c]
11140                }
11141        };
11142        var w = [],
11143                q = {
11144                        "default": [function (a) {
11145                                var b = this.getConf();
11146                                e.each(a, function (c, k) {
11147                                        c = k.input;
11148                                        c.addClass(b.errorClass);
11149                                        var f = c.data("msg.el");
11150                                        if (!f) {
11151                                                f = e(b.message).addClass(b.messageClass).appendTo(document.body);
11152                                                c.data("msg.el", f)
11153                                        }
11154                                        f.css({
11155                                                visibility: "hidden"
11156                                        }).find("p").remove();
11157                                        e.each(k.messages, function (l, p) {
11158                                                e("<p/>").html(p).appendTo(f)
11159                                        });
11160                                        f.outerWidth() == f.parent().width() && f.add(f.find("p")).css({
11161                                                display: "inline"
11162                                        });
11163                                        k = t(c, f, b);
11164                                        f.css({
11165                                                visibility: "visible",
11166                                                position: "absolute",
11167                                                top: k.top,
11168                                                left: k.left
11169                                        }).fadeIn(b.speed)
11170                                })
11171                        }, function (a) {
11172                                var b = this.getConf();
11173                                a.removeClass(b.errorClass).each(function () {
11174                                        var c = e(this).data("msg.el");
11175                                        c && c.css({
11176                                                visibility: "hidden"
11177                                        })
11178                                })
11179                        }]
11180                };
11181        e.each("email,url,number".split(","), function (a, b) {
11182                e.expr[":"][b] = function (c) {
11183                        return c.getAttribute("type") === b
11184                }
11185        });
11186        e.fn.oninvalid = function (a) {
11187                return this[a ? "bind" : "trigger"]("OI", a)
11188        };
11189        h.fn(":email", "Please enter a valid email address", function (a, b) {
11190                return !b || B.test(b)
11191        });
11192        h.fn(":url", "Please enter a valid URL", function (a, b) {
11193                return !b || C.test(b)
11194        });
11195        h.fn(":number", "Please enter a numeric value.", function (a, b) {
11196                return A.test(b)
11197        });
11198        h.fn("[max]", "Please enter a value smaller than $1", function (a, b) {
11199                if (b === "" || r && a.is(":date")) return true;
11200                a = a.attr("max");
11201                return parseFloat(b) <= parseFloat(a) ? true : [a]
11202        });
11203        h.fn("[min]", "Please enter a value larger than $1", function (a, b) {
11204                if (b === "" || r && a.is(":date")) return true;
11205                a = a.attr("min");
11206                return parseFloat(b) >= parseFloat(a) ? true : [a]
11207        });
11208        h.fn("[required]", "Please complete this mandatory field.", function (a, b) {
11209                if (a.is(":checkbox")) return a.is(":checked");
11210                return !!b
11211        });
11212        h.fn("[pattern]", function (a) {
11213                var b = new RegExp("^" + a.attr("pattern") + "$");
11214                return b.test(a.val())
11215        });
11216        e.fn.validator = function (a) {
11217                var b = this.data("validator");
11218                if (b) {
11219                        b.destroy();
11220                        this.removeData("validator")
11221                }
11222                a = e.extend(true, {}, h.conf, a);
11223                if (this.is("form")) return this.each(function () {
11224                        var c = e(this);
11225                        b = new u(c.find(":input"), c, a);
11226                        c.data("validator", b)
11227                });
11228                else {
11229                        b = new u(this, this.eq(0).closest("form"), a);
11230                        return this.data("validator", b)
11231                }
11232        }
11233})(jQuery);
11234
11235;/*
11236 * transform: A jQuery cssHooks adding cross-browser 2d transform capabilities to $.fn.css() and $.fn.animate()
11237 *
11238 * limitations:
11239 * - requires jQuery 1.4.3+
11240 * - Should you use the *translate* property, then your elements need to be absolutely positionned in a relatively positionned wrapper **or it will fail in IE678**.
11241 * - transformOrigin is not accessible
11242 *
11243 * latest version and complete README available on Github:
11244 * https://github.com/louisremi/jquery.transform.js
11245 *
11246 * Copyright 2011 @louis_remi
11247 * Licensed under the MIT license.
11248 *
11249 * This saved you an hour of work?
11250 * Send me music http://www.amazon.co.uk/wishlist/HNTU0468LQON
11251 *
11252 */
11253(function( $, window, document, Math, undefined ) {
11254
11255/*
11256 * Feature tests and global variables
11257 */
11258var div = document.createElement("div"),
11259	divStyle = div.style,
11260	suffix = "Transform",
11261	testProperties = [
11262		"O" + suffix,
11263		"ms" + suffix,
11264		"Webkit" + suffix,
11265		"Moz" + suffix
11266	],
11267	i = testProperties.length,
11268	supportProperty,
11269	supportMatrixFilter,
11270	supportFloat32Array = "Float32Array" in window,
11271	propertyHook,
11272	propertyGet,
11273	rMatrix = /Matrix([^)]*)/,
11274	rAffine = /^\s*matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*(?:,\s*0(?:px)?\s*){2}\)\s*$/,
11275	_transform = "transform",
11276	_transformOrigin = "transformOrigin",
11277	_translate = "translate",
11278	_rotate = "rotate",
11279	_scale = "scale",
11280	_skew = "skew",
11281	_matrix = "matrix";
11282
11283// test different vendor prefixes of these properties
11284while ( i-- ) {
11285	if ( testProperties[i] in divStyle ) {
11286		$.support[_transform] = supportProperty = testProperties[i];
11287		$.support[_transformOrigin] = supportProperty + "Origin";
11288		continue;
11289	}
11290}
11291// IE678 alternative
11292if ( !supportProperty ) {
11293	$.support.matrixFilter = supportMatrixFilter = divStyle.filter === "";
11294}
11295
11296// px isn't the default unit of these properties
11297$.cssNumber[_transform] = $.cssNumber[_transformOrigin] = true;
11298
11299/*
11300 * fn.css() hooks
11301 */
11302if ( supportProperty && supportProperty != _transform ) {
11303	// Modern browsers can use jQuery.cssProps as a basic hook
11304	$.cssProps[_transform] = supportProperty;
11305	$.cssProps[_transformOrigin] = supportProperty + "Origin";
11306
11307	// Firefox needs a complete hook because it stuffs matrix with "px"
11308	if ( supportProperty == "Moz" + suffix ) {
11309		propertyHook = {
11310			get: function( elem, computed ) {
11311				return (computed ?
11312					// remove "px" from the computed matrix
11313					$.css( elem, supportProperty ).split("px").join(""):
11314					elem.style[supportProperty]
11315				);
11316			},
11317			set: function( elem, value ) {
11318				// add "px" to matrices
11319				elem.style[supportProperty] = /matrix\([^)p]*\)/.test(value) ?
11320					value.replace(/matrix((?:[^,]*,){4})([^,]*),([^)]*)/, _matrix+"$1$2px,$3px"):
11321					value;
11322			}
11323		};
11324	/* Fix two jQuery bugs still present in 1.5.1
11325	 * - rupper is incompatible with IE9, see http://jqbug.com/8346
11326	 * - jQuery.css is not really jQuery.cssProps aware, see http://jqbug.com/8402
11327	 */
11328	} else if ( /^1\.[0-5](?:\.|$)/.test($.fn.jquery) ) {
11329		propertyHook = {
11330			get: function( elem, computed ) {
11331				return (computed ?
11332					$.css( elem, supportProperty.replace(/^ms/, "Ms") ):
11333					elem.style[supportProperty]
11334				);
11335			}
11336		};
11337	}
11338	/* TODO: leverage hardware acceleration of 3d transform in Webkit only
11339	else if ( supportProperty == "Webkit" + suffix && support3dTransform ) {
11340		propertyHook = {
11341			set: function( elem, value ) {
11342				elem.style[supportProperty] = 
11343					value.replace();
11344			}
11345		}
11346	}*/
11347
11348} else if ( supportMatrixFilter ) {
11349	propertyHook = {
11350		get: function( elem, computed, asArray ) {
11351			var elemStyle = ( computed && elem.currentStyle ? elem.currentStyle : elem.style ),
11352				matrix, data;
11353
11354			if ( elemStyle && rMatrix.test( elemStyle.filter ) ) {
11355				matrix = RegExp.$1.split(",");
11356				matrix = [
11357					matrix[0].split("=")[1],
11358					matrix[2].split("=")[1],
11359					matrix[1].split("=")[1],
11360					matrix[3].split("=")[1]
11361				];
11362			} else {
11363				matrix = [1,0,0,1];
11364			}
11365
11366			if ( ! $.cssHooks[_transformOrigin] ) {
11367				matrix[4] = elemStyle ? parseInt(elemStyle.left, 10) || 0 : 0;
11368				matrix[5] = elemStyle ? parseInt(elemStyle.top, 10) || 0 : 0;
11369
11370			} else {
11371				data = $._data( elem, "transformTranslate", undefined );
11372				matrix[4] = data ? data[0] : 0;
11373				matrix[5] = data ? data[1] : 0;
11374			}
11375
11376			return asArray ? matrix : _matrix+"(" + matrix + ")";
11377		},
11378		set: function( elem, value, animate ) {
11379			var elemStyle = elem.style,
11380				currentStyle,
11381				Matrix,
11382				filter,
11383				centerOrigin;
11384
11385			if ( !animate ) {
11386				elemStyle.zoom = 1;
11387			}
11388
11389			value = matrix(value);
11390
11391			// rotate, scale and skew
11392			Matrix = [
11393				"Matrix("+
11394					"M11="+value[0],
11395					"M12="+value[2],
11396					"M21="+value[1],
11397					"M22="+value[3],
11398					"SizingMethod='auto expand'"
11399			].join();
11400			filter = ( currentStyle = elem.currentStyle ) && currentStyle.filter || elemStyle.filter || "";
11401
11402			elemStyle.filter = rMatrix.test(filter) ?
11403				filter.replace(rMatrix, Matrix) :
11404				filter + " progid:DXImageTransform.Microsoft." + Matrix + ")";
11405
11406			if ( ! $.cssHooks[_transformOrigin] ) {
11407
11408				// center the transform origin, from pbakaus's Transformie http://github.com/pbakaus/transformie
11409				if ( (centerOrigin = $.transform.centerOrigin) ) {
11410					elemStyle[centerOrigin == "margin" ? "marginLeft" : "left"] = -(elem.offsetWidth/2) + (elem.clientWidth/2) + "px";
11411					elemStyle[centerOrigin == "margin" ? "marginTop" : "top"] = -(elem.offsetHeight/2) + (elem.clientHeight/2) + "px";
11412				}
11413
11414				// translate
11415				// We assume that the elements are absolute positionned inside a relative positionned wrapper
11416				elemStyle.left = value[4] + "px";
11417				elemStyle.top = value[5] + "px";
11418
11419			} else {
11420				$.cssHooks[_transformOrigin].set( elem, value );
11421			}
11422		}
11423	};
11424}
11425// populate jQuery.cssHooks with the appropriate hook if necessary
11426if ( propertyHook ) {
11427	$.cssHooks[_transform] = propertyHook;
11428}
11429// we need a unique setter for the animation logic
11430propertyGet = propertyHook && propertyHook.get || $.css;
11431
11432/*
11433 * fn.animate() hooks
11434 */
11435$.fx.step.transform = function( fx ) {
11436	var elem = fx.elem,
11437		start = fx.start,
11438		end = fx.end,
11439		pos = fx.pos,
11440		transform = "",
11441		precision = 1E5,
11442		i, startVal, endVal, unit;
11443
11444	// fx.end and fx.start need to be converted to interpolation lists
11445	if ( !start || typeof start === "string" ) {
11446
11447		// the following block can be commented out with jQuery 1.5.1+, see #7912
11448		if ( !start ) {
11449			start = propertyGet( elem, supportProperty );
11450		}
11451
11452		// force layout only once per animation
11453		if ( supportMatrixFilter ) {
11454			elem.style.zoom = 1;
11455		}
11456
11457		// replace "+=" in relative animations (-= is meaningless with transforms)
11458		end = end.split("+=").join(start);
11459
11460		// parse both transform to generate interpolation list of same length
11461		$.extend( fx, interpolationList( start, end ) );
11462		start = fx.start;
11463		end = fx.end;
11464	}
11465
11466	i = start.length;
11467
11468	// interpolate functions of the list one by one
11469	while ( i-- ) {
11470		startVal = start[i];
11471		endVal = end[i];
11472		unit = +false;
11473
11474		switch ( startVal[0] ) {
11475
11476			case _translate:
11477				unit = "px";
11478			case _scale:
11479				unit || ( unit = "");
11480
11481				transform = startVal[0] + "(" +
11482					Math.round( (startVal[1][0] + (endVal[1][0] - startVal[1][0]) * pos) * precision ) / precision + unit +","+
11483					Math.round( (startVal[1][1] + (endVal[1][1] - startVal[1][1]) * pos) * precision ) / precision + unit + ")"+
11484					transform;
11485				break;
11486
11487			case _skew + "X":
11488			case _skew + "Y":
11489			case _rotate:
11490				transform = startVal[0] + "(" +
11491					Math.round( (startVal[1] + (endVal[1] - startVal[1]) * pos) * precision ) / precision +"rad)"+
11492					transform;
11493				break;
11494		}
11495	}
11496
11497	fx.origin && ( transform = fx.origin + transform );
11498
11499	propertyHook && propertyHook.set ?
11500		propertyHook.set( elem, transform, +true ):
11501		elem.style[supportProperty] = transform;
11502};
11503
11504/*
11505 * Utility functions
11506 */
11507
11508// turns a transform string into its "matrix(A,B,C,D,X,Y)" form (as an array, though)
11509function matrix( transform ) {
11510	transform = transform.split(")");
11511	var
11512			trim = $.trim
11513		, i = -1
11514		// last element of the array is an empty string, get rid of it
11515		, l = transform.length -1
11516		, split, prop, val
11517		, prev = supportFloat32Array ? new Float32Array(6) : []
11518		, curr = supportFloat32Array ? new Float32Array(6) : []
11519		, rslt = supportFloat32Array ? new Float32Array(6) : [1,0,0,1,0,0]
11520		;
11521
11522	prev[0] = prev[3] = rslt[0] = rslt[3] = 1;
11523	prev[1] = prev[2] = prev[4] = prev[5] = 0;
11524
11525	// Loop through the transform properties, parse and multiply them
11526	while ( ++i < l ) {
11527		split = transform[i].split("(");
11528		prop = trim(split[0]);
11529		val = split[1];
11530		curr[0] = curr[3] = 1;
11531		curr[1] = curr[2] = curr[4] = curr[5] = 0;
11532
11533		switch (prop) {
11534			case _translate+"X":
11535				curr[4] = parseInt(val, 10);
11536				break;
11537
11538			case _translate+"Y":
11539				curr[5] = parseInt(val, 10);
11540				break;
11541
11542			case _translate:
11543				val = val.split(",");
11544				curr[4] = parseInt(val[0], 10);
11545				curr[5] = parseInt(val[1] || 0, 10);
11546				break;
11547
11548			case _rotate:
11549				val = toRadian(val);
11550				curr[0] = Math.cos(val);
11551				curr[1] = Math.sin(val);
11552				curr[2] = -Math.sin(val);
11553				curr[3] = Math.cos(val);
11554				break;
11555
11556			case _scale+"X":
11557				curr[0] = +val;
11558				break;
11559
11560			case _scale+"Y":
11561				curr[3] = val;
11562				break;
11563
11564			case _scale:
11565				val = val.split(",");
11566				curr[0] = val[0];
11567				curr[3] = val.length>1 ? val[1] : val[0];
11568				break;
11569
11570			case _skew+"X":
11571				curr[2] = Math.tan(toRadian(val));
11572				break;
11573
11574			case _skew+"Y":
11575				curr[1] = Math.tan(toRadian(val));
11576				break;
11577
11578			case _matrix:
11579				val = val.split(",");
11580				curr[0] = val[0];
11581				curr[1] = val[1];
11582				curr[2] = val[2];
11583				curr[3] = val[3];
11584				curr[4] = parseInt(val[4], 10);
11585				curr[5] = parseInt(val[5], 10);
11586				break;
11587		}
11588
11589		// Matrix product (array in column-major order)
11590		rslt[0] = prev[0] * curr[0] + prev[2] * curr[1];
11591		rslt[1] = prev[1] * curr[0] + prev[3] * curr[1];
11592		rslt[2] = prev[0] * curr[2] + prev[2] * curr[3];
11593		rslt[3] = prev[1] * curr[2] + prev[3] * curr[3];
11594		rslt[4] = prev[0] * curr[4] + prev[2] * curr[5] + prev[4];
11595		rslt[5] = prev[1] * curr[4] + prev[3] * curr[5] + prev[5];
11596
11597		prev = [rslt[0],rslt[1],rslt[2],rslt[3],rslt[4],rslt[5]];
11598	}
11599	return rslt;
11600}
11601
11602// turns a matrix into its rotate, scale and skew components
11603// algorithm from http://hg.mozilla.org/mozilla-central/file/7cb3e9795d04/layout/style/nsStyleAnimation.cpp
11604function unmatrix(matrix) {
11605	var
11606			scaleX
11607		, scaleY
11608		, skew
11609		, A = matrix[0]
11610		, B = matrix[1]
11611		, C = matrix[2]
11612		, D = matrix[3]
11613		;
11614
11615	// Make sure matrix is not singular
11616	if ( A * D - B * C ) {
11617		// step (3)
11618		scaleX = Math.sqrt( A * A + B * B );
11619		A /= scaleX;
11620		B /= scaleX;
11621		// step (4)
11622		skew = A * C + B * D;
11623		C -= A * skew;
11624		D -= B * skew;
11625		// step (5)
11626		scaleY = Math.sqrt( C * C + D * D );
11627		C /= scaleY;
11628		D /= scaleY;
11629		skew /= scaleY;
11630		// step (6)
11631		if ( A * D < B * C ) {
11632			A = -A;
11633			B = -B;
11634			skew = -skew;
11635			scaleX = -scaleX;
11636		}
11637
11638	// matrix is singular and cannot be interpolated
11639	} else {
11640		// In this case the elem shouldn't be rendered, hence scale == 0
11641		scaleX = scaleY = skew = 0;
11642	}
11643
11644	// The recomposition order is very important
11645	// see http://hg.mozilla.org/mozilla-central/file/7cb3e9795d04/layout/style/nsStyleAnimation.cpp#l971
11646	return [
11647		[_translate, [+matrix[4], +matrix[5]]],
11648		[_rotate, Math.atan2(B, A)],
11649		[_skew + "X", Math.atan(skew)],
11650		[_scale, [scaleX, scaleY]]
11651	];
11652}
11653
11654// build the list of transform functions to interpolate
11655// use the algorithm described at http://dev.w3.org/csswg/css3-2d-transforms/#animation
11656function interpolationList( start, end ) {
11657	var list = {
11658			start: [],
11659			end: []
11660		},
11661		i = -1, l,
11662		currStart, currEnd, currType;
11663
11664	// get rid of affine transform matrix
11665	( start == "none" || isAffine( start ) ) && ( start = "" );
11666	( end == "none" || isAffine( end ) ) && ( end = "" );
11667
11668	// if end starts with the current computed style, this is a relative animation
11669	// store computed style as the origin, remove it from start and end
11670	if ( start && end && !end.indexOf("matrix") && toArray( start ).join() == toArray( end.split(")")[0] ).join() ) {
11671		list.origin = start;
11672		start = "";
11673		end = end.slice( end.indexOf(")") +1 );
11674	}
11675
11676	if ( !start && !end ) { return; }
11677
11678	// start or end are affine, or list of transform functions are identical
11679	// => functions will be interpolated individually
11680	if ( !start || !end || functionList(start) == functionList(end) ) {
11681
11682		start && ( start = start.split(")") ) && ( l = start.length );
11683		end && ( end = end.split(")") ) && ( l = end.length );
11684
11685		while ( ++i < l-1 ) {
11686			start[i] && ( currStart = start[i].split("(") );
11687			end[i] && ( currEnd = end[i].split("(") );
11688			currType = $.trim( ( currStart || currEnd )[0] );
11689
11690			append( list.start, parseFunction( currType, currStart ? currStart[1] : 0 ) );
11691			append( list.end, parseFunction( currType, currEnd ? currEnd[1] : 0 ) );
11692		}
11693
11694	// otherwise, functions will be composed to a single matrix
11695	} else {
11696		list.start = unmatrix(matrix(start));
11697		list.end = unmatrix(matrix(end))
11698	}
11699
11700	return list;
11701}
11702
11703function parseFunction( type, value ) {
11704	var
11705		// default value is 1 for scale, 0 otherwise
11706		defaultValue = +(!type.indexOf(_scale)),
11707		scaleX,
11708		// remove X/Y from scaleX/Y & translateX/Y, not from skew
11709		cat = type.replace( /e[XY]/, "e" );
11710
11711	switch ( type ) {
11712		case _translate+"Y":
11713		case _scale+"Y":
11714
11715			value = [
11716				defaultValue,
11717				value ?
11718					parseFloat( value ):
11719					defaultValue
11720			];
11721			break;
11722
11723		case _translate+"X":
11724		case _translate:
11725		case _scale+"X":
11726			scaleX = 1;
11727		case _scale:
11728
11729			value = value ?
11730				( value = value.split(",") ) &&	[
11731					parseFloat( value[0] ),
11732					parseFloat( value.length>1 ? value[1] : type == _scale ? scaleX || value[0] : defaultValue+"" )
11733				]:
11734				[defaultValue, defaultValue];
11735			break;
11736
11737		case _skew+"X":
11738		case _skew+"Y":
11739		case _rotate:
11740			value = value ? toRadian( value ) : 0;
11741			break;
11742
11743		case _matrix:
11744			return unmatrix( value ? toArray(value) : [1,0,0,1,0,0] );
11745			break;
11746	}
11747
11748	return [[ cat, value ]];
11749}
11750
11751function isAffine( matrix ) {
11752	return rAffine.test(matrix);
11753}
11754
11755function functionList( transform ) {
11756	return transform.replace(/(?:\([^)]*\))|\s/g, "");
11757}
11758
11759function append( arr1, arr2, value ) {
11760	while ( value = arr2.shift() ) {
11761		arr1.push( value );
11762	}
11763}
11764
11765// converts an angle string in any unit to a radian Float
11766function toRadian(value) {
11767	return ~value.indexOf("deg") ?
11768		parseInt(value,10) * (Math.PI * 2 / 360):
11769		~value.indexOf("grad") ?
11770			parseInt(value,10) * (Math.PI/200):
11771			parseFloat(value);
11772}
11773
11774// Converts "matrix(A,B,C,D,X,Y)" to [A,B,C,D,X,Y]
11775function toArray(matrix) {
11776	// remove the unit of X and Y for Firefox
11777	matrix = /([^,]*),([^,]*),([^,]*),([^,]*),([^,p]*)(?:px)?,([^)p]*)(?:px)?/.exec(matrix);
11778	return [matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6]];
11779}
11780
11781$.transform = {
11782	centerOrigin: "margin"
11783};
11784
11785})( jQuery, window, document, Math );
11786;// The MIT License (MIT)
11787
11788// Typed.js | Copyright (c) 2014 Matt Boldt | www.mattboldt.com
11789
11790// Permission is hereby granted, free of charge, to any person obtaining a copy
11791// of this software and associated documentation files (the "Software"), to deal
11792// in the Software without restriction, including without limitation the rights
11793// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11794// copies of the Software, and to permit persons to whom the Software is
11795// furnished to do so, subject to the following conditions:
11796
11797// The above copyright notice and this permission notice shall be included in
11798// all copies or substantial portions of the Software.
11799
11800// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
11801// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11802// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
11803// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
11804// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
11805// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
11806// THE SOFTWARE.
11807
11808
11809
11810
11811!function($){
11812
11813    "use strict";
11814
11815    var Typed = function(el, options){
11816
11817        // chosen element to manipulate text
11818        this.el = $(el);
11819        // options
11820        this.options = $.extend({}, $.fn.typed.defaults, options);
11821
11822        // text content of element
11823        this.text = this.el.text();
11824
11825        // typing speed
11826        this.typeSpeed = this.options.typeSpeed;
11827
11828        // add a delay before typing starts
11829        this.startDelay = this.options.startDelay;
11830
11831        // backspacing speed
11832        this.backSpeed = this.options.backSpeed;
11833
11834        // amount of time to wait before backspacing
11835        this.backDelay = this.options.backDelay;
11836
11837        // input strings of text
11838        this.strings = this.options.strings;
11839
11840        // character number position of current string
11841        this.strPos = 0;
11842
11843        // current array position
11844        this.arrayPos = 0;
11845
11846        // current string based on current values[] array position
11847        this.string = this.strings[this.arrayPos];
11848
11849        // number to stop backspacing on.
11850        // default 0, can change depending on how many chars
11851        // you want to remove at the time
11852        this.stopNum = 0;
11853
11854        // Looping logic
11855        this.loop = this.options.loop;
11856        this.loopCount = this.options.loopCount;
11857        this.curLoop = 1;
11858        if (this.loop === false){
11859            // number in which to stop going through array
11860            // set to strings[] array (length - 1) to stop deleting after last string is typed
11861            this.stopArray = this.strings.length-1;
11862        }
11863        else{
11864            this.stopArray = this.strings.length;
11865        }
11866
11867        // All systems go!
11868        this.build();
11869    }
11870
11871        Typed.prototype =  {
11872
11873            constructor: Typed
11874
11875            , init: function(){
11876                // begin the loop w/ first current string (global self.string)
11877                // current string will be passed as an argument each time after this
11878                var self  = this;
11879                setTimeout(function() {
11880                    // Start typing
11881                    self.typewrite(self.string, self.strPos)
11882                }, self.startDelay);
11883            }
11884
11885            , build: function(){
11886                // Insert cursor
11887                this.el.after("<span id=\"typed-cursor\">|</span>");
11888                this.init();
11889            }
11890
11891            // pass current string state to each function
11892            , typewrite: function(curString, curStrPos){
11893
11894                // varying values for setTimeout during typing
11895                // can't be global since number changes each time loop is executed
11896                var humanize = Math.round(Math.random() * (100 - 30)) + this.typeSpeed;
11897                var self = this;
11898
11899                // ------------- optional ------------- //
11900                // backpaces a certain string faster
11901                // ------------------------------------ //
11902                // if (self.arrayPos == 1){
11903                //  self.backDelay = 50;
11904                // }
11905                // else{ self.backDelay = 500; }
11906
11907                // contain typing function in a timeout
11908                setTimeout(function() {
11909
11910                    // make sure array position is less than array length
11911                    if (self.arrayPos < self.strings.length){
11912
11913                        // check for an escape character before a pause value
11914                        if (curString.substr(curStrPos, 1) === "^") {
11915                            var charPauseEnd = curString.substr(curStrPos + 1).indexOf(" ");
11916                            var charPause = curString.substr(curStrPos + 1, charPauseEnd);
11917                            // strip out the escape character and pause value so they're not printed
11918                            curString = curString.replace("^" + charPause, "");
11919                        }
11920                        else {
11921                            var charPause = 0;
11922                        }
11923
11924                        // timeout for any pause after a character
11925                        setTimeout(function() {
11926
11927                            // start typing each new char into existing string
11928                            // curString is function arg
11929                            self.el.text(self.text + curString.substr(0, curStrPos));
11930
11931                            // check if current character number is the string's length
11932                            // and if the current array position is less than the stopping point
11933                            // if so, backspace after backDelay setting
11934                            if (curStrPos > curString.length && self.arrayPos < self.stopArray){
11935                                clearTimeout(clear);
11936                                self.options.onStringTyped();
11937                                var clear = setTimeout(function(){
11938                                    self.backspace(curString, curStrPos);
11939                                }, self.backDelay);
11940                            }
11941
11942                            // else, keep typing
11943                            else{
11944                                // add characters one by one
11945                                curStrPos++;
11946                                // loop the function
11947                                self.typewrite(curString, curStrPos);
11948                                // if the array position is at the stopping position
11949                                // finish code, on to next task
11950                                if (self.loop === false){
11951                                    if (self.arrayPos === self.stopArray && curStrPos === curString.length){
11952                                        // animation that occurs on the last typed string
11953                                        // fires callback function
11954                                        var clear = self.options.callback();
11955                                        clearTimeout(clear);
11956                                    }
11957                                }
11958                            }
11959
11960                        // end of character pause
11961                        }, charPause);
11962                    }
11963                    // if the array position is greater than array length
11964                    // and looping is active, reset array pos and start over.
11965                    else if (self.loop === true && self.loopCount === false){
11966                        self.arrayPos = 0;
11967                        self.init();
11968                    }
11969                        else if(self.loopCount !== false && self.curLoop < self.loopCount){
11970                            self.arrayPos = 0;
11971                            self.curLoop = self.curLoop+1;
11972                            self.init();
11973                        }
11974
11975                // humanized value for typing
11976                }, humanize);
11977
11978            }
11979
11980            , backspace: function(curString, curStrPos){
11981
11982                // varying values for setTimeout during typing
11983                // can't be global since number changes each time loop is executed
11984                var humanize = Math.round(Math.random() * (100 - 30)) + this.backSpeed;
11985                var self = this;
11986
11987                setTimeout(function() {
11988
11989                    // ----- this part is optional ----- //
11990                    // check string array position
11991                    // on the first string, only delete one word
11992                    // the stopNum actually represents the amount of chars to
11993                    // keep in the current string. In my case it's 14.
11994                    // if (self.arrayPos == 1){
11995                    //  self.stopNum = 14;
11996                    // }
11997                    //every other time, delete the whole typed string
11998                    // else{
11999                    //  self.stopNum = 0;
12000                    // }
12001
12002                    // ----- continue important stuff ----- //
12003                    // replace text with current text + typed characters
12004                    self.el.text(self.text + curString.substr(0, curStrPos));
12005
12006                    // if the number (id of character in current string) is
12007                    // less than the stop number, keep going
12008                    if (curStrPos > self.stopNum){
12009                        // subtract characters one by one
12010                        curStrPos--;
12011                        // loop the function
12012                        self.backspace(curString, curStrPos);
12013                    }
12014                    // if the stop number has been reached, increase
12015                    // array position to next string
12016                    else if (curStrPos <= self.stopNum){
12017                        clearTimeout(clear);
12018                        var clear = self.arrayPos = self.arrayPos+1;
12019                        // must pass new array position in this instance
12020                        // instead of using global arrayPos
12021                        self.typewrite(self.strings[self.arrayPos
12021], curStrPos);
12022                    }
12023
12024                // humanized value for typing
12025                }, humanize);
12026
12027            }
12028
12029        }
12030
12031    $.fn.typed = function (option) {
12032        return this.each(function () {
12033          var $this = $(this)
12034            , data = $this.data('typed')
12035            , options = typeof option == 'object' && option
12036          if (!data) $this.data('typed', (data = new Typed(this, options)))
12037          if (typeof option == 'string') data[option]()
12038        });
12039    }
12040
12041    $.fn.typed.defaults = {
12042        strings: ["These are the default values...", "You know what you should do?", "Use your own!", "Have a great day!"],
12043        // typing speed
12044        typeSpeed: 0,
12045        // time before typing starts
12046        startDelay: 0,
12047        // backspacing speed
12048        backSpeed: 0,
12049        // time before backspacing
12050        backDelay: 500,
12051        // loop
12052        loop: false,
12053        // false = infinite
12054        loopCount: false,
12055        // ending callback function
12056        callback: function(){ null },
12057        //callback for every typed string
12058        onStringTyped: function(){ null }
12059    }
12060
12061
12062}(window.jQuery);;;
12063(function($, window, undefined) {
12064
12065	'use strict';
12066
12067	// global
12068	var Modernizr = window.Modernizr,
12069		$body = $('body');
12070
12071	$.DLMenu = function(options, element) {
12072		this.$el = $(element);
12073		this._init(options);
12074	};
12075
12076	$.DLMenu.defaults = {
12077		animationClasses: {
12078			classin: 'mk-vm-animate-in-' + $('body').attr('data-vm-anim'),
12079			classout: 'mk-vm-animate-out-' + $('body').attr('data-vm-anim')
12080		},
12081		onLevelClick: function(el, name) {
12082			return false;
12083		},
12084		onLinkClick: function(el, ev) {
12085			return false;
12086		}
12087	};
12088
12089	$.DLMenu.prototype = {
12090		_init: function(options) {
12091
12092			this.options = $.extend(true, {}, $.DLMenu.defaults, options);
12093			this._config();
12094
12095			var animEndEventNames = {
12096					'WebkitAnimation': 'webkitAnimationEnd',
12097					'OAnimation': 'oAnimationEnd',
12098					'msAnimation': 'MSAnimationEnd',
12099					'animation': 'animationend'
12100				},
12101				transEndEventNames = {
12102					'WebkitTransition': 'webkitTransitionEnd',
12103					'MozTransition': 'transitionend',
12104					'OTransition': 'oTransitionEnd',
12105					'msTransition': 'MSTransitionEnd',
12106					'transition': 'transitionend'
12107				};
12108			this.animEndEventName = animEndEventNames[Modernizr.prefixed('animation')] + '.dlmenu';
12109			this.transEndEventName = transEndEventNames[Modernizr.prefixed('transition')] + '.dlmenu',
12110			this.supportAnimations = Modernizr.cssanimations,
12111			this.supportTransitions = Modernizr.csstransitions;
12112
12113			this._initEvents();
12114
12115		},
12116		_config: function() {
12117			this.open = false;
12118			var $backText = $('body').attr('data-backText');
12119			this.$trigger = this.$el.children('.mk-vm-trigger');
12120			this.$menu = this.$el.children('ul.mk-vm-menu');
12121			this.$menuitems = this.$menu.find('li:not(.mk-vm-back)');
12122			this.$el.find('ul.sub-menu').prepend('<li class="mk-vm-back"><a href="#">' + $backText + '</a></li>');
12123			this.$back = this.$menu.find('li.mk-vm-back');
12124		},
12125		_initEvents: function() {
12126
12127			var self = this;
12128
12129			this.$trigger.on('click.dlmenu', function() {
12130
12131				if (self.open) {
12132					self._closeMenu();
12133				} else {
12134					self._openMenu();
12135				}
12136				return false;
12137
12138			});
12139
12140			this.$menuitems.on('click.dlmenu', function(event) {
12141
12142				event.stopPropagation();
12143
12144				var $item = $(this),
12145					$submenu = $item.children('ul.sub-menu');
12146
12147				if ($submenu.length > 0) {
12148
12149					var $flyin = $submenu.clone().css('opacity', 0).insertAfter(self.$menu),
12150						onAnimationEndFn = function() {
12151							self.$menu.off(self.animEndEventName).removeClass(self.options.animationClasses.classout).addClass('mk-vm-subview');
12152							$item.addClass('mk-vm-subviewopen').parents('.mk-vm-subviewopen:first').removeClass('mk-vm-subviewopen').addClass('mk-vm-subview');
12153							$flyin.remove();
12154						};
12155
12156					setTimeout(function() {
12157						$flyin.addClass(self.options.animationClasses.classin);
12158						self.$menu.addClass(self.options.animationClasses.classout);
12159						if (self.supportAnimations) {
12160							self.$menu.on(self.animEndEventName, onAnimationEndFn);
12161						} else {
12162							onAnimationEndFn.call();
12163						}
12164
12165						self.options.onLevelClick($item, $item.children('a:first').text());
12166					});
12167
12168					return false;
12169
12170				} else {
12171					self.options.onLinkClick($item, event);
12172				}
12173
12174			});
12175
12176			this.$back.on('click.dlmenu', function(event) {
12177
12178				var $this = $(this),
12179					$submenu = $this.parents('ul.sub-menu:first'),
12180					$item = $submenu.parent(),
12181
12182					$flyin = $submenu.clone().insertAfter(self.$menu);
12183
12184				var onAnimationEndFn = function() {
12185					self.$menu.off(self.animEndEventName).removeClass(self.options.animationClasses.classin);
12186					$flyin.remove();
12187				};
12188
12189				setTimeout(function() {
12190					$flyin.addClass(self.options.animationClasses.classout);
12191					self.$menu.addClass(self.options.animationClasses.classin);
12192					if (self.supportAnimations) {
12193						self.$menu.on(self.animEndEventName, onAnimationEndFn);
12194					} else {
12195						onAnimationEndFn.call();
12196					}
12197
12198					$item.removeClass('mk-vm-subviewopen');
12199
12200					var $subview = $this.parents('.mk-vm-subview:first');
12201					if ($subview.is('li')) {
12202						$subview.addClass('mk-vm-subviewopen');
12203					}
12204					$subview.removeClass('mk-vm-subview');
12205				});
12206
12207				return false;
12208
12209			});
12210
12211		},
12212		closeMenu: function() {
12213			if (this.open) {
12214				this._closeMenu();
12215			}
12216		},
12217		_closeMenu: function() {
12218			var self = this,
12219				onTransitionEndFn = function() {
12220					self.$menu.off(self.transEndEventName);
12221					self._resetMenu();
12222				};
12223
12224			this.$menu.removeClass('mk-vm-menuopen');
12225			this.$menu.addClass('mk-vm-menu-toggle');
12226			this.$trigger.removeClass('mk-vm-active');
12227
12228			if (this.supportTransitions) {
12229				this.$menu.on(this.transEndEventName, onTransitionEndFn);
12230			} else {
12231				onTransitionEndFn.call();
12232			}
12233
12234			this.open = false;
12235		},
12236		openMenu: function() {
12237			if (!this.open) {
12238				this._openMenu();
12239			}
12240		},
12241		_openMenu: function() {
12242			var self = this;
12243			$body.off('click').on('click.dlmenu', function() {
12244				self._closeMenu();
12245			});
12246			this.$menu.addClass('mk-vm-menuopen mk-vm-menu-toggle').on(this.transEndEventName, function() {
12247				$(this).removeClass('mk-vm-menu-toggle');
12248			});
12249			this.$trigger.addClass('mk-vm-active');
12250			this.open = true;
12251		},
12252		_resetMenu: function() {
12253			this.$menu.removeClass('mk-vm-subview');
12254			this.$menuitems.removeClass('mk-vm-subview mk-vm-subviewopen');
12255		}
12256	};
12257
12258	var logError = function(message) {
12259		if (window.console) {
12260			window.console.error(message);
12261		}
12262	};
12263
12264	$.fn.dlmenu = function(options) {
12265		if (typeof options === 'string') {
12266			var args = Array.prototype.slice.call(arguments, 1);
12267			this.each(function() {
12268				var instance = $.data(this, 'dlmenu');
12269				if (!instance) {
12270					logError("cannot call methods on dlmenu prior to initialization; " +
12271						"attempted to call method '" + options + "'");
12272					return;
12273				}
12274				if (!$.isFunction(instance[options]) || options.charAt(0) === "_") {
12275					logError("no such method '" + options + "' for dlmenu instance");
12276					return;
12277				}
12278				instance[options].apply(instance, args);
12279			});
12280		} else {
12281			this.each(function() {
12282				var instance = $.data(this, 'dlmenu');
12283				if (instance) {
12284					instance._init();
12285				} else {
12286					instance = $.data(this, 'dlmenu', new $.DLMenu(options, this));
12287				}
12288			});
12289		}
12290		return this;
12291	};
12292
12293})(jQuery, window);;
12294
12295/*
12296 * Viewport - jQuery selectors for finding elements in viewport
12297 *
12298 * Copyright (c) 2008-2009 Mika Tuupola
12299 *
12300 * Licensed under the MIT license:
12301 *   http://www.opensource.org/licenses/mit-license.php
12302 *
12303 * Project home:
12304 *  http://www.appelsiini.net/projects/viewport
12305 *
12306 */
12307(function ($) {
12308
12309        "use strict";
12310
12311        $.belowthefold = function (element, settings) {
12312                var fold = $(window).height() + $(window).scrollTop();
12313                return fold <= $(element).offset().top - settings.threshold;
12314        };
12315
12316        $.abovethetop = function (element, settings) {
12317                var top = $(window).scrollTop();
12318                return top >= $(element).offset().top + $(element).height() - settings.threshold;
12319        };
12320
12321        $.rightofscreen = function (element, settings) {
12322                var fold = $(window).width() + $(window).scrollLeft();
12323                return fold <= $(element).offset().left - settings.threshold;
12324        };
12325
12326        $.leftofscreen = function (element, settings) {
12327                var left = $(window).scrollLeft();
12328                return left >= $(element).offset().left + $(element).width() - settings.threshold;
12329        };
12330
12331        $.inviewport = function (element, settings) {
12332                return !$.rightofscreen(element, settings) && !$.leftofscreen(element, settings) && !$.belowthefold(element, settings) && !$.abovethetop(element, settings);
12333        };
12334
12335        $.extend($.expr[':'], {
12336                "below-the-fold": function (a) {
12337                        return $.belowthefold(a, {
12338                                threshold: 0
12339                        });
12340                },
12341                "above-the-top": function (a) {
12342                        return $.abovethetop(a, {
12343                                threshold: 0
12344                        });
12345                },
12346                "left-of-screen": function (a) {
12347                        return $.leftofscreen(a, {
12348                                threshold: 0
12349                        });
12350                },
12351                "right-of-screen": function (a) {
12352                        return $.rightofscreen(a, {
12353                                threshold: 0
12354                        });
12355                },
12356                "in-viewport": function (a) {
12357                        return $.inviewport(a, {
12358                                threshold: -40
12359                        });
12360                }
12361        });
12362
12363
12364})(jQuery);
12365
12366
12367
12368;
12369/*! waitForImages jQuery Plugin - v1.5.0 - 2013-07-20
12370 * https://github.com/alexanderdickson/waitForImages
12371 * Copyright (c) 2013 Alex Dickson; Licensed MIT */
12372(function ($) {
12373        var o = 'waitForImages';
12374        $.waitForImages = {
12375                hasImageProperties: ['backgroundImage', 'listStyleImage', 'borderImage', 'borderCornerImage', 'cursor']
12376        };
12377        $.expr[':'].uncached = function (a) {
12378                if (!$(a).is('img[src!=""]')) {
12379                        return false
12380                }
12381                var b = new Image();
12382                b.src = a.src;
12383                return !b.complete
12384        };
12385        $.fn.waitForImages = function (j, k, l) {
12386                var m = 0;
12387                var n = 0;
12388                if ($.isPlainObject(arguments[0])) {
12389                        l = arguments[0].waitForAll;
12390                        k = arguments[0].each;
12391                        j = arguments[0].finished
12392                }
12393                j = j || $.noop;
12394                k = k || $.noop;
12395                l = !! l;
12396                if (!$.isFunction(j) || !$.isFunction(k)) {
12397                        throw new TypeError('An invalid callback was supplied.');
12398                }
12399                return this.each(function () {
12400                        var e = $(this);
12401                        var f = [];
12402                        var g = $.waitForImages.hasImageProperties || [];
12403                        var h = /url\(\s*(['"]?)(.*?)\1\s*\)/g;
12404                        if (l) {
12405                                e.find('*').addBack().each(function () {
12406                                        var d = $(this);
12407                                        if (d.is('img:uncached')) {
12408                                                f.push({
12409                                                        src: d.attr('src'),
12410                                                        element: d[0]
12411                                                })
12412                                        }
12413                                        $.each(g, function (i, a) {
12414                                                var b = d.css(a);
12415                                                var c;
12416                                                if (!b) {
12417                                                        return true
12418                                                }
12419                                                while (c = h.exec(b)) {
12420                                                        f.push({
12421                                                                src: c[2],
12422                                                                element: d[0]
12423                                                        })
12424                                                }
12425                                        })
12426                                })
12427                        } else {
12428                                e.find('img:uncached').each(function () {
12429                                        f.push({
12430                                                src: this.src,
12431                                                element: this
12432                                        })
12433                                })
12434                        }
12435                        m = f.length;
12436                        n = 0;
12437                        if (m === 0) {
12438                                j.call(e[0])
12439                        }
12440                        $.each(f, function (i, b) {
12441                                var c = new Image();
12442                                $(c).on('load.' + o + ' error.' + o, function (a) {
12443                                        n++;
12444                                        k.call(b.element, n, m, a.type == 'load');
12445                                        if (n == m) {
12446                                                j.call(e[0]);
12447                                                return false
12448                                        }
12449                                });
12450                                c.src = b.src
12451                        })
12452                })
12453        }
12454}(jQuery));
12455;// Generated by CoffeeScript 1.6.2
12456/*!
12457jQuery Waypoints - v2.0.5
12458Copyright (c) 2011-2014 Caleb Troughton
12459Licensed under the MIT license.
12460https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt
12461*/
12462(function(){var t=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++){if(e in this&&this[e]===t)return e}return-1},e=[].slice;(function(t,e){if(typeof define==="function"&&define.amd){return define("waypoints",["jquery"],function(n){return e(n,t)})}else{return e(t.jQuery,t)}})(window,function(n,r){var i,o,l,s,f,u,c,a,h,d,p,y,v,w,g,m;i=n(r);a=t.call(r,"ontouchstart")>=0;s={horizontal:{},vertical:{}};f=1;c={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;
vendor: 6,764 bytes, line 12462
12462w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didResize=false;this.didScroll=false;this.id="context"+f++;this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()};this.waypoints={horizontal:{},vertical:{}};this.element[u]=this.id;c[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||a)){e.didScroll=true;t=function(){e.doScroll();return e.didScroll=false};return r.setTimeout(t,n[m].settings.scrollThrottle)}});t.bind(p,function(){var t;if(!e.didResize){e.didResize=true;t=function(){n[m]("refresh");return e.didResize=false};return r.setTimeout(t,n[m].settings.resizeThrottle)}})}t.prototype.doScroll=function(){var t,e=this;t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};if(a&&(!t.vertical.oldScroll||!t.vertical.newScroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newScroll>r.oldScroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldScroll<(n=e.offset)&&n<=r.newScroll){return l.push(e)}else if(r.newScroll<(i=e.offset)&&i<=r.oldScroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.isWindow(this.element);e=this.$element.offset();this.doScroll();t={horizontal:{contextOffset:r?0:e.left,contextScroll:r?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:r?0:e.top,contextScroll:r?0:this.oldScroll.y,contextDimension:r?n[m]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.isWindow(r.element)?0:r.$element.offset()[e.offsetProp];if(n.isFunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parseFloat(i);if(r.options.offset.indexOf("%")>-1){i=Math.ceil(e.contextDimension*i/100)}}r.offset=o-e.contextOffset+e.contextScroll-i;if(r.options.onlyOnScroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldScroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldScroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldScroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkEmpty=function(){if(n.isEmptyObject(this.waypoints.horizontal)&&n.isEmptyObject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete c[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportHeight");if(!n.isWindow(e.element)){t=e.$element.height()}return t-n(this).outerHeight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=this.element[w])!=null?o:[];i.push(this.id);this.element[w]=i}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggerOnce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkEmpty()};t.getWaypointsByElement=function(t){var e,r;r=t[w];if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;e=n.extend({},n.fn[g].defaults,e);if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.isWindow(i)){i=t.closest(i)}i=n(i);r=c[i[0][u]];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke.call(this,"disable")},enable:function(){return d._invoke.call(this,"enable")},destroy:function(){return d._invoke.call(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e<n.length-1){return t.push(n[e+1])}})},_traverse:function(t,e,i){var o,l;if(t==null){t="vertical"}if(e==null){e=r}l=h.aggregate(e);o=[];this.each(function(){var e;e=n.inArray(this,l[t]);return i(o,e,l[t])});return this.pushStack(o)},_invoke:function(t){this.each(function(){var e;e=l.getWaypointsByElement(this);return n.each(e,function(e,n){n[t]();return true})});return this}};n.fn[g]=function(){var t,r;r=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(d[r]){return d[r].apply(this,t)}else if(n.isFunction(r)){return d.init.apply(this,arguments)}else if(n.isPlainObject(r)){return d.init.apply(this,[null,r])}else if(!r){return n.error("jQuery Waypoints needs a callback function or handler option.")}else{return n.error("The "+r+" method does not exist in jQuery Waypoints.")}};n.fn[g].defaults={context:r,continuous:true,enabled:true,horizontal:false,offset:0,triggerOnce:false};h={refresh:function(){return n.each(c,function(t,e){return e.refresh()})},viewportHeight:function(){var t;return(t=r.innerHeight)!=null?t:i.height()},aggregate:function(t){var e,r,i;e=s;if(t){e=(i=c[n(t)[0][u]])!=null?i.waypoints:void 0}if(!e){return[]}r={horizontal:[],vertical:[]};n.each(r,function(t,i){n.each(e[t],function(t,e){return i.push(e)});i.sort(function(t,e){return t.offset-e.offset});r[t]=n.map(i,function(t){return t.element});return r[t]=n.unique(r[t])});return r},above:function(t){if(t==null){t=r}return h._filter(t,"vertical",function(t,e){return e.offset<=t.oldScroll.y})},below:function(t){if(t==null){t=r}return h._filter(t,"vertical",function(t,e){return e.offset>t.oldScroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldScroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset>t.oldScroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendFn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);
12462return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=c[n(t)[0][u]];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizeThrottle:100,scrollThrottle:30};return i.on("load.waypoints",function(){return n[m]("refresh")})})}).call(this);
12463
12464
12465
12466
12467// Generated by CoffeeScript 1.6.2
12468/*
12469Sticky Elements Shortcut for jQuery Waypoints - v2.0.5
12470Copyright (c) 2011-2014 Caleb Troughton
12471Licensed under the MIT license.
12472https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt
12473*/
12474(function(){(function(t,n){if(typeof define==="function"&&define.amd){return define(["jquery","waypoints"],n)}else{return n(t.jQuery)}})(window,function(t){var n,i;n={wrapper:'<div class="sticky-wrapper" />',stuckClass:"stuck",direction:"down right"};i=function(t,n){var i;t.wrap(n.wrapper);i=t.parent();return i.data("isWaypointStickyWrapper",true)};t.waypoints("extendFn","sticky",function(r){var e,a,s;a=t.extend({},t.fn.waypoint.defaults,n,r);e=i(this,a);s=a.handler;a.handler=function(n){var i,r;i=t(this).children(":first");r=a.direction.indexOf(n)!==-1;i.toggleClass(a.stuckClass,r);e.height(r?i.outerHeight():"");if(s!=null){return s.call(this,n)}};e.waypoint(a);return this.data("stuckClass",a.stuckClass)});return t.waypoints("extendFn","unsticky",function(){var t;t=this.parent();if(!t.data("isWaypointStickyWrapper")){return this}t.waypoint("destroy");this.unwrap();return this.removeClass(this.data("stuckClass"))})})}).call(this);;/**
12475 * FastDom
12476 *
12477 * Eliminates layout thrashing
12478 * by batching DOM read/write
12479 * interactions.
12480 *
12481 * @author Wilson Page <[email protected]>
12482 */
12483
12484;(function(fastdom){
12485
12486  'use strict';
12487
12488  // Normalize rAF
12489  var raf = window.requestAnimationFrame
12490    || window.webkitRequestAnimationFrame
12491    || window.mozRequestAnimationFrame
12492    || window.msRequestAnimationFrame
12493    || function(cb) { return window.setTimeout(cb, 1000 / 60); };
12494
12495  /**
12496   * Creates a fresh
12497   * FastDom instance.
12498   *
12499   * @constructor
12500   */
12501  function FastDom() {
12502    this.frames = [];
12503    this.lastId = 0;
12504
12505    // Placing the rAF method
12506    // on the instance allows
12507    // us to replace it with
12508    // a stub for testing.
12509    this.raf = raf;
12510
12511    this.batch = {
12512      hash: {},
12513      read: [],
12514      write: [],
12515      mode: null
12516    };
12517  }
12518
12519  /**
12520   * Adds a job to the
12521   * read batch and schedules
12522   * a new frame if need be.
12523   *
12524   * @param  {Function} fn
12525   * @public
12526   */
12527  FastDom.prototype.read = function(fn, ctx) {
12528    var job = this.add('read', fn, ctx);
12529    var id = job.id;
12530
12531    // Add this job to the read queue
12532    this.batch.read.push(job.id);
12533
12534    // We should *not* schedule a new frame if:
12535    // 1. We're 'reading'
12536    // 2. A frame is already scheduled
12537    var doesntNeedFrame = this.batch.mode === 'reading'
12538      || this.batch.scheduled;
12539
12540    // If a frame isn't needed, return
12541    if (doesntNeedFrame) return id;
12542
12543    // Schedule a new
12544    // frame, then return
12545    this.scheduleBatch();
12546    return id;
12547  };
12548
12549  /**
12550   * Adds a job to the
12551   * write batch and schedules
12552   * a new frame if need be.
12553   *
12554   * @param  {Function} fn
12555   * @public
12556   */
12557  FastDom.prototype.write = function(fn, ctx) {
12558    var job = this.add('write', fn, ctx);
12559    var mode = this.batch.mode;
12560    var id = job.id;
12561
12562    // Push the job id into the queue
12563    this.batch.write.push(job.id);
12564
12565    // We should *not* schedule a new frame if:
12566    // 1. We are 'writing'
12567    // 2. We are 'reading'
12568    // 3. A frame is already scheduled.
12569    var doesntNeedFrame = mode === 'writing'
12570      || mode === 'reading'
12571      || this.batch.scheduled;
12572
12573    // If a frame isn't needed, return
12574    if (doesntNeedFrame) return id;
12575
12576    // Schedule a new
12577    // frame, then return
12578    this.scheduleBatch();
12579    return id;
12580  };
12581
12582  /**
12583   * Defers the given job
12584   * by the number of frames
12585   * specified.
12586   *
12587   * If no frames are given
12588   * then the job is run in
12589   * the next free frame.
12590   *
12591   * @param  {Number}   frame
12592   * @param  {Function} fn
12593   * @public
12594   */
12595  FastDom.prototype.defer = function(frame, fn, ctx) {
12596
12597    // Accepts two arguments
12598    if (typeof frame === 'function') {
12599      ctx = fn;
12600      fn = frame;
12601      frame = 1;
12602    }
12603
12604    var self = this;
12605    var index = frame - 1;
12606
12607    return this.schedule(index, function() {
12608      self.run({
12609        fn: fn,
12610        ctx: ctx
12611      });
12612    });
12613  };
12614
12615  /**
12616   * Clears a scheduled 'read',
12617   * 'write' or 'defer' job.
12618   *
12619   * @param  {Number} id
12620   * @public
12621   */
12622  FastDom.prototype.clear = function(id) {
12623
12624    // Defer jobs are cleared differently
12625    if (typeof id === 'function') {
12626      return this.clearFrame(id);
12627    }
12628
12629    var job = this.batch.hash[id];
12630    if (!job) return;
12631
12632    var list = this.batch[job.type];
12633    var index = list.indexOf(id);
12634
12635    // Clear references
12636    delete this.batch.hash[id];
12637    if (~index) list.splice(index, 1);
12638  };
12639
12640  /**
12641   * Clears a scheduled frame.
12642   *
12643   * @param  {Function} frame
12644   * @private
12645   */
12646  FastDom.prototype.clearFrame = function(frame) {
12647    var index = this.frames.indexOf(frame);
12648    if (~index) this.frames.splice(index, 1);
12649  };
12650
12651  /**
12652   * Schedules a new read/write
12653   * batch if one isn't pending.
12654   *
12655   * @private
12656   */
12657  FastDom.prototype.scheduleBatch = function() {
12658    var self = this;
12659
12660    // Schedule batch for next frame
12661    this.schedule(0, function() {
12662      self.batch.scheduled = false;
12663      self.runBatch();
12664    });
12665
12666    // Set flag to indicate
12667    // a frame has been scheduled
12668    this.batch.scheduled = true;
12669  };
12670
12671  /**
12672   * Generates a unique
12673   * id for a job.
12674   *
12675   * @return {Number}
12676   * @private
12677   */
12678  FastDom.prototype.uniqueId = function() {
12679    return ++this.lastId;
12680  };
12681
12682  /**
12683   * Calls each job in
12684   * the list passed.
12685   *
12686   * If a context has been
12687   * stored on the function
12688   * then it is used, else the
12689   * current `this` is used.
12690   *
12691   * @param  {Array} list
12692   * @private
12693   */
12694  FastDom.prototype.flush = function(list) {
12695    var id;
12696
12697    while (id = list.shift()) {
12698      this.run(this.batch.hash[id]);
12699    }
12700  };
12701
12702  /**
12703   * Runs any 'read' jobs followed
12704   * by any 'write' jobs.
12705   *
12706   * We run this inside a try catch
12707   * so that if any jobs error, we
12708   * are able to recover and continue
12709   * to flush the batch until it's empty.
12710   *
12711   * @private
12712   */
12713  FastDom.prototype.runBatch = function() {
12714    try {
12715
12716      // Set the mode to 'reading',
12717      // then empty all read jobs
12718      this.batch.mode = 'reading';
12719      this.flush(this.batch.read);
12720
12721      // Set the mode to 'writing'
12722      // then empty all write jobs
12723      this.batch.mode = 'writing';
12724      this.flush(this.batch.write);
12725
12726      this.batch.mode = null;
12727
12728    } catch (e) {
12729      this.runBatch();
12730      throw e;
12731    }
12732  };
12733
12734  /**
12735   * Adds a new job to
12736   * the given batch.
12737   *
12738   * @param {Array}   list
12739   * @param {Function} fn
12740   * @param {Object}   ctx
12741   * @returns {Number} id
12742   * @private
12743   */
12744  FastDom.prototype.add = function(type, fn, ctx) {
12745    var id = this.uniqueId();
12746    return this.batch.hash[id] = {
12747      id: id,
12748      fn: fn,
12749      ctx: ctx,
12750      type: type
12751    };
12752  };
12753
12754  /**
12755   * Runs a given job.
12756   *
12757   * Applications using FastDom
12758   * have the options of setting
12759   * `fastdom.onError`.
12760   *
12761   * This will catch any
12762   * errors that may throw
12763   * inside callbacks, which
12764   * is useful as often DOM
12765   * nodes have been removed
12766   * since a job was scheduled.
12767   *
12768   * Example:
12769   *
12770   *   fastdom.onError = function(e) {
12771   *     // Runs when jobs error
12772   *   };
12773   *
12774   * @param  {Object} job
12775   * @private
12776   */
12777  FastDom.prototype.run = function(job){
12778    var ctx = job.ctx || this;
12779    var fn = job.fn;
12780
12781    // Clear reference to the job
12782    delete this.batch.hash[job.id];
12783
12784    // If no `onError` handler
12785    // has been registered, just
12786    // run the job normally.
12787    if (!this.onError) {
12788      return fn.call(ctx);
12789    }
12790
12791    // If an `onError` handler
12792    // has been registered, catch
12793    // errors that throw inside
12794    // callbacks, and run the
12795    // handler instead.
12796    try { fn.call(ctx); } catch (e) {
12797      this.onError(e);
12798    }
12799  };
12800
12801  /**
12802   * Starts a rAF loop
12803   * to empty the frame queue.
12804   *
12805   * @private
12806   */
12807  FastDom.prototype.loop = function() {
12808    var self = this;
12809    var raf = this.raf;
12810
12811    // Don't start more than one loop
12812    if (this.looping) return;
12813
12814    raf(function frame() {
12815      var fn = self.frames.shift();
12816
12817      // If no more frames,
12818      // stop looping
12819      if (!self.frames.length) {
12820        self.looping = false;
12821
12822      // Otherwise, schedule the
12823      // next frame
12824      } else {
12825        raf(frame);
12826      }
12827
12828      // Run the frame.  Note that
12829      // this may throw an error
12830      // in user code, but all
12831      // fastdom tasks are dealt
12832      // with already so the code
12833      // will continue to iterate
12834      if (fn) fn();
12835    });
12836
12837    this.looping = true;
12838  };
12839
12840  /**
12841   * Adds a function to
12842   * a specified index
12843   * of the frame queue.
12844   *
12845   * @param  {Number}   index
12846   * @param  {Function} fn
12847   * @return {Function}
12848   * @private
12849   */
12850  FastDom.prototype.schedule = function(index, fn) {
12851
12852    // Make sure this slot
12853    // hasn't already been
12854    // taken. If it has, try
12855    // re-scheduling for the next slot
12856    if (this.frames[index]) {
12857      return this.schedule(index + 1, fn);
12858    }
12859
12860    // Start the rAF
12861    // loop to empty
12862    // the frame queue
12863    this.loop();
12864
12865    // Insert this function into
12866    // the frames queue and return
12867    return this.frames[index] = fn;
12868  };
12869
12870  // We only ever want there to be
12871  // one instance of FastDom in an app
12872  fastdom = fastdom || new FastDom();
12873
12874  /**
12875   * Expose 'fastdom'
12876   */
12877
12878  if (typeof module !== 'undefined' && module.exports) {
12879    module.exports = fastdom;
12880  } else if (typeof define === 'function' && define.amd) {
12881    define(function(){ return fastdom; });
12882  } else {
12883    window['fastdom'] = fastdom;
12884  }
12885
12886})(window.fastdom);
12887;function Events() {
12888
12889    (function (fastdom) {
12890		abb.events = (function() {
12891			'use strict';
12892
12893			var Public = {
12894
12895			};
12896
12897			
12898
12899			return Public;
12900
12901		})();
12902	})(fastdom);
12903}	;function Polyfills() {
12904
12905	(function () {
12906		'use strict';
12907
12908		abb.utils.polyfills = (function () {
12909
12910			var Public = {
12911				initAll: function() {
12912					bindPolyfill();
12913					rAFPolyfill();
12914				}
12915			}
12916
12917			function bindPolyfill() {
12918				if (!Function.prototype.bind) {
12919				  Function.prototype.bind = function(oThis) {
12920				    if (typeof this !== 'function') {
12921				      // closest thing possible to the ECMAScript 5
12922				      // internal IsCallable function
12923				      throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
12924				    }
12925
12926				    var aArgs   = Array.prototype.slice.call(arguments, 1),
12927				        fToBind = this,
12928				        fNOP    = function() {},
12929				        fBound  = function() {
12930				          return fToBind.apply(this instanceof fNOP && oThis
12931				                 ? this
12932				                 : oThis,
12933				                 aArgs.concat(Array.prototype.slice.call(arguments)));
12934				        };
12935
12936				    fNOP.prototype = this.prototype;
12937				    fBound.prototype = new fNOP();
12938
12939				    return fBound;
12940				  };
12941				}
12942			}
12943
12944			function rAFPolyfill() {
12945			    var lastTime, vendors, x;
12946			    lastTime = 0;
12947			    vendors = ["webkit", "moz"];
12948			    x = 0;
12949			    while (x < vendors.length && !window.requestAnimationFrame) {
12950			      window.requestAnimationFrame = window[vendors[x] + "RequestAnimationFrame"];
12951			      window.cancelAnimationFrame = window[vendors[x] + "CancelAnimationFrame"] || window[vendors[x] + "CancelRequestAnimationFrame"];
12952			      ++x;
12953			    }
12954			    if (!window.requestAnimationFrame) {
12955			      window.requestAnimationFrame = function(callback, element) {
12956			        var currTime, id, timeToCall;
12957			        currTime = new Date().getTime();
12958			        timeToCall = Math.max(0, 16 - (currTime - lastTime));
12959			        id = window.setTimeout(function() {
12960			          callback(currTime + timeToCall);
12961			        }, timeToCall);
12962			        lastTime = currTime + timeToCall;
12963			        return id;
12964			      };
12965			    }
12966			    if (!window.cancelAnimationFrame) {
12967			      window.cancelAnimationFrame = function(id) {
12968			        clearTimeout(id);
12969			      };
12970			    }
12971			};
12972
12973			return Public.initAll();
12974
12975		})();
12976	})();
12977
12978};function Scroll() {
12979
12980    (function (fastdom) {
12981		abb.scroll = (function() {
12982			'use strict';
12983
12984			var Public = {
12985				containerOffset: containerOffset, // provide: element selector
12986				parallax: parallax, // provide: element selector
12987				Y: Y
12988			};
12989
12990			// Private 
12991			var $window = $(window);
12992
12993			function Y() { 
12994				var scroll = (window.pageYOffset !== undefined) ? window.pageYOffset : 
12995							 (document.documentElement || document.body.parentNode || document.body).scrollTop;
12996				return scroll;
12997			}
12998
12999			//
13000			// containerOffset() method
13001			// check where container starts and ends
13002			// returns an object 
13003			//
13004
13005			function containerOffset(el) {
13006				var $el = $(el),
13007					height = $el.outerHeight(),
13008					start = $el.offset().top,
13009					end = start + height;
13010
13011				return {
13012					start: start,
13013					end: end
13014				};
13015			};
13016
13017			//
13018			// parallax() method
13019			// produces parallax effect for given element with given factor value
13020			//
13021			
13022			function parallax(el, factor) {
13023				var $el = $(el),
13024					sY, currentPoint,
13025					parallaxFactor = factor,
13026					height = $el.outerHeight(),
13027					winH = abb.utils.viewport.y,
13028					start = $el.offset().top,
13029					end = start + height;
13030
13031				var layerPosition = function() {
13032					fastdom.read(function() { 
13033						sY = Y(); 
13034						// console.log(sY);
13035						currentPoint = (start - sY) * parallaxFactor;
13036						if(abb.debug.fastdom) { console.log('read-parallax-1'); }
13037						
13038						// if (start >= currentPoint && end >= currentPoint) {
13039							fastdom.write(function() {
13040								$el.css({
13041									'-webkit-transform': 'translateY(' + -currentPoint + 'px)',
13042									'-moz-transform': 'translateY(' + -currentPoint + 'px)',
13043									'-ms-transform': 'translateY(' + -currentPoint + 'px)',
13044									'-o-transform': 'translateY(' + -currentPoint + 'px)',
13045									'transform': 'translateY(' + -currentPoint + 'px)'
13046								});
13047
13048								if(abb.debug.fastdom) { console.log('write-parallax-1'); }
13049							});
13050						// }
13051					});
13052				};
13053
13054				$window.load(layerPosition());
13055				$window.on('scroll resize', layerPosition);
13056			}
13057
13058			return Public;
13059
13060		})();
13061	})(fastdom);
13062}	;function Utils() {
13063    // Dependency ABB modules:
13064
13065    // Dependency PHP modules:
13066    // php.json
13067
13068    // Dependency JSON->DOM modules
13069    // Try not to keep them here.
13070
13071    (function (window, navigator) {
13072        abb.utils = (function () {
13073            'use strict';
13074
13075            var Public = {
13076                JSONLookup: JSONLookup,
13077                browser: browser(),
13078                viewport: viewport(),
13079                fullHeight: fullHeight
13080            };
13081
13082            //
13083            // JSONLookup() method
13084            // Searches through our global JSON collection by element name
13085            // returns array of objects matched by name
13086            //
13087
13088            function JSONLookup(name) {
13089                var params = [];
13090                for(var i = 0, jsonLength = php.json.length; i < jsonLength; i++) {
13091                  if(php.json[i].name == name) {
13092                    params.push(php.json[i]);
13093                  } 
13094                }
13095                return params;
13096            }
13097
13098            function browser() {
13099                if(!!window.chrome && !(!!window.opera)) { return 'chrome'; } // Chrome 1+
13100                if(typeof InstallTrigger !== 'undefined') { return 'firefox'; } // Firefox 1.0+
13101                if(!!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0) { return 'opera'; } // Opera 8.0+ (UA detection to detect Blink/v8-powered Opera)
13102                if(/*@cc_on!@*/false || !!document.documentMode) { return 'ie'; } // At least IE6
13103                if(Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0) { return 'safari'; } // At least Safari 3+: "[object HTMLElementConstructor]"
13104            }
13105
13106            function viewport() {
13107                var w = window,
13108                    d = document,
13109                    e = d.documentElement,
13110                    g = d.getElementsByTagName('body')[0],
13111                    x = w.innerWidth || e.clientWidth || g.clientWidth,
13112                    y = w.innerHeight|| e.clientHeight|| g.clientHeight;
13113
13114                return {
13115                    x: x,
13116                    y: y
13117                }
13118            }
13119
13120            function fullHeight() {
13121                var height = viewport().x;
13122
13123                // console.log(height);
13124                return height;
13125            }
13126
13127            return Public;
13128
13129        })();
13130    })(window, navigator);
13131};function ModuleHeader() {
13132	// Dependency ABB modules:
13133	// abb.utils
13134
13135	// Dependency JSON->DOM modules
13136	// 'theme_header',
13137	// 'mk_header'
13138
13139	// Dependency libraries
13140	// jQuery
13141
13142	(function ($) {
13143		'use strict';
13144
13145		abb.modules.header = (function() {
13146
13147			var Public = {
13148	            height: height
13149	        };
13150
13151
13152	        var $window = $(window);
13153
13154			//
13155	        // height() method
13156	        //
13157
13158	        var header = abb.utils.JSONLookup('theme_header'),
13159	            adminbar = 0,
13160	            totalHeight = 0;
13161
13162	        function height() {
13163	            if(php.hasAdminbar) {
13164	                if($window.width() > 782) {
13165	                    adminbar = 32;   
13166	                } else {
13167	                    adminbar = 46;
13168	                }
13169	            }
13170
13171	            totalHeight = 
13172	                adminbar + 
13173	                (header[0] != undefined ? header[0].params.stickyHeight : 0);
13174
13175	            return Math.round(totalHeight);
13176	        }        
13177
13178	        return Public;
13179
13180		})();
13181	})(jQuery); 
13182}
13183;function ModulePageSection() {
13184	// Dependency ABB modules:
13185	// abb.utils
13186
13187	// Dependency JSON->DOM modules
13188	// 'page_section'
13189
13190	// Dependency libraries
13191	// jQuery
13192
13193	(function ($) {
13194		'use strict';
13195
13196		abb.modules.page_section = (function() {
13197
13198			var Public = {};
13199
13200	        var pageSection = abb.utils.JSONLookup('page_section');
13201
13202	        function manipulateDOM() {
13203			    setTimeout(function() {
13204		        	if (pageSection.length) {
13205			        	for (var i = 0, x = pageSection.length; i < x; i++) {
13206			        		var params = pageSection[i].params,
13207			        			id = params.id;
13208
13209			        		//
13210				        	// Checks for params and trigger methods 
13211				        	//
13212
13213			        		if (params.hasBgLayer && params.bgAttachment === 'fixed' && abb.utils.browser === 'chrome') {
13214				        		var height = abb.utils.viewport.y;
13215
13216				        		var setStyles = function() {
13217					        		$('#' + id + ' .background-layer').css({ 
13218					        			'background-attachment': 'scroll',
13219					        			'height': height + 'px'
13220					        		});
13221					        	}
13222
13223					        	// setStyles();
13224				        		// abb.scroll.parallax('#' + id + ' .background-layer', 
132241);
13225				        		
13226				        	}
13227			        	}
13228			        }
13229		        }, 100);
13230	        }        
13231
13232	        return manipulateDOM();
13233
13234		})();
13235	})(jQuery); 
13236}
13237;/**
13238*
13239*   Art Bees Boilerplate
13240*
13241*/
13242
13243(function () {
13244	'use strict'; 
13245
13246	// Root namespace: abb
13247	// Init in header.php
13248
13249	// Object to hold our modules
13250	abb.modules = {};
13251
13252	// We need function wrappers to trigger our modules on demand.
13253	// This is best way until we refactor whole codebase into modules so we could remove wrappers and move to AMD loading.
13254	// Some of modules are mendatory, some will be triggered with if(true) based on JSON collection and dependency map.
13255	// We don't need DOM ready as we include scripts in footer where DOM is ready already. Bind to onload with reason.
13256
13257	// IMPORTANT TODO - try to handle modules with ES6 module import / export polyfilled with google traceur
13258	window.onload = function() {
13259		Utils();
13260		Events();
13261		Polyfills();
13262		Scroll();
13263		
13264		ModuleHeader();
13265		ModulePageSection();
13266	}
13267
13268	// Debugging settings. 
13269	abb.debug = {};
13270	abb.debug.fastdom = false;
13271
13272})();;// //////////////////////////////////////////////////////
13273// 
13274//  Helpers
13275// 
13276// ///////////////////////////////////////////////////
13277
13278function is_touch_device() {
13279    return ('ontouchstart' in document.documentElement);
13280}
13281jQuery.exists = function(selector) {
13282    return ($(selector).length > 0);
13283};
13284
13285var isMobile = {
13286    Android: function() {
13287        var check;
13288        if (navigator.userAgent.match(/Android/i)) check = true;
13289        return check;
13290    },
13291    BlackBerry: function() {
13292        var check;
13293        if (navigator.userAgent.match(/BlackBerry/i)) check = true;
13294        return check;
13295    },
13296    iOS: function() {
13297        var check;
13298        if (navigator.userAgent.match(/iPhone|iPad|iPod/i)) check = true;
13299        return check;
13300    },
13301    Opera: function() {
13302        var check;
13303        if (navigator.userAgent.match(/Opera Mini/i)) check = true;
13304        return check;
13305    },
13306    Windows: function() {
13307        var check;
13308        if (navigator.userAgent.match(/IEMobile/i) || navigator.userAgent.match(/WPDesktop/i)) check = true;
13309        return check;
13310    },
13311    any: function() {
13312        return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
13313    }
13314};
13315
13316
13317
13318//////////////////////////////////////////////////////////////////////////
13319//
13320//   Defining global variables for cross app use
13321//
13322//////////////////////////////////////////////////////////////////////////
13323
13324var scrollY = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop, // Updated in global event handler
13325    global_window_width = $(window).width(),
13326    global_window_height = $(window).height(),
13327    global_admin_bar,
13328    global_admin_bar_height = 0;
13329
13330
13331$(window).load(function() {
13332    if ($.exists("#wpadminbar")) {
13333        global_admin_bar = $("#wpadminbar");
13334        global_admin_bar_height = global_admin_bar.height();
13335    }
13336});
13337
13338function mk_update_globals() {
13339    global_window_width = $(window).width();
13340    global_window_height = $(window).height();
13341}
13342
13343window.scroll = function() {
13344    scrollY = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;
13345}
13346
13347//////////////////////////////////////////////////////////////////////////
13348//
13349//   Global scroll handler
13350//
13351//////////////////////////////////////////////////////////////////////////
13352
13353
13354var animationThrottle = function(toThrottle, wait) {
13355    var lastTick = Date.now(),
13356        endTimeout = null;
13357
13358    return function run() {
13359        if (Date.now() - lastTick > wait) {
13360            lastTick = Date.now();
13361            clearTimeout(endTimeout);
13362            window.requestAnimationFrame(toThrottle);
13363        } else {
13364            clearTimeout(endTimeout);
13365            endTimeout = setTimeout(run, wait);
13366        }
13367    };
13368};
13369
13370// rAF 
13371var scrollAnimations = {
13372    sets: [],
13373
13374    init: function() {
13375        this.update();
13376        this.attachEvents();
13377        // console.table(this.sets);
13378    },
13379
13380    attachEvents: function() {
13381        window.addEventListener('scroll', animationThrottle(
13382            this.play.bind(this), 0
13383        ));
13384    },
13385
13386    add: function(handler) {
13387        this.sets.push(handler);
13388    },
13389
13390    play: function() {
13391        this.update();
13392        this.sets.forEach(function(animationSet) {
13393            animationSet(scrollY);
13394        }.bind(this));
13395    },
13396
13397    update: function() {
13398        scrollY = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;
13399    },
13400
13401};
13402scrollAnimations.init();
13403
13404// Throttled 200 ms
13405var debouncedScrollAnimations = {
13406    sets: [],
13407
13408    init: function() {
13409        this.attachEvents();
13410    },
13411
13412    attachEvents: function() {
13413        window.addEventListener('scroll', animationThrottle(
13414            this.play.bind(this), 200
13415        ));
13416    },
13417
13418    add: function(handler) {
13419        this.sets.push(handler);
13420    },
13421
13422    play: function() {
13423        this.sets.forEach(function(animationSet) {
13424            animationSet(scrollY);
13425        }.bind(this));
13426    },
13427};
13428debouncedScrollAnimations.init();
13429
13430
13431//////////////////////////////////////////////////////////////////////////
13432//
13433//   Init all scripts
13434//
13435//////////////////////////////////////////////////////////////////////////
13436
13437$(document).ready(function() {
13438    mk_animated_contents();
13439    mk_lightbox_init();
13440    mk_login_form();
13441    mk_backgrounds_parallax();
13442    mk_flexslider_init();
13443    mk_event_countdown();
13444    mk_skill_meter();
13445    mk_charts();
13446    mk_milestone();
13447    mk_ajax_search();
13448    mk_hover_events();
13449    mk_portfolio_ajax();
13450    mk_love_post();
13451    product_loop_add_cart();
13452    mk_social_share();
13453    mk_section_intro_effects();
13454    mk_newspaper_comments_share();
13455    mk_responsive_fix();
13456    mk_portfolio_widget();
13457    mk_contact_form();
13458    mk_blog_carousel();
13459    mk_responsive_nav();
13460    mk_header_searchform();
13461    mk_click_events();
13462    mk_theme_toggle_box();
13463    mk_text_typer();
13464    mk_tab_slider();
13465    mk_one_page_scroller();
13466    mk_one_pager_resposnive();
13467    mk_sidebar_navigation();
13468    mk_clients_mobile();
13469
13470    $(window).load(function() {
13471        mk_edge_parallax();
13472        mk_smooth_scroll_events();
13473        mk_swipe_slider();
13474        mk_load_isotop_enabled_scripts();
13475        mk_unfold_footer();
13476        mk_blur_boxes();
13477        shop_isotop_init();
13478        mk_tabs();
13479        mk_accordion_toggles_tooltip();
13480        section_to_full_height();
13481        mk_page_title_parallax();
13482        mk_header_scripts();
13483        mk_parallax();
13484        mk_gallery();
13485        mk_edge_fullpage_pagination();
13486        mk_theatre_responsive_calculator();
13487        mk_mobile_tablet_responsive_calculator();
13488        mk_tabs_responsive();
13489        mk_start_tour_resize();
13490        mk_header_social_resize();
13491        mk_page_section_social_video_bg();
13492        loop_audio_init();
13493        mk_animated_cols();
13494        mk_edge_slider();
13495        mk_google_maps();
13496    });
13497
13498
13499    $(window).on("debouncedresize", function() {
13500        section_to_full_height();
13501        mk_responsive_fix();
13502        mk_page_title_parallax();
13503        mk_section_intro_effects();
13504        mk_theatre_responsive_calculator();
13505        mk_mobile_tablet_responsive_calculator();
13506        mk_tabs_responsive();
13507        mk_accordion_toggles_tooltip();
13508        mk_start_tour_resize();
13509        mk_header_social_resize();
13510
13511        setTimeout(function() {
13512            mk_one_pager_resposnive();
13513            mk_header_scripts();
13514            mk_unfold_footer();
13515        }, 300);
13516
13517    });
13518
13519    new ChopScroll(function() {
13520        mk_skill_meter();
13521        mk_charts();
13522        mk_milestone();
13523    }, 200);
13524
13525    //  if (is_touch_device() || $(window).width() < 780) {
13526    if (is_touch_device()) {
13527        $('body').addClass('no-transform');
13528        $('.mk-animate-element').removeClass('mk-animate-element');
13529    } else {
13530        choppedjs.onResize(mk_animated_contents, 2000);
13531        choppedjs.onScroll(mk_animated_contents, 700);
13532    }
13533
13534});
13535
13536/* Typer */
13537/* -------------------------------------------------------------------- */
13538function mk_text_typer() {
13539
13540    "use strict";
13541
13542    $('[data-typer-targets]').each(function() {
13543        var $this = $(this),
13544            $first_string = [$this.text()],
13545            $rest_strings = $this.attr('data-typer-targets').split(','),
13546            $strings = $first_string.concat($rest_strings);
13547
13548        $this.text('');
13549
13550        $this.typed({
13551            strings: $strings,
13552            typeSpeed: 30, // typing speed
13553            backDelay: 1200, // pause before backspacing
13554            loop: true, // loop on or off (true or false)
13555            loopCount: false, // number of loops, false = infinite
13556        });
13557    });
13558}
13559
13560
13561
13562/* Tab Slider */
13563/* -------------------------------------------------------------------- */
13564
13565function mk_tab_slider() {
13566
13567    "use strict";
13568
13569    $('.mk-tab-slider').each(function() {
13570
13571        var $this = $(this),
13572            id = $this.data('id'),
13573            $autoplayTime = $this.data('autoplay');
13574
13575        var mk_tab_slider = $(this).swiper({
13576            wrapperClass: 'mk-tab-slider-wrapper',
13577            slideClass: 'mk-tab-slider-item',
13578            calculateHeight: true,
13579            speed: 500,
13580            autoplay: $autoplayTime,
13581            onSlideChangeStart: function() {
13582                $('.mk-tab-slider-nav[data-id="' + id + '"]').find(".active").removeClass('active')
13583                $('.mk-tab-slider-nav[data-id="' + id + '"]').find("a").eq(mk_tab_slider.activeIndex).addClass('active')
13584            }
13585        });
13586
13587        $('.mk-tab-slider-nav[data-id="' + id + '"]').find("a").first().addClass('active');
13588
13589        $('.mk-tab-slider-nav[data-id="' + id + '"]').find("a").on('touchstart mousedown', function(e) {
13590            e.preventDefault()
13591            $('.mk-tab-slider-nav[data-id="' + id + '"]').find(".active").removeClass('active')
13592            $(this).addClass('active')
13593            mk_tab_slider.swipeTo($(this).index())
13594        });
13595
13596        $('.mk-tab-slider-nav[data-id="' + id + '"]').find("a").click(function(e) {
13597            e.preventDefault()
13598        });
13599
13600    });
13601
13602}
13603
13604
13605
13606/* Edge One Pager */
13607/* -------------------------------------------------------------------- */
13608function mk_one_page_scroller() {
13609
13610    "use strict";
13611
13612    $('.mk-edge-one-pager').each(function() {
13613
13614        var $this = $(this),
13615            $tooltip_txt = [];
13616
13617        $this.find('.section').each(function() {
13618            $tooltip_txt.push($(this).attr('data-title'));
13619        });
13620
13621        $this.fullpage({
13622            verticalCentered: false,
13623            resize: true,
13624            slidesColor: ['#ccc', '#fff'],
13625            anchors: $tooltip_txt,
13626            scrollingSpeed: 600,
13627            easing: 'easeInQuart',
13628            menu: false,
13629            navigation: true,
13630            navigationPosition: 'right',
13631            navigationTooltips: false,
13632            slidesNavigation: true,
13633            slidesNavPosition: 'bottom',
13634            loopBottom: false,
13635            loopTop: false,
13636            loopHorizontal: true,
13637            autoScrolling: true,
13638            scrollOverflow: false,
13639            css3: true,
13640            paddingTop: 0,
13641            paddingBottom: 0,
13642            normalScrollElements: '#mk-header, #mk-responsive-wrap',
13643            normalScrollElementTouchThreshold: 5,
13644            keyboardScrolling: true,
13645            touchSensitivity: 15,
13646            continuousVertical: false,
13647            animateAnchor: true,
13648
13649            onLeave: function(index, nextIndex, direction) {
13650
13651                $('#mk-header.transparent-header').removeClass('light-header-skin dark-header-skin').addClass($this.find('.one-pager-slide').eq(nextIndex - 1).attr('data-header-skin') + '-header-skin');
13652                $('#fullPage-nav').removeClass('light-skin dark-skin').addClass($this.find('.one-pager-slide').eq(nextIndex - 1).attr('data-header-skin') + '-skin');
13653
13654            },
13655            afterRender: function() {
13656                // $(body).addClass('')
13657                setTimeout(function() {
13658                    $('#mk-header.transparent-header').removeClass('light-header-skin dark-header-skin').addClass($this.find('.one-pager-slide').eq(0).attr('data-header-skin') + '-header-skin');
13659                    $('#fullPage-nav').removeClass('light-skin dark-skin').addClass($this.find('.one-pager-slide').eq(0).attr('data-header-skin') + '-skin');
13660                }, 300);
13661
13662            },
13663        });
13664
13665        // var eventtype = mobilecheck() ? 'touchstart' : 'click';
13666        // $('.mk-nav-responsive-link').on(eventtype, function() {
13667        //     if ($('body').hasClass('mk-opened-nav')) {
13668        //         $.fn.fullpage.setAutoScrolling(false);
13669        //         $('body, html').css({
13670        //             'overflow': 'hidden'
13671        //         });
13672        //     } else {
13673        //         $.fn.fullpage.setAutoScrolling(true);
13674        //     }
13675        // });
13676    });
13677
13678}
13679
13680
13681function mk_one_pager_resposnive() {
13682
13683    "use strict";
13684
13685    $('.mk-edge-one-pager').each(function() {
13686        var $this = $(this),
13687            $header_height = 0;
13688
13689        var $window_height = $(window).outerHeight();
13690
13691        if ($(window).width() <= 1165) {
13692            $header_height = $('#mk-header').data('height');
13693        }
13694
13695        $this.find('.one-pager-slide').each(function() {
13696
13697
13698            var $this = $(this),
13699                $content = $this.find('.edge-slide-content');
13700
13701            if ($this.hasClass('left_center') || $this.hasClass('center_center') || $this.hasClass('right_center')) {
13702
13703                var $this_height_half = $content.outerHeight() / 2,
13704                    $window_half = $window_height / 2;
13705
13706                $content.css('marginTop', ($window_half - $this_height_half - $header_height / 2));
13707            }
13708
13709            if ($this.hasClass('left_bottom') || $this.hasClass('center_bottom') || $this.hasClass('right_bottom')) {
13710
13711                var $distance_from_top = $window_height - $content.outerHeight() - 90;
13712
13713                $content.css('marginTop', ($distance_from_top));
13714            }
13715
13716        });
13717    });
13718
13719}
13720
13721/* Gets IE version */
13722/* -------------------------------------------------------------------- */
13723
13724function mk_detect_ie() {
13725    var ua = window.navigator.userAgent;
13726    var msie = ua.indexOf('MSIE ');
13727    var trident = ua.indexOf('Trident/');
13728    if (msie > 0) {
13729        return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
13730    }
13731    if (trident > 0) {
13732        var rv = ua.indexOf('rv:');
13733        return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);
13734    }
13735    return false;
13736}
13737
13738
13739
13740/* Greensock wrapper for animation scroll */
13741/* -------------------------------------------------------------------- */
13742
13743function tweenScroll(startPoint, endPoint, tweenName, endFix) {
13744    progressVal = (1 / (endPoint - startPoint) * (scrollY - startPoint));
13745
13746    if (progressVal >= 0 && progressVal <= 1) {
13747        tweenName.progress(progressVal * endFix);
13748        // TweenLite.to(tweenName, 0, {progress:progressVal * endFix, ease:Linear.easeNone}); // also cool with ease:Strong.easeOut
13749        TweenLite.set(tweenName, {
13750            progress: progressVal * endFix
13751        });
13752        // console.log(progressVal);
13753    }
13754
13755}
13756
13757/* Image Gallery */
13758/* -------------------------------------------------------------------- */
13759
13760function mk_gallery() {
13761
13762    "use strict";
13763
13764    $('.mk-gallery-shortcode .mk-gallery-item.hover-overlay_layer .item-holder').each(function() {
13765        var itemHolder = $(this),
13766            galleryDesc = itemHolder.find('.gallery-desc');
13767
13768        function updatePosition() {
13769            var parentHeight = itemHolder.outerHeight(),
13770                contentHeight = galleryDesc.innerHeight();
13771
13772            var paddingVal = (parentHeight - contentHeight) / 2;
13773            galleryDesc.css({
13774                'top': paddingVal,
13775                // 'padding-bottom': paddingVal
13776            });
13777
13778            // console.log(parentHeight);
13779            // console.log(contentHeight);
13780
13781
13782        }
13783        updatePosition();
13784
13785        $(window).on('debouncedresize', function() {
13786            setTimeout(function() {
13787                updatePosition();
13788            }, 1000);
13789        });
13790    });
13791}
13792
13793
13794/* Page Title Box */
13795/* -------------------------------------------------------------------- */
13796
13797
13798function mk_page_title_parallax() {
13799
13800    "use strict";
13801
13802    if (!is_touch_device()) {
13803        $('.mk-effect-wrapper').each(function() {
13804
13805            var progressVal,
13806                currentPoint,
13807                ticking = false,
13808                scrollY = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop,
13809                $this = $(this),
13810                $window = $(window),
13811                windowHeight = $(window).height(),
13812                parentHeight = $this.outerHeight(),
13813                startPoint = 0,
13814                endPoint = $this.offset().top + parentHeight,
13815                effectLayer = $this.find('.mk-effect-bg-layer'),
13816                gradientLayer = effectLayer.find('.mk-effect-gradient-layer'),
13817                cntLayer = $this.find('.mk-page-title-box-content'),
13818                animation = effectLayer.attr('data-effect'),
13819                top = $this.offset().top,
13820                height = $this.outerHeight();
13821
13822            var parallaxSpeed = .7,
13823                zoomFactor = 1.3;
13824
13825            var animationSet = function() {
13826                scrollY = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;
13827
13828                if (animation == "parallax") {
13829                    currentPoint = (startPoint + scrollY) * parallaxSpeed;
13830                    effectLayer.css({
13831                        'transform': 'translateY(' + currentPoint + 'px)'
13832                    });
13833                }
13834
13835                if (animation == "parallaxZoomOut") {
13836                    currentPoint = (startPoint + scrollY) * parallaxSpeed;
13837                    progressVal = (1 / (endPoint - startPoint) * (scrollY - startPoint));
13838                    var zoomCalc = zoomFactor - ((zoomFactor - 1) * progressVal);
13839
13840                    effectLayer.css({
13841                        'transform': 'translateY(' + currentPoint + 'px), scale(' + zoomCalc + ')'
13842                    });
13843                }
13844
13845                if (animation == "gradient") {
13846                    progressVal = (1 / (endPoint - startPoint) * (scrollY - startPoint));
13847                    gradientLayer.css({
13848                        opacity: progressVal * 2
13849                    });
13850                }
13851
13852                if (animation != "gradient") {
13853                    progressVal = (1 / (endPoint - startPoint) * (scrollY - startPoint));
13854                    cntLayer.css({
13855                        opacity: 1 - (progressVal * 4)
13856                    });
13857                }
13858
13859                // Stop ticking
13860                ticking = false;
13861            }
13862            animationSet();
13863
13864            // This will limit the calculation of the background position to
13865            // 60fps as well as blocking it from running multiple times at once
13866            var requestTick = function() {
13867                if (!ticking) {
13868                    requestAnimationFrame(animationSet);
13869                    ticking = true;
13870                }
13871            };
13872
13873
13874            // RequestAnimationFrame polyfill for older browsers
13875            var rafPolyfill = function() {
13876                var lastTime = 0;
13877                var vendors = ['ms', 'moz', 'webkit', 'o'];
13878                for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
13879                    window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
13880                    window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
13881                }
13882                if (!window.requestAnimationFrame)
13883                    window.requestAnimationFrame = function(callback, element) {
13884                        var currTime = new Date().getTime();
13885                        var timeToCall = Math.max(0, 16 - (currTime - lastTime));
13886                        var id = window.setTimeout(function() {
13887                                callback(currTime + timeToCall);
13888                            },
13889                            timeToCall);
13890                        lastTime = currTime + timeToCall;
13891                        return id;
13892                    };
13893                if (!window.cancelAnimationFrame)
13894                    window.cancelAnimationFrame = function(id) {
13895                        clearTimeout(id);
13896                    };
13897            };
13898            rafPolyfill();
13899
13900            $window.on('scroll', requestTick);
13901
13902        });
13903    }
13904}
13905
13906
13907
13908/* Adds pagination style in fullpage Edge Slider */
13909/* -------------------------------------------------------------------- */
13910function mk_edge_fullpage_pagination() {
13911
13912    "use strict";
13913
13914    var style = $('#fullpage').attr('data-pagination');
13915    // console.log(style);
13916    $('#fullPage-nav').addClass('pagination-' + style);
13917}
13918
13919
13920
13921/* Clients Shortcode mobile fix */
13922/* -------------------------------------------------------------------- */
13923function mk_clients_mobile() {
13924
13925    "use strict";
13926
13927    $('.mk-clients-shortcode.column-style').each(function() {
13928        var group = $(this),
13929            list = group.find('li'),
13930            listStyle = group.find('ul').attr('style'),
13931            fullRowColumns = group.find('ul:first-of-type li').length,
13932
13933            viewport = $(window),
13934            viewportWidth = viewport.innerWidth(),
13935            breakPoint1 = 960 - 25,
13936            breakPoint2 = 767 - 25,
13937            breakPoint3 = 550 - 25;
13938
13939        function recreateGrid() {
13940            if (viewportWidth > breakPoint1) {
13941                list.unwrap();
13942                for (var i = 0; i < list.length; i += fullRowColumns) {
13943                    list.slice(i, i + fullRowColumns)
13944                        .wrapAll('<ul style="' + listStyle + '"></ul>');
13945                }
13946            } else if (viewportWidth < breakPoint3) {
13947                list.unwrap();
13948                for (var i = 0; i < list.length; i += 1) {
13949                    list.slice(i, i + 1).wrapAll('<ul class="mk-clients-fixed-list" style="' + listStyle + '"></ul>');
13950                }
13951            } else if (viewportWidth < breakPoint2) {
13952                list.unwrap();
13953                for (var i = 0; i < list.length; i += 2) {
13954                    list.slice(i, i + 2).wrapAll('<ul class="mk-clients-fixed-list" style="' + listStyle + '"></ul>');
13955                }
13956            } else if (viewportWidth < breakPoint1) {
13957                list.unwrap();
13958                for (var i = 0; i < list.length; i += 3) {
13959                    list.slice(i, i + 3).wrapAll('<ul class="mk-clients-fixed-list" style="' + listStyle + '"></ul>');
13960                }
13961            }
13962        }
13963        recreateGrid();
13964
13965        $(window).on('debouncedresize', function() {
13966            viewportWidth = viewport.innerWidth();
13967            recreateGrid();
13968        });
13969
13970    });
13971}
13972
13973
13974
13975/* Theatre Slider Responsive Calculator */
13976/* -------------------------------------------------------------------- */
13977
13978function mk_theatre_responsive_calculator() {
13979    var $laptopContainer = $(".laptop-theatre-slider");
13980    var $computerContainer = $(".computer-theatre-slider");
13981    $laptopContainer.each(function() {
13982        var $this = $(this),
13983            $window = $(window),
13984            $windowWidth = $window.outerWidth(),
13985            $windowHeight = $window.outerHeight(),
13986            $width = $this.outerWidth(),
13987            $height = $this.outerHeight(),
13988            $paddingTop = 38,
13989            $paddingRight = 143,
13990            $paddingBottom = 78,
13991            $paddingLeft = 143;
13992
13993        var $player = $this.find('.player-container');
13994
13995        if ($windowWidth > $width) {
13996            $player.css({
13997                'padding-left': parseInt(($width * $paddingLeft) / 1200),
13998                'padding-right': parseInt(($width * $paddingRight) / 1200),
13999                'padding-top': parseInt(($height * $paddingTop) / 690),
14000                'padding-bottom': parseInt(($height * $paddingBottom) / 690),
14001            });
14002        }
14003
14004    });
14005
14006    $computerContainer.each(function() {
14007        var $this = $(this),
14008            $window = $(window),
14009            $windowWidth = $window.outerWidth(),
14010            $windowHeight = $window.outerHeight(),
14011            $width = $this.outerWidth(),
14012            $height = $this.outerHeight(),
14013            $paddingTop = 60,
14014            $paddingRight = 52,
14015            $paddingBottom = 290,
14016            $paddingLeft = 49;
14017
14018        var $player = $this.find('.player-container');
14019
14020        if ($windowWidth > $width) {
14021            $player.css({
14022                'padding-left': parseInt(($width * $paddingLeft) / 1200),
14023                'padding-right': parseInt(($width * $paddingRight) / 1200),
14024                'padding-top': parseInt(($height * $paddingTop) / 969),
14025                'padding-bottom': parseInt(($height * $paddingBottom) / 969),
14026            });
14027        }
14028
14029    });
14030
14031}
14032
14033/* Mobile and Tablet Slideshow Responsive Calculator */
14034/* -------------------------------------------------------------------- */
14035function mk_mobile_tablet_responsive_calculator() {
14036    var $laptopSlideshow = $(".mk-laptop-slideshow-shortcode");
14037    var $lcdSlideshow = $(".mk-lcd-slideshow");
14038
14039    if ($.exists(".mk-laptop-slideshow-shortcode")) {
14040        $laptopSlideshow.each(function() {
14041            var $this = $(this),
14042                $window = $(window),
14043                $windowWidth = $window.outerWidth(),
14044                $windowHeight = $window.outerHeight(),
14045                $width = $this.outerWidth(),
14046                $height = $this.outerHeight(),
14047                $paddingTop = 28,
14048                $paddingRight = 102,
14049                $paddingBottom = 52,
14050                $paddingLeft = 102;
14051
14052            var $player = $this.find(".slideshow-container");
14053
14054            $player.css({
14055                "padding-left": parseInt(($width * $paddingLeft) / 836),
14056                "padding-right": parseInt(($width * $paddingRight) / 836),
14057                "padding-top": parseInt(($height * $paddingTop) / 481),
14058                "padding-bottom": parseInt(($height * $paddingBottom) / 481),
14059            });
14060
14061        });
14062    }
14063
14064    if ($.exists(".mk-lcd-slideshow")) {
14065        $lcdSlideshow.each(function() {
14066            var $this = $(this),
14067                $window = $(window),
14068                $windowWidth = $window.outerWidth(),
14069                $windowHeight = $window.outerHeight(),
14070                $width = $this.outerWidth(),
14071                $height = $this.outerHeight(),
14072                $paddingTop = 35,
14073                $paddingRight = 39,
14074                $paddingBottom = 213,
14075                $paddingLeft = 36;
14076
14077            var $player = $this.find(".slideshow-container");
14078            $player.css({
14079                "padding-left": parseInt(($width * $paddingLeft) / 886),
14080                "padding-right": parseInt(($width * $paddingRight) / 886),
14081                "padding-top": parseInt(($height * $paddingTop) / 713),
14082                "padding-bottom": parseInt(($height * $paddingBottom) / 713),
14083            });
14084        });
14085    }
14086}
14087
14088
14089/* Start a tour resize function */
14090/* -------------------------------------------------------------------- */
14091function mk_start_tour_resize() {
14092
14093    $('.mk-header-start-tour').each(function() {
14094
14095        var $windowWidth = $(document).width(),
14096            $this = $(this),
14097            $linkWidth = $this.width() + 15,
14098            $padding = ($windowWidth - mk_responsive_nav_width) / 2;
14099
14100
14101
14102        function updateStartTour(){
14103            if($windowWidth < mk_responsive_nav_width){
14104                $this.removeClass('hidden');
14105                $this.addClass('show');
14106            }else{
14107                if($padding < $linkWidth){
14108                    $this.removeClass('show');
14109                    $this.addClass('hidden'); 
14110                }else{
14111                    $this.removeClass('hidden');
14112                    $this.addClass('show');  
14113                }
14114            }
14115        }
14116
14117        setTimeout(function() {
14118            updateStartTour();
14119        }, 300);
14120    });
14121}
14122
14123/* Header social resize function */
14124/* -------------------------------------------------------------------- */
14125function mk_header_social_resize() {
14126
14127    $('#mk-header-social.header-section').each(function() {
14128
14129        var $windowWidth = $(document).width(),
14130            $this = $(this),
14131            $linkWidth = $this.width() + 15,
14132            $padding = ($windowWidth - mk_responsive_nav_width) / 2;
14133
14134
14135
14136        function updateStartTour(){
14137            if($windowWidth < mk_responsive_nav_width){
14138                $this.removeClass('hidden');
14139                $this.addClass('show');
14140            }else{
14141                if($padding < $linkWidth){
14142                    $this.removeClass('show');
14143                    $this.addClass('hidden'); 
14144                }else{
14145                    $this.removeClass('hidden');
14146                    $this.addClass('show');  
14147                }
14148            }
14149        }
14150
14151        setTimeout(function() {
14152            updateStartTour();
14153        }, 300);
14154    });
14155}
14156
14157/* Page Section Socail Video Player Controls */
14158/* -------------------------------------------------------------------- */
14159
14160function mk_page_section_social_video_bg() {
14161    $(".mk-page-section.social-hosted").each(function() {
14162        var $container = $(this),
14163            $source = $container.data('source'),
14164            player;
14165 
14166        if ($source == 'youtube') {
14167            var youtube = $container.find('iframe')[0];
14168            player = new YT.Player(youtube);
14169            setTimeout(function() { 
14170                player.playVideo();
14171                player.mute();
14172            }, 1000); 
14173        }
14174        if ($source == 'vimeo') {
14175            var vimeo = $container.find('iframe')[0];
14176            player = $f(vimeo);
14177            setTimeout(function() { 
14178                player.api('play');
14179                player.api('setVolume', 0);
14180            }, 1000);
14181        }
14182
14183    });
14184}
14185
14186// Pre RequireJS hot bug fixing
14187
14188function videoLoadState() {
14189    $('.mk-section-video video').each(function() {
14190        var mkVideo = this;
14191
14192        this.onload = fire();
14193
14194        function fire() {
14195            setTimeout(function() {
14196                $(mkVideo).animate({
14197                    'opacity': 1
14198                }, 300);
14199            }, 1000);
14200        }
14201    });
14202}
14203videoLoadState();
14204
14205function mk_animated_cols() {
14206    function equalheight (container){
14207        var currentTallest = 0,
14208             currentRowStart = 0,
14209             rowDivs = new Array(),
14210             $el,
14211             topPosition = 0;
14212         $(container).each(function() {
14213
14214           $el = $(this);
14215           $($el).height('auto')
14216           topPosition = $el.position().top;
14217
14218           if (currentRowStart != topPosition) {
14219             for (var currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++) {
14220               rowDivs[currentDiv].height(currentTallest);
14221             }
14222             rowDivs.length = 0; // empty the array
14223             currentRowStart = topPosition;
14224             currentTallest = $el.height();
14225             rowDivs.push($el);
14226           } else {
14227             rowDivs.push($el);
14228             currentTallest = (currentTallest < $el.height()) ? ($el.height()) : (currentTallest);
14229          }
14230           for (currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++) {
14231             rowDivs[currentDiv].height(currentTallest);
14232           }
14233
14234         });
14235        
14236        // console.log('recalc' + container + ' ' + currentTallest);
14237
14238        return currentTallest;
14239    }
14240
14241
14242    function prepareCols(el) {
14243        var $this = el.parent().parent().find('.mk-animated-columns');
14244
14245        var iconHeight  = equalheight('.vc_row .animated-column-icon'),
14246            titleHeight = equalheight('.vc_row .animated-column-title'),
14247            descHeight  = equalheight('.vc_row .animated-column-desc'),
14248            btnHeight   = $this.find('.animated-column-btn').innerHeight();
14249
14250        // console.log('iconHeight: ' + iconHeight + ' / ' + $this.find('.animated-column-icon').innerHeight());
14251        // console.log('titleHeight: ' + titleHeight + ' / ' + $this.find('.animated-column-title').innerHeight());
14252        // console.log('descHeight: ' + descHeight + ' / ' + $this.find('.animated-column-desc').innerHeight());
14253        // console.log('btnHeight: ' + btnHeight);
14254
14255        if ($this.hasClass('full-style')) {
14256            $this.find('.animated-column-item').each(function() {
14257                var $this = $(this),
14258                    contentHeight = (iconHeight + 30) + (titleHeight + 10) + (descHeight + 70) + 34;
14259
14260                $this.height(contentHeight * 1.5 + 50);
14261
14262                var $box_height = $this.outerHeight(true),
14263                    $icon_height = $this.find('.animated-column-icon').height();
14264
14265                $this.find('.animated-column-holder').css({
14266                    'paddingTop': $box_height / 2 - $icon_height
14267                });
14268
14269
14270                $this.animate({opacity:1}, 300);
14271            });
14272        } else {
14273            $this.find('.animated-column-item').each(function() {
14274                var $this = $(this),
14275                    $half_box_height = $this.outerHeight(true) / 2,
14276                    $icon_height = $this.find('.animated-column-icon').outerHeight(true)/2,
14277                    $title_height = $this.find('.animated-column-simple-title').outerHeight(true)/2;
14278
14279                $this.find('.animated-column-holder').css({
14280                    'paddingTop': $half_box_height - $icon_height
14281                });
14282                $this.find('.animated-column-title').css({
14283                    'paddingTop': $half_box_height - $title_height + ($icon_height * 2)
14284                });
14285
14286                $this.animate({opacity:1}, 300);
14287
14288            });
14289        }
14290    }
14291
14292    $('.mk-animated-columns').each(function() {
14293        var $this = $(this),
14294            $parent = $this.parent().parent(),
14295            $columns = $parent.find('.column_container'),
14296            index = $columns.index($this.parent());
14297            // really bad that we cannot read it before bootstrap - needs full shortcode refactor
14298
14299        if($this.hasClass('full-style')) {
14300            $this.find('.animated-column-item').hover(
14301            function() {
14302                TweenLite.to($(this).find(".animated-column-holder"), 0.5, {
14303                    top: '-15%',
14304                    ease: Back.easeOut
14305                });
14306                TweenLite.to($(this).find(".animated-column-desc"), 0.5, {
14307                    top: '-50%',
14308                    ease: Expo.easeOut
14309                }, 0.4);
14310                TweenLite.to($(this).find(".animated-column-btn"), 0.3, {
14311                    top: '-50%',
14312                    ease: Expo.easeOut
14313                }, 0.6);
14314            },
14315            function() {
14316
14317                TweenLite.to($(this).find(".animated-column-holder"), 0.5, {
14318                    top: '0%',
14319                    ease: Back.easeOut, easeParams:[3]
14320                });
14321                TweenLite.to($(this).find(".animated-column-desc"), 0.5, {
14322                    top: '100%',
14323                    ease: Back.easeOut
14324                }, 0.4);
14325                TweenLite.to($(this).find(".animated-column-btn"), 0.5, {
14326                    top: '100%',
14327                    ease: Back.easeOut
14328                }, 0.2);
14329            });
14330        }
14331
14332        if($this.hasClass('.simple-style')) {
14333            $this.find('.animated-column-item').hover(
14334            function() {
14335                TweenLite.to($(this).find(".animated-column-holder"), 0.7, {
14336                    top: '100%',
14337                    ease: Expo.easeOut
14338                });
14339                TweenLite.to($(this).find(".animated-column-title"), 0.7, {
14340                    top: '0%',
14341                    ease: Back.easeOut
14342                }, 0.2);
14343            },
14344            function() {
14345                TweenLite.to($(this).find(".animated-column-holder"), 0.7, {
14346                    top: '0%',
14347                    ease: Expo.easeOut
14348                });
14349                TweenLite.to($(this).find(".animated-column-title"), 0.7, {
14350                    top: '-100%',
14351                    ease: Back.easeOut
14352                }, 0.2);
14353            });
14354        };
14355
14356        if($columns.length === index + 1) {
14357            prepareCols($this);
14358        }
14359
14360        $(window).on("resize", function() {
14361            if($columns.length === index + 1) {
14362                setTimeout(prepareCols($this), 1000);
14363            }
14364        });
14365    });
14366}
14367
14368function mk_google_maps() {
14369
14370    $('.mk-advanced-gmaps').each(function() {
14371            var $this = $(this),
14372              $id = $this.attr('id'),
14373              $zoom = parseInt($this.attr('data-zoom')),
14374              $latitude = $this.attr('data-latitude'),
14375              $longitude = $this.attr('data-longitude'),
14376              $address = $this.attr('data-address'),
14377              $latitude_2 = $this.attr('data-latitude2'),
14378              $longitude_2 = $this.attr('data-longitude2'),
14379              $address_2 = $this.attr('data-address2'),
14380              $latitude_3 = $this.attr('data-latitude3'),
14381              $longitude_3 = $this.attr('data-longitude3'),
14382              $address_3 = $this.attr('data-address3'),
14383              $map_type = $this.attr('data-map-type'),
14384              $pin_icon = $this.attr('data-pin-icon'),
14385              $pan_control = $this.attr('data-pan-control') === "true" ? true : false,
14386              $map_type_control = $this.attr('data-map-type-control') === "true" ? true : false,
14387              $scale_control = $this.attr('data-scale-control') === "true" ? true : false,
14388              $draggable = $this.attr('data-draggable') === "true" ? true : false,
14389              $zoom_control = $this.attr('data-zoom-control') === "true" ? true : false,
14390              $modify_coloring = $this.attr('data-modify-coloring') === "true" ? true : false,
14391              $saturation = $this.attr('data-saturation'),
14392              $hue = $this.attr('data-hue'),
14393              $lightness = $this.attr('data-lightness'),
14394              $styles;
14395
14396
14397            if ($modify_coloring == true) {
14398              var $styles = [{
14399                stylers: [{
14400                  hue: $hue
14401                }, {
14402                  saturation: $saturation
14403                }, {
14404                  lightness: $lightness
14405                }, {
14406                  featureType: "landscape.man_made",
14407                  stylers: [{
14408                    visibility: "on"
14409                  }]
14410                }]
14411              }];
14412            }
14413
14414            
14415
14416            var map;
14417
14418            function initialize() {
14419
14420
14421              var bounds = new google.maps.LatLngBounds();
14422
14423
14424
14425              var mapOptions = {
14426                zoom: $zoom,
14427                panControl: $pan_control,
14428                zoomControl: $zoom_control,
14429                mapTypeControl: $map_type_control,
14430                scaleControl: $scale_control,
14431                draggable: $draggable,
14432                scrollwheel: false,
14433                mapTypeId: google.maps.MapTypeId[$map_type],
14434                styles: $styles
14435              };
14436
14437              map = new google.maps.Map(document.getElementById($id), mapOptions);
14438              map.setTilt(45);
14439
14440              // Multiple Markers
14441
14442              var markers = [];
14443              var infoWindowContent = [];
14444
14445              if ($latitude != '' && $longitude != '') {
14446                markers[0] = [$address, $latitude, $longitude];
14447                infoWindowContent[0] = [$address];
14448              }
14449
14450              if ($latitude_2 != '' && $longitude_2 != '') {
14451                markers[1] = [$address_2, $latitude_2, $longitude_2];
14452                infoWindowContent[1] = [$address_2];
14453              }
14454
14455              if ($latitude_3 != '' && $longitude_3 != '') {
14456                markers[2] = [$address_3, $latitude_3, $longitude_3];
14457                infoWindowContent[2] = [$address_3];
14458              }
14459
14460
14461              var infoWindow = new google.maps.InfoWindow(),
14462                marker, i;
14463
14464
14465           
14466              for (i = 0; i < markers.length; i++) {
14467                var position = new google.maps.LatLng(markers[i][1], markers[i][2]);
14468                bounds.extend(position);
14469                marker = new google.maps.Marker({
14470                  position: position,
14471                  map: map,
14472                  title: markers[i][0],
14473                  icon: $pin_icon
14474                });
14475
14476                google.maps.event.addListener(marker, 'click', (function(marker, i) {
14477                  return function() {
14478                    if(infoWindowContent[i][0].length > 1) {
14479                      infoWindow.setContent('<div class="info_content"><p>'+infoWindowContent[i][0]+'</p></div>');  
14480                    }
14481                    
14482                    infoWindow.open(map, marker);
14483                  }
14484                })(marker, i));
14485
14486                map.fitBounds(bounds);
14487
14488              }
14489
14490
14491
14492              var boundsListener = google.maps.event.addListener((map), 'bounds_changed', function(event) {
14493                this.setZoom($zoom);
14494                google.maps.event.removeListener(boundsListener);
14495              });
14496
14497              // console.log('google map should be initialised');
14498            }
14499            initialize();
14500
14501            // google.maps.event.addDomListener(window, "load", initialize);
14502            // $(window).load(initialize)
14503
14504
14505         
14506            function googleMapsResize() {
14507              //google.maps.event.trigger(map, 'resize');
14508              initialize();
14509            } 
14510
14511            var temporaryTabsContainer = $('.mk-tabs');
14512            if (temporaryTabsContainer.length) {
14513              temporaryTabsContainer.each(function() {
14514                google.maps.event.addDomListener($(this)[0], "click", googleMapsResize);
14515              });
14516
14517            }
14518
14519            var fullHeight = $this.hasClass('full-height-map');
14520
14521            function fullHeightMap() {
14522                if (fullHeight) {
14523
14524                  var $window_height = $(window).outerHeight(),
14525                       wp_admin_height = 0,
14526                       header_height = 0;
14527
14528                    if($.exists('#mk-header .mk-header-holder')) {
14529                      header_height = parseInt($('#mk-header').attr('data-sticky-height'));  
14530                    }   
14531                       
14532                    if ($.exists("#wpadminbar")) {
14533                      var wp_admin_height = $("#wpadminbar").outerHeight();
14534                    }
14535              
14536                  $window_height = $window_height - wp_admin_height - header_height;
14537
14538                  $this.css('height', $window_height);
14539                }
14540            }
14541            fullHeightMap();
14542
14543            $(window).on('debouncedresize', fullHeightMap);
14544    });
14545}
14546;/* Blog, Portfolio Audio */
14547/* -------------------------------------------------------------------- */
14548
14549function loop_audio_init() {
14550  if ($.exists('.jp-jplayer')) {
14551    $('.jp-jplayer.mk-blog-audio').each(function () {
14552      var css_selector_ancestor = "#" + $(this).siblings('.jp-audio').attr('id');
14553      var ogg_file, mp3_file, mk_theme_js_path;
14554      ogg_file = $(this).attr('data-ogg');
14555      mp3_file = $(this).attr('data-mp3');
14556      $(this).jPlayer({
14557        ready: function () {
14558          $(this).jPlayer("setMedia", {
14559            mp3: mp3_file,
14560            ogg: ogg_file
14561          });
14562        },
14563        play: function () { // To avoid both jPlayers playing together.
14564          $(this).jPlayer("pauseOthers");
14565        }, 
14566        swfPath: mk_theme_js_path,
14567        supplied: "mp3, ogg",
14568        cssSelectorAncestor: css_selector_ancestor,
14569        wmode: "window"
14570      });
14571    });
14572  }
14573}
14574
14575;/* jQuery prettyPhoto lightbox */
14576/* -------------------------------------------------------------------- */
14577
14578function mk_lightbox_init() {
14579  $(".mk-lightbox").fancybox({
14580            padding: 15,
14581            margin: 15,
14582
14583            width: 800,
14584            height: 600,
14585            minWidth: 100,
14586            minHeight: 100,
14587            maxWidth: 9999,
14588            maxHeight: 9999,
14589            pixelRatio: 1, // Set to 2 for retina display support
14590
14591            autoSize: true,
14592            autoHeight: false,
14593            autoWidth: false,
14594
14595            autoResize: true,
14596            fitToView: true,
14597            aspectRatio: false,
14598            topRatio: 0.5,
14599            leftRatio: 0.5,
14600
14601            scrolling: 'auto', // 'auto', 'yes' or 'no'
14602            wrapCSS: '',
14603
14604            arrows: true,
14605            closeBtn: true,
14606            closeClick: false,
14607            nextClick: false,
14608            mouseWheel: true,
14609            autoPlay: false,
14610            playSpeed: 3000,
14611            preload: 3,
14612            modal: false,
14613            loop: true,
14614            // Properties for each animation type
14615            // Opening fancyBox
14616            openEffect: 'fade', // 'elastic', 'fade' or 'none'
14617            openSpeed: 200,
14618            openEasing: 'swing',
14619            openOpacity: true,
14620            openMethod: 'zoomIn',
14621
14622            // Closing fancyBox
14623            closeEffect: 'fade', // 'elastic', 'fade' or 'none'
14624            closeSpeed: 200,
14625            closeEasing: 'swing',
14626            closeOpacity: true,
14627            closeMethod: 'zoomOut',
14628
14629            // Changing next gallery item
14630            nextEffect: 'none', // 'elastic', 'fade' or 'none'
14631            nextSpeed: 350,
14632            nextEasing: 'swing',
14633            nextMethod: 'changeIn',
14634
14635            // Changing previous gallery item
14636            prevEffect: 'none', // 'elastic', 'fade' or 'none'
14637            prevSpeed: 350,
14638            prevEasing: 'swing',
14639            prevMethod: 'changeOut',
14640            helpers : {
14641                 media : {}
14642            },
14643
14644            tpl: {
14645                wrap: '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',
14646                image: '<img class="fancybox-image" src="{href}" alt="" />',
14647                error: '<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',
14648                closeBtn: '<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"><i class="mk-moon-close-2"></i></a>',
14649                next: '<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span><i class="mk-jupiter-icon-arrow-right"></i></span></a>',
14650                prev: '<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span><i class="mk-jupiter-icon-arrow-left"></i></span></a>',
14651                loading: '<div id="fancybox-loading"><div></div></div>'
14652            },
14653
14654        });
14655}
14656
14657;/* Event Count Down */
14658/* -------------------------------------------------------------------- */
14659
14660function mk_event_countdown() {
14661  if ($.exists('.mk-event-countdown')) {
14662    $('.mk-event-countdown').each(function () {
14663      var $this = $(this),
14664        $date = $this.attr('data-date'),
14665        $offset = $this.attr('data-offset');
14666
14667      $this.downCount({
14668        date: $date,
14669        offset: $offset
14670      });
14671    });
14672  }
14673};/* Flexslider init */
14674/* -------------------------------------------------------------------- */
14675
14676function mk_flexslider_init() {
14677
14678  $('.mk-flexslider.mk-script-call').each(function () {
14679
14680    if ($(this).parents('.mk-tabs').length || $(this).parents('.mk-accordion').length) {
14681      $(this).removeData("flexslider");
14682    }
14683
14684    var $this = $(this),
14685      $selector = $this.attr('data-selector'),
14686      $animation = $this.attr('data-animation'),
14687      $easing = $this.attr('data-easing'),
14688      $direction = $this.attr('data-direction'),
14689      $smoothHeight = $this.attr('data-smoothHeight') == "true" ? true : false,
14690      $slideshowSpeed = $this.attr('data-slideshowSpeed'),
14691      $animationSpeed = $this.attr('data-animationSpeed'),
14692      $controlNav = $this.attr('data-controlNav') == "true" ? true : false,
14693      $directionNav = $this.attr('data-directionNav') == "true" ? true : false,
14694      $pauseOnHover = $this.attr('data-pauseOnHover') == "true" ? true : false,
14695      $isCarousel = $this.attr('data-isCarousel') == "true" ? true : false,
14696      $arrowLeft = $this.attr('data-arrow-left'),
14697      $arrowRight = $this.attr('data-arrow-right');
14698
14699      if($arrowLeft == undefined) {
14700        $arrowLeft = '<i class="mk-jupiter-icon-arrow-left"></i>';
14701      } else {
14702        $arrowLeft = '<i class="'+$arrowLeft+'"></i>';
14703      }
14704
14705      if($arrowRight == undefined) {
14706        $arrowRight = '<i class="mk-jupiter-icon-arrow-right"></i>';
14707      } else {
14708        $arrowRight = '<i class="'+$arrowRight+'"></i>';
14709      }
14710
14711
14712    if ($selector != undefined) {
14713      var $selector_class = $selector;
14714    } else {
14715      var $selector_class = ".mk-flex-slides > li";
14716    }
14717
14718    if ($isCarousel == true) {
14719      var $itemWidth = parseInt($this.attr('data-itemWidth')),
14720        $itemMargin = parseInt($this.attr('data-itemMargin')),
14721        $minItems = parseInt($this.attr('data-minItems')),
14722        $maxItems = parseInt($this.attr('data-maxItems')),
14723        $move = parseInt($this.attr('data-move'));
14724    } else {
14725      var $itemWidth = $itemMargin = $minItems = $maxItems = $move = 0;
14726    }
14727
14728    $this.flexslider({
14729      selector: $selector_class,
14730      animation: $animation,
14731      easing: $easing,
14732      direction: $direction,
14733      smoothHeight: $smoothHeight,
14734      slideshow: true,
14735      slideshowSpeed: $slideshowSpeed,
14736      animationSpeed: $animationSpeed,
14737      controlNav: $controlNav,
14738      directionNav: $directionNav,
14739      pauseOnHover: $pauseOnHover,
14740      prevText: "",
14741      nextText: "",
14742      directionNavArrowsLeft: $arrowLeft,
14743      directionNavArrowsRight:$arrowRight,
14744      itemWidth: $itemWidth,
14745      itemMargin: $itemMargin,
14746      minItems: $minItems,
14747      maxItems: $maxItems,
14748      move: $move,
14749    });
14750
14751  });
14752
14753}
14754
14755
14756//
14757;/* Background Parallax Effects */
14758/* -------------------------------------------------------------------- */
14759
14760function mk_backgrounds_parallax() {
14761
14762  "use strict";
14763
14764  if (mk_header_parallax == true) {
14765    $('.mk-header-bg').addClass('mk-parallax-enabled');
14766  }
14767  if (mk_body_parallax == true) {
14768    $('body').addClass('mk-parallax-enabled');
14769  }
14770  if (mk_banner_parallax == true) {
14771    $('#mk-header').addClass('mk-parallax-enabled');
14772  }
14773  if (mk_page_parallax == true) {
14774    $('#theme-page').addClass('mk-parallax-enabled');
14775  }
14776  if (mk_footer_parallax == true) {
14777    $('#mk-footer').addClass('mk-parallax-enabled');
14778  }
14779
14780  $('.mk-parallax-enabled').each(function () {
14781    if (!is_touch_device()) {
14782      $(this).parallax("49%", 0.3);
14783    }
14784  });
14785
14786  $('.mk-fullwidth-slideshow.parallax-slideshow').each(function () {
14787    if (!is_touch_device()) {
14788      var speed_factor = $(this).attr('data-speedFactor');
14789      $(this).parallax("49%", speed_factor);
14790    }
14791  });
14792
14793};/* Animated Contents */
14794/* -------------------------------------------------------------------- */
14795
14796function mk_animated_contents() {
14797
14798  "use strict";
14799
14800  $(".mk-animate-element").filter(":in-viewport").each(function (i) {
14801    var $this = $(this);
14802    if (!$this.hasClass('mk-in-viewport')) {
14803      setTimeout(function () {
14804        $this.addClass('mk-in-viewport');
14805      }, 100 * i);
14806    }
14807  });
14808
14809}
14810;/* Box Blur effect */
14811/* -------------------------------------------------------------------- */
14812
14813function mk_blur_boxes() {
14814
14815  "use strict";
14816
14817  var viewportWidth = $(window).width(),
14818  	  overlayColor = "rgba(255,255,255,0.6)";
14819
14820
14821
14822  if ($.exists('.icon-box-boxed.blured-box, .mk-employee-item.employee-item-blur') && !is_touch_device() && viewportWidth > 1024 ) {
14823
14824  		var bg = $('.mk-blur-parent').find('.background-layer'),
14825  			i = 0;
14826
14827
14828  		var setLoop = setInterval( function(){ 
14829			var	mk_blur_parent = bg.eq(i),
14830		  		mk_blur_elements = $('.mk-blur-parent').find('.icon-box-boxed.blured-box, .mk-employee-item.employee-item-blur');
14831
14832				mk_blur_elements.blurjs({
14833				  source: mk_blur_parent,
14834				  radius: 18,
14835				  overlay: overlayColor,
14836				});
14837				i++;
14838				if(i === bg.length) {
14839					clearInterval(setLoop);
14840					// console.log('blur-stop-propagation');
14841				}
14842  		}, 1000);
14843	
14844  }  else if ($.exists('.icon-box-boxed.blured-box, .mk-employee-item.employee-item-blur')) {
14845		if ( viewportWidth <= 935 ) {
14846		  	$('.mk-blur-parent .icon-box-boxed').css({ 'background-color' : overlayColor });
14847		  	$('.mk-blur-parent .mk-employee-item').css({ 'background-color' : overlayColor });
14848		} 
14849  }
14850}
14851;/* Tabs */
14852/* -------------------------------------------------------------------- */
14853
14854function mk_tabs() {
14855
14856  "use strict";
14857
14858  if ($.exists('.mk-tabs, .mk-news-tab, .mk-woo-tabs')) {
14859    $(".mk-tabs, .mk-news-tab, .mk-woo-tabs").tabs();
14860
14861    $('.mk-tabs').on('click', function () {
14862      $('.mk-theme-loop').isotope('reLayout');
14863    });
14864
14865    $('.mk-tabs.vertical-style').each(function () {
14866      $(this).find('.mk-tabs-pane').css('minHeight', $(this).find('.mk-tabs-tabs').height() - 1);
14867    });
14868
14869  }
14870}
14871
14872function mk_tabs_responsive(){
14873  if ($.exists('.mk-tabs, .mk-news-tab, .mk-woo-tabs')) {
14874    if (window.matchMedia('(max-width: 767px)').matches)
14875    {
14876        $(".mk-tabs, .mk-news-tab, .mk-woo-tabs").tabs("destroy");
14877    }
14878  }
14879}
14880
14881;/* Parallax for page sections 
14882 * Thx to Olafur Nielsen (http://form5.is)
14883/* -------------------------------------------------------------------- */
14884
14885function mk_parallax_improved() {
14886
14887
14888  // var parallax_parent = $('.parallax-true'),
14889  //     $bgElm = [],
14890  //     $offset = [],
14891  //     $height = [];
14892
14893  // parallax_parent.each(function() {
14894      
14895  //     var scrollTop = 0,
14896  //         ticking = false,
14897  //         windowHeight = $(window).height(),
14898  //         $speedFactor = $(this).attr('data-speedFactor'),
14899  //         speedDivider = 1 + (.2 * $speedFactor);
14900
14901  //     $bgElm.push($(this).find('.swiper-slide-bg, .mk-section-video'));
14902  //     $offset.push($(this).offset().top);
14903  //     $height.push($(this).outerHeight());
14904
14905      
14906  //     // Update background position
14907  //     var updatePosition = function() {
14908  //       $($bgElm).each(function(i) {
14909  //         var offset = $offset[i],
14910  //             height = $height[i],
14911  //             translateValue =  (offset - scrollTop) / speedDivider;
14912
14913  //         $(this).height(height * speedDivider);
14914
14915  //             console.log(translateValue)
14916
14917  //         // Check if above or below viewport
14918  //         if (offset + height <= scrollTop || offset >= scrollTop + windowHeight) {
14919  //           return;
14920  //         }
14921
14922  //         // We don't want parallax to happen if scrollpos is below 0
14923  //         // if (translateValue < 0)
14924  //         //   translateValue = 0;
14925
14926  //         this.each(function() {
14927  //           translateY(this, translateValue);
14928  //         })
14929  //       })
14930
14931  //       // Stop ticking
14932  //       ticking = false;
14933  //     };
14934
14935  //     // Translates an element on the Y axis using translate3d to ensure
14936  //     // that the rendering is done by the GPU
14937  //     var translateY = function(elm, value) {
14938  //       var translate = 'translate3d(0px,' + value + 'px, 0px)';
14939  //       elm.style['-webkit-transform'] = translate;
14940  //       elm.style['-moz-transform'] = translate;
14941  //       elm.style['-ms-transform'] = translate;
14942  //       elm.style['-o-transform'] = translate;
14943  //       elm.style.transform = translate;
14944  //     };
14945
14946  //     // This will limit the calculation of the background position to
14947  //     // 60fps as well as blocking it from running multiple times at once
14948  //     var requestTick = function() {
14949  //       if (!ticking) {
14950  //         window.requestAnimationFrame(updatePosition);
14951  //         ticking = true;
14952  //       }
14953  //     };
14954
14955  //     // Update scroll value and request tick
14956  //     var doScroll = function() {
14957  //       scrollTop = $(window).scrollTop();
14958  //       requestTick();
14959  //     };
14960
14961  //     // Initialize on domready
14962  //     (function() {
14963  //       var loaded = 0;
14964  //       var bootstrap = function() {
14965  //         if (loaded) return;
14966  //         loaded = 1;
14967
14968  //         rafPolyfill();
14969  //         window.onscroll = doScroll;
14970  //       };
14971
14972  //       if ( document.readyState === 'complete' ) {
14973  //         setTimeout( bootstrap );
14974  //       } else {
14975  //         document.addEventListener( 'DOMContentLoaded', bootstrap, false );
14976  //         window.addEventListener( 'load', bootstrap, false );
14977  //       }
14978  //     })();
14979
14980  //     // RequestAnimationFrame polyfill for older browsers
14981  //     var rafPolyfill = function() {
14982  //       var lastTime, vendors, x;
14983  //       lastTime = 0;
14984  //       vendors = ["webkit", "moz"];
14985  //       x = 0;
14986  //       while (x < vendors.length && !window.requestAnimationFrame) {
14987  //         window.requestAnimationFrame = window[vendors[x] + "RequestAnimationFrame"];
14988  //         window.cancelAnimationFrame = window[vendors[x] + "CancelAnimationFrame"] || window[vendors[x] + "CancelRequestAnimationFrame"];
14989  //         ++x;
14990  //       }
14991  //       if (!window.requestAnimationFrame) {
14992  //         window.requestAnimationFrame = function(callback, element) {
14993  //           var currTime, id, timeToCall;
14994  //           currTime = new Date().getTime();
14995  //           timeToCall = Math.max(0, 16 - (currTime - lastTime));
14996  //           id = window.setTimeout(function() {
14997  //             callback(currTime + timeToCall);
14998  //           }, timeToCall);
14999  //           lastTime = currTime + timeToCall;
15000  //           return id;
15001  //         };
15002  //       }
15003  //       if (!window.cancelAnimationFrame) {
15004  //         window.cancelAnimationFrame = function(id) {
15005  //           clearTimeout(id);
15006  //         };
15007  //       }
15008  //     };
15009  // })
15010};/* Parallx for page sections */
15011/* -------------------------------------------------------------------- */
15012
15013function mk_parallax() {
15014
15015  "use strict";
15016
15017
15018  if (!is_touch_device()) {
15019    $('.mk-page-section .parallax-true').each(function () {
15020      var $this = $(this),
15021        $speedFactor = $this.attr('data-speedFactor');
15022
15023      $($this).parallax("49%", $speedFactor);
15024    });
15025  }
15026
15027  // if (!is_touch_device()) {
15028
15029  // 	var $parallaxLayer = [];
15030
15031  //   $('.mk-page-section.parallax-true').each(function () {
15032
15033  //     var lastScrollY = 0,
15034  //         ticking = false,
15035  //         $this = $(this),
15036  //         windowHeight = $(window).height(),
15037  //         parentHeight = $this.outerHeight(),
15038  //         $speedFactor = $this.attr('data-speedFactor'),
15039  //         parallaxSpeed = 0.1*$speedFactor/2;
15040
15041  //     $parallaxLayer.push($this.find('.parallax-layer'));
15042
15043  //     // Update background position
15044  //     var updatePosition = function() {
15045  //       var translateValue = lastScrollY / $speedFactor;
15046
15047  //       // We don't want parallax to happen if scrollpos is below 0
15048  //       if (translateValue < 0)
15049  //           translateValue = 0;
15050
15051	 //    $($parallaxLayer).each(function() {
15052	 //    	var $this = $(this);
15053
15054	 //    	// $this.height(parentHeight + Math.abs(parentHeight*parallaxSpeed*2));
15055
15056	 //    	if($speedFactor > 0) {
15057	 //    		$this.css('top', -(parentHeight * parallaxSpeed));
15058	 //    		$this.height(parentHeight * (1 + Math.abs(parallaxSpeed)*4));
15059	 //    	} else {
15060	 //    		$this.height(parentHeight + parentHeight / (1 + Math.abs(parallaxSpeed)*4));
15061	 //    	}
15062
15063	 //    	var scrollTop = $(window).scrollTop();
15064  //           var offset = $this.offset().top;
15065  //           var height = $this.outerHeight();
15066
15067  //           if (offset + height <= scrollTop || offset >= scrollTop + windowHeight) {
15068		// 		return;
15069		// 	}
15070
15071	 //      	translateY(this[0], (offset - scrollTop) * parallaxSpeed);
15072		// });
15073
15074  //       // Stop ticking
15075  //       ticking = false;
15076  //     };
15077
15078  //     // Translates an element on the Y axis using translate3d to ensure
15079  //     // that the rendering is done by the GPU
15080  //     var translateY = function(elm, value) {
15081  //       var translate = 'translate3d(0px,' + value + 'px, 0px)';
15082  //       elm.style['-webkit-transform'] = translate;
15083  //       elm.style['-moz-transform'] = translate;
15084  //       elm.style['-ms-transform'] = translate;
15085  //       elm.style['-o-transform'] = translate;
15086  //       elm.style.transform = translate;
15087  //     };
15088
15089  //     // This will limit the calculation of the background position to
15090  //     // 60fps as well as blocking it from running multiple times at once
15091  //     var requestTick = function() {
15092  //       if (!ticking) {
15093  //         window.requestAnimationFrame(updatePosition);
15094  //         ticking = true;
15095  //       }
15096  //     };
15097
15098  //     // Update scroll value and request tick
15099  //     var doScroll = function() {
15100  //       lastScrollY = window.scrollY;
15101  //       requestTick();
15102  //     };
15103
15104  //     // Initialize on domready
15105  //     (function() {
15106  //       var loaded = 0;
15107  //       var bootstrap = function() {
15108  //         if (loaded) return;
15109  //         loaded = 1;
15110
15111  //         rafPolyfill();
15112  //         window.onscroll = doScroll;
15113
15114  //         // Repair position on refresh
15115  //         doScroll();
15116  //       };
15117
15118  //       if ( document.readyState === 'complete' ) {
15119  //         setTimeout( bootstrap );
15120  //       } else {
15121  //         document.addEventListener( 'DOMContentLoaded', bootstrap, false );
15122  //         window.addEventListener( 'load', bootstrap, false );
15123  //       }
15124  //     })();
15125
15126  //     // RequestAnimationFrame polyfill for older browsers
15127  //     var rafPolyfill = function() {
15128  //       var lastTime, vendors, x;
15129  //       lastTime = 0;
15130  //       vendors = ["webkit", "moz"];
15131  //       x = 0;
15132  //       while (x < vendors.length && !window.requestAnimationFrame) {
15133  //         window.requestAnimationFrame = window[vendors[x] + "RequestAnimationFrame"];
15134  //         window.cancelAnimationFrame = window[vendors[x] + "CancelAnimationFrame"] || window[vendors[x] + "CancelRequestAnimationFrame"];
15135  //         ++x;
15136  //       }
15137  //       if (!window.requestAnimationFrame) {
15138  //         window.requestAnimationFrame = function(callback, element) {
15139  //           var currTime, id, timeToCall;
15140  //           currTime = new Date().getTime();
15141  //           timeToCall = Math.max(0, 16 - (currTime - lastTime));
15142  //           id = window.setTimeout(function() {
15143  //             callback(currTime + timeToCall);
15144  //           }, timeToCall);
15145  //           lastTime = currTime + timeToCall;
15146  //           return id;
15147  //         };
15148  //       }
15149  //       if (!window.cancelAnimationFrame) {
15150  //         window.cancelAnimationFrame = function(id) {
15151  //           clearTimeout(id);
15152  //         };
15153  //       }
15154  //     };
15155
15156  //   });
15157  // }
15158}
15159
15160
15161;/* Ajax Search */
15162/* -------------------------------------------------------------------- */
15163
15164function mk_ajax_search() {
15165
15166  "use strict";
15167
15168  if ($.exists('.main-nav-side-search') && mk_ajax_search_option == "beside_nav") {
15169    $("#mk-ajax-search-input").autocomplete({
15170      delay: 40,
15171      minLength: 2,
15172      appendTo: $("#mk-nav-search-wrapper"),
15173      search: function (event, ui) {
15174        $(this).parent('form').addClass('ajax-searching');
15175      },
15176      source: function (req, response) {
15177        $.getJSON(ajaxurl + '?callback=?&action=mk_ajax_search', req, response);
15178      },
15179      select: function (event, ui) {
15180        window.location.href = ui.item.link;
15181      },
15182      response: function (event, ui) {
15183        $(this).parent('form').removeClass('ajax-searching').addClass('ajax-search-complete');
15184      }
15185
15186    }).data("ui-autocomplete")._renderItem = function (ul, item) {
15187
15188
15189      return $("<li>").append("<a>" + item.image + "<span class='search-title'>" + item.label + "</span><span class='search-date'>" + item.date + "</span></a>").appendTo(ul);
15190
15191    };
15192  }
15193}
15194
15195
15196;/* Hover Events */
15197/* -------------------------------------------------------------------- */
15198
15199function mk_hover_events() {
15200
15201  "use strict";
15202
15203  $('.shopping-cart-header').hoverIntent({
15204    over: function() {
15205      $('.mk-shopping-cart-box').show();
15206    },
15207    out: function() {
15208      $('.mk-shopping-cart-box').hide();
15209    },
15210    timeout: 500
15211  });
15212
15213
15214  $('.widget-sub-navigation > ul > li, .widget_nav_menu ul.menu > li, .widget_product_categories ul > .cat-item').each(function() {
15215
15216    var $this = $(this),
15217      $subLevel = $this.find('ul');
15218
15219    if ($this.hasClass('page_item_has_children') || $this.hasClass('menu-item-has-children') || $this.hasClass('cat-parent')) {
15220      $this.hoverIntent({
15221        over : function() {
15222          $subLevel.slideDown(500);
15223        }, 
15224        out : function() {
15225          $subLevel.slideUp(500);
15226        },
15227        timeout: 1000
15228        });
15229    }
15230
15231  });  
15232
15233  var eventtype = mobilecheck() ? 'touchstart' : 'click';
15234
15235  $('.mk-fullscreen-trigger').on(eventtype, function(e) {
15236    $('.mk-fullscreen-search-overlay').addClass('mk-fullscreen-search-overlay-show');
15237    setTimeout(function(){
15238      $("#mk-fullscreen-search-input").focus();
15239    }, 300);
15240    e.preventDefault();
15241  });
15242
15243  $('.mk-fullscreen-close').on(eventtype, function(e) {
15244    $('.mk-fullscreen-search-overlay').removeClass('mk-fullscreen-search-overlay-show');
15245    e.preventDefault();
15246  });
15247
15248}
15249
15250function mk_unfold_footer() {
15251  var $this = $('#mk-footer'),
15252    $themePage = $('#theme-page'),
15253    $footerHeight = $this.outerHeight()
15254  $winWidth = $(window).outerWidth();
15255  if ($winWidth > 767) {
15256    if ($this.hasClass('mk-footer-unfold')) {
15257      $themePage.css('margin-bottom', $footerHeight);
15258    }
15259  } else {
15260    $themePage.css('margin-bottom', 0);
15261  }
15262};/* Ajax portfolio */
15263/* -------------------------------------------------------------------- */
15264
15265function mk_portfolio_ajax() {
15266
15267  "use strict";
15268
15269  var headerHeight = 0;
15270  if ($.exists("#wpadminbar")) {
15271    headerHeight += $("#wpadminbar").height();
15272  }
15273  if (!$.exists('.mk-vm-menuwrapper')) {
15274    headerHeight += parseInt($('#mk-header').attr('data-sticky-height'));
15275  }
15276
15277  $('.portfolio-grid.portfolio-ajax-enabled').ajaxPortfolio({
15278  	extraOffset: headerHeight
15279  });
15280}
15281
15282
15283;/* Love This */
15284/* -------------------------------------------------------------------- */
15285
15286function mk_love_post() {
15287
15288  "use strict";
15289
15290  $('body').on('click', '.mk-love-this', function () {
15291    var $this = $(this),
15292      $id = $this.attr('id');
15293
15294    if ($this.hasClass('item-loved')) return false;
15295
15296    if ($this.hasClass('item-inactive')) return false;
15297
15298    var $sentdata = {
15299      action: 'mk_love_post',
15300      post_id: $id
15301    }
15302
15303    $.post(ajaxurl, $sentdata, function (data) {
15304      $this.find('.mk-love-count').html(data);
15305      $this.addClass('item-loved');
15306    });
15307
15308    $this.addClass('item-inactive');
15309    return false;
15310  });
15311
15312}
15313
15314
15315
15316;/* Woocommerce Add to card */
15317/* -------------------------------------------------------------------- */
15318
15319function product_loop_add_cart() {
15320
15321  "use strict";
15322
15323  var $body = $('body');
15324  $body.on('click', '.add_to_cart_button', function () {
15325    var product = $(this).parents('.product:eq(0)').addClass('adding-to-cart').removeClass('added-to-cart');
15326  })
15327
15328  $body.bind('added_to_cart', function () {
15329    $('.adding-to-cart').removeClass('adding-to-cart').addClass('added-to-cart');
15330  });
15331}
15332
15333
15334
15335;/* Woocommerce Loop Scripts */
15336/* -------------------------------------------------------------------- */
15337
15338function shop_isotop_init() {
15339
15340  "use strict";
15341
15342  if ($.exists('.products') && !$('.products').hasClass('related')) {
15343    $('.products').each(function () {
15344
15345      if (!$(this).parents('.mk-woocommerce-carousel').length) {
15346        var $woo_container = $(this),
15347          $container_item = '.products .product';
15348
15349        $woo_container.isotope({
15350          itemSelector: $container_item,
15351          masonry: {
15352            columnWidth: 1
15353          }
15354
15355        });
15356
15357
15358      }
15359    });
15360  }
15361}
15362
15363
15364
15365;/* Social Share */
15366/* -------------------------------------------------------------------- */
15367
15368function mk_social_share() {
15369
15370  "use strict";
15371
15372  $('.twitter-share').on('click', function () {
15373    var $url = $(this).attr('data-url'),
15374      $title = $(this).attr('data-title');
15375
15376    window.open('http://twitter.com/intent/tweet?text=' + $title + ' ' + $url, "twitterWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0");
15377    return false;
15378  });
15379
15380  $('.pinterest-share').on('click', function () {
15381    var $url = $(this).attr('data-url'),
15382      $title = $(this).attr('data-title'),
15383      $image = $(this).attr('data-image');
15384    window.open('http://pinterest.com/pin/create/button/?url=' + $url + '&media=' + $image + '&description=' + $title, "twitterWindow", "height=320,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0");
15385    return false;
15386  });
15387
15388  $('.facebook-share').on('click', function () {
15389    var $url = $(this).attr('data-url');
15390    window.open('https://www.facebook.com/sharer/sharer.php?u=' + $url, "facebookWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0");
15391    return false;
15392  });
15393
15394  $('.googleplus-share').on('click', function () {
15395    var $url = $(this).attr('data-url');
15396    window.open('https://plus.google.com/share?url=' + $url, "googlePlusWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0");
15397    return false;
15398  });
15399
15400  $('.linkedin-share').on('click', function () {
15401    var $url = $(this).attr('data-url'),
15402      $title = $(this).attr('data-title'),
15403      $desc = $(this).attr('data-desc');
15404    window.open('http://www.linkedin.com/shareArticle?mini=true&url=' + $url + '&title=' + $title + '&summary=' + $desc, "linkedInWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0");
15405    return false;
15406  });
15407}
15408
15409
15410
15411;/* Floating Go to top Link */
15412/* -------------------------------------------------------------------- */
15413
15414function mk_smooth_scroll_events() {
15415
15416
15417  "use strict";
15418
15419  var eventtype = mobilecheck() ? 'touchstart' : 'click';
15420
15421  $('.mk-go-top, .mk-back-top-link, .single-back-top a, .divider-go-top, .comments-back-top').on(eventtype, function () {
15422    //TweenLite.to(window, 1, {scrollTo:{y:0}, ease:Expo.easeInOut});
15423    $("html, body").animate({
15424      scrollTop: 0
15425      }, 1500);
15426    return false;
15427  });
15428
15429  $('.mk-classic-comments').on(eventtype, function () {
15430    $("html, body").animate({
15431      scrollTop: $('#comments').offset().top
15432    }, 800);
15433    //TweenLite.to(window, 1, {scrollTo:{y:$('#comments').offset().top}, ease:Expo.easeInOut});
15434
15435  });
15436
15437  $(".mk-smooth").on(eventtype, function () {
15438    var header_height = 0,
15439         wp_admin_height = 0;
15440
15441    if ($.exists("#wpadminbar")) {
15442      wp_admin_height = $("#wpadminbar").height();
15443    }
15444    if($.exists('#mk-header .mk-header-holder') && !$('#mk-header').hasClass('header-style-4')) {
15445      header_height = parseInt($('#mk-header').attr('data-sticky-height'));  
15446    }
15447    
15448    if ( $(window).width() <= mk_responsive_nav_width ) {
15449      header_height = 0;
15450    }
15451    // console.log(header_height); // test
15452
15453    // $("body, html").animate({
15454    //   scrollTop: $($(this).attr("href")).offset().top - (header_height + wp_admin_height) + "px"
15455    // }, {
15456    //   duration: 1200,
15457    //   easing: "easeInOutExpo"
15458    // });
15459
15460    var offsetTop = $($(this).attr("href")).offset().top - (header_height + wp_admin_height);
15461
15462    $('html, body').stop().animate({
15463      scrollTop: offsetTop
15464    }, {
15465      duration: 1200,
15466      easing: "easeInOutExpo"
15467    });
15468    
15469    //TweenLite.to(window, 1, {scrollTo: { y: offsetTop }, ease:Expo.easeInOut });
15470
15471    return false;
15472
15473    // Above script creates an error in some users : Uncaught TypeError: Failed to execute 'scrollTo' on 'Window': 2 arguments required, but only 0 present. 
15474
15475  });
15476
15477}
15478
15479
15480new ChopScroll(function () {
15481  if ($(window).scrollTop() > 400) {
15482    $('.mk-go-top, .mk-quick-contact-wrapper').removeClass('off').addClass('on');
15483  } else {
15484    $('.mk-go-top, .mk-quick-contact-wrapper').removeClass('on').addClass('off');
15485  }
15486}, 800);
15487;/* Page Section full height feature */
15488/* -------------------------------------------------------------------- */
15489
15490function section_to_full_height() {
15491
15492
15493  "use strict";
15494
15495  $('.full-height-true.mk-page-section').each(function () {
15496    var $this = $(this),
15497      $content_height = $this.find('.page-section-content').outerHeight(true),
15498      $window_height = $(window).outerHeight(),
15499      header = $('#mk-header').attr('data-height'),
15500      headerHeight = 0;
15501 
15502   /* if ($('.mk-header-toolbar').length > 0) {
15503      var mk_header_toolbar = $(".mk-header-toolbar").outerHeight();
15504    } else {
15505      var mk_header_toolbar = 0;
15506    }*/
15507
15508    if ($.exists("#wpadminbar")) {
15509      var wp_admin_height = $("#wpadminbar").outerHeight();
15510    } else {
15511      wp_admin_height = 0;
15512    }
15513  
15514    if(window.matchMedia("(max-width: 1140px)").matches) {
15515      headerHeight = header;
15516    }
15517
15518
15519    $window_height = $window_height - wp_admin_height - headerHeight;
15520
15521
15522    if ($content_height > $window_height) {
15523      $this.css('height', 'auto');
15524      $this.find('.page-section-content').css({
15525        'padding-top': 30,
15526        'padding-bottom': 30
15527      });
15528    } else { 
15529      $this.css('height', $window_height);
15530      var $this_height_half = $this.find('.page-section-content').outerHeight() / 2,
15531        $window_half = $window_height / 2;
15532
15533      $this.find('.page-section-content').css('marginTop', ($window_half - $this_height_half));
15534    }
15535
15536    $this.find('.mk-page-section-loader').fadeOut();
15537
15538  });
15539
15540}
15541
15542
15543
15544/* Page Section Intro Effects */
15545/* -------------------------------------------------------------------- */
15546
15547function mk_section_intro_effects() {
15548  if ( !is_touch_device() ) {
15549    if($.exists('.mk-page-section.intro-true')) {
15550
15551      $('.mk-page-section.intro-true').each(function() {
15552          var $this = $(this),
15553              $pageCnt = $this.nextAll('div'),
15554              windowHeight = $(window).height(),
15555              effectName = $this.attr('data-intro-effect'),
15556              $header = $('#mk-header');
15557
15558              var effect = {
15559                    fade :    new TimelineLite({paused: true})
15560                              .set($pageCnt, { opacity: 0, y: windowHeight * 0.3 })
15561                              .to($this, 1, { opacity: 0, ease:Power2.easeInOut })
15562                              .to($pageCnt, 1, { opacity: 1, y: 0, ease:Power2.easeInOut}, "-=.7")
15563                              .set($this, { zIndex: '-1'}),
15564
15565                    zoom_out : new TimelineLite({paused: true})
15566                              .set($pageCnt, { opacity: 0, y: windowHeight * 0.3})
15567                              .to($this, 1.5, { opacity: .8, scale: 0.8, y: -windowHeight - 100, ease:Strong.easeInOut })
15568                              .to($pageCnt, 1.5, { opacity: 1, y:  0, ease:Strong.easeInOut}, "-=1.3"),
15569
15570                    shuffle : new TimelineLite({paused: true})
15571                              .to($this, 1.5, { y: -windowHeight/2, ease:Strong.easeInOut })
15572                              .to($this.nextAll('div').first(), 1.5, { paddingTop: windowHeight/2, ease:Strong.easeInOut }, "-=1.3")
15573              }
15574      
15575
15576          $this.sectiontrans({
15577            effect : effectName,
15578          });
15579
15580          if($this.hasClass('shuffled')) {
15581            TweenLite.set($this, { y: -windowHeight/2 });
15582            TweenLite.set($this.nextAll('div').first(), { paddingTop: windowHeight/2 });
15583          }
15584
15585          $('body').on('page_intro', function() {
15586            $(this).data('intro', true);
15587            effect[effectName].play();
15588            setTimeout(function() {
15589              $header.addClass('header-sticky-prepare');
15590              $header.addClass('header-sticky-ready');
15591              $('.mk-header-padding-wrapper').addClass('enable-padding');
15592              $('body').data('intro', false);
15593              if(effectName === 'shuffle') $this.addClass('shuffled');
15594            }, 1000);
15595          });
15596
15597          $('body').on('page_outro', function() {
15598            $(this).data('intro', true);
15599            effect[effectName].reverse();
15600            setTimeout(function() {
15601              $header.removeClass('header-sticky-prepare');
15602              $header.removeClass('header-sticky-ready');
15603              $('.mk-header-padding-wrapper').removeClass('enable-padding');
15604              $('body').data('intro', false);
15605              if($this.hasClass('shuffled')) $this.removeClass('shuffled');
15606            }, 1000);
15607          });
15608
15609      });
15610    }
15611  } else {
15612    $('.mk-page-section.intro-true').each(function() {
15613      $(this).attr('data-intro-effect', '');
15614    });
15615  }
15616};/* Accordions & Toggles */
15617/* -------------------------------------------------------------------- */
15618
15619
15620/* Accordions */
15621
15622function mk_accordion_toggles_tooltip() {
15623
15624  "use strict";
15625
15626  var accordion = $(".mk-accordion"),
15627    accordionPaneClass = "mk-accordion-pane",
15628    actionClass = "accordion-action",
15629    accordionTabClass = "mk-accordion-tab",
15630    togglePaneClass = "mk-toggle-pane",
15631    activeToggleClass = "active-toggle";
15632
15633  if ($.exists(accordion)) {
15634
15635    $.tools.toolsTabs.addEffect("slide", function(i, done) {
15636      this.getPanes().slideUp(250);
15637      this.getPanes().eq(i).slideDown(250, function() {
15638        done.call();
15639      });
15640    });
15641
15642    accordion.each(function() {
15643
15644      if ($(this).hasClass(actionClass)) {
15645
15646        var $initialIndex = parseInt($(this).attr('data-initialindex'));
15647        if ($initialIndex == undefined) {
15648          $initialIndex = 0;
15649        }
15650        if (window.matchMedia('(max-width: 767px)').matches){
15651          
15652        }else{
15653          $(this).toolsTabs("div.mk-accordion-pane", {
15654            toolsTabs: accordionTabClass,
15655            effect: 'slide',
15656            initialIndex: $initialIndex,
15657            slideInSpeed: 400,
15658            slideOutSpeed: 400
15659          });
15660        }
15661      } else {
15662        $(".toggle-action .mk-accordion-tab").toggle(
15663          function() {
15664            $(this).parent('.mk-accordion-single').addClass('current');
15665            $(this).siblings('.' + accordionPaneClass).slideDown(150);
15666          }, function() {
15667            $(this).parent('.mk-accordion-single').removeClass('current');
15668            $(this).siblings('.' + accordionPaneClass).slideUp(1
1566850);
15669          });
15670      }
15671    });
15672
15673  }
15674
15675
15676  /* Toggles */
15677
15678  if ($.exists('.mk-toggle-title')) {
15679    if (window.matchMedia('(max-width: 767px)').matches){
15680
15681    }else{ 
15682      $(".mk-toggle-title").toggle(
15683        function() {
15684          $(this).addClass(activeToggleClass);
15685          $(this).siblings('.' + togglePaneClass).slideDown(200);
15686        }, function() {
15687          $(this).removeClass(activeToggleClass);
15688          $(this).siblings('.' + togglePaneClass).slideUp(200);
15689        }
15690      );
15691    }
15692  } 
15693
15694
15695  /* Message Boxes */
15696  /* -------------------------------------------------------------------- */
15697
15698  $('.box-close-btn').on('click', function() {
15699    $(this).parent().fadeOut(300);
15700    return false;
15701
15702  });
15703
15704
15705  $('.mk-tooltip').each(function() {
15706    $(this).find('.tooltip-init').hover(function() {
15707      $(this).siblings('.tooltip-text').animate({
15708        'opacity': 1
15709      }, 400);
15710
15711    }, function() {
15712      $(this).siblings('.tooltip-text').animate({
15713        'opacity': 0
15714      }, 400);
15715    });
15716  });
15717
15718}
15719;/* Newspaper Comments & Share section */
15720/* -------------------------------------------------------------------- */
15721
15722function mk_newspaper_comments_share() {
15723
15724  "use strict";
15725
15726  $('.newspaper-item-footer').each(function () {
15727
15728    $(this).find('.newspaper-item-comment').click(function () {
15729
15730      $(this).parents('.newspaper-item-footer').find('.newspaper-social-share').slideUp(200).end().find('.newspaper-comments-list').slideDown(200);
15731      setTimeout(function () {
15732        $('.mk-theme-loop').isotope('reLayout');
15733      }, 300);
15734    });
15735
15736    $(this).find('.newspaper-item-share').click(function () {
15737
15738      $(this).parents('.newspaper-item-footer').find('.newspaper-comments-list').slideUp(200).end().find('.newspaper-social-share').slideDown(200);
15739      setTimeout(function () {
15740        $('.mk-theme-loop').isotope('reLayout');
15741      }, 300);
15742
15743    });
15744
15745  });
15746
15747}
15748
15749
15750;/* Main Navigation */
15751/* -------------------------------------------------------------------- */
15752
15753function mk_main_navigation_init() {
15754
15755  "use strict";
15756
15757  var $body = $('body');
15758
15759  if (!$body.hasClass('navigation-initialised')) {
15760
15761    $(".main-navigation-ul").MegaMenu({
15762      type: "vertical",
15763      delay: 200
15764    });
15765
15766    $('#mk-vm-menu').dlmenu();
15767
15768    $body.addClass('navigation-initialised');
15769
15770  }
15771
15772
15773
15774}
15775
15776
15777
15778function mk_responsive_nav() {
15779
15780  "use strict";
15781
15782  var eventtype = mobilecheck() ? 'touchstart MSPointerDown pointerdown' : 'click';
15783
15784  $('.mk-nav-responsive-link').on(eventtype, function(e) {
15785    e.preventDefault();
15786    var $body = $('body'),
15787      $res_nav = $('#mk-responsive-nav');
15788    if ($body.hasClass('mk-opened-nav')) {
15789      $body.removeClass('mk-opened-nav').addClass('mk-closed-nav');
15790      $res_nav.slideUp(300);
15791    } else {
15792      $body.removeClass('mk-closed-nav').addClass('mk-opened-nav');
15793      $res_nav.slideDown(300);
15794    }
15795  });
15796
15797  $('.mk-toolbar-resposnive-icon').on(eventtype,function(e) {
15798    e.preventDefault();
15799    var $body = $('body'),
15800      $toolbar = $('.mk-header-toolbar');
15801
15802
15803    if ($body.hasClass('toolbar-oppend')) {
15804      $body.removeClass('toolbar-oppend').addClass('toolbar-closed');
15805      $toolbar.slideUp();
15806    } else {
15807      $body.removeClass('toolbar-closed').addClass('toolbar-oppend');
15808      $toolbar.slideDown();
15809    }
15810  });
15811
15812}
15813
15814
15815/* Responsive Fixes */
15816/* -------------------------------------------------------------------- */
15817
15818
15819function mk_responsive_fix() {
15820  "use strict";
15821
15822  var eventtype = 'click';
15823
15824
15825  if ($(window).width() > mk_responsive_nav_width) {
15826
15827
15828    $('#mk-responsive-nav').hide();
15829    mk_main_navigation_init();
15830
15831
15832  } else {
15833
15834    if (!$.exists('#mk-responsive-nav')) {
15835      $('.main-navigation-ul, .mk-vm-menu').clone().attr({
15836        id: "mk-responsive-nav",
15837        "class": ""
15838      }).insertAfter('.mk-header-inner');
15839
15840      $('#mk-responsive-nav > li').each(function() {
15841        var $this = $(this);
15842
15843        $this.removeClass('has-mega-menu').addClass('no-mega-menu');
15844
15845        $this.children('ul').siblings('a').append('<span class="mk-moon-arrow-down mk-nav-arrow mk-nav-sub-closed"></span>').end().attr("style", '');
15846
15847        var link = $this.find('a').attr('href');
15848        if(link.length < 5) {
15849          $this.find('a').addClass('mk-nav-open');
15850        }
15851
15852      });
15853
15854
15855      $('.mk-header-inner').attr('style', '');
15856
15857      $('#mk-responsive-nav').append($('.responsive-searchform'));
15858
15859
15860      $('#mk-responsive-nav > li > a').stop(true).on(eventtype, function(e) {
15861      // $('.mk-nav-arrow, .mk-nav-open a').stop(true).on(eventtype, function(e) {
15862        var $this = $(this),
15863            $arrow = $this.find('.mk-nav-arrow');
15864
15865          // console.log($(e.target).attr('class'));
15866        if($(e.target).hasClass('mk-nav-arrow') || $(e.target).hasClass('mk-nav-open')) {
15867          if ($arrow.hasClass('mk-nav-sub-closed')) {
15868            $arrow.parent().siblings('ul').slideDown(450).end().end().removeClass('mk-nav-sub-closed').addClass('mk-nav-sub-opened');
15869          } else {
15870            $arrow.parent().siblings('ul').slideUp(450).end().end().removeClass('mk-nav-sub-opened').addClass('mk-nav-sub-closed');
15871          }
15872          e.preventDefault();
15873        }
15874      });
15875
15876
15877      var $header_height = 0;
15878      var $window_height = $(window).outerHeight();
15879
15880      if ($.exists('#wpadminbar')) {
15881        $header_height += $('#wpadminbar').outerHeight();
15882      }
15883
15884      if($.exists('#mk-responsive-nav')) {
15885        $header_height += $('.mk-header-inner').height();
15886
15887        var nav_height = $window_height - $header_height;
15888
15889        $('#mk-responsive-nav').wrap('<div id="mk-responsive-wrap" style="max-height:'+nav_height+'px"></div>');
15890        
15891        setTimeout(function() {
15892          document.getElementById("mk-responsive-wrap").addEventListener('touchstart', function(event){});
15893        }, 300);
15894      }
15895
15896    }
15897  }
15898
15899}
15900
15901
15902
15903function mk_sidebar_navigation() {
15904
15905  "use strict";
15906
15907  var $header = $('#mk-header'),
15908    $sticky_style = $header.attr('data-header-style');
15909
15910  if ($sticky_style == 3) {
15911
15912    $('.sidedash-navigation-ul > li').each(function() {
15913      var $this = $(this);
15914
15915      $this.children('ul').siblings('a').after('<span class="mk-moon-arrow-down mk-nav-arrow mk-nav-sub-closed"></span>');
15916    });
15917
15918
15919     $('.mk-nav-arrow').stop(true).on('click', function(e) {
15920        var $this = $(this);
15921        if ($this.hasClass('mk-nav-sub-closed')) {
15922          $this.siblings('ul').slideDown(450).end().removeClass('mk-nav-sub-closed').addClass('mk-nav-sub-opened');
15923        } else {
15924          $this.siblings('ul').slideUp(450).end().removeClass('mk-nav-sub-opened').addClass('mk-nav-sub-closed');
15925        }
15926        e.preventDefault();
15927      });
15928
15929  }
15930
15931
15932
15933};function loops_iosotop_init() {
15934
15935  "use strict";
15936
15937  $('.loop-main-wrapper').each(function() {
15938      var $this = $(this),
15939      $mk_container = $this.find('.mk-theme-loop'),
15940      $mk_container_item = '.' + $mk_container.attr('data-style') + '-' + $mk_container.attr('data-uniqid'),
15941      $load_button = $this.find('.mk-loadmore-button'),
15942      $pagination_items = $this.find('.mk-pagination');
15943
15944    $mk_container.isotope({
15945      itemSelector: $mk_container_item,
15946      animationEngine: "best-available",
15947      masonry: {
15948        columnWidth: 1
15949      } 
15950    });
15951
15952    $mk_container.isotope('reLayout');
15953
15954    $(this).parent().find('#mk-filter-portfolio ul li a').click(function() {
15955      var $this = $(this);
15956      // console.log('clicked');
15957
15958
15959
15960      /* Removes ajax container when filter items get triggered */
15961      $this.parents('.portfolio-grid').find('.ajax-container').animate({
15962        'height': 0,
15963        opacity: 0
15964      }, 500);
15965
15966      if ($this.hasClass('.current')) {
15967        return false;
15968      }
15969      var $optionSet = $this.parents('#mk-filter-portfolio ul');
15970      $optionSet.find('.current').removeClass('current');
15971      $this.addClass('current');
15972
15973      var selector = $(this).attr('data-filter');
15974
15975      $mk_container.isotope({
15976        filter: ''
15977      });
15978      $mk_container.isotope({
15979        filter: selector
15980      });
15981
15982      setTimeout(function() {
15983        $mk_container.isotope('reLayout');
15984      }, 400);
15985
15986      return false;
15987    });
15988
15989
15990    $load_button.hide();
15991
15992    if ($this.find('.mk-theme-loop').hasClass('scroll-load-style') || $this.find('.mk-theme-loop').hasClass('load-button-style')) {
15993      if ($pagination_items.length > 0) {
15994        $load_button.css('display', 'block');
15995      }
15996      $pagination_items.hide();
15997
15998
15999      $load_button.on('click', function() {
16000        if (!$(this).hasClass('pagination-loading')) {
16001          $(this).addClass('pagination-loading');
16002        }
16003
16004      });
16005
16006      $mk_container.infinitescroll({
16007          navSelector: $pagination_items,
16008          nextSelector: $this.find('.mk-pagination a:first'),
16009          itemSelector: $mk_container_item,
16010          bufferPx: 70,
16011          loading: {
16012            finishedMsg: "",
16013            img: mk_images_dir + "/load-more-loading.gif",
16014            msg: null,
16015            msgText: "",
16016            selector: $load_button,
16017            speed: 300,
16018            start: undefined
16019          },
16020          errorCallback: function() {
16021
16022            $load_button.html(mk_no_more_posts).addClass('disable-pagination');
16023
16024          },
16025
16026        },
16027
16028        function(newElements) {
16029
16030          var $newElems = $(newElements);
16031          $newElems.hide();
16032          $newElems.imagesLoaded(function() {
16033            $load_button.removeClass('pagination-loading');
16034
16035
16036            var selected_item = $('#mk-filter-portfolio ul').find('.current').attr('data-filter');
16037            
16038            $mk_container.isotope('appended', $newElems);
16039            $mk_container.isotope({
16040              filter: ''
16041            });
16042            $mk_container.isotope({
16043              filter: selected_item
16044            });
16045            setTimeout(function() {
16046              $newElems.show();
16047
16048              loop_audio_init();
16049              mk_portfolio_ajax();
16050              mk_newspaper_comments_share();
16051              mk_ajax_lightbox_init();
16052              mk_social_share();
16053              mk_theme_toggle_box();
16054              mk_swipe_slider();
16055              ajaxStylesInjector();
16056
16057              $mk_container.isotope('reLayout');
16058            }, 450);
16059          });
16060        }
16061
16062      );
16063
16064      /* Loading elements based on scroll window */
16065      if ($this.find('.mk-theme-loop').hasClass('load-button-style')) {
16066        $(window).unbind('.infscr');
16067        $load_button.click(function() {
16068
16069          $mk_container.infinitescroll('retrieve');
16070
16071          return false;
16072
16073        });
16074      }
16075
16076    } else {
16077      $load_button.hide();
16078    }
16079  });
16080}
16081
16082
16083$('.filter-faq li a').click(function() {
16084
16085  $(this).parent().siblings().children().removeClass('current');
16086  $(this).addClass('current');
16087
16088  var filterVal = $(this).attr('data-filter');
16089  var $filterContent = $(this).parent().parent().parent().next().next().find(".mk-faq-toggle");
16090
16091
16092  if (filterVal === '') {
16093    $filterContent.slideDown(200).removeClass('hidden');
16094  } else {
16095    $filterContent.each(function() {
16096      if (!$(this).hasClass(filterVal)) {
16097        $(this).slideUp(200).addClass('hidden');
16098      } else {
16099        $(this).slideDown(200).removeClass('hidden');
16100      }
16101    });
16102  }
16103  return false;
16104});;/* reload elements on reload */
16105/* -------------------------------------------------------------------- */
16106
16107function mk_load_isotop_enabled_scripts() {
16108	if ($.exists('.mk-blog-container') || $.exists('.mk-portfolio-container') || $.exists('.mk-news-container') || $.exists('.mk-gallery-shortcode')) {
16109	    $(window).unbind('keydown');
16110	    loops_iosotop_init();
16111	    isotop_load_fix();
16112	}
16113}
16114;/* Fix isotop layout */
16115/* -------------------------------------------------------------------- */
16116
16117function isotop_load_fix() {
16118
16119  "use strict";
16120
16121
16122
16123  if ($.exists('.mk-blog-container') || $.exists('.mk-portfolio-container') || $.exists('.mk-news-container') || $.exists('.mk-gallery-shortcode')) {
16124    $('.mk-blog-container, .mk-portfolio-container, .mk-news-container, .mk-gallery-shortcode').each(function () {
16125      $(this).animate({
16126        'opacity': 1
16127      }, 1000).siblings('.mk-preloader').fadeOut(300);
16128
16129    });
16130    
16131  }
16132
16133}
16134
16135
16136
16137;/* Recent Works Widget */
16138/* -------------------------------------------------------------------- */
16139
16140function mk_portfolio_widget() {
16141
16142  "use strict";
16143
16144  $('.widget_recent_portfolio li').each(function () {
16145
16146    $(this).find('.portfolio-widget-thumb').hover(function () {
16147
16148      $(this).siblings('.portfolio-widget-info').animate({
16149        'opacity': 1
16150      }, 200);
16151    }, function () {
16152
16153      $(this).siblings('.portfolio-widget-info').animate({
16154        'opacity': 0
16155      }, 200);
16156    });
16157
16158  });
16159}
16160
16161
16162;/* Contact Form */
16163/* -------------------------------------------------------------------- */
16164
16165function mk_contact_form() {
16166
16167  "use strict";
16168
16169  if ($.tools.validator != undefined) {
16170    $.tools.validator.addEffect("contact_form", function(errors) {
16171      $.each(errors, function(index, error) {
16172        var input = error.input;
16173
16174        input.addClass('mk-invalid');
16175      });
16176    }, function(inputs) {
16177      inputs.removeClass('mk-invalid');
16178    });
16179
16180    $(".captcha-change-image").on("click", function(e) {
16181        e.preventDefault();
16182        changeCaptcha();
16183    });
16184
16185    $(".captcha-form").each(function() {
16186      $(this).on("focus", function() {
16187        $(this).attr("placeholder", mk_captcha_placeholder).removeClass('contact-captcha-invalid contact-captcha-valid');
16188      });
16189    })
16190
16191    var changeCaptcha = function() {
16192        $(".captcha-image").attr("src", mk_theme_dir + "/captcha/captcha.php?"+Math.random()); 
16193    }
16194
16195    var sendForm;
16196    var checkCaptcha = function(form, enteredCaptcha) {
16197        $.get( mk_theme_dir + "/captcha/captcha-check.php", { captcha: enteredCaptcha }).done(function( data ) {
16198          if(data != "ok") {
16199            changeCaptcha();
16200            form.find(".captcha-form").val("").addClass('contact-captcha-invalid').attr("placeholder", mk_captcha_invalid_txt);
16201          } else {
16202            sendForm();
16203            changeCaptcha();
16204            form.find(".captcha-form").val("").addClass('contact-captcha-valid').attr("placeholder", mk_captcha_correct_txt);
16205          }
16206        });
16207    }
16208
16209    $('.mk-contact-form').validator({
16210      effect: 'contact_form'
16211    }).submit(function(e) {
16212      var form = $(this);
16213      if (!e.isDefaultPrevented()) {
16214
16215        var data = {
16216          action: 'mk_contact_form',
16217          to: form.find('input[name="contact_to"]').val().replace("*", "@"),
16218          name: form.find('input[name="contact_name"]').val(),
16219          last_name: form.find('input[name="contact_last_name"]').val(),
16220          phone: form.find('input[name="contact_phone"]').val(),
16221          email: form.find('input[name="contact_email"]').val(),
16222          website: form.find('input[name="contact_website"]').val(),
16223          content: form.find('textarea[name="contact_content"]').val()
16224        };
16225
16226        sendForm = function() {
16227          progressButton.loader(form);
16228          $.post(ajaxurl, data, function(response) {
16229            form.find('.mk-contact-loading').fadeOut('slow');
16230            form.find('input').val("");
16231            progressButton.success(form);
16232          });
16233        }; 
16234
16235        var enteredCaptcha = form.find('input[name="captcha"]').val();
16236
16237        if(form.find('.captcha-form').length){
16238          checkCaptcha(form, enteredCaptcha);
16239        } else {
16240          sendForm();
16241        }
16242
16243        e.preventDefault();
16244      }
16245    });
16246
16247  }
16248}
16249
16250/* Ajax Login Form */
16251/* -------------------------------------------------------------------- */
16252
16253function mk_login_form() {
16254
16255  $('form.mk-login-form').each(function() {
16256    var $this = $(this);
16257    $this.on('submit', function(e) {
16258      $('p.mk-login-status', $this).show().text(ajax_login_object.loadingmessage);
16259      $.ajax({
16260        type: 'POST',
16261        dataType: 'json',
16262        url: ajax_login_object.ajaxurl,
16263        data: {
16264          'action': 'ajaxlogin',
16265          'username': $('#username', $this).val(),
16266          'password': $('#password', $this).val(),
16267          'security': $('#security', $this).val()
16268        },
16269        success: function(data) {
16270          $('p.mk-login-status', $this).text(data.message);
16271          if (data.loggedin === true) {
16272            document.location.href = ajax_login_object.redirecturl;
16273          }
16274        }
16275      });
16276      e.preventDefault();
16277    });
16278  });
16279}
16280
16281
16282/* Progress Button */
16283/* -------------------------------------------------------------------- */
16284
16285var progressButton = {
16286    loader: function(form) {
16287        var $form = form,
16288            progressBar = $form.find(".mk-progress-button .mk-progress-inner"),
16289            buttonText = $form.find(".mk-progress-button .mk-progress-button-content"),
16290            progressButton = new TimelineLite();
16291
16292        progressButton
16293            .to(progressBar, 0, {
16294                width: "100%",
16295                scaleX: 0,
16296                scaleY: 1
16297            })
16298            .to(buttonText, .3, {
16299                y: -5
16300            })
16301            .to(progressBar, 1.5, {
16302                scaleX: 1,
16303                ease: Power2.easeInOut
16304            }, "-=.1")
16305            .to(buttonText, .3, {
16306                y: 0
16307            })
16308            .to(progressBar, .3, {
16309                scaleY: 0
16310            });
16311    },
16312
16313    success: function(form) {
16314        var $form = form,
16315            buttonText = $form.find(".mk-button .mk-progress-button-content, .mk-contact-button .mk-progress-button-content"),
16316            successIcon = $form.find(".mk-progress-button .state-success"),
16317            progressButtonSuccess = new TimelineLite({
16318                onComplete: hideSuccessMessage
16319            });
16320
16321        progressButtonSuccess
16322            .to(buttonText, .3, {
16323                paddingRight: 20,
16324                ease: Power2.easeInOut
16325            }, "+=1")
16326            .to(successIcon, .3, {
16327                opacity: 1
16328            })
16329            .to(successIcon, 2, {
16330                opacity: 1
16331            });
16332
16333        function hideSuccessMessage() {
16334            progressButtonSuccess.reverse()
16335        }
16336    },
16337
16338    error: function(form) {
16339        var $form = form,
16340            buttonText = $form.find(".mk-button .mk-progress-button-content, .mk-contact-button .mk-progress-button-content"),
16341            errorIcon = $form.find(".mk-progress-button .state-error"),
16342            progressButtonError = new TimelineLite({
16343                onComplete: hideErrorMessage
16344            });
16345
16346        progressButtonError
16347            .to(buttonText, .3, {
16348                paddingRight: 20
16349            }, "+=1")
16350            .to(errorIcon, .3, {
16351                opacity: 1
16352            })
16353            .to(errorIcon, 2, {
16354                opacity: 1
16355            });
16356
16357        function hideErrorMessage() {
16358            progressButtonError.reverse()
16359        }
16360    }
16361};/* Blog Loop Carousel Shortcode */
16362/* -------------------------------------------------------------------- */
16363
16364
16365function mk_blog_carousel() {
16366
16367  "use strict";
16368
16369  if (!$.exists('.mk-blog-showcase')) {
16370    return;
16371  }
16372  $('.mk-blog-showcase ul li').each(function () {
16373
16374    $(this).on('hover', function () {
16375
16376      $(this).siblings('li').removeClass('mk-blog-first-el').end().addClass('mk-blog-first-el');
16377
16378    });
16379
16380  });
16381
16382
16383}
16384
16385
16386
16387;/* Header Fixed */
16388function mk_header_scripts() {
16389
16390
16391  if($(window).width() < mk_responsive_nav_width || !($.exists('#mk-header .mk-header-holder'))) return false;
16392
16393
16394
16395  var $header = $('#mk-header'),
16396    $sticky_style = $header.attr('data-sticky-style'),
16397    $sticky_offset = $header.attr('data-sticky-offset'),
16398    $header_style = $header.attr('data-header-style'),
16399    $ChopScroll_speed = 100;   
16400
16401//if ($header.hasClass('header-style-4')) return false;
16402  
16403
16404if($header_style != 2) {
16405  if ($sticky_offset == 'header') {
16406    $sticky_offset = parseInt($header.attr('data-height'));
16407  } else {
16408    $sticky_offset = String($sticky_offset);
16409    $sticky_offset = $sticky_offset;
16410    
16411  }
16412} else {
16413
16414  var wp_admin_height = $header_toolbar_h = 0;
16415
16416  if ($.exists('.mk-header-toolbar')) {
16417      $header_toolbar_h = $('.mk-header-toolbar').outerHeight();
16418  }
16419
16420  $ChopScroll_speed = 10;
16421  $sticky_offset = parseInt($header.attr('data-height')) + $header_toolbar_h;
16422  $sticky_offset = $sticky_offset;
16423
16424}
16425
16426  var scrollY = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop,
16427      viewportPercent = $(window).height()/100,
16428      $sticky_offset = Math.abs(parseInt($sticky_offset));
16429      
16430      if($header.data('sticky-offset') == 'header') {    
16431          var offsetCalc = $sticky_offset;
16432          // console.log($sticky_offset);
16433      } else {
16434          var offsetCalc = (viewportPercent * $sticky_offset);
16435      }
16436   
16437  var pageIntro;
16438  var stick_it = function() {
16439      scrollY = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;
16440      pageIntro = $('body').data('intro');
16441      //console.log(scrollY);
16442
16443      // console.log('Page Intro:' + pageIntro);
16444      //console.log(scrollY);
16445      if (!pageIntro) {
16446        if (scrollY > offsetCalc && scrollY > 0) {
16447            if ($sticky_style == 'fixed' || $header_style == 2) {
16448              $header.addClass('header-sticky-ready');
16449            } else {
16450              if(!$header.hasClass('header-sticky-ready')) {
16451                $header.addClass('header-sticky-prepare');
16452                $('.mk-header-padding-wrapper').addClass('enable-padding');
16453                setTimeout(function() {
16454                  $header.addClass('header-sticky-ready');
16455                }, 300);  
16456              }
16457            }
16458        } else {
16459              
16460              $header.removeClass('header-sticky-ready');
16461              $header.removeClass('header-sticky-prepare');
16462              $('.mk-header-padding-wrapper').removeClass('enable-padding');
16463        }
16464      }
16465      // console.log(scrollY);
16466      // console.log((viewportPercent * $sticky_offset));
16467    }
16468
16469    new ChopScroll(stick_it, $ChopScroll_speed);
16470};/* Header Search Form */
16471/* -------------------------------------------------------------------- */
16472
16473function mk_header_searchform() {
16474
16475
16476  "use strict";
16477
16478  $('.mk-header-toolbar #mk-header-searchform .text-input').on('focus', function () {
16479
16480    if ($('.mk-header-toolbar #mk-header-searchform .text-input').hasClass('on-close-state')) {
16481      $('.mk-header-toolbar #mk-header-searchform .text-input').removeClass('on-close-state').animate({
16482        'width': '200px'
16483      }, 200);
16484      return false;
16485    }
16486  });
16487
16488  $(".mk-header-toolbar .mk-header-searchform").click(function (event) {
16489    if (event.stopPropagation) {
16490      event.stopPropagation();
16491    } else if (window.event) {
16492      window.event.cancelBubble = true;
16493    }
16494  });
16495
16496
16497  $("html").click(function () {
16498    $(this).find(".mk-header-toolbar #mk-header-searchform .text-input").addClass('on-close-state').animate({
16499      'width': 90
16500    }, 300);
16501  });
16502
16503}
16504
16505
16506
16507;/* Milestone Number Shortcode */
16508/* -------------------------------------------------------------------- */
16509
16510function mk_milestone() {
16511
16512  "use strict";
16513
16514  if ($.exists('.mk-milestone')) {
16515
16516    var play;
16517    if ( !is_touch_device() ) {
16518      play = ':in-viewport';
16519    }  else {
16520      play = '';
16521    }
16522
16523    $('.mk-milestone'+play).each(function () {
16524      var el_this = $(this),
16525        stop_number = el_this.find('.milestone-number').attr('data-stop'),
16526        animation_speed = parseInt(el_this.find('.milestone-number').attr('data-speed'));
16527
16528      if (!$(this).hasClass('scroll-animated')) {
16529        $(this).addClass('scroll-animated');
16530
16531        $({
16532          countNum: el_this.find('.milestone-number').text()
16533        }).animate({
16534          countNum: stop_number
16535        }, {
16536          duration: animation_speed,
16537          easing: 'linear',
16538          step: function () {
16539            el_this.find('.milestone-number').text(Math.floor(this.countNum));
16540          },
16541          complete: function () {
16542            el_this.find('.milestone-number').text(this.countNum);
16543          }
16544        });
16545      }
16546    });
16547
16548  }
16549}
16550
16551
16552
16553;/* Skill Meter and Charts */
16554/* -------------------------------------------------------------------- */
16555
16556function mk_skill_meter() {
16557
16558  "use strict";
16559
16560  if ($.exists('.mk-skill-meter')) {
16561    if ( !is_touch_device() ) {
16562      $(".mk-skill-meter .progress-outer:in-viewport").each(function () {
16563        var $this = $(this);
16564        if (!$this.hasClass('scroll-animated')) {
16565          $this.addClass('scroll-animated');
16566          $this.animate({
16567            width: $(this).attr("data-width") + '%'
16568          }, 2000);
16569        }
16570      });
16571    } else {
16572      $(".mk-skill-meter .progress-outer").each(function () {
16573        var $this = $(this);
16574        if (!$this.hasClass('scroll-animated')) {
16575          $this.addClass('scroll-animated');
16576          $this.css({
16577            width: $(this).attr("data-width") + '%'
16578          });
16579        }
16580      });
16581    }
16582  }
16583}
16584
16585
16586function mk_charts() {
16587
16588  "use strict";
16589
16590  if ($.exists('.mk-chart')) {
16591    if ( !is_touch_device() ) {
16592    // $(window).on("load", function () {
16593      $('.mk-chart:in-viewport').each(function () {
16594        var $this, $parent_width, $chart_size;
16595        $this = $(this);
16596        $parent_width = $(this).parent().width();
16597        $chart_size = $this.attr('data-barSize');
16598        if ($parent_width < $chart_size) {
16599          $chart_size = $parent_width;
16600          $this.css('line-height', $chart_size);
16601          $this.find('i').css({
16602            'line-height': $chart_size + 'px'
16603          });
16604        }
16605        // if (!$this.hasClass('chart-animated')) {
16606          $this.easyPieChart({
16607            animate: 1300,
16608            lineCap: 'butt',
16609            lineWidth: $this.attr('data-lineWidth'),
16610            size: $chart_size,
16611            barColor: $this.attr('data-barColor'),
16612            trackColor: $this.attr('data-trackColor'),
16613            scaleColor: 'transparent',
16614            onStep: function (value) {
16615              this.$el.find('.chart-percent span').text(Math.ceil(value));
16616            }
16617          });
16618        // }
16619      });
16620    // });
16621    }
16622  }
16623}
16624
16625
16626;/* Scroll function for main navigation on one page concept */
16627/* -------------------------------------------------------------------- */
16628
16629
16630function mk_main_nav_scroll() {
16631
16632
16633  "use strict";
16634
16635
16636  //console.log(window.location.href.split('#')[0]);
16637  var lastId, 
16638      topMenu = $("#mk-main-navigation, .mk-vm-menu"),
16639      menuItems = topMenu.find(".menu-item a");
16640
16641
16642  menuItems.each(function() {
16643    //console.log();
16644    var href_attr = $(this).attr('href');
16645
16646
16647    if (typeof href_attr !== 'undefined' && href_attr !== false) {
16648      var href = $(this).attr("href").split('#')[0];
16649      $(this).addClass("one-page-nav-item");
16650    } else {
16651      href = "";
16652    }
16653
16654
16655    /* if(typeof $(this).attr("href").split('#')[1] != 'undefined') {
16656      $(this).addClass("one-page-nav-item");
16657    }*/
16658
16659    if (href == window.location.href.split('#')[0] && (typeof $(this).attr("href").split('#')[1] != 'undefined')) {
16660      //console.log($(this).attr("href").split('#')[1]);
16661      $(this).attr("href", "#" + $(this).attr("href").split('#')[1]);
16662      $(this).parent().removeClass("current-menu-item");
16663    }
16664
16665
16666  });
16667
16668  var onePageMenuItems = $('.one-page-nav-item'),
16669    wp_admin_height = 0,
16670    header_height = 0;
16671
16672  var scrollItems = onePageMenuItems.map(function() {
16673    var item = $(this).attr("href");
16674    if (/^#\w/.test(item) && $(item).length) {
16675      return $(item);
16676    }
16677  });
16678
16679
16680  if ($.exists("#wpadminbar")) {
16681    wp_admin_height = $("#wpadminbar").height();
16682  }
16683
16684  if (!$.exists('.mk-vm-menuwrapper')) {
16685    header_height = parseInt($('#mk-header').attr('data-sticky-height'));
16686  }
16687
16688
16689  var offsetTop = 0;
16690  $('.mk-header-holder').on('click', '.one-page-nav-item', function(e) {
16691  // onePageMenuItems.click(function(e) {
16692    var href = $(this).attr("href");
16693    if (typeof $(href).offset() != 'undefined') {
16694      var href_top = $(href).offset().top;
16695    } else {
16696      var href_top = 0;
16697    }
16698
16699    if (!$(this).hasClass('mk-nav-open')) {
16700      $('#mk-responsive-nav').slideUp(300);
16701      $('body').removeClass('mk-opened-nav');
16702    }
16703
16704    if ($.exists("#wpadminbar")) {
16705      var wp_admin_height = $("#wpadminbar").height();
16706      // console.log(wp_admin_height);
16707    } else {
16708      wp_admin_height = 0;
16709    }
16710
16711    if ($(window).width() <= mk_responsive_nav_width) {
16712      header_height = 0;
16713    }
16714
16715    offsetTop = href === "#" ? 0 : href_top - (wp_admin_height + header_height - 1);
16716
16717    $('html, body').stop().animate({
16718      scrollTop: offsetTop
16719    }, {
16720      duration: 1200,
16721      easing: "easeInOutExpo"
16722    });
16723    //TweenLite.to(window, 1.2, {scrollTo:{y: offsetTop}, ease:Expo.easeInOut});
16724
16725    e.preventDefault();
16726  });
16727
16728
16729  function hashLink() {
16730    var hash = window.location.hash;
16731    if(hash.length) {
16732        setTimeout(function() {
16733          window.scrollTo(0, 0);
16734        }, 1);
16735
16736        $(window).load(function() {
16737
16738          if ($.exists("#wpadminbar")) {
16739            var wp_admin_height = $("#wpadminbar").height();
16740          } else {
16741            wp_admin_height = 0;
16742          }
16743
16744         var $target = $('#'+hash.substring(1)),
16745              offsetHash = $target.offset().top,
16746              offset;
16747
16748          offset = offsetHash - (wp_admin_height + header_height - 1);
16749
16750          setTimeout(function() {
16751            $('html, body').stop().animate({
16752              scrollTop: offset
16753            }, {
16754              duration: 1200,
16755              easing: "easeInOutExpo"
16756            });
16757          }, 500);
16758        });
16759    }
16760  }
16761  hashLink();
16762
16763  new ChopScroll(function() {
16764    if (!scrollItems.length) return false;
16765    var fromTop = $(window).scrollTop() + (wp_admin_height + header_height);
16766    var cur = scrollItems.map(function() {
16767      if ($(this).offset().top - 200 < fromTop) return this; // This is purely empirical - we don't look at the top of screen but a little bit lower, so lets switch section at this point.
16768    });
16769    cur = cur[cur.length - 1];
16770    var id = cur && cur.length ? cur[0].id : "";
16771
16772    if (lastId !== id) {
16773      lastId = id;
16774
16775      onePageMenuItems.parent().removeClass("current-menu-item current-menu-ancestor current-menu-parent");
16776      if (id.length) {
16777        onePageMenuItems.filter("[href=#" + id + "]").parent().addClass("current-menu-item");
16778      }
16779    }
16780  }, 200);
16781}
16782
16783
16784mk_main_nav_scroll();;/* Swipe Slideshow */
16785/* -------------------------------------------------------------------- */
16786
16787
16788function mk_swipe_slider() {
16789
16790
16791  "use strict";
16792
16793  $('.mk-swiper-slider').each(function() {
16794
16795      if ($(this).data('state') != 'init') {
16796
16797        $(this).data('state', 'init');
16798
16799        var $this = $(this),
16800          $thumbs = $this.parent().siblings('.gallery-thumbs-small'),
16801          $next_arrow = $this.find('.mk-swiper-next'),
16802          $prev_arrow = $this.find('.mk-swiper-prev'),
16803          $direction = $this.attr('data-direction'),
16804          $pagination = $this.attr('data-pagination') == "true" ? true : false,
16805          $slideshowSpeed = $this.attr('data-slideshowSpeed'),
16806          $animationSpeed = $this.attr('data-animationSpeed'),
16807          $controlNav = $this.attr('data-controlNav') == "true" ? true : false,
16808          $directionNav = $this.attr('data-directionNav') == "true" ? true : false,
16809          $freeModeFluid = $this.attr('data-freeModeFluid') == "true" ? true : false,
16810          $freeMode = $this.attr('data-freeMode') == "true" ? true : false,
16811          $mousewheelControl = $this.attr('data-mousewheelControl') == "true" ? true : false,
16812          $loop = $this.attr('data-loop') == "true" ? true : false,
16813          $slidesPerView = $this.attr('data-slidesPerView'),
16814          vieportWidth = $(window).width();
16815
16816        if ($pagination === true) {
16817          var $pagination_class = '#' + $this.attr('id') + ' .swiper-pagination';
16818        } else {
16819          var $pagination_class = false;
16820        }
16821
16822        if ($slidesPerView != 'auto' && $slidesPerView > 2) {
16823          if (vieportWidth > 768) {
16824            var slidesOnInit = $slidesPerView;
16825          }
16826          if (vieportWidth <= 768) {
16827            var slidesOnInit = 2;
16828          }
16829          if (vieportWidth <= 568) {
16830            var slidesOnInit = 1;
16831          }
16832        } else {
16833          slidesOnInit = $slidesPerView;
16834        }
16835
16836        var mk_swiper = $(this).swiper({
16837          mode: $direction,
16838          loop: $loop,
16839          freeMode: $freeMode,
16840          pagination: $pagination_class,
16841          freeModeFluid: $freeModeFluid,
16842          autoplay: $slideshowSpeed,
16843          speed: $animationSpeed,
16844          calculateHeight: true,
16845          grabCursor: true,
16846          useCSS3Transforms: false,
16847          mousewheelControl: $mousewheelControl,
16848          paginationClickable: true,
16849          slidesPerView: slidesOnInit,
16850          resizeReInit: true,
16851          onSwiperCreated: function(swiper) {
16852
16853          },
16854          onSlideChangeStart: function() {
16855            $thumbs.find('.active-item').removeClass('active-item');
16856            $thumbs.find('a').eq(mk_swiper.activeIndex).addClass('active-item');
16857          }
16858        });
16859
16860
16861        $prev_arrow.click(function(e) {
16862          mk_swiper.swipePrev();
16863        });
16864
16865        $next_arrow.click(function(e) {
16866          mk_swiper.swipeNext();
16867        });
16868
16869
16870        $thumbs.find('a').on('touchstart mousedown', function(e) {
16871          e.preventDefault();
16872          $thumbs.find('.active-item').removeClass('active-item');
16873          $(this).addClass('active-item');
16874          mk_swiper.swipeTo($(this).index());
16875        });
16876
16877        $thumbs.find('a').click(function(e) {
16878          e.preventDefault();
16879        });
16880
16881
16882        // change per view size for smaller screens to fixed value on resize
16883        if ($slidesPerView != 'auto' && $slidesPerView > 2) {
16884          $(window).on("resize", function() {
16885            vieportWidth = $(window).width();
16886
16887            if (vieportWidth > 768) {
16888              mk_swiper.params.slidesPerView = $slidesPerView;
16889              setTimeout(function() {
16890                mk_swiper.reInit();
16891                setTimeout(mk_swiper.swipePrev(), 200);
16892              }, 200);
16893              // console.log('full'); 
16894            }
16895            if (vieportWidth <= 768) {
16896              mk_swiper.params.slidesPerView = 2;
16897              setTimeout(function() {
16898                mk_swiper.reInit();
16899                setTimeout(mk_swiper.swipePrev(), 200);
16900              }, 200);
16901              // console.log('medium');
16902            }
16903            if (vieportWidth <= 568) {
16904              mk_swiper.params.slidesPerView = 1;
16905              setTimeout(function() {
16906                mk_swiper.reInit();
16907                setTimeout(mk_swiper.swipePrev(), 200);
16908              }, 200);
16909              // console.log('small');
16910            }
16911
16912          });
16913      }
16914
16915
16916        }
16917
16918      });
16919
16920
16921
16922
16923};/* Edge Slideshow */
16924/* -------------------------------------------------------------------- */
16925
16926  function mk_edge_slider() {
16927    $('.mk-edge-slider').each(function() {
16928      var $slider_wrapper = $(this),
16929        $theme_container = $('#mk-theme-container'),
16930        $next_arrow = $slider_wrapper.find('.mk-edge-next'),
16931        $prev_arrow = $slider_wrapper.find('.mk-edge-prev'),
16932        $pause = $slider_wrapper.attr('data-pause'),
16933        $first_el = $slider_wrapper.attr('data-first'),
16934        $speed = $slider_wrapper.attr('data-speed'),
16935        $animation = $slider_wrapper.attr('data-animation'),
16936        $height = $slider_wrapper.attr('data-height'),
16937        $fullHeight = $slider_wrapper.attr('data-fullHeight'),
16938        $header_height = 0,
16939        edge_height = 0,
16940        adminbar = 0,
16941        loop = true,
16942        $pagination = $slider_wrapper.attr('data-pagination') == "true" ? true : false;
16943
16944      if ($pagination === true) {
16945        var $pagination_class = '#' + $slider_wrapper.attr('id') + ' .swiper-pagination';
16946
16947        $($pagination_class).on('click', 'span', function() {
16948          mk_swiper.swipeTo($(this).index(), 500);
16949        });
16950
16951        $slider_wrapper.find('.edge-skip-slider').css('bottom', '14%');
16952      } else {
16953        var $pagination_class = false;
16954      }
16955
16956
16957      if($animation == "kenburned") {
16958        loop = false;
16959      }
16960
16961
16962      var animationDimensions = function() {
16963        mk_edge_slider_resposnive($slider_wrapper);
16964          if ($.exists('#mk-header.sticky-header') && !$('#mk-header').hasClass('transparent-header')) {
16965              $header_height = parseInt($('#mk-header.sticky-header').attr('data-sticky-height'));
16966          }
16967          if ($.exists('#wpadminbar')) {
16968              adminbar = $('#wpadminbar').height();
16969          }
16970          if ($fullHeight === 'true') {
16971              edge_height = $(window).height() - $header_height - adminbar;
16972          } else {
16973              edge_height = $height;
16974          }
16975          // console.log('edge_height: ' + edge_height);
16976      }
16977
16978      $(window).load(animationDimensions());
16979
16980      $(window).on("debouncedresize", function(event) {
16981          setTimeout(function() {
16982              animationDimensions();
16983          }, 50);
16984      });
16985
16986
16987      $slider_wrapper.find('.mk-animate-element').removeClass('mk-animate-element fade-in scale-up right-to-left left-to-right bottom-to-top top-to-bottom flip-x flip-y');
16988
16989      var mk_swiper = $slider_wrapper.swiper({
16990        mode: 'horizontal',
16991        loop: loop,
16992        grabCursor: true,
16993        useCSS3Transforms: true,
16994        mousewheelControl: false,
16995        pagination: $pagination_class,
16996        paginationClickable: true,
16997        freeModeFluid: true,
16998        speed: $speed,
16999        autoplay: $pause,
17000        progress: true,
17001        autoplayDisableOnInteraction: false,
17002        onSwiperCreated: function(swiper) {
17003
17004          var current_eq, prev_eq, next_eq;
17005          if(loop == false) {
17006            current_eq = 0;
17007            prev_eq = swiper.slides.length - 1;
17008            next_eq = 1;
17009          } else {
17010            current_eq = 1;
17011            prev_eq = 0;
17012            next_eq = 2;           
17013          }
17014
17015          if ($theme_container.hasClass('mk-transparent-header')) {
17016            if ($first_el == 'true') {
17017              $('#mk-header.transparent-header').removeClass('light-header-skin dark-header-skin').addClass($slider_wrapper.find('.swiper-slide').eq(current_eq).attr('data-header-skin') + '-header-skin');
17018            }
17019          }
17020
17021          var currentSlide = $slider_wrapper.find('.swiper-slide').eq(current_eq),
17022            currentSkin = $slider_wrapper.find('.swiper-slide').eq(current_eq).attr("data-header-skin");
17023
17024          //if ($first_el == 'true') {    
17025          $('.mk-edge-nav a').attr('data-skin', currentSkin);
17026          $('.swiper-pagination').attr('data-skin', currentSkin);
17027          $('.edge-skip-slider').attr('data-skin', currentSkin);
17028          //}
17029
17030          // if (mk_detect_ie() == false) {
17031
17032            var prev_active_slide = $slider_wrapper.find('.swiper-slide').eq(prev_eq).find('.edge-slide-content .edge-title').text(),
17033              next_active_slide = $slider_wrapper.find('.swiper-slide').eq(next_eq).find('.edge-slide-content .edge-title').text();
17034            //console.log(prev_active_slide + "---" + next_active_slide);
17035            var prev_active_slide_bg = $slider_wrapper.find('.swiper-slide').eq(prev_eq).find('.mk-section-image').css('background-image'),
17036              next_active_slide_bg = $slider_wrapper.find('.swiper-slide').eq(next_eq).find('.mk-section-image').css('background-image');
17037            // console.log(prev_active_slide_bg + "---" + next_active_slide_bg);
17038            var prev_active_slide_bg_video = $slider_wrapper.find('.swiper-slide').eq(prev_eq).find('.mk-video-section-touch').css('background-image'),
17039              next_active_slide_bg_video = $slider_wrapper.find('.swiper-slide').eq(next_eq).find('.mk-video-section-touch').css('background-image');
17040
17041            //console.log(prev_active_slide_bg_video);
17042            //console.log(next_active_slide_bg_video);
17043
17044            var prev_active_slide_bg_color = $slider_wrapper.find('.swiper-slide').eq(prev_eq).find('.mk-section-image').css('background-color'),
17045              next_active_slide_bg_color = $slider_wrapper.find('.swiper-slide').eq(next_eq).find('.mk-section-image').css('background-color');
17046
17047            if (prev_active_slide.length > 1) {
17048              $prev_arrow.find('.prev-item-caption').show().text(prev_active_slide);
17049              // console.log(prev_active_slide);
17050            }
17051
17052            if (typeof prev_active_slide_bg !== 'undefined' && prev_active_slide_bg != "none") {
17053              $prev_arrow.find('.edge-nav-bg').show().css({
17054                'background-image': prev_active_slide_bg
17055              });
17056              // console.log(prev_active_slide_bg);
17057            } else if (typeof prev_active_slide_bg_video !== 'undefined' && prev_active_slide_bg_video != "none") {
17058              $prev_arrow.find('.edge-nav-bg').show().css({
17059                'background-image': prev_active_slide_bg_video
17060              });
17061              // console.log(prev_active_slide_bg_video);
17062            } else if (prev_active_slide_bg_color !== 'undefined') {
17063              $prev_arrow.find('.edge-nav-bg').show().css({
17064                'background-color': prev_active_slide_bg_color
17065              });
17066              // console.log(prev_active_slide_bg_color);
17067            }
17068
17069            if (typeof next_active_slide !== 'undefined') {
17070              $next_arrow.find('.next-item-caption').show().text(next_active_slide);
17071            }
17072
17073            if (typeof next_active_slide_bg !== 'undefined' && next_active_slide_bg != "none") {
17074              $next_arrow.find('.edge-nav-bg').show().css({
17075                'background-image': next_active_slide_bg
17076              });
17077            } else if (typeof next_active_slide_bg_video !== 'undefined' && next_active_slide_bg_video != "none") {
17078              $next_arrow.find('.edge-nav-bg').show().css({
17079                'background-image': next_active_slide_bg_video
17080              });
17081            } else if (typeof next_active_slide_bg_color !== 'undefined') {
17082              $next_arrow.find('.edge-nav-bg').show().css({
17083                'background-color': next_active_slide_bg_color
17084              });
17085            }
17086
17087            if (!$('#mk-header').hasClass('transparent-header-sticky')) {
17088              if ($first_el == 'true') {
17089                $('#mk-header.transparent-header').removeClass('light-header-skin dark-header-skin').addClass($slider_wrapper.find('.swiper-slide').eq(current_eq).attr('data-header-skin') + '-header-skin');
17090              }
17091            }
17092
17093
17094
17095          // } else {
17096          //   $next_arrow.find('.next-item-caption, .edge-nav-bg').css('display', 'none');
17097          //   $prev_arrow.find('.prev-item-caption, .edge-nav-bg').css('display', 'none');
17098          // }
17099
17100          if ($pagination === true) {
17101            $('#' + $slider_wrapper.attr('id') + ' .swiper-pagination span').append('<a href="#"></a>');
17102          }
17103
17104
17105        },
17106        onSlideChangeEnd: function() {
17107
17108
17109          var current_eq, prev_eq, next_eq;
17110          if(loop == false) {
17111            current_eq = mk_swiper.activeIndex;
17112            prev_eq = mk_swiper.activeIndex -1 ;
17113            next_eq = mk_swiper.activeIndex + 1;
17114
17115            if(prev_eq < 0) {
17116              prev_eq = mk_swiper.slides.length - 1;
17117            }
17118            if(next_eq > mk_swiper.slides.length - 1) {
17119              next_eq = 0;
17120            }
17121          } else {
17122            current_eq = mk_swiper.activeLoopIndex + 1;
17123            prev_eq = mk_swiper.activeLoopIndex;
17124            next_eq = mk_swiper.activeLoopIndex + 2;           
17125          }
17126
17127          if ($theme_container.hasClass('mk-transparent-header')) {
17128            if ($first_el == 'true') {
17129              $('#mk-header.transparent-header').removeClass('light-header-skin dark-header-skin').addClass($(mk_swiper.getSlide(current_eq)).attr('data-header-skin') + '-header-skin');
17130            }
17131          }
17132
17133          // if (mk_detect_ie() == false) {
17134
17135            var currentSlide = $(mk_swiper.activeSlide()),
17136              currentSkin = currentSlide.attr("data-header-skin");
17137
17138            //if ($first_el == 'true') {    
17139            $('.mk-edge-nav a').attr('data-skin', currentSkin);
17140            $('.swiper-pagination').attr('data-skin', currentSkin);
17141            $('.edge-skip-slider').attr('data-skin', currentSkin);
17142            //  }
17143
17144            var prev_active_slide = $(mk_swiper.getSlide(prev_eq)).find('.edge-slide-content .edge-title').text(),
17145              next_active_slide = $(mk_swiper.getSlide(next_eq)).find('.edge-slide-content .edge-title').text();
17146
17147            var prev_active_slide_bg = $(mk_swiper.getSlide(prev_eq)).find('.mk-section-image').css('background-image'),
17148              next_active_slide_bg = $(mk_swiper.getSlide(next_eq)).find('.mk-section-image').css('background-image');
17149
17150            var prev_active_slide_bg_video = $(mk_swiper.getSlide(prev_eq)).find('.mk-video-section-touch').css('background-image'),
17151              next_active_slide_bg_video = $(mk_swiper.getSlide(next_eq)).find('.mk-video-section-touch').css('background-image');
17152
17153            var prev_active_slide_bg_color = $(mk_swiper.getSlide(prev_eq)).find('.mk-section-image').css('background-color'),
17154              next_active_slide_bg_color = $(mk_swiper.getSlide(next_eq)).find('.mk-section-image').css('background-color');
17155
17156            if (typeof prev_active_slide !== 'undefined') {
17157              $prev_arrow.find('.prev-item-caption').show().text(prev_active_slide);
17158              // console.log(prev_active_slide);
17159            }
17160
17161            if (typeof prev_active_slide_bg !== 'undefined' && prev_active_slide_bg != "none") {
17162              $prev_arrow.find('.edge-nav-bg').show().css({
17163                'background-image': prev_active_slide_bg
17164              });
17165              // console.log(prev_active_slide_bg);
17166            } else if (typeof prev_active_slide_bg_video !== 'undefined' && prev_active_slide_bg_video != "none") {
17167              $prev_arrow.find('.edge-nav-bg').show().css({
17168                'background-image': prev_active_slide_bg_video
17169              });
17170              // console.log(prev_active_slide_bg_video);
17171            } else if (typeof prev_active_slide_bg_color !== 'undefined') {
17172              $prev_arrow.find('.edge-nav-bg').show().css({
17173                'background-color': prev_active_slide_bg_color
17174              });
17175              // console.log(prev_active_slide_bg_color);
17176            }
17177
17178            if (typeof next_active_slide !== 'undefined') {
17179              $next_arrow.find('.next-item-caption').show().text(next_active_slide);
17180            }
17181
17182            if (typeof next_active_slide_bg !== 'undefined' && next_active_slide_bg != "none") {
17183              $next_arrow.find('.edge-nav-bg').show().css({
17184                'background-image': next_active_slide_bg
17185              });
17186            } else if (typeof next_active_slide_bg_video !== 'undefined' && next_active_slide_bg_video != "none") {
17187              $next_arrow.find('.edge-nav-bg').show().css({
17188                'background-image': next_active_slide_bg_video
17189              });
17190            } else if (typeof next_active_slide_bg_color !== 'undefined') {
17191              $next_arrow.find('.edge-nav-bg').show().css({
17192                'background-color': next_active_slide_bg_color
17193              });
17194            }
17195
17196            if (!$('#mk-header').hasClass('transparent-header-sticky')) {
17197              if ($first_el == 'true') {
17198                $('#mk-header.transparent-header').removeClass('light-header-skin dark-header-skin').addClass($(mk_swiper.getSlide(current_eq)).attr('data-header-skin') + '-header-skin');
17199              }
17200            }
17201
17202
17203          // } else {
17204          //   $next_arrow.find('.next-item-caption, .edge-nav-bg').css('display', 'none');
17205          //   $prev_arrow.find('.prev-item-caption, .edge-nav-bg').css('display', 'none');
17206          // }
17207
17208        },    
17209        onProgressChange: function(swiper){
17210                  for (var i = 0; i < swiper.slides.length; i++){
17211
17212                      var slide = swiper.slides[i];
17213                      var progress = slide.progress;
17214
17215                      // SLIDER ANIMATION EFFECTS
17216
17217                      if($animation == "horizontal_curtain") {
17218                          var translateX, zIndex, transitionTiming;
17219                              translateX = progress*swiper.width;
17220
17221                          if (progress<=0) {
17222                              zIndex = 1;
17223                              translateX = 0;
17224                              transitionTiming = 'ease';
17225                          }
17226                          else if (progress>0){
17227                              zIndex = 0;
17228                              translateX = (progress*swiper.width)/2;
17229                              transitionTiming = 'ease';
17230                          }
17231
17232                          swiper.setTransform(slide,'translate3d('+(translateX/2)+'px,0,0)');
17233                          slide.style.webkitTransitionTimingFunction = transitionTiming;
17234                          slide.style.zIndex = zIndex;
17235                      }
17236
17237                      if($animation == "perspective_flip") {
17238                          var translateX, translateY, rotateX;
17239
17240                              translateX = progress*swiper.width;
17241                              translateY = progress*edge_height;
17242
17243                          if (progress>=0) {
17244                              rotateX = 0;
17245                          }
17246                          else if (progress<0){
17247                              rotateX = 70;
17248                          }
17249
17250                          swiper.setTransform(slide,'translate3d('+translateX+'px,'+ (-translateY) +'px,0) rotateX('+rotateX+'deg)');
17251                      }
17252
17253                      if($animation == "vertical_slide") {
17254                          var translateX, translateY;
17255
17256                              translateX = progress*swiper.width;
17257                              translateY = progress*edge_height;
17258
17259                          swiper.setTransform(slide,'translate3d('+translateX+'px,'+ (-translateY) +'px,0)');
17260                      }
17261
17262                      if($animation == "fade") {
17263                          var translate, opacity, zIndex;
17264
17265                          if (progress == 0) {
17266                              zIndex = 1;
17267                          }
17268                          else {
17269                              zIndex = 0;
17270                          }
17271                              opacity = 1 - Math.min(Math.abs(progress),1);
17272                              translate = progress*swiper.width;
17273
17274                          swiper.setTransform(slide,'translate3d('+translate+'px,0,0)');
17275                          slide.style.opacity = opacity;
17276                          slide.style.zIndex = zIndex;
17277                      }
17278
17279                      if($animation == "kenburned") {
17280                          var translateX, opacity, zIndex;
17281
17282                          if (progress == 0) {
17283                              zIndex = 1;
17284                          }
17285                          else {
17286                              zIndex = 0;
17287                          }
17288
17289                              translateX = progress*swiper.width;
17290                              opacity = 1 - Math.min(Math.abs(progress),1);
17291
17292                          swiper.setTransform(slide,'translate3d('+translateX+'px,0,0)');
17293                          slide.style.opacity = opacity;
17294                          slide.style.zIndex = zIndex;
17295
17296                      }
17297
17298                      if($animation == "zoom_out") {
17299                          var scale, translateX, translateY, opacity, zIndex;
17300
17301                              translateX = progress*swiper.width;
17302
17303                          if (progress<=0) {
17304                              opacity = 1;
17305                              scale = 1;
17306                              zIndex = 1;
17307                              translateY = progress*edge_height;
17308                          }
17309                          else if (progress>0){
17310                              opacity = (1 - Math.min(Math.abs(progress),1))/2;
17311                              scale = 1 - Math.min(Math.abs(progress/2),1);
17312                              zIndex = 0;
17313                              translateY = 0;
17314                          }
17315
17316                          swiper.setTransform(slide,'translate3d('+translateX+'px,'+ -translateY +'px,0)  scale('+scale+')');
17317                          slide.style.opacity = opacity;
17318                          slide.style.zIndex = zIndex;
17319                      }
17320
17321                      if($animation == "zoom") {
17322                          var scale, scaleContent, translate, opacity, zIndex;
17323
17324                          if (progress == 0) {
17325                              zIndex = 1;
17326                          }
17327                          else {
17328                              zIndex = 0;
17329                          }
17330
17331                          if (progress<=0) {
17332                              opacity = 1 - Math.min(Math.abs(progress),1);
17333                              scale = 1 - Math.min(Math.abs(progress/12),1);
17334                              scaleContent = 1;
17335                              translate = progress*swiper.width;
17336                          }
17337                          else {
17338                              opacity = 0;
17339                              scale = 1 + Math.min(Math.abs(progress/6),1);
17340                              translate = progress*swiper.width;
17341                          }
17342
17343                          // console.log(progress)
17344
17345                          slide.style.opacity = opacity;
17346                          slide.style.zIndex = zIndex;
17347                          swiper.setTransform(slide,'translate3d('+translate+'px,0,0) scale('+scale+')');
17348                      }
17349
17350                  }
17351                },
17352                onTouchStart:function(swiper){
17353                  for (var i = 0; i < swiper.slides.length; i++){
17354                    swiper.setTransition(swiper.slides[i], 0);
17355                  }
17356                },
17357                onSetWrapperTransition: function(swiper, speed) {
17358                  for (var i = 0; i < swiper.slides.length; i++){
17359                    swiper.setTransition(swiper.slides[i], speed);
17360                  }
17361                }
17362      });
17363
17364      if(loop == true) {
17365        $prev_arrow.click(function(e) {
17366          mk_swiper.swipePrev();
17367          e.preventDefault();
17368        });
17369
17370        $next_arrow.click(function(e) {
17371          mk_swiper.swipeNext();
17372          e.preventDefault();
17373        });
17374      } else {
17375        var first_eq = 0,
17376            last_eq = mk_swiper.slides.length - 1;
17377
17378        $prev_arrow.click(function(e) {
17379          var current_eq = mk_swiper.activeIndex;
17380          if(current_eq == first_eq) {
17381            mk_swiper.swipeTo(last_eq);
17382          } else {
17383            mk_swiper.swipePrev();
17384          }
17385          e.preventDefault();
17386        });
17387
17388        $next_arrow.click(function(e) {
17389          var current_eq = mk_swiper.activeIndex;
17390          if(current_eq == last_eq) {
17391            mk_swiper.swipeTo(first_eq);
17392          } else {
17393            mk_swiper.swipeNext();
17394          }
17395          e.preventDefault();
17396        });
17397      }
17398  });
17399}
17400
17401
17402  function mk_edge_slider_resposnive(el) {
17403    "use strict";
17404
17405      var $this = el,
17406        $items = $this.find('.edge-slider-holder, .swiper-slide'),
17407        $height = $this.attr('data-height'),
17408        $fullHeight = $this.attr('data-fullHeight'),
17409        $skip_header_fix = 0,
17410        $header_height = 0;
17411
17412      var $window_height = $(window).outerHeight();
17413
17414
17415      if ($.exists('#wpadminbar')) {
17416        $header_height += $('#wpadminbar').outerHeight();
17417      }
17418
17419
17420      /* if ($.exists('.mk-header-toolbar')) {
17421        $header_height += $('.mk-header-toolbar').outerHeight();
17422      }*/
17423
17424
17425      if (!$('#mk-theme-container').hasClass('mk-transparent-header') && $.exists('.mk-header-holder')) {
17426        $skip_header_fix += parseInt($('#mk-header').attr('data-height'));
17427        $header_height += $skip_header_fix;
17428      }
17429
17430
17431      if ($(window).width() < 780) {
17432
17433        $window_height = 600;
17434
17435      } else if ($fullHeight == 'true') {
17436
17437        $window_height = $window_height - $header_height;
17438
17439      } else {
17440
17441        $window_height = $height;
17442      }
17443
17444      $items.css('height', $window_height);
17445
17446      $this.find('.swiper-slide').each(function() {
17447
17448
17449        var $this = $(this),
17450          $content = $this.find('.edge-slide-content');
17451
17452        if ($this.hasClass('left_center') || $this.hasClass('center_center') || $this.hasClass('right_center')) {
17453
17454          var $this_height_half = $content.outerHeight() / 2;
17455          if ($content.outerHeight() < $window_height) {
17456            var $window_half = $window_height / 2;
17457            $content.css('marginTop', ($window_half - $this_height_half));
17458          }
17459
17460        }
17461
17462        if ($this.hasClass('left_bottom') || $this.hasClass('center_bottom') || $this.hasClass('right_bottom')) {
17463
17464          if ($content.outerHeight() < $window_height) {
17465            var $distance_from_top = $window_height - $content.outerHeight() - 90;
17466            $content.css('marginTop', ($distance_from_top));
17467          }
17468        }
17469
17470
17471      });
17472
17473      var header_padding_fix = 0;
17474      header_padding_fix = parseInt($('#mk-header').attr('data-sticky-height'));
17475
17476      if ($('.mk-nav-responsive-link').css('display') != 'none') {
17477        $skip_header_fix += parseInt($('#mk-header').attr('data-height'));
17478        header_padding_fix = 0;
17479      }
17480
17481      // console.log($header_height);
17482      var skip = $window_height - header_padding_fix + $skip_header_fix;
17483
17484
17485      $this.find('.edge-skip-slider').bind("click", function(e) {
17486        $("html, body").stop().animate({ scrollTop: skip }, 1000, "easeInOutExpo");
17487        e.preventDefault();
17488      });
17489
17490      $this.find('.edge-slider-loading').fadeOut();
17491
17492  }
17493
17494
17495
17496function mk_flexslider_init() {
17497
17498  "use strict";
17499
17500  jQuery('.mk-flexslider.mk-script-call').each(function() {
17501    var $this = jQuery(this),
17502      $selector = $this.attr('data-selector'),
17503      $animation = $this.attr('data-animation'),
17504      $easing = $this.attr('data-easing'),
17505      $direction = $this.attr('data-direction'),
17506      $smoothHeight = $this.attr('data-smoothHeight') == "true" ? true : false,
17507      $slideshowSpeed = $this.attr('data-slideshowSpeed'),
17508      $animationSpeed = $this.attr('data-animationSpeed'),
17509      $controlNav = $this.attr('data-controlNav') == "true" ? true : false,
17510      $directionNav = $this.attr('data-directionNav') == "true" ? true : false,
17511      $pauseOnHover = $this.attr('data-pauseOnHover') == "true" ? true : false,
17512      $isCarousel = $this.attr('data-isCarousel') == "true" ? true : false;
17513
17514    if ($selector != undefined) {
17515      var $selector_class = $selector;
17516    } else {
17517      var $selector_class = ".mk-flex-slides > li";
17518    }
17519
17520    if ($isCarousel == true) {
17521      var $itemWidth = parseInt($this.attr('data-itemWidth')),
17522        $itemMargin = parseInt($this.attr('data-itemMargin')),
17523        $minItems = parseInt($this.attr('data-minItems')),
17524        $maxItems = parseInt($this.attr('data-maxItems')),
17525        $move = parseInt($this.attr('data-move'));
17526    } else {
17527      var $itemWidth = $itemMargin = $minItems = $maxItems = $move = 0;
17528    }
17529
17530    $this.flexslider({
17531      selector: $selector_class,
17532      animation: $animation,
17533      easing: $easing,
17534      direction: $direction,
17535      smoothHeight: $smoothHeight,
17536      slideshow: true,
17537      slideshowSpeed: $slideshowSpeed,
17538      animationSpeed: $animationSpeed,
17539      controlNav: $controlNav,
17540      directionNav: $directionNav,
17541      pauseOnHover: $pauseOnHover,
17542      prevText: "",
17543      nextText: "",
17544      itemWidth: $itemWidth,
17545      itemMargin: $itemMargin,
17546      minItems: $minItems,
17547      maxItems: $maxItems,
17548      move: $move,
17549    });
17550
17551  });
17552
17553}
17554
17555
17556function mk_ajax_lightbox_init() {
17557
17558  "use strict";
17559
17560  jQuery(".mk-lightbox").fancybox({
17561    padding: 15,
17562    margin: 15,
17563
17564    width: 800,
17565    height: 600,
17566    minWidth: 100,
17567    minHeight: 100,
17568    maxWidth: 9999,
17569    maxHeight: 9999,
17570    pixelRatio: 1, // Set to 2 for retina display support
17571
17572    autoSize: true,
17573    autoHeight: false,
17574    autoWidth: false,
17575
17576    autoResize: true,
17577    fitToView: true,
17578    aspectRatio: false,
17579    topRatio: 0.5,
17580    leftRatio: 0.5,
17581
17582    scrolling: 'auto', // 'auto', 'yes' or 'no'
17583    wrapCSS: '',
17584
17585    arrows: true,
17586    closeBtn: true,
17587    closeClick: false,
17588    nextClick: false,
17589    mouseWheel: true,
17590    autoPlay: false,
17591    playSpeed: 3000,
17592    preload: 3,
17593    modal: false,
17594    loop: true,
17595    // Properties for each animation type
17596    // Opening fancyBox
17597    openEffect: 'fade', // 'elastic', 'fade' or 'none'
17598    openSpeed: 200,
17599    openEasing: 'swing',
17600    openOpacity: true,
17601    openMethod: 'zoomIn',
17602
17603    // Closing fancyBox
17604    closeEffect: 'fade', // 'elastic', 'fade' or 'none'
17605    closeSpeed: 200,
17606    closeEasing: 'swing',
17607    closeOpacity: true,
17608    closeMethod: 'zoomOut',
17609
17610    // Changing next gallery item
17611    nextEffect: 'none', // 'elastic', 'fade' or 'none'
17612    nextSpeed: 350,
17613    nextEasing: 'swing',
17614    nextMethod: 'changeIn',
17615
17616    // Changing previous gallery item
17617    prevEffect: 'none', // 'elastic', 'fade' or 'none'
17618    prevSpeed: 350,
17619    prevEasing: 'swing',
17620    prevMethod: 'changeOut',
17621
17622    tpl: {
17623      wrap: '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',
17624      image: '<img class="fancybox-image" src="{href}" alt="" />',
17625      error: '<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',
17626      closeBtn: '<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"><i class="mk-moon-close-2"></i></a>',
17627      next: '<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span><i class="mk-jupiter-icon-arrow-right"></i></span></a>',
17628      prev: '<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span><i class="mk-jupiter-icon-arrow-left"></i></span></a>',
17629      loading: '<div id="fancybox-loading"><div></div></div>'
17630    },
17631
17632  });
17633}
17634
17635
17636
17637function mk_swipe_slider_init() {
17638
17639
17640  "use strict";
17641
17642  jQuery('.mk-swiper-slider').each(function() {
17643
17644    if ($(this).data('state') != 'init') {
17645
17646      $(this).data('state', 'init');
17647
17648      var $this = jQuery(this),
17649        $thumbs = $this.parent().siblings('.gallery-thumbs-small'),
17650        $next_arrow = $this.find('.mk-swiper-next'),
17651        $prev_arrow = $this.find('.mk-swiper-prev'),
17652        $direction = $this.attr('data-direction'),
17653        $pagination = $this.attr('data-pagination') == "true" ? true : false,
17654        $slideshowSpeed = $this.attr('data-slideshowSpeed'),
17655        $animationSpeed = $this.attr('data-animationSpeed'),
17656        $controlNav = $this.attr('data-controlNav') == "true" ? true : false,
17657        $directionNav = $this.attr('data-directionNav') == "true" ? true : false,
17658        $freeModeFluid = $this.attr('data-freeModeFluid') == "true" ? true : false,
17659        $freeMode = $this.attr('data-freeMode') == "true" ? true : false,
17660        $mousewheelControl = $this.attr('data-mousewheelControl') == "true" ? true : false,
17661        $loop = $this.attr('data-loop') == "true" ? true : false,
17662        $slidesPerView = $this.attr('data-slidesPerView');
17663
17664      if ($pagination === true) {
17665        var $pagination_class = '#' + $this.attr('id') + ' .swiper-pagination';
17666      } else {
17667        var $pagination_class = false;
17668      }
17669
17670
17671      var mk_swiper = jQuery(this).swiper({
17672        mode: $direction,
17673        loop: $loop,
17674        freeMode: $freeMode,
17675        pagination: $pagination_class,
17676        freeModeFluid: $freeModeFluid,
17677        autoplay: $slideshowSpeed,
17678        speed: $animationSpeed,
17679        calculateHeight: true,
17680        grabCursor: true,
17681        useCSS3Transforms: false,
17682        mousewheelControl: $mousewheelControl,
17683        paginationClickable: true,
17684        slidesPerView: $slidesPerView,
17685        onSwiperCreated: function(swiper) {
17686
17687        },
17688        onSlideChangeStart: function() {
17689          $thumbs.find('.active-item').removeClass('active-item');
17690          $thumbs.find('a').eq(mk_swiper.activeIndex).addClass('active-item');
17691        }
17692      });
17693
17694
17695      $prev_arrow.click(function(e) {
17696        mk_swiper.swipePrev();
17697      });
17698
17699      $next_arrow.click(function(e) {
17700        mk_swiper.swipeNext();
17701      });
17702
17703
17704      $thumbs.find('a').on('touchstart mousedown', function(e) {
17705        e.preventDefault();
17706        $thumbs.find('.active-item').removeClass('active-item');
17707        jQuery(this).addClass('active-item');
17708        mk_swiper.swipeTo($(this).index());
17709      });
17710
17711      $thumbs.find('a').click(function(e) {
17712        e.preventDefault();
17713      });
17714
17715    }
17716  });
17717
17718}
17719
17720
17721
17722/* Parallax for edge slider */
17723/* -------------------------------------------------------------------- */
17724
17725function mk_edge_parallax() {
17726
17727  "use strict";
17728
17729  if (!isMobile.any()) {
17730
17731
17732    var $parallaxLayer = [];
17733
17734
17735    $('.mk-edge-wrapper .mk-edge-slider').each(function() {
17736      var progressVal,
17737        currentPoint,
17738        ticking = false,
17739        scrollY = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop,
17740        $this = $(this),
17741        $window = $(window),
17742        windowHeight = $(window).height(),
17743        parentHeight = $this.outerHeight(),
17744        startPoint = 0,
17745        endPoint = $this.offset().top + parentHeight,
17746        effectLayer = $this,
17747        cntLayer = $this.find('.mk-grid'),
17748        height = $this.outerHeight();
17749
17750      var parallaxSpeed = .7;
17751
17752      var animationSet = function() {
17753        // fastdom.read(function() { 
17754          scrollY = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;
17755          currentPoint = (startPoint + scrollY) * parallaxSpeed;
17756          progressVal = (1 / (endPoint - startPoint) * (scrollY - startPoint));
17757
17758          // fastdom.write(function() {
17759            if(progressVal <= 1) {
17760                effectLayer.css({
17761                  '-webkit-transform': 'translateY(' + currentPoint + 'px)',
17762                  '-moz-transform': 'translateY(' + currentPoint + 'px)',
17763                  '-ms-transform': 'translateY(' + currentPoint + 'px)',
17764                  '-o-transform': 'translateY(' + currentPoint + 'px)',
17765                  'transform': 'translateY(' + currentPoint + 'px)'
17766                });
17767            }
17768            cntLayer.css({
17769              opacity: (1 - (progressVal * 2))
17770            });
17771          // });
17772
17773          ticking = false;
17774        // });
17775      }
17776      animationSet();
17777
17778      var requestTick = function() {
17779        if (!ticking) {
17780          window.requestAnimationFrame(animationSet);
17781          ticking = true;
17782        }
17783      };
17784
17785      $window.on('scroll',requestTick);
17786    });
17787  }
17788};/* Element Click Events */
17789/* -------------------------------------------------------------------- */
17790  function mobilecheck() {
17791    var check = false;
17792    (function(a){if(/(android|ipad|playbook|silk|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))check = true})(navigator.userAgent||navigator.vendor||window.opera);
17793    return check;
17794  }
17795
17796function mk_click_events() {
17797
17798
17799  "use strict";
17800
17801  var eventtype = mobilecheck() ? 'touchstart' : 'click';
17802
17803
17804
17805
17806
17807  jQuery(".mk-header-login, .mk-header-signup, .mk-side-dashboard, .mk-quick-contact-wrapper, .mk-dashboard-trigger, .blog-share-container, .news-share-buttons, .main-nav-side-search, #mk-fullscreen-search-wrapper, #fullscreen-navigation").on(eventtype, function(event) {
17808    if (event.stopPropagation) {
17809      event.stopPropagation();
17810    } else if (window.event) {
17811      window.event.cancelBubble = true;
17812    }
17813  });
17814  jQuery("html").on(eventtype, function() {
17815    jQuery(this).find(".mk-login-register, #mk-header-subscribe, #mk-quick-contact, .single-share-buttons, .single-share-box, .blog-social-share, .news-share-buttons, #mk-nav-search-wrapper").fadeOut(100);
17816    jQuery('.mk-quick-contact-link').removeClass('quick-contact-active');
17817    jQuery('.mk-toggle-trigger').removeClass('mk-toggle-active');
17818    jQuery('body').removeClass('dashboard-opened');
17819    jQuery('.mk-dashboard-trigger').removeClass('dashboard-active');
17820  });
17821
17822  jQuery('.mk-fullscreen-search-overlay').on(eventtype,function(){
17823    $(this).removeClass('mk-fullscreen-search-overlay-show');
17824  });
17825  jQuery('.mk-fullscreen-nav-wrapper').on(eventtype,function(){
17826    $(this).parent().removeClass('opened');
17827    $('.mk-dashboard-trigger').removeClass('fullscreen-active');
17828  });
17829
17830  jQuery('.mk-forget-password').on(eventtype, function() {
17831    jQuery('#mk-forget-panel').siblings().hide().end().show();
17832  });
17833
17834  jQuery('.mk-create-account').on(eventtype, function() {
17835    jQuery('#mk-register-panel').siblings().hide().end().show();
17836  });
17837
17838  jQuery('.mk-return-login').on(eventtype, function() {
17839    jQuery('#mk-login-panel').siblings().hide().end().show();
17840  });
17841
17842
17843  jQuery('.mk-quick-contact-link').on(eventtype, function() {
17844    var $this = jQuery(this),
17845        $quickContact = jQuery('#mk-quick-contact');
17846    if (!$this.hasClass('quick-contact-active')) {
17847      $quickContact.addClass('quick-contact-anim').fadeIn(250);
17848      $this.addClass('quick-contact-active');
17849    } else {
17850      $quickContact.removeClass('quick-contact-anim').fadeOut(100);
17851      $this.removeClass('quick-contact-active');
17852    }
17853    return false;
17854  });
17855
17856 
17857  jQuery('.mk-dashboard-trigger').on(eventtype, function(e) {
17858
17859    var $this = jQuery(this),
17860        $body = jQuery('body'),
17861        $fullscreen_box = jQuery('.mk-fullscreen-nav');
17862
17863    if ($this.hasClass('header_dashboard_style')){
17864      if (!$this.hasClass('dashboard-active')) {
17865        $this.addClass('dashboard-active');
17866        $body.addClass('dashboard-opened');
17867      } else {
17868        $this.removeClass('dashboard-active'); 
17869        $body.removeClass('dashboard-opened');
17870      }
17871    }else if($this.hasClass('header_fullscreen_style')){
17872      if (!$this.hasClass('fullscreen-active')) {
17873        $this.addClass('fullscreen-active');
17874        $body.addClass('fullscreen-opened');
17875        $fullscreen_box.addClass('opened');
17876      } else {
17877        $this.removeClass('fullscreen-active');
17878        $body.removeClass('fullscreen-opened');
17879        $fullscreen_box.removeClass('opened');
17880      }
17881    }
17882
17883    e.preventDefault();
17884
17885  });
17886  $('.mk-fullscreen-nav-close').on(eventtype, function(e) {
17887    $(this).parent().removeClass('opened');
17888    $('.mk-dashboard-trigger').removeClass('fullscreen-active');
17889    e.preventDefault();
17890  });
17891
17892}
17893
17894
17895function mk_theme_toggle_box() {
17896
17897  "use strict";
17898
17899  var eventtype = mobilecheck() ? 'touchstart' : 'click';
17900
17901  jQuery('.mk-toggle-trigger').on(eventtype, function() {
17902      var $this = jQuery(this);
17903
17904    if (!$this.hasClass('mk-toggle-active')) {
17905
17906      jQuery('.mk-box-to-trigger').fadeOut(100);
17907      $this.parent().find('.mk-box-to-trigger').fadeIn(150);
17908      jQuery('.mk-toggle-trigger').removeClass('mk-toggle-active');
17909      $this.addClass('mk-toggle-active');
17910
17911    } else {
17912
17913      jQuery('.mk-box-to-trigger').fadeOut(100);
17914      $this.removeClass('mk-toggle-active');
17915
17916    }
17917    return false;
17918  });
17919}
17920
17921function mk_social_share_global() {
17922
17923  "use strict";
17924
17925  var eventtype = mobilecheck() ? 'touchstart' : 'click';
17926
17927
17928  jQuery('.twitter-share').on(eventtype, function() {
17929    var $this = jQuery(this),
17930        $url = $this.attr('data-url'),
17931        $title = $this.attr('data-title');
17932
17933    window.open('http://twitter.com/intent/tweet?text=' + $title + ' ' + $url, "twitterWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0");
17934    return false;
17935  });
17936
17937  jQuery('.pinterest-share').on(eventtype, function() {
17938    var $this = jQuery(this),
17939        $url = $this.attr('data-url'),
17940        $title = $this.attr('data-title'),
17941        $image = $this.attr('data-image');
17942    window.open('http://pinterest.com/pin/create/button/?url=' + $url + '&media=' + $image + '&description=' + $title, "twitterWindow", "height=320,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0");
17943    return false;
17944  });
17945
17946  jQuery('.facebook-share').on(eventtype, function() {
17947    var $url = jQuery(this).attr('data-url');
17948    window.open('https://www.facebook.com/sharer/sharer.php?u=' + $url, "facebookWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0");
17949    return false;
17950  });
17951
17952  jQuery('.googleplus-share').on(eventtype, function() {
17953    var $url = jQuery(this).attr('data-url');
17954    window.open('https://plus.google.com/share?url=' + $url, "googlePlusWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0");
17955    return false;
17956  });
17957
17958  jQuery('.linkedin-share').on(eventtype, function() {
17959    var $this = jQuery(this),
17960        $url = $this.attr('data-url'),
17961        $title = $this.attr('data-title'),
17962        $desc = $this.attr('data-desc');
17963    window.open('http://www.linkedin.com/shareArticle?mini=true&url=' + $url + '&title=' + $title + '&summary=' + $desc, "linkedInWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0");
17964    return false;
17965  });
17966}
17967
17968})(jQuery, window);

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.