/
var
/
www
/
barefootlaw.org
/
wp-content
/
plugins
/
bdthemes-prime-slider-lite
/
assets
/
vendor
/
js
/
Upload File
HOME
!function(t,e,n){var a,i="mThumbnailScroller",o="mTS",r=".mThumbnailScroller",l={setTop:0,setLeft:0,type:"hover-50",axis:"x",speed:15,contentTouchScroll:25,markup:{buttonsPlaceholder:!1,buttonsHTML:{up:"SVG set 1",down:"SVG set 1",left:"SVG set 1",right:"SVG set 1"}},advanced:{autoExpandHorizontalScroll:!0,updateOnContentResize:!0,updateOnImageLoad:!0},theme:"none",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},s=0,c={},d=e.attachEvent&&!e.addEventListener?1:0,u=["mTS_disabled","mTS_destroyed","mTS_no_scroll"],h={init:function(e){e=t.extend(!0,{},l,e);var n=f.call(this);if(e.live){var a=e.liveSelector||this.selector||r,i=t(a);if("off"===e.live)return void m(a);c[a]=setTimeout((function(){i.mThumbnailScroller(e),"once"===e.live&&i.length&&m(a)}),500)}else m(a);return e.speed=0===e.speed?100:e.speed,p(e),t(n).each((function(){var n=t(this);if(!n.data(o)){n.data(o,{idx:++s,opt:e,html:null,overflowed:null,bindEvents:!1,tweenRunning:!1,langDir:n.css("direction"),cbOffsets:null,trigger:null});var a=n.data(o).opt,i=n.data("mts-axis"),r=n.data("mts-type"),l=n.data("mts-theme");i&&(a.axis=i),r&&(a.type=r),l&&(a.theme=l,p(a)),v.call(this),h.update.call(null,n)}}))},update:function(e){var n=e||f.call(this);return t(n).each((function(){var e=t(this);if(e.data(o)){var n=e.data(o),a=n.opt,i=t("#mTS_"+n.idx+"_container");if(!i.length)return;n.tweenRunning&&F(e),e.hasClass(u[0])&&e.removeClass(u[0]),e.hasClass(u[1])&&e.removeClass(u[1]),w.call(this),x.call(this),n.overflowed=b.call(this),C.call(this),y.call(this);var r=[i[0].offsetTop,i[0].offsetLeft];"x"!==a.axis&&(n.overflowed[0]?R(e,r[0].toString(),{dir:"y",dur:0,overwrite:"none"}):(_.call(this),"y"===a.axis?(R(e,"0",{dir:"y",dur:0,overwrite:"none"}),M.call(this)):"yx"===a.axis&&n.overflowed[1]&&R(e,r[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==a.axis&&(n.overflowed[1]?R(e,r[1].toString(),{dir:"x",dur:0,overwrite:"none"}):(_.call(this),"x"===a.axis?(R(e,"0",{dir:"x",dur:0,overwrite:"none"}),M.call(this)):"yx"===a.axis&&n.overflowed[0]&&R(e,r[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),n.overflowed[0]||n.overflowed[1]?e.removeClass(u[2]):e.addClass(u[2]),D.call(this)}}))},scrollTo:function(e,n){if(void 0!==e&&null!=e){var a=f.call(this);return t(a).each((function(){var a=t(this);if(a.data(o)){var i=a.data(o),r=i.opt,l={trigger:"external",speed:r.speed,duration:1e3,easing:"easeInOut",timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},s=t.extend(!0,{},l,n),c=P.call(this,e),d=s.duration?s.duration:7e3/(s.speed||1);c[0]=E.call(this,c[0],"y"),c[1]=E.call(this,c[1],"x"),s.dur=d>0&&d<17?17:d,setTimeout((function(){null!==c[0]&&void 0!==c[0]&&"x"!==r.axis&&i.overflowed[0]&&(s.dir="y",s.overwrite="all",R(a,-c[0].toString(),s)),null!==c[1]&&void 0!==c[1]&&"y"!==r.axis&&i.overflowed[1]&&(s.dir="x",s.overwrite="none",R(a,-c[1].toString(),s))}),s.timeout)}}))}},stop:function(){var e=f.call(this);return t(e).each((function(){var e=t(this);e.data(o)&&F(e)}))},disable:function(e){var n=f.call(this);return t(n).each((function(){var n=t(this);if(n.data(o)){n.data(o).opt;D.call(this,"remove"),M.call(this),e&&_.call(this),C.call(this,!0),n.addClass(u[0])}}))},destroy:function(){var e=f.call(this);return t(e).each((function(){var n=t(this);if(n.data(o)){var a=n.data(o),r=a.opt,l=t("#mTS_"+a.idx),s=(t("#mTS_"+a.idx+"_container"),t("#mTS_"+a.idx+"_buttonUp,#mTS_"+a.idx+"_buttonDown,#mTS_"+a.idx+"_buttonLeft,#mTS_"+a.idx+"_buttonRight"));r.live&&m(e),D.call(this,"remove"),M.call(this),_.call(this),n.removeData(o),q(this,"mts"),s.remove(),l.replaceWith(a.html),n.removeClass(i+" _"+"mTS_"+a.idx+" "+"mTS-"+r.theme+" "+u[2]+" "+u[0]).addClass(u[1])}}))}},f=function(){return"object"!=typeof t(this)||t(this).length<1?r:this},p=function(e){var n=["hover-classic"],a=["hover-full"];e.markup.buttonsPlaceholder=t.inArray(e.theme,["buttons-out"])>-1?"outside":e.markup.buttonsPlaceholder,e.markup.buttonsHTML=t.inArray(e.theme,["buttons-in"])>-1?{up:"SVG set 2",down:"SVG set 2",left:"SVG set 2",right:"SVG set 2"}:t.inArray(e.theme,["buttons-out"])>-1?{up:"SVG set 3",down:"SVG set 3",left:"SVG set 3",right:"SVG set 3"}:e.markup.buttonsHTML,e.type=t.inArray(e.theme,n)>-1?"hover-85":t.inArray(e.theme,a)>-1?"hover-precise":e.type,e.speed=t.inArray(e.theme,n)>-1?60:t.inArray(e.theme,a)>-1?10:e.speed},m=function(t){c[t]&&(clearTimeout(c[t]),q(c,t))},v=function(){var e=t(this),n=e.data(o),a=n.opt,r="yx"===a.axis?"mTS_vertical_horizontal":"x"===a.axis?"mTS_horizontal":"mTS_vertical",l=a.markup.thumbnailsContainer||"ul",s=a.markup.thumbnailContainer||"li",c=a.markup.thumbnailElement||"img";if(n.html=e.children().clone(!0,!0),!e.find(l).length){var d=e.find("li").length?"<ul class='mTSAutoContainer' />":"<div class='mTSAutoContainer' />";e.wrapInner(d),l=".mTSAutoContainer"}a.setWidth&&e.css("width",a.setWidth),a.setHeight&&e.css("height",a.setHeight),a.setLeft="y"!==a.axis&&"rtl"===n.langDir?"-989999px":a.setLeft,e.addClass(i+" _"+"mTS_"+n.idx+" "+"mTS-"+a.theme).find(l).wrap("<div id='mTS_"+n.idx+"' class='mTSWrapper "+r+"' />").addClass("mTSContainer").attr("id","mTS_"+n.idx+"_container").css({position:"relative",top:a.setTop,left:a.setLeft}).find(s).addClass("mTSThumbContainer").find(c).addClass("mTSThumb"),T.call(this)},x=function(){var e=t(this).data(o),n=e.opt,a=t("#mTS_"+e.idx+"_container");n.advanced.autoExpandHorizontalScroll&&"y"!==n.axis&&a.css({position:"absolute",width:"auto"}).wrap("<div class='mTS_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:Math.ceil(a[0].getBoundingClientRect().right)-Math.floor(a[0].getBoundingClientRect().left),position:"relative"}).unwrap()},T=function(){var e=t(this),n=e.data(o),a=n.opt,r=a.markup.buttonsPlaceholder?"outside"===a.markup.buttonsPlaceholder?e:t(a.markup.buttonsPlaceholder):t("#mTS_"+n.idx),l=["<a href='#' id='mTS_"+n.idx+"_buttonUp' class='mTSButton mTSButtonUp'><span class='mTSButtonIconContainer'>"+S.call(this,"up")+"</span></a>","<a href='#' id='mTS_"+n.idx+"_buttonDown' class='mTSButton mTSButtonDown'><span class='mTSButtonIconContainer'>"+S.call(this,"down")+"</span></a>","<a href='#' id='mTS_"+n.idx+"_buttonLeft' class='mTSButton mTSButtonLeft'><span class='mTSButtonIconContainer'>"+S.call(this,"left")+"</span></a>","<a href='#' id='mTS_"+n.idx+"_buttonRight' class='mTSButton mTSButtonRight'><span class='mTSButtonIconContainer'>"+S.call(this,"right")+"</span></a>"];a.axis,a.axis;r.hasClass(i)&&"static"===r.css("position")&&r.css("position","relative"),-1!==a.type.indexOf("click")&&("x"!==a.axis&&r.append(l[0]+l[1]),"y"!==a.axis&&r.append(l[2]+l[3]))},S=function(e){var n=t(this).data(o).opt.markup.buttonsHTML,a="SVG set 1"===n[e]?0:"SVG set 2"===n[e]?1:"SVG set 3"===n[e]?2:"SVG set 4"===n[e]?3:"SVG set 5"===n[e]?4:null;switch(e){case"up":return null===a?n[e]:d?"↑":g(n[e])[a][0];case"down":return null===a?n[e]:d?"↓":g(n[e])[a][1];case"left":return null===a?n[e]:d?"←":g(n[e])[a][2];case"right":return null===a?n[e]:d?"→":g(n[e])[a][3]}},g=function(){var t="<svg version='1.1' viewBox='0 0 24 24' preserveAspectRatio='xMinYMin meet' class='mTSButtonIcon'><g><line stroke-width='1' x1='' y1='' x2='' y2='' stroke='#449FDB' opacity=''></line></g>",e="</svg>";return[[t+"<path d='M20.561 9.439l-7.5-7.5c-0.586-0.586-1.535-0.586-2.121 0l-7.5 7.5c-0.586 0.586-0.586 1.536 0 2.121s1.536 0.586 2.121 0l4.939-4.939v14.379c0 0.828 0.672 1.5 1.5 1.5s1.5-0.672 1.5-1.5v-14.379l4.939 4.939c0.293 0.293 0.677 0.439 1.061 0.439s0.768-0.146 1.061-0.439c0.586-0.586 0.586-1.535 0-2.121z'></path>"+e,t+"<path d='M3.439 14.561l7.5 7.5c0.586 0.586 1.536 0.586 2.121 0l7.5-7.5c0.586-0.586 0.586-1.536 0-2.121s-1.536-0.586-2.121 0l-4.939 4.939v-14.379c0-0.828-0.672-1.5-1.5-1.5s-1.5 0.672-1.5 1.5v14.379l-4.939-4.939c-0.293-0.293-0.677-0.439-1.061-0.439s-0.768 0.146-1.061 0.439c-0.586 0.586-0.586 1.536 0 2.121z'></path>"+e,t+"<path d='M9.439 3.439l-7.5 7.5c-0.586 0.586-0.586 1.536 0 2.121l7.5 7.5c0.586 0.586 1.536 0.586 2.121 0s0.586-1.536 0-2.121l-4.939-4.939h14.379c0.828 0 1.5-0.672 1.5-1.5s-0.672-1.5-1.5-1.5h-14.379l4.939-4.939c0.293-0.293 0.439-0.677 0.439-1.061s-0.146-0.768-0.439-1.061c-0.586-0.586-1.536-0.586-2.121 0z'></path>"+e,t+"<path d='M14.561 20.561l7.5-7.5c0.586-0.586 0.586-1.536 0-2.121l-7.5-7.5c-0.586-0.586-1.536-0.586-2.121 0s-0.586 1.536 0 2.121l4.939 4.939h-14.379c-0.828 0-1.5 0.672-1.5 1.5s0.672 1.5 1.5 1.5h14.379l-4.939 4.939c-0.293 0.293-0.439 0.677-0.439 1.061s0.146 0.768 0.439 1.061c0.586 0.586 1.536 0.586 2.121 0z'></path>"+e],[t+"<path d='M18.58 13.724c-0.488-0.502-5.634-5.402-5.634-5.402-0.262-0.268-0.604-0.402-0.946-0.402-0.343 0-0.685 0.134-0.946 0.402 0 0-5.146 4.901-5.635 5.402-0.488 0.502-0.522 1.404 0 1.939 0.523 0.534 1.252 0.577 1.891 0l4.69-4.496 4.688 4.496c0.641 0.577 1.37 0.534 1.891 0 0.523-0.536 0.491-1.439 0-1.939z'</path>"+e,t+"<path d='M18.58 10.276c-0.488 0.502-5.634 5.404-5.634 5.404-0.262 0.268-0.604 0.401-0.946 0.401-0.343 0-0.685-0.133-0.946-0.401 0 0-5.146-4.902-5.635-5.404-0.488-0.502-0.522-1.403 0-1.939 0.523-0.535 1.252-0.577 1.891 0l4.69 4.498 4.688-4.496c0.641-0.577 1.37-0.535 1.891 0 0.523 0.535 0.491 1.438 0 1.938z'></path>"+e,t+"<path d='M13.724 5.419c-0.502 0.49-5.402 5.635-5.402 5.635-0.268 0.262-0.401 0.604-0.401 0.946s0.133 0.684 0.401 0.946c0 0 4.901 5.146 5.402 5.634 0.502 0.49 1.404 0.523 1.939 0 0.534-0.522 0.576-1.25-0.001-1.89l-4.496-4.69 4.496-4.69c0.577-0.641 0.535-1.369 0.001-1.891-0.536-0.522-1.439-0.49-1.939 0z'></path>"+e,t+"<path d='M10.276 5.419c0.502 0.49 5.402 5.635 5.402 5.635 0.269 0.262 0.402 0.604 0.402 0.946s-0.133 0.684-0.402 0.946c0 0-4.901 5.146-5.402 5.634-0.502 0.49-1.403 0.523-1.939 0-0.535-0.522-0.577-1.25 0-1.89l4.498-4.69-4.496-4.69c-0.577-0.641-0.535-1.369 0-1.891s1.438-0.49 1.938 0z'></path>"+e],[t+"<path d='M20.902 17.279c0.325 0.322 0.851 0.322 1.175 0 0.325-0.322 0.325-0.841 0-1.163l-9.49-9.396c-0.324-0.322-0.85-0.322-1.174 0l-9.49 9.396c-0.324 0.322-0.325 0.841 0 1.163s0.85 0.322 1.175 0l8.902-8.569 8.902 8.569z'></path>"+e,t+"<path d='M3.098 6.721c-0.325-0.322-0.851-0.322-1.175 0-0.324 0.32-0.324 0.841 0 1.163l9.49 9.396c0.325 0.322 0.85 0.322 1.175 0l9.49-9.396c0.324-0.322 0.325-0.841 0-1.163s-0.852-0.322-1.175-0.001l-8.903 8.569-8.902-8.568z'></path>"+e,t+"<path d='M17.279 20.902c0.322 0.325 0.322 0.85 0 1.175s-0.841 0.325-1.163 0l-9.396-9.488c-0.322-0.325-0.322-0.851 0-1.175l9.396-9.49c0.322-0.325 0.841-0.325 1.163 0s0.322 0.85 0 1.175l-8.568 8.902 8.568 8.902z'</path>"+e,t+"<path d='M6.72 20.902c-0.322 0.325-0.322 0.85 0 1.175s0.841 0.325 1.163 0l9.396-9.488c0.322-0.325 0.322-0.851 0-1.175l-9.396-9.49c-0.322-0.325-0.841-0.325-1.163 0s-0.322 0.85 0 1.175l8.568 8.902-8.568 8.902z'</path>"+e],[t+"<path d='M12 0l-12 12h7.5v12l9 0v-12h7.5z'></path>"+e,t+"<path d='M12 24l12-12h-7.5v-12l-9-0v12h-7.5z'></path>"+e,t+"<path d='M0 12l12 12v-7.5h12l0-9h-12v-7.5z'></path>"+e,t+"<path d='M24 12l-12-12v7.5h-12l-0 9h12v7.5z'></path>"+e],[t+"<path d='M6.48 16.8h11.040l-5.521-9.6z'></path>"+e,t+"<path d='M17.52 7.201l-11.040-0.001 5.52 9.6z'></path>"+e,t+"<path d='M16.799 6.48l0.001 11.040-9.6-5.52z'></path>"+e,t+"<path d='M7.201 6.48l-0.001 11.040 9.6-5.52z'></path>"+e]]},w=function(){var e=t(this),n=e.data(o),a=(n.opt,t("#mTS_"+n.idx)),i=e.css("max-height"),r=-1!==i.indexOf("%"),l=e.css("box-sizing");if("none"!==i){var s=r?e.parent().height()*parseInt(i)/100:parseInt(i);"border-box"===l&&(s-=e.innerHeight()-e.height()+(e.outerHeight()-e.innerHeight())),a.css("max-height",Math.round(s))}},b=function(){var e=t(this).data(o),n=t("#mTS_"+e.idx),a=t("#mTS_"+e.idx+"_container");return[a.height()>n.height(),a.width()>n.width()]},_=function(){var e=t(this),n=e.data(o),a=n.opt,i=t("#mTS_"+n.idx),r=t("#mTS_"+n.idx+"_container");if(F(e),("x"!==a.axis&&!n.overflowed[0]||"y"===a.axis&&n.overflowed[0])&&r.css("top",0),"y"!==a.axis&&!n.overflowed[1]||"x"===a.axis&&n.overflowed[1]){var l="rtl"===n.langDir?i.width()-r.width():0;r.css("left",l)}},y=function(){var e=t(this).data(o),n=e.opt;e.bindEvents||(n.contentTouchScroll&&I.call(this),-1!==n.type.indexOf("hover")?"hover-precise"===n.type?L.call(this):A.call(this):-1!==n.type.indexOf("click")&&B.call(this),e.bindEvents=!0)},M=function(){var e=t(this).data(o),n="mTS_"+e.idx,a=t("#mTS_"+e.idx+",#mTS_"+e.idx+"_container,#mTS_"+e.idx+"_buttonUp,#mTS_"+e.idx+"_buttonDown,#mTS_"+e.idx+"_buttonLeft,#mTS_"+e.idx+"_buttonRight"),i=t("#mTS_"+e.idx+"_container");e.bindEvents&&(a.each((function(){t(this).unbind("."+n)})),clearTimeout(i[0].onCompleteTimeout),q(i[0],"onCompleteTimeout"),e.bindEvents=!1)},C=function(e,n,a){var i=t(this).data(o),r=i.opt;if(-1!==r.type.indexOf("click")){a||(a=r.axis);var l=[t("#mTS_"+i.idx+"_buttonUp"),t("#mTS_"+i.idx+"_buttonDown"),t("#mTS_"+i.idx+"_buttonLeft"),t("#mTS_"+i.idx+"_buttonRight")],s="mTS-hidden";"x"!==a&&(!i.overflowed[0]||e||n?sel=1===n?[l[0],l[1]]:2===n?[l[1],l[0]]:[l[0].add(l[1]),null]:sel=[i.overflowed[1]?null:l[2].add(l[3]),l[0].add(l[1])]),"y"!==a&&(!i.overflowed[1]||e||n?sel=1===n?[l[2],l[3]]:2===n?[l[3],l[2]]:[l[2].add(l[3]),null]:sel=[i.overflowed[0]?null:l[0].add(l[1]),l[2].add(l[3])]),sel[0]&&sel[0].addClass(s),sel[1]&&sel[1].removeClass(s)}},k=function(t){switch(t.type){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return[t.originalEvent.pageY,t.originalEvent.pageX];case"touchstart":case"touchmove":case"touchend":var e=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0];return[e.pageY,e.pageX];default:return[t.pageY,t.pageX]}},O=function(t){return a||-1!==t.type.indexOf("touch")||void 0!==t.pointerType&&(2===t.pointerType||"touch"===t.pointerType)?"touch":"mouse"},I=function(){var e,n,i,r,l,s,c,d,u,h,f,p=t(this),m=p.data(o),v=m.opt,x="mTS_"+m.idx,T=t("#mTS_"+m.idx),S=t("#mTS_"+m.idx+"_container"),g=[],w=[],b="yx"===v.axis?"none":"all",_=[];function y(t,e){var n=[1.5*e,2*e,e/1.5,e/2];return t>90?e>4?n[0]:n[3]:t>60?e>3?n[3]:n[2]:t>30?e>8?n[1]:e>6?n[0]:e>4?e:n[2]:e>8?e:n[3]}function M(t,e,n,a,i){t&&R(p,-t.toString(),{dur:e,easing:n,dir:a,overwrite:i})}S.bind("touchstart."+x+" pointerdown."+x+" MSPointerDown."+x,(function(t){if(j(t)){p.removeClass("mTS_touch_action");var a=S.offset();e=k(t)[0]-a.top,n=k(t)[1]-a.left,_=[k(t)[0],k(t)[1]]}})).bind("touchmove."+x+" pointermove."+x+" MSPointerMove."+x,(function(t){if(j(t)){t.stopImmediatePropagation(),s=V();var a=T.offset(),i=k(t)[0]-a.top,o=k(t)[1]-a.left,r="linearOut";if(g.push(i),w.push(o),_[2]=Math.abs(k(t)[0]-_[0]),_[3]=Math.abs(k(t)[1]-_[1]),m.overflowed[0])var l=T.height()-S.height(),c=e-i>0&&i-e>l&&2*_[3]<_[2];if(m.overflowed[1])var d=T.width()-S.width(),u=n-o>0&&o-n>d&&2*_[2]<_[3];c||u?t.preventDefault():p.addClass("mTS_touch_action"),h="yx"===v.axis?[e-i,n-o]:"x"===v.axis?[null,n-o]:[e-i,null],S[0].idleTimer=250,m.overflowed[0]&&M(h[0],0,r,"y","all"),m.overflowed[1]&&M(h[1],0,r,"x",b)}})),T.bind("touchstart."+x+" pointerdown."+x+" MSPointerDown."+x,(function(t){if(j(t)){t.stopImmediatePropagation(),a=!0,F(p),l=V();var e=T.offset();i=k(t)[0]-e.top,r=k(t)[1]-e.left,g=[],w=[]}})).bind("touchend."+x+" pointerup."+x+" MSPointerUp."+x,(function(t){if(j(t)){t.stopImmediatePropagation(),c=V();var e=T.offset(),n=k(t)[0]-e.top,a=k(t)[1]-e.left;if(!(c-s>30)){var o="easeOut",p=(u=1e3/(c-l))<2.5,x=p?[g[g.length-2],w[w.length-2]]:[0,0];d=p?[n-x[0],a-x[1]]:[n-i,a-r];var _=[Math.abs(d[0]),Math.abs(d[1])];u=p?[Math.abs(d[0]/4),Math.abs(d[1]/4)]:[u,u];var C=[Math.abs(S[0].offsetTop)-d[0]*y(_[0]/u[0],u[0]),Math.abs(S[0].offsetLeft)-d[1]*y(_[1]/u[1],u[1])];h="yx"===v.axis?[C[0],C[1]]:"x"===v.axis?[null,C[1]]:[C[0],null],f=[4*_[0]+60*v.speed,4*_[1]+60*v.speed];var O=parseInt(v.contentTouchScroll)||0;h[0]=_[0]>O?h[0]:0,h[1]=_[1]>O?h[1]:0,m.overflowed[0]&&M(h[0],f[0],o,"y",b),m.overflowed[1]&&M(h[1],f[1],o,"x",b)}}}))},L=function(){var n,a,i,r=t(this),l=r.data(o),s=l.opt,c="mTS_"+l.idx,d=t("#mTS_"+l.idx),u=t("#mTS_"+l.idx+"_container"),h=e.navigator.pointerEnabled?"pointermove":e.navigator.msPointerEnabled?"MSPointerMove":"mousemove";d.bind(h+"."+c,(function(t){if("touch"!==O(t.originalEvent||t)&&(l.overflowed[0]||l.overflowed[1])){t.preventDefault();var e=d.height(),o=u.height(),c=d.width(),h=u.width(),f=h/c*7e3/(s.speed||1);n=[k(t)[0]-d.offset().top,k(t)[1]-d.offset().left],a=[n[0]/d.height(),n[1]/d.width()],i=[Math.round(-(o-e)*a[0]),Math.round(-(h-c)*a[1])],"x"!==s.axis&&l.overflowed[0]&&R(r,i[0].toString(),{dir:"y",dur:f,easing:"easeOut"}),"y"!==s.axis&&l.overflowed[1]&&R(r,i[1].toString(),{dir:"x",dur:f,easing:"easeOut"})}}))},A=function(){var n,i,r,l,s,c=t(this),d=c.data(o),u=d.opt,h="mTS_"+d.idx,f=t("#mTS_"+d.idx),p=t("#mTS_"+d.idx+"_container"),m=e.navigator.pointerEnabled?["pointerover","pointermove","pointerout"]:e.navigator.msPointerEnabled?["MSPointerOver","MSPointerMove","MSPointerOut"]:["mouseenter","mousemove","mouseleave"],v=e.requestAnimationFrame?0:17,x=u.speed,T=parseInt(u.type.split("hover-")[1])||1,S=x*T/100,g=[0,0];function w(){if(!a){l=[r[0]+p[0].offsetTop,r[1]+p[0].offsetLeft];var t=[f.height()-p.height(),f.width()-p.width()];"x"!==u.axis&&d.overflowed[0]&&(l[0]=l[0]>0?0:l[0]<t[0]?t[0]:l[0],r[0]&&!g[0]&&R(c,l[0],{dir:"y",dur:0,easing:"linear"}),(l[0]>=0||l[0]<=t[0])&&(g[0]=1)),"y"!==u.axis&&d.overflowed[1]&&(l[1]=l[1]>0?0:l[1]<t[1]?t[1]:l[1],r[1]&&!g[1]&&R(c,l[1],{dir:"x",dur:0,easing:"linear"}),(l[1]>=0||l[1]<=t[1])&&(g[1]=1)),s=setTimeout((function(){f[0].rAF=n(w)}),v)}}f.bind(m[0]+"."+h,(function(t){"touch"!==O(t.originalEvent||t)&&(d.overflowed[0]||d.overflowed[1])&&function(){if(f[0].rAF)return;n=e.requestAnimationFrame?e.requestAnimationFrame:function(t){return setTimeout(t,17)},f[0].rAF=n(w)}()})).bind(m[1]+"."+h,(function(t){"touch"!==O(t.originalEvent||t)&&(d.overflowed[0]||d.overflowed[1])&&(i=[k(t)[0]-f.offset().top,k(t)[1]-f.offset().left],(r=[Math.round(Math.cos(i[0]/f.height()*Math.PI)*x),Math.round(Math.cos(i[1]/f.width()*Math.PI)*x)])[0]=r[0]<=-S?r[0]+=S:r[0]>=S?r[0]-=S:r[0]=0,r[1]=r[1]<=-S?r[1]+=S:r[1]>=S?r[1]-=S:r[1]=0,g=[0,0])})).bind(m[2]+"."+h,(function(t){"touch"!==O(t.originalEvent||t)&&(d.overflowed[0]||d.overflowed[1])&&function(){if(null==f[0].rAF)return;e.requestAnimationFrame?e.cancelAnimationFrame(f[0].rAF):clearTimeout(f[0].rAF);clearTimeout(s),f[0].rAF=null}()}))},B=function(){var e=t(this),n=e.data(o),a=n.opt,i="mTS_"+n.idx,r=t("#mTS_"+n.idx),l=t("#mTS_"+n.idx+"_container"),s=[t("#mTS_"+n.idx+"_buttonUp"),t("#mTS_"+n.idx+"_buttonDown"),t("#mTS_"+n.idx+"_buttonLeft"),t("#mTS_"+n.idx+"_buttonRight")];s[0].add(s[1]).add(s[2]).add(s[3]).bind("click."+i,(function(i){if(H(i)&&(n.overflowed[0]||n.overflowed[1])&&(i.preventDefault(),!n.tweenRunning)){if("x"!==a.axis&&n.overflowed[0]){var o=r.height(),s="click-thumb"===a.type?0:t(this).hasClass("mTSButtonUp")?"+=":t(this).hasClass("mTSButtonDown")?"-=":0;if("click-thumb"!==a.type)var c=parseInt(a.type.split("click-")[1])||1,d=s?[s+o*c/100,null]:0;else{var u=z.call(e[0])[0],f=z.call(e[0])[1];if(t(this).hasClass("mTSButtonDown"))d=f?f[0].offsetTop-parseInt(f.css("margin-bottom"))-o:989999;else if(t(this).hasClass("mTSButtonUp")){d=u?u[0].offsetTop-parseInt(u.css("margin-top")):0;if(0===l[0].offsetTop)return}}}if("y"!==a.axis&&n.overflowed[1]){var p=r.width();s="click-thumb"===a.type?0:t(this).hasClass("mTSButtonLeft")?"+=":t(this).hasClass("mTSButtonRight")?"-=":0;if("click-thumb"!==a.type)c=parseInt(a.type.split("click-")[1])||1,d=s?[null,s+p*c/100]:d;else{u=z.call(e[0])[2],f=z.call(e[0])[3];if(t(this).hasClass("mTSButtonRight"))d=f?f[0].offsetLeft-parseInt(f.css("margin-right"))-p:989999;else if(t(this).hasClass("mTSButtonLeft")){d=u?u[0].offsetLeft-parseInt(u.css("margin-left")):0;if(0===l[0].offsetLeft)return}}}null!==d&&h.scrollTo.call(e[0],d,{duration:0})}}))},z=function(){var e,n,a,i,r=t(this).data(o),l=(r.opt,t("#mTS_"+r.idx+"_container")),s=t("#mTS_"+r.idx),c=l.find(".mTSThumbContainer");return c.each((function(){var o=t(this),r=[Math.round(o.offset().top-l.offset().top+l[0].offsetTop),Math.round(o.offset().left-l.offset().left+l[0].offsetLeft)];if(r[0]<=0-parseInt(o.css("margin-top")))e=0===r[0]?c.eq(o.index()-1):c.eq(o.index());else if(r[0]<=s.height()+parseInt(o.css("margin-bottom"))){var d=c.eq(o.index()+1);n=d.length?d:null}if(r[1]<=0-parseInt(o.css("margin-left")))a=0===r[1]?c.eq(o.index()-1):c.eq(o.index());else if(r[1]<=s.width()+parseInt(o.css("margin-right"))){var u=c.eq(o.index()+1);i=u.length?u:null}})),[e,n,a,i]},P=function(e){var n=t(this).data(o).opt,a=[];return"function"==typeof e&&(e=e()),e instanceof Array?a=e.length>1?[e[0],e[1]]:"x"===n.axis?[null,e[0]]:[e[0],null]:(a[0]=e.y?e.y:e.x||"x"===n.axis?null:e,a[1]=e.x?e.x:e.y||"y"===n.axis?null:e),"function"==typeof a[0]&&(a[0]=a[0]()),"function"==typeof a[1]&&(a[1]=a[1]()),a},E=function(e,n){if(null!=e&&void 0!==e){var a=t(this),i=a.data(o),r=i.opt,l=t("#mTS_"+i.idx),s=t("#mTS_"+i.idx+"_container"),c=typeof e;n||(n="x"===r.axis?"x":"y");var d="x"===n?s.width():s.height(),u="x"===n?s.offset().left:s.offset().top,f="x"===n?s[0].offsetLeft:s[0].offsetTop,p="x"===n?"left":"top";switch(c){case"function":return e();case"object":if(e.nodeType)var m="x"===n?t(e).offset().left:t(e).offset().top;else if(e.jquery){if(!e.length)return;m="x"===n?e.offset().left:e.offset().top}return m-u;case"string":case"number":if(N(e))return Math.abs(e);if(-1!==e.indexOf("%"))return Math.abs(d*parseInt(e)/100);if(-1!==e.indexOf("-="))return Math.abs(f-parseInt(e.split("-=")[1]));if(-1!==e.indexOf("+=")){var v=f+parseInt(e.split("+=")[1]);return v>=0?0:Math.abs(v)}if(-1!==e.indexOf("px")&&N(e.split("px")[0]))return Math.abs(e.split("px")[0]);if("top"===e||"left"===e)return 0;if("bottom"===e)return Math.abs(l.height()-s.height());if("right"===e)return Math.abs(l.width()-s.width());if("first"===e||"last"===e){var x=s.find(":"+e);return(m="x"===n?t(x).offset().left:t(x).offset().top)-u}return t(e).length?(m="x"===n?t(e).offset().left:t(e).offset().top)-u:(s.css(p,e),void h.update.call(null,a[0]))}}},D=function(e){var n=t(this),a=n.data(o),i=a.opt,r=t("#mTS_"+a.idx),l=t("#mTS_"+a.idx+"_container");if(e)return clearTimeout(l[0].autoUpdate),void q(l[0],"autoUpdate");var s,c,d,u=v(),f=[l.height(),l.width(),r.height(),r.width(),n.height(),n.width()],p=m();function m(){var t=0;return i.advanced.updateOnImageLoad&&(t=l.find("img").length),t}function v(){!0===i.advanced.updateOnSelectorChange&&(i.advanced.updateOnSelectorChange="*");var e=0,n=l.find(i.advanced.updateOnSelectorChange);return i.advanced.updateOnSelectorChange&&n.length>0&&n.each((function(){e+=t(this).height()+t(this).width()})),e}function x(){clearTimeout(l[0].autoUpdate),h.update.call(null,n[0])}!function t(){if(clearTimeout(l[0].autoUpdate),0===n.parents("html").length)return void(n=null);l[0].autoUpdate=setTimeout((function(){if(i.advanced.updateOnSelectorChange&&(s=v())!==u)return x(),void(u=s);i.advanced.updateOnContentResize&&((c=[l.height(),l.width(),r.height(),r.width(),n.height(),n.width()])[0]===f[0]&&c[1]===f[1]&&c[2]===f[2]&&c[3]===f[3]&&c[4]===f[4]&&c[5]===f[5]||(x(),f=c)),i.advanced.updateOnImageLoad&&(d=m())!==p&&(l.find("img").each((function(){!function(t){var e=new Image;function n(t,e){return function(){return e.apply(t,arguments)}}function a(){this.onload=null,x()}e.onload=n(e,a),e.src=t}(this.src)})),p=d),(i.advanced.updateOnSelectorChange||i.advanced.updateOnContentResize||i.advanced.updateOnImageLoad)&&t()}),60)}()},F=function(e){var n=e.data(o);t("#mTS_"+n.idx+"_container").each((function(){G.call(this)}))},R=function(e,n,a){var i=e.data(o),r=i.opt,l={trigger:"internal",dir:"y",easing:"easeOut",dur:60*r.speed,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},s=(a=t.extend(l,a),t("#mTS_"+i.idx)),c=t("#mTS_"+i.idx+"_container"),d=r.callbacks.onTotalScrollOffset?P.call(e,r.callbacks.onTotalScrollOffset):[0,0],u=r.callbacks.onTotalScrollBackOffset?P.call(e,r.callbacks.onTotalScrollBackOffset):[0,0];switch(i.trigger=a.trigger,0===s.scrollTop()&&0===s.scrollLeft()||s.scrollTop(0).scrollLeft(0),a.dir){case"x":var h="left",f=c[0].offsetLeft,p=s.width()-c.width(),m=n,v=d[1],x=u[1],T=v>0?v:0,S=x>0?x:0;break;case"y":h="top",f=c[0].offsetTop,p=s.height()-c.height(),m=n,v=d[0],x=u[0],T=v>0?v:0,S=x>0?x:0}function g(t){return i&&r.callbacks[t]&&"function"==typeof r.callbacks[t]}function w(){var t=[c[0].offsetTop,c[0].offsetLeft],n=[c.height(),c.width()],i=[s.height(),s.width()];e[0].mts={content:c,top:t[0],left:t[1],topPct:Math.round(100*Math.abs(t[0])/(Math.abs(n[0])-i[0])),leftPct:Math.round(100*Math.abs(t[1])/(Math.abs(n[1])-i[1])),direction:a.dir}}m>=0?(m=0,C.call(e,!1,1,a.dir)):m<=p?(m=p,C.call(e,!1,2,a.dir)):(m=m,C.call(e,!1,0,a.dir)),e[0].mts||(w(),g("onInit")&&r.callbacks.onInit.call(e[0])),clearTimeout(c[0].onCompleteTimeout),!i.tweenRunning&&(0===f&&m>=0||f===p&&m<=p)||U(c[0],h,Math.round(m),a.dur,a.easing,a.overwrite,{onStart:function(){a.callbacks&&a.onStart&&!i.tweenRunning&&(g("onScrollStart")&&(w(),r.callbacks.onScrollStart.call(e[0])),i.tweenRunning=!0,i.cbOffsets=[r.callbacks.alwaysTriggerOffsets||f>=p+v,r.callbacks.alwaysTriggerOffsets||f<=-x])},onUpdate:function(){a.callbacks&&a.onUpdate&&g("whileScrolling")&&(w(),r.callbacks.whileScrolling.call(e[0]))},onComplete:function(){if(a.callbacks&&a.onComplete){"yx"===r.axis&&clearTimeout(c[0].onCompleteTimeout);var t=c[0].idleTimer||0;c[0].onCompleteTimeout=setTimeout((function(){g("onScroll")&&(w(),r.callbacks.onScroll.call(e[0])),g("onTotalScroll")&&m<=p+T&&i.cbOffsets[0]&&(w(),r.callbacks.onTotalScroll.call(e[0])),g("onTotalScrollBack")&&m>=-S&&i.cbOffsets[1]&&(w(),r.callbacks.onTotalScrollBack.call(e[0])),i.tweenRunning=!1,c[0].idleTimer=0}),t)}}})},U=function(t,n,a,i,o,r,l){t._mTween||(t._mTween={top:{},left:{}});var s,c,d=(l=l||{}).onStart||function(){},u=l.onUpdate||function(){},h=l.onComplete||function(){},f=V(),p=0,m=t.offsetTop,v=t.style,x=t._mTween[n];"left"===n&&(m=t.offsetLeft);var T=a-m;function S(){x.stop||(p||d.call(),p=V()-f,g(),p>=x.time&&(x.time=p>x.time?p+s-(p-x.time):p+s-1,x.time<p+1&&(x.time=p+1)),x.time<i?x.id=c(S):h.call())}function g(){i>0?(x.currVal=function(t,e,n,a,i){switch(i){case"linear":return n*t/a+e;case"linearOut":return t/=a,t--,n*Math.sqrt(1-t*t)+e;case"easeInOutSmooth":return(t/=a/2)<1?n/2*t*t+e:-n/2*(--t*(t-2)-1)+e;case"easeInOutStrong":return(t/=a/2)<1?n/2*Math.pow(2,10*(t-1))+e:(t--,n/2*(2-Math.pow(2,-10*t))+e);case"easeInOut":return(t/=a/2)<1?n/2*t*t*t+e:n/2*((t-=2)*t*t+2)+e;case"easeOutSmooth":return t/=a,-n*(--t*t*t*t-1)+e;case"easeOutStrong":return n*(1-Math.pow(2,-10*t/a))+e;default:var o=(t/=a)*t,r=o*t;return e+n*(.499999999999997*r*o+-2.5*o*o+5.5*r+-6.5*o+4*t)}}(x.time,m,T,i,o),v[n]=Math.round(x.currVal)+"px"):v[n]=a+"px",u.call()}x.stop=0,"none"!==r&&function(){if(null==x.id)return;e.requestAnimationFrame?e.cancelAnimationFrame(x.id):clearTimeout(x.id);x.id=null}(),s=1e3/60,x.time=p+s,c=e.requestAnimationFrame?e.requestAnimationFrame:function(t){return g(),setTimeout(t,.01)},x.id=c(S)},V=function(){return e.performance&&e.performance.now?e.performance.now():e.performance&&e.performance.webkitNow?e.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},G=function(){var t=this;t._mTween||(t._mTween={top:{},left:{}});for(var n=["top","left"],a=0;a<n.length;a++){var i=n[a];t._mTween[i].id&&(e.requestAnimationFrame?e.cancelAnimationFrame(t._mTween[i].id):clearTimeout(t._mTween[i].id),t._mTween[i].id=null,t._mTween[i].stop=1)}},q=function(t,e){try{delete t[e]}catch(n){t[e]=null}},H=function(t){return!(t.which&&1!==t.which)},j=function(t){var e=t.originalEvent.pointerType;return!(e&&"touch"!==e&&2!==e)},N=function(t){return!isNaN(parseFloat(t))&&isFinite(t)};t.fn[i]=function(e){return h[e]?h[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void t.error("Method "+e+" does not exist"):h.init.apply(this,arguments)},t[i]=function(e){return h[e]?h[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void t.error("Method "+e+" does not exist"):h.init.apply(this,arguments)},t[i].defaults=l,e[i]=!0,t(e).load((function(){var e=t(r),n=[];if(e.length){e.each((function(){var e=t(this),a=e.data("mts-axis")||l.axis,i=e.data("mts-type")||l.type,o="auto-mTS-"+a+"-"+i+"-"+(e.data("mts-theme")||l.theme),r=[o,a,i];e.addClass(o),-1===t.inArray(o,n)&&n.push(r)}));for(var a=0;a<n.length;a++)t("."+n[a][0])[i]({axis:n[a][1],type:n[a][2]})}}))}(jQuery,window,document);