!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof module&&module.exports?module.exports=e:e(jQuery,window,document)}(function(P){var z,f,H,a,n,l,i,p,F,S,U,e,t,o;e="function"==typeof define&&define.amd,t="undefined"!=typeof module&&module.exports,o="https:"==document.location.protocol?"https:":"http:",e||(t?require("jquery-mousewheel")(P):P.event.special.mousewheel||P("head").append(decodeURI("%3Cscript src="+o+"//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js%3E%3C/script%3E"))),f="mCustomScrollbar",H="mCS",a=".mCustomScrollbar",n={setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:100,autoDraggerLength:!0,alwaysShowScrollbar:0,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",deltaFactor:"auto",disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,documentTouchScroll:!0,advanced:{autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:"auto",autoUpdateTimeout:60},theme:"light",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},l=0,i={},p=window.attachEvent&&!window.addEventListener?1:0,F=!1,U=!(S=["mCSB_dragger_onDrag","mCSB_scrollTools_onDrag","mCS_img_loaded","mCS_disabled","mCS_destroyed","mCS_no_scrollbar","mCS-autoHide","mCS-dir-rtl","mCS_no_scrollbar_y","mCS_no_scrollbar_x","mCS_y_hidden","mCS_x_hidden","mCSB_draggerContainer","mCSB_buttonUp","mCSB_buttonDown","mCSB_buttonLeft colored_theme_hover_text","mCSB_buttonRight colored_theme_hover_text"]),methods={init:function(r){var r=P.extend(!0,{},n,r),e=_selector.call(this);if(r.live){var t=r.liveSelector||this.selector||a,o=P(t);if("off"===r.live)return void removeLiveTimers(t);i[t]=setTimeout(function(){o.mCustomScrollbar(r),"once"===r.live&&o.length&&removeLiveTimers(t)},500)}else removeLiveTimers(t);return r.setWidth=r.set_width?r.set_width:r.setWidth,r.setHeight=r.set_height?r.set_height:r.setHeight,r.axis=r.horizontalScroll?"x":_findAxis(r.axis),r.scrollInertia=0<r.scrollInertia&&r.scrollInertia<17?17:r.scrollInertia,"object"!=typeof r.mouseWheel&&1==r.mouseWheel&&(r.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),r.mouseWheel.scrollAmount=r.mouseWheelPixels?r.mouseWheelPixels:r.mouseWheel.scrollAmount,r.mouseWheel.normalizeDelta=r.advanced.normalizeMouseWheelDelta?r.advanced.normalizeMouseWheelDelta:r.mouseWheel.normalizeDelta,r.scrollButtons.scrollType=_findScrollButtonsType(r.scrollButtons.scrollType),_theme(r),P(e).each(function(){var e=P(this);if(!e.data(H)){e.data(H,{idx:++l,opt:r,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:e.css("direction"),cbOffsets:null,trigger:null,poll:{size:{o:0,n:0},img:{o:0,n:0},change:{o:0,n:0}}});var t=e.data(H),o=t.opt,a=e.data("mcs-axis"),n=e.data("mcs-scrollbar-position"),i=e.data("mcs-theme");a&&(o.axis=a),n&&(o.scrollbarPosition=n),i&&(o.theme=i,_theme(o)),_pluginMarkup.call(this),t&&o.callbacks.onCreate&&"function"==typeof o.callbacks.onCreate&&o.callbacks.onCreate.call(this),P("#mCSB_"+t.idx+"_container img:not(."+S[2]+")").addClass(S[2]),methods.update.call(null,e)}})},update:function(e,l){var t=e||_selector.call(this);return P(t).each(function(){var e=P(this);if(e.data(H)){var t=e.data(H),o=t.opt,a=P("#mCSB_"+t.idx+"_container"),n=P("#mCSB_"+t.idx),i=[P("#mCSB_"+t.idx+"_dragger_vertical"),P("#mCSB_"+t.idx+"_dragger_horizontal")];if(!a.length)return;t.tweenRunning&&_stop(e),l&&t&&o.callbacks.onBeforeUpdate&&"function"==typeof o.callbacks.onBeforeUpdate&&o.callbacks.onBeforeUpdate.call(this),e.hasClass(S[3])&&e.removeClass(S[3]),e.hasClass(S[4])&&e.removeClass(S[4]),n.css("max-height","none"),n.height()!==e.height()&&n.css("max-height",e.height()),_expandContentHorizontally.call(this),"y"===o.axis||o.advanced.autoExpandHorizontalScroll||a.css("width",_contentWidth(a)),t.overflowed=_overflowed.call(this),_scrollbarVisibility.call(this),o.autoDraggerLength&&_setDraggerLength.call(this),_scrollRatio.call(this),_bindEvents.call(this);var r=[Math.abs(a[0].offsetTop),Math.abs(a[0].offsetLeft)];"x"!==o.axis&&(t.overflowed[0]?i[0].height()>i[0].parent().height()?_resetContentPosition.call(this):(_scrollTo(e,r[0].toString(),{dir:"y",dur:0,overwrite:"none"}),t.contentReset.y=null):(_resetContentPosition.call(this),"y"===o.axis?_unbindEvents.call(this):"yx"===o.axis&&t.overflowed[1]&&_scrollTo(e,r[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==o.axis&&(t.overflowed[1]?i[1].width()>i[1].parent().width()?_resetContentPosition.call(this):(_scrollTo(e,r[1].toString(),{dir:"x",dur:0,overwrite:"none"}),t.contentReset.x=null):(_resetContentPosition.call(this),"x"===o.axis?_unbindEvents.call(this):"yx"===o.axis&&t.overflowed[0]&&_scrollTo(e,r[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),l&&t&&(2===l&&o.callbacks.onImageLoad&&"function"==typeof o.callbacks.onImageLoad?o.callbacks.onImageLoad.call(this):3===l&&o.callbacks.onSelectorChange&&"function"==typeof o.callbacks.onSelectorChange?o.callbacks.onSelectorChange.call(this):o.callbacks.onUpdate&&"function"==typeof o.callbacks.onUpdate&&o.callbacks.onUpdate.call(this)),_autoUpdate.call(this)}})},scrollTo:function(l,s){if(void 0!==l&&null!=l){var e=_selector.call(this);return P(e).each(function(){var e=P(this);if(e.data(H)){var t=e.data(H),o=t.opt,a={trigger:"external",scrollInertia:o.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},n=P.extend(!0,{},a,s),i=_arr.call(this,l),r=0<n.scrollInertia&&n.scrollInertia<17?17:n.scrollInertia;i[0]=_to.call(this,i[0],"y"),i[1]=_to.call(this,i[1],"x"),n.moveDragger&&(i[0]*=t.scrollRatio.y,i[1]*=t.scrollRatio.x),n.dur=_isTabHidden()?0:r,setTimeout(function(){null!==i[0]&&void 0!==i[0]&&"x"!==o.axis&&t.overflowed[0]&&(n.dir="y",n.overwrite="all",_scrollTo(e,i[0].toString(),n)),null!==i[1]&&void 0!==i[1]&&"y"!==o.axis&&t.overflowed[1]&&(n.dir="x",n.overwrite="none",_scrollTo(e,i[1].toString(),n))},n.timeout)}})}},stop:function(){var e=_selector.call(this);return P(e).each(function(){var e=P(this);e.data(H)&&_stop(e)})},disable:function(t){var e=_selector.call(this);return P(e).each(function(){var e=P(this);e.data(H)&&(e.data(H),_autoUpdate.call(this,"remove"),_unbindEvents.call(this),t&&_resetContentPosition.call(this),_scrollbarVisibility.call(this,!0),e.addClass(S[3]))})},destroy:function(){var r=_selector.call(this);return P(r).each(function(){var e=P(this);if(e.data(H)){var t=e.data(H),o=t.opt,a=P("#mCSB_"+t.idx),n=P("#mCSB_"+t.idx+"_container"),i=P(".mCSB_"+t.idx+"_scrollbar");o.live&&removeLiveTimers(o.liveSelector||P(r).selector),_autoUpdate.call(this,"remove"),_unbindEvents.call(this),_resetContentPosition.call(this),e.removeData(H),_delete(this,"mcs"),i.remove(),n.find("img."+S[2]).removeClass(S[2]),a.replaceWith(n.contents()),e.removeClass(f+" _"+H+"_"+t.idx+" "+S[6]+" "+S[7]+" "+S[5]+" "+S[3]).addClass(S[4])}})}},_selector=function(){return"object"!=typeof P(this)||P(this).length<1?a:this},_theme=function(e){e.autoDraggerLength=!(-1<P.inArray(e.theme,["rounded","rounded-dark","rounded-dots","rounded-dots-dark"]))&&e.autoDraggerLength,e.autoExpandScrollbar=!(-1<P.inArray(e.theme,["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"]))&&e.autoExpandScrollbar,e.scrollButtons.enable=!(-1<P.inArray(e.theme,["minimal","minimal-dark"]))&&e.scrollButtons.enable,e.autoHideScrollbar=-1<P.inArray(e.theme,["minimal","minimal-dark"])||e.autoHideScrollbar,e.scrollbarPosition=-1<P.inArray(e.theme,["minimal","minimal-dark"])?"outside":e.scrollbarPosition},removeLiveTimers=function(e){i[e]&&(clearTimeout(i[e]),_delete(i,e))},_findAxis=function(e){return"yx"===e||"xy"===e||"auto"===e?"yx":"x"===e||"horizontal"===e?"x":"y"},_findScrollButtonsType=function(e){return"stepped"===e||"pixels"===e||"step"===e||"click"===e?"stepped":"stepless"},_pluginMarkup=function(){var e=P(this),t=e.data(H),o=t.opt,a=o.autoExpandScrollbar?" "+S[1]+"_expand":"",n=["<div id='mCSB_"+t.idx+"_scrollbar_vertical' class='mCSB_scrollTools mCSB_"+t.idx+"_scrollbar mCS-"+o.theme+" mCSB_scrollTools_vertical"+a+"'><div class='"+S[12]+"'><div id='mCSB_"+t.idx+"_dragger_vertical' class='mCSB_dragger' style='position:absolute;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>","<div id='mCSB_"+t.idx+"_scrollbar_horizontal' class='mCSB_scrollTools mCSB_"+t.idx+"_scrollbar mCS-"+o.theme+" mCSB_scrollTools_horizontal"+a+"'><div class='"+S[12]+"'><div id='mCSB_"+t.idx+"_dragger_horizontal' class='mCSB_dragger' style='position:absolute;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>"],i="yx"===o.axis?"mCSB_vertical_horizontal":"x"===o.axis?"mCSB_horizontal":"mCSB_vertical",r="yx"===o.axis?n[0]+n[1]:"x"===o.axis?n[1]:n[0],l="yx"===o.axis?"<div id='mCSB_"+t.idx+"_container_wrapper' class='mCSB_container_wrapper' />":"",s=o.autoHideScrollbar?" "+S[6]:"",c="x"!==o.axis&&"rtl"===t.langDir?" "+S[7]:"";o.setWidth&&e.css("width",o.setWidth),o.setHeight&&e.css("height",o.setHeight),o.setLeft="y"!==o.axis&&"rtl"===t.langDir?"989999px":o.setLeft,e.addClass(f+" _"+H+"_"+t.idx+s+c).wrapInner("<div id='mCSB_"+t.idx+"' class='mCustomScrollBox mCS-"+o.theme+" "+i+"'><div id='mCSB_"+t.idx+"_container' class='mCSB_container' style='position:relative; top:"+o.setTop+"; left:"+o.setLeft+";' dir='"+t.langDir+"' /></div>");var d=P("#mCSB_"+t.idx),u=P("#mCSB_"+t.idx+"_container");"y"===o.axis||o.advanced.autoExpandHorizontalScroll||u.css("width",_contentWidth(u)),"outside"===o.scrollbarPosition?("static"===e.css("position")&&e.css("position","relative"),e.css("overflow","visible"),d.addClass("mCSB_outside").after(r)):(d.addClass("mCSB_inside").append(r),u.wrap(l)),_scrollButtons.call(this);var h=[P("#mCSB_"+t.idx+"_dragger_vertical"),P("#mCSB_"+t.idx+"_dragger_horizontal")];h[0].css("min-height",h[0].height()),h[1].css("min-width",h[1].width())},_contentWidth=function(e){var t=[e[0].scrollWidth,Math.max.apply(Math,e.children().map(function(){return P(this).outerWidth(!0)}).get())],o=e.parent().width();return o<t[0]?t[0]:o<t[1]?t[1]:"100%"},_expandContentHorizontally=function(){var e=P(this),t=e.data(H),o=t.opt,a=P("#mCSB_"+t.idx+"_container");if(o.advanced.autoExpandHorizontalScroll&&"y"!==o.axis){a.css({width:"auto","min-width":0,"overflow-x":"scroll"});var n=Math.ceil(a[0].scrollWidth);3===o.advanced.autoExpandHorizontalScroll||2!==o.advanced.autoExpandHorizontalScroll&&n>a.parent().width()?a.css({width:n,"min-width":"100%","overflow-x":"inherit"}):a.css({"overflow-x":"inherit",position:"absolute"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:Math.ceil(a[0].getBoundingClientRect().right+.4)-Math.floor(a[0].getBoundingClientRect().left),"min-width":"100%",position:"relative"}).unwrap()}},_scrollButtons=function(){var e=P(this),t=e.data(H),o=t.opt,a=P(".mCSB_"+t.idx+"_scrollbar:first"),n=_isNumeric(o.scrollButtons.tabindex)?"tabindex='"+o.scrollButtons.tabindex+"'":"",i=["<a href='#' class='"+S[13]+"' "+n+" />","<a href='#' class='"+S[14]+"' "+n+" />","<a href='#' class='"+S[15]+"' "+n+" ><i class='svg right'><svg width='12' height='6.969' viewBox='0 0 12 6.969'><path class='cls-1' d='M361.691,401.707a1,1,0,0,1-1.414,0L356,397.416l-4.306,4.291a1,1,0,0,1-1.414,0,0.991,0.991,0,0,1,0-1.406l5.016-5a1.006,1.006,0,0,1,1.415,0l4.984,5A0.989,0.989,0,0,1,361.691,401.707Z' transform='translate(-350 -395.031)'></path></svg></i></a>","<a href='#' class='"+S[16]+"' "+n+" ><i class='svg right'><svg width='12' height='6.969' viewBox='0 0 12 6.969'><path class='cls-1' d='M361.691,401.707a1,1,0,0,1-1.414,0L356,397.416l-4.306,4.291a1,1,0,0,1-1.414,0,0.991,0.991,0,0,1,0-1.406l5.016-5a1.006,1.006,0,0,1,1.415,0l4.984,5A0.989,0.989,0,0,1,361.691,401.707Z' transform='translate(-350 -395.031)'></path></svg></i></a>"],r=["x"===o.axis?i[2]:i[0],"x"===o.axis?i[3]:i[1],i[2],i[3]];o.scrollButtons.enable&&a.prepend(r[0]).append(r[1]).next(".mCSB_scrollTools").prepend(r[2]).append(r[3])},_setDraggerLength=function(){var e=P(this),t=e.data(H),o=P("#mCSB_"+t.idx),a=P("#mCSB_"+t.idx+"_container"),n=[P("#mCSB_"+t.idx+"_dragger_vertical"),P("#mCSB_"+t.idx+"_dragger_horizontal")],i=[o.height()/a.outerHeight(!1),o.width()/a.outerWidth(!1)],r=[parseInt(n[0].css("min-height")),Math.round(i[0]*n[0].parent().height()),parseInt(n[1].css("min-width")),Math.round(i[1]*n[1].parent().width())],l=p&&r[1]<r[0]?r[0]:r[1],s=p&&r[3]<r[2]?r[2]:r[3];n[0].css({height:l,"max-height":n[0].parent().height()-10}).find(".mCSB_dragger_bar").css({"line-height":r[0]+"px"}),n[1].css({width:s,"max-width":n[1].parent().width()-10})},_scrollRatio=function(){var e=P(this),t=e.data(H),o=P("#mCSB_"+t.idx),a=P("#mCSB_"+t.idx+"_container"),n=[P("#mCSB_"+t.idx+"_dragger_vertical"),P("#mCSB_"+t.idx+"_dragger_horizontal")],i=[a.outerHeight(!1)-o.height(),a.outerWidth(!1)-o.width()],r=[i[0]/(n[0].parent().height()-n[0].height()),i[1]/(n[1].parent().width()-n[1].width())];t.scrollRatio={y:r[0],x:r[1]}},_onDragClasses=function(e,t,o){var a=o?S[0]+"_expanded":"",n=e.closest(".mCSB_scrollTools");"active"===t?(e.toggleClass(S[0]+" "+a),n.toggleClass(S[1]),e[0]._draggable=e[0]._draggable?0:1):e[0]._draggable||("hide"===t?(e.removeClass(S[0]),n.removeClass(S[1])):(e.addClass(S[0]),n.addClass(S[1])))},_overflowed=function(){var e=P(this),t=e.data(H),o=P("#mCSB_"+t.idx),a=P("#mCSB_"+t.idx+"_container"),n=null==t.overflowed?a.height():a.outerHeight(!1),i=null==t.overflowed?a.width():a.outerWidth(!1),r=a[0].scrollHeight,l=a[0].scrollWidth;return n<r&&(n=r),i<l&&(i=l),[n>o.height(),i>o.width()]},_resetContentPosition=function(){var e=P(this),t=e.data(H),o=t.opt,a=P("#mCSB_"+t.idx),n=P("#mCSB_"+t.idx+"_container"),i=[P("#mCSB_"+t.idx+"_dragger_vertical"),P("#mCSB_"+t.idx+"_dragger_horizontal")];if(_stop(e),("x"!==o.axis&&!t.overflowed[0]||"y"===o.axis&&t.overflowed[0])&&(i[0].add(n).css("top",0),_scrollTo(e,"_resetY")),"y"!==o.axis&&!t.overflowed[1]||"x"===o.axis&&t.overflowed[1]){var r=dx=0;"rtl"===t.langDir&&(r=a.width()-n.outerWidth(!1),dx=Math.abs(r/t.scrollRatio.x)),n.css("left",r),i[1].css("left",dx),_scrollTo(e,"_resetX")}},_bindEvents=function(){var t=P(this),e=t.data(H),o=e.opt;if(!e.bindEvents){var a;if(_draggable.call(this),o.contentTouchScroll&&_contentDraggable.call(this),_selectable.call(this),o.mouseWheel.enable)!function e(){a=setTimeout(function(){P.event.special.mousewheel?(clearTimeout(a),_mousewheel.call(t[0])):e()},100)}();_draggerRail.call(this),_wrapperScroll.call(this),o.advanced.autoScrollOnFocus&&_focus.call(this),o.scrollButtons.enable&&_buttons.call(this),o.keyboard.enable&&_keyboard.call(this),e.bindEvents=!0}},_unbindEvents=function(){var e=P(this),t=e.data(H),o=t.opt,a=H+"_"+t.idx,n=".mCSB_"+t.idx+"_scrollbar",i=P("#mCSB_"+t.idx+",#mCSB_"+t.idx+"_container,#mCSB_"+t.idx+"_container_wrapper,"+n+" ."+S[12]+",#mCSB_"+t.idx+"_dragger_vertical,#mCSB_"+t.idx+"_dragger_horizontal,"+n+">a"),r=P("#mCSB_"+t.idx+"_container");o.advanced.releaseDraggableSelectors&&i.add(P(o.advanced.releaseDraggableSelectors)),o.advanced.extraDraggableSelectors&&i.add(P(o.advanced.extraDraggableSelectors)),t.bindEvents&&(P(document).add(P(!_canAccessIFrame()||top.document)).unbind("."+a),i.each(function(){P(this).unbind("."+a)}),clearTimeout(e[0]._focusTimeout),_delete(e[0],"_focusTimeout"),clearTimeout(t.sequential.step),_delete(t.sequential,"step"),clearTimeout(r[0].onCompleteTimeout),_delete(r[0],"onCompleteTimeout"),t.bindEvents=!1)},_scrollbarVisibility=function(e){var t=P(this),o=t.data(H),a=o.opt,n=P("#mCSB_"+o.idx+"_container_wrapper"),i=n.length?n:P("#mCSB_"+o.idx+"_container"),r=[P("#mCSB_"+o.idx+"_scrollbar_vertical"),P("#mCSB_"+o.idx+"_scrollbar_horizontal")],l=[r[0].find(".mCSB_dragger"),r[1].find(".mCSB_dragger")];"x"!==a.axis&&(o.overflowed[0]&&!e?(r[0].add(l[0]).add(r[0].children("a")).css("display","block"),i.removeClass(S[8]+" "+S[10])):(a.alwaysShowScrollbar?(2!==a.alwaysShowScrollbar&&l[0].css("display","none"),i.removeClass(S[10])):(r[0].css("display","none"),i.addClass(S[10])),i.addClass(S[8]))),"y"!==a.axis&&(o.overflowed[1]&&!e?(r[1].add(l[1]).add(r[1].children("a")).css("display","block"),i.removeClass(S[9]+" "+S[11])):(a.alwaysShowScrollbar?(2!==a.alwaysShowScrollbar&&l[1].css("display","none"),i.removeClass(S[11])):(r[1].css("display","none"),i.addClass(S[11])),i.addClass(S[9]))),o.overflowed[0]||o.overflowed[1]?t.removeClass(S[5]):t.addClass(S[5])},_coordinates=function(e){var t=e.type,o=e.target.ownerDocument!==document&&null!==frameElement?[P(frameElement).offset().top,P(frameElement).offset().left]:null,a=_canAccessIFrame()&&e.target.ownerDocument!==top.document&&null!==frameElement?[P(e.view.frameElement).offset().top,P(e.view.frameElement).offset().left]:[0,0];switch(t){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return o?[e.originalEvent.pageY-o[0]+a[0],e.originalEvent.pageX-o[1]+a[1],!1]:[e.originalEvent.pageY,e.originalEvent.pageX,!1];case"touchstart":case"touchmove":case"touchend":var n=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0],i=e.originalEvent.touches.length||e.originalEvent.changedTouches.length;return e.target.ownerDocument!==document?[n.screenY,n.screenX,1<i]:[n.pageY,n.pageX,1<i];default:return o?[e.pageY-o[0]+a[0],e.pageX-o[1]+a[1],!1]:[e.pageY,e.pageX,!1]}},_draggable=function(){var r,l,s,c=P(this),d=c.data(H),u=d.opt,e=H+"_"+d.idx,h=["mCSB_"+d.idx+"_dragger_vertical","mCSB_"+d.idx+"_dragger_horizontal"],f=P("#mCSB_"+d.idx+"_container"),t=P("#"+h[0]+",#"+h[1]),o=u.advanced.releaseDraggableSelectors?t.add(P(u.advanced.releaseDraggableSelectors)):t,a=u.advanced.extraDraggableSelectors?P(!_canAccessIFrame()||top.document).add(P(u.advanced.extraDraggableSelectors)):P(!_canAccessIFrame()||top.document);function n(e,t,o,a){if(f[0].idleTimer=u.scrollInertia<233?250:0,r.attr("id")===h[1])var n="x",i=(r[0].offsetLeft-t+a)*d.scrollRatio.x;else var n="y",i=(r[0].offsetTop-e+o)*d.scrollRatio.y;_scrollTo(c,i.toString(),{dir:n,drag:!0})}t.bind("contextmenu."+e,function(e){e.preventDefault()}).bind("mousedown."+e+" touchstart."+e+" pointerdown."+e+" MSPointerDown."+e,function(e){if(e.stopImmediatePropagation(),e.preventDefault(),_mouseBtnLeft(e)){F=!0,p&&(document.onselectstart=function(){return!1}),_iframe.call(f,!1),_stop(c);var t=(r=P(this)).offset(),o=_coordinates(e)[0]-t.top,a=_coordinates(e)[1]-t.left,n=r.height()+t.top,i=r.width()+t.left;o<n&&0<o&&a<i&&0<a&&(l=o,s=a),_onDragClasses(r,"active",u.autoExpandScrollbar)}}).bind("touchmove."+e,function(e){e.stopImmediatePropagation(),e.preventDefault();var t=r.offset(),o=_coordinates(e)[0]-t.top,a=_coordinates(e)[1]-t.left;n(l,s,o,a)}),P(document).add(a).bind("mousemove."+e+" pointermove."+e+" MSPointerMove."+e,function(e){if(r){var t=r.offset(),o=_coordinates(e)[0]-t.top,a=_coordinates(e)[1]-t.left;if(l===o&&s===a)return;n(l,s,o,a)}}).add(o).bind("mouseup."+e+" touchend."+e+" pointerup."+e+" MSPointerUp."+e,function(e){r&&(_onDragClasses(r,"active",u.autoExpandScrollbar),r=null),F=!1,p&&(document.onselectstart=null),_iframe.call(f,!0)})},_contentDraggable=function(){var d,c,u,h,f,m,_,p,g,v,x,w,S,b,C=P(this),y=C.data(H),T=y.opt,e=H+"_"+y.idx,B=P("#mCSB_"+y.idx),k=P("#mCSB_"+y.idx+"_container"),M=[P("#mCSB_"+y.idx+"_dragger_vertical"),P("#mCSB_"+y.idx+"_dragger_horizontal")],I=[],D=[],O=0,E="yx"===T.axis?"none":"all",A=[],t=k.find("iframe"),o=["touchstart."+e+" pointerdown."+e+" MSPointerDown."+e,"touchmove."+e+" pointermove."+e+" MSPointerMove."+e,"touchend."+e+" pointerup."+e+" MSPointerUp."+e],L=void 0!==document.body.style.touchAction&&""!==document.body.style.touchAction;function a(e){if(!_pointerTouch(e)||F||_coordinates(e)[2])z=0;else{if(P(e.target).closest(".bx_ui_slider_track").length)return U=!0,void(z=0);U=!1,b=S=0,d=z=1,C.removeClass("mCS_touch_action");var t=k.offset();c=_coordinates(e)[0]-t.top,u=_coordinates(e)[1]-t.left,A=[_coordinates(e)[0],_coordinates(e)[1]]}}function n(e){if(_pointerTouch(e)&&!F&&!_coordinates(e)[2])if(U)z=0;else if(T.documentTouchScroll||e.preventDefault(),e.stopImmediatePropagation(),(!b||S)&&d){_=_getTime();var t=B.offset(),o=_coordinates(e)[0]-t.top,a=_coordinates(e)[1]-t.left,n="mcsLinearOut";if(I.push(o),D.push(a),A[2]=Math.abs(_coordinates(e)[0]-A[0]),A[3]=Math.abs(_coordinates(e)[1]-A[1]),y.overflowed[0])var i=M[0].parent().height()-M[0].height(),r=0<c-o&&o-c>-i*y.scrollRatio.y&&(2*A[3]<A[2]||"yx"===T.axis);if(y.overflowed[1])var l=M[1].parent().width()-M[1].width(),s=0<u-a&&a-u>-l*y.scrollRatio.x&&(2*A[2]<A[3]||"yx"===T.axis);r||s?(L||e.preventDefault(),S=1):(b=1,C.addClass("mCS_touch_action")),L&&e.preventDefault(),x="yx"===T.axis?[c-o,u-a]:"x"===T.axis?[null,u-a]:[c-o,null],k[0].idleTimer=250,y.overflowed[0]&&W(x[0],O,n,"y","all",!0),y.overflowed[1]&&W(x[1],O,n,"x",E,!0)}}function i(e){if(!_pointerTouch(e)||F||_coordinates(e)[2])z=0;else{if(P(e.target).closest(".bx_ui_slider_track").length)return U=!0,void(z=0);U=!1,z=1,e.stopImmediatePropagation(),_stop(C),m=_getTime();var t=B.offset();h=_coordinates(e)[0]-t.top,f=_coordinates(e)[1]-t.left,I=[],D=[]}}function r(e){if(_pointerTouch(e)&&!F&&!_coordinates(e)[2]){if(P(e.target).closest(".bx_ui_slider_track").length)return U=!1,void(z=0);d=0,e.stopImmediatePropagation(),b=S=0,p=_getTime();var t=B.offset(),o=_coordinates(e)[0]-t.top,a=_coordinates(e)[1]-t.left;if(!(30<p-_)){var n="mcsEaseOut",i=(v=1e3/(p-m))<2.5,r=i?[I[I.length-2],D[D.length-2]]:[0,0];g=i?[o-r[0],a-r[1]]:[o-h,a-f];var l=[Math.abs(g[0]),Math.abs(g[1])];v=i?[Math.abs(g[0]/4),Math.abs(g[1]/4)]:[v,v];var s=[Math.abs(k[0].offsetTop)-g[0]*R(l[0]/v[0],v[0]),Math.abs(k[0].offsetLeft)-g[1]*R(l[1]/v[1],v[1])];x="yx"===T.axis?[s[0],s[1]]:"x"===T.axis?[null,s[1]]:[s[0],null],w=[4*l[0]+T.scrollInertia,4*l[1]+T.scrollInertia];var c=parseInt(T.contentTouchScroll)||0;x[0]=c<l[0]?x[0]:0,x[1]=c<l[1]?x[1]:0,y.overflowed[0]&&W(x[0],w[0],n,"y",E,!1),y.overflowed[1]&&W(x[1],w[1],n,"x",E,!1)}}}function R(e,t){var o=[1.5*t,2*t,t/1.5,t/2];return 90<e?4<t?o[0]:o[3]:60<e?3<t?o[3]:o[2]:30<e?8<t?o[1]:6<t?o[0]:4<t?t:o[2]:8<t?t:o[3]}function W(e,t,o,a,n,i){e&&_scrollTo(C,e.toString(),{dur:t,scrollEasing:o,dir:a,overwrite:n,drag:i})}k.bind(o[0],function(e){a(e)}).bind(o[1],function(e){n(e)}),B.bind(o[0],function(e){i(e)}).bind(o[2],function(e){r(e)}),t.length&&t.each(function(){P(this).bind("load",function(){_canAccessIFrame(this)&&P(this.contentDocument||this.contentWindow.document).bind(o[0],function(e){a(e),i(e)}).bind(o[1],function(e){n(e)}).bind(o[2],function(e){r(e)})})})},_selectable=function(){var n,a=P(this),i=a.data(H),r=i.opt,l=i.sequential,e=H+"_"+i.idx,s=P("#mCSB_"+i.idx+"_container"),c=s.parent();function d(e,t,o){l.type=o&&n?"stepped":"stepless",l.scrollAmount=10,_sequentialScroll(a,e,t,"mcsLinearOut",o?60:null)}s.bind("mousedown."+e,function(e){z||n||(n=1,F=!0)}).add(document).bind("mousemove."+e,function(e){if(!z&&n&&(window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type&&document.selection.createRange().text)){var t=s.offset(),o=_coordinates(e)[0]-t.top+s[0].offsetTop,a=_coordinates(e)[1]-t.left+s[0].offsetLeft;0<o&&o<c.height()&&0<a&&a<c.width()?l.step&&d("off",null,"stepped"):("x"!==r.axis&&i.overflowed[0]&&(o<0?d("on",38):o>c.height()&&d("on",40)),"y"!==r.axis&&i.overflowed[1]&&(a<0?d("on",37):a>c.width()&&d("on",39)))}}).bind("mouseup."+e+" dragend."+e,function(e){z||(n&&(n=0,d("off",null)),F=!1)})},_mousewheel=function(){if(P(this).data(H)){var u=P(this),h=u.data(H),f=h.opt,e=H+"_"+h.idx,m=P("#mCSB_"+h.idx),_=[P("#mCSB_"+h.idx+"_dragger_vertical"),P("#mCSB_"+h.idx+"_dragger_horizontal")],t=P("#mCSB_"+h.idx+"_container").find("iframe");t.length&&t.each(function(){P(this).bind("load",function(){_canAccessIFrame(this)&&P(this.contentDocument||this.contentWindow.document).bind("mousewheel."+e,function(e,t){o(e,t)})})}),m.bind("mousewheel."+e,function(e,t){o(e,t)})}function o(e,t){if(_stop(u),!_disableMousewheel(u,e.target)){var o="auto"!==f.mouseWheel.deltaFactor?parseInt(f.mouseWheel.deltaFactor):p&&e.deltaFactor<100?100:e.deltaFactor||100,a=f.scrollInertia;if("x"===f.axis||"x"===f.mouseWheel.axis)var n="x",i=[Math.round(o*h.scrollRatio.x),parseInt(f.mouseWheel.scrollAmount)],r="auto"!==f.mouseWheel.scrollAmount?i[1]:i[0]>=m.width()?.9*m.width():i[0],l=Math.abs(P("#mCSB_"+h.idx+"_container")[0].offsetLeft),s=_[1][0].offsetLeft,c=_[1].parent().width()-_[1].width(),d="y"===f.mouseWheel.axis?e.deltaY||t:e.deltaX;else var n="y",i=[Math.round(o*h.scrollRatio.y),parseInt(f.mouseWheel.scrollAmount)],r="auto"!==f.mouseWheel.scrollAmount?i[1]:i[0]>=m.height()?.9*m.height():i[0],l=Math.abs(P("#mCSB_"+h.idx+"_container")[0].offsetTop),s=_[0][0].offsetTop,c=_[0].parent().height()-_[0].height(),d=e.deltaY||t;"y"===n&&!h.overflowed[0]||"x"===n&&!h.overflowed[1]||((f.mouseWheel.invert||e.webkitDirectionInvertedFromDevice)&&(d=-d),f.mouseWheel.normalizeDelta&&(d=d<0?-1:1),(0<d&&0!==s||d<0&&s!==c||f.mouseWheel.preventDefault)&&(e.stopImmediatePropagation(),e.preventDefault()),e.deltaFactor<5&&!f.mouseWheel.normalizeDelta&&(r=e.deltaFactor,a=17),_scrollTo(u,(l-d*r).toString(),{dir:n,dur:a}))}}},_canAccessIFrameCache=new Object,_canAccessIFrame=function(e){var t=!1,o=!1,a=null;if(void 0===e?o="#empty":void 0!==P(e).attr("id")&&(o=P(e).attr("id")),!1!==o&&void 0!==_canAccessIFrameCache[o])return _canAccessIFrameCache[o];if(e){try{var n=e.contentDocument||e.contentWindow.document;a=n.body.innerHTML}catch(e){}t=null!==a}else{try{var n=top.document;a=n.body.innerHTML}catch(e){}t=null!==a}return!1!==o&&(_canAccessIFrameCache[o]=t),t},_iframe=function(e){var t=this.find("iframe");if(t.length){var o=e?"auto":"none";t.css("pointer-events",o)}},_disableMousewheel=function(e,t){var o=t.nodeName.toLowerCase(),a=e.data(H).opt.mouseWheel.disableOver;return-1<P.inArray(o,a)&&!(-1<P.inArray(o,["select","textarea"])&&!P(t).is(":focus"))},_draggerRail=function(){var r,l=P(this),s=l.data(H),e=H+"_"+s.idx,c=P("#mCSB_"+s.idx+"_container"),d=c.parent(),t=P(".mCSB_"+s.idx+"_scrollbar ."+S[12]);t.bind("mousedown."+e+" touchstart."+e+" pointerdown."+e+" MSPointerDown."+e,function(e){F=!0,P(e.target).hasClass("mCSB_dragger")||(r=1)}).bind("touchend."+e+" pointerup."+e+" MSPointerUp."+e,function(e){F=!1}).bind("click."+e,function(e){if(r&&(r=0,P(e.target).hasClass(S[12])||P(e.target).hasClass("mCSB_draggerRail"))){_stop(l);var t=P(this),o=t.find(".mCSB_dragger");if(0<t.parent(".mCSB_scrollTools_horizontal").length){if(!s.overflowed[1])return;var a="x",n=e.pageX>o.offset().left?-1:1,i=Math.abs(c[0].offsetLeft)-n*(.9*d.width())}else{if(!s.overflowed[0])return;var a="y",n=e.pageY>o.offset().top?-1:1,i=Math.abs(c[0].offsetTop)-n*(.9*d.height())}_scrollTo(l,i.toString(),{dir:a,scrollEasing:"mcsEaseInOut"})}})},_focus=function(){var i=P(this),e=i.data(H),r=e.opt,t=H+"_"+e.idx,l=P("#mCSB_"+e.idx+"_container"),s=l.parent();l.bind("focusin."+t,function(e){var n=P(document.activeElement),t=l.find(".mCustomScrollBox").length;n.is(r.advanced.autoScrollOnFocus)&&(_stop(i),clearTimeout(i[0]._focusTimeout),i[0]._focusTimer=t?17*t:0,i[0]._focusTimeout=setTimeout(function(){var e=[_childPos(n)[0],_childPos(n)[1]],t=[l[0].offsetTop,l[0].offsetLeft],o=[0<=t[0]+e[0]&&t[0]+e[0]<s.height()-n.outerHeight(!1),0<=t[1]+e[1]&&t[0]+e[1]<s.width()-n.outerWidth(!1)],a="yx"!==r.axis||o[0]||o[1]?"all":"none";"x"===r.axis||o[0]||_scrollTo(i,e[0].toString(),{dir:"y",scrollEasing:"mcsEaseInOut",overwrite:a,dur:0}),"y"===r.axis||o[1]||_scrollTo(i,e[1].toString(),{dir:"x",scrollEasing:"mcsEaseInOut",overwrite:a,dur:0})},i[0]._focusTimer))})},_wrapperScroll=function(){var e=P(this),t=e.data(H),o=H+"_"+t.idx,a=P("#mCSB_"+t.idx+"_container").parent();a.bind("scroll."+o,function(e){0===a.scrollTop()&&0===a.scrollLeft()||P(".mCSB_"+t.idx+"_scrollbar").css("visibility","hidden")})},_buttons=function(){var a=P(this),n=a.data(H),i=n.opt,r=n.sequential,e=H+"_"+n.idx,t=".mCSB_"+n.idx+"_scrollbar",o=P(t+">a");o.bind("contextmenu."+e,function(e){e.preventDefault()}).bind("mousedown."+e+" touchstart."+e+" pointerdown."+e+" MSPointerDown."+e+" mouseup."+e+" touchend."+e+" pointerup."+e+" MSPointerUp."+e+" mouseout."+e+" pointerout."+e+" MSPointerOut."+e+" click."+e,function(e){if(e.preventDefault(),_mouseBtnLeft(e)){var t=P(this).attr("class");switch(r.type=i.scrollButtons.scrollType,e.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===r.type)return;F=!0,n.tweenRunning=!1,o("on",t);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===r.type)return;F=!1,r.dir&&o("off",t);break;case"click":if("stepped"!==r.type||n.tweenRunning)return;o("on",t)}}function o(e,t){_sequentialScroll(a,e,t)}})},_keyboard=function(){var l=P(this),s=l.data(H),c=s.opt,d=s.sequential,e=H+"_"+s.idx,t=P("#mCSB_"+s.idx),u=P("#mCSB_"+s.idx+"_container"),h=u.parent(),f="input,textarea,select,datalist,keygen,[contenteditable='true']",o=u.find("iframe"),a=["blur."+e+" keydown."+e+" keyup."+e];function n(e){switch(e.type){case"blur":s.tweenRunning&&d.dir&&r("off",null);break;case"keydown":case"keyup":var t=e.keyCode?e.keyCode:e.which,o="on";if("x"!==c.axis&&(38===t||40===t)||"y"!==c.axis&&(37===t||39===t)){if((38===t||40===t)&&!s.overflowed[0]||(37===t||39===t)&&!s.overflowed[1])return;"keyup"===e.type&&(o="off"),P(document.activeElement).is(f)||(e.preventDefault(),e.stopImmediatePropagation(),r(o,t))}else if(33===t||34===t){if((s.overflowed[0]||s.overflowed[1])&&(e.preventDefault(),e.stopImmediatePropagation()),"keyup"===e.type){_stop(l);var a=34===t?-1:1;if("x"===c.axis||"yx"===c.axis&&s.overflowed[1]&&!s.overflowed[0])var n="x",i=Math.abs(u[0].offsetLeft)-a*(.9*h.width());else var n="y",i=Math.abs(u[0].offsetTop)-a*(.9*h.height());_scrollTo(l,i.toString(),{dir:n,scrollEasing:"mcsEaseInOut"})}}else if((35===t||36===t)&&!P(document.activeElement).is(f)&&((s.overflowed[0]||s.overflowed[1])&&(e.preventDefault(),e.stopImmediatePropagation()),"keyup"===e.type)){if("x"===c.axis||"yx"===c.axis&&s.overflowed[1]&&!s.overflowed[0])var n="x",i=35===t?Math.abs(h.width()-u.outerWidth(!1)):0;else var n="y",i=35===t?Math.abs(h.height()-u.outerHeight(!1)):0;_scrollTo(l,i.toString(),{dir:n,scrollEasing:"mcsEaseInOut"})}}function r(e,t){d.type=c.keyboard.scrollType,d.scrollAmount=c.keyboard.scrollAmount,"stepped"===d.type&&s.tweenRunning||_sequentialScroll(l,e,t)}}o.length&&o.each(function(){P(this).bind("load",function(){_canAccessIFrame(this)&&P(this.contentDocument||this.contentWindow.document).bind(a[0],function(e){n(e)})})}),t.attr("tabindex","0").bind(a[0],function(e){n(e)})},_sequentialScroll=function(u,e,t,h,f){var m=u.data(H),_=m.opt,p=m.sequential,g=P("#mCSB_"+m.idx+"_container"),o="stepped"===p.type,v=_.scrollInertia<26?26:_.scrollInertia,x=_.scrollInertia<1?17:_.scrollInertia;switch(e){case"on":if(p.dir=[t===S[16]||t===S[15]||39===t||37===t?"x":"y",t===S[13]||t===S[15]||38===t||37===t?-1:1],_stop(u),_isNumeric(t)&&"stepped"===p.type)return;w(o);break;case"off":clearTimeout(p.step),_delete(p,"step"),_stop(u),(o||m.tweenRunning&&p.dir)&&w(!0)}function w(e){_.snapAmount&&(p.scrollAmount=_.snapAmount instanceof Array?"x"===p.dir[0]?_.snapAmount[1]:_.snapAmount[0]:_.snapAmount);var t="stepped"!==p.type,o=f||(e?t?v/1.5:x:1e3/60),a=e?t?7.5:40:2.5,n=[Math.abs(g[0].offsetTop),Math.abs(g[0].offsetLeft)],i=[10<m.scrollRatio.y?10:m.scrollRatio.y,10<m.scrollRatio.x?10:m.scrollRatio.x],r="x"===p.dir[0]?n[1]+p.dir[1]*(i[1]*a):n[0]+p.dir[1]*(i[0]*a),l="x"===p.dir[0]?n[1]+p.dir[1]*parseInt(p.scrollAmount):n[0]+p.dir[1]*parseInt(p.scrollAmount),s="auto"!==p.scrollAmount?l:r,c=h||(e?t?"mcsLinearOut":"mcsEaseInOut":"mcsLinear"),d=!!e;e&&o<17&&(s="x"===p.dir[0]?n[1]:n[0]),_scrollTo(u,s.toString(),{dir:p.dir[0],scrollEasing:c,dur:o,onComplete:d}),e?p.dir=!1:(clearTimeout(p.step),p.step=setTimeout(function(){w()},o))}},_arr=function(e){var t=P(this).data(H).opt,o=[];return"function"==typeof e&&(e=e()),e instanceof Array?o=1<e.length?[e[0],e[1]]:"x"===t.axis?[null,e[0]]:[e[0],null]:(o[0]=e.y?e.y:e.x||"x"===t.axis?null:e,o[1]=e.x?e.x:e.y||"y"===t.axis?null:e),"function"==typeof o[0]&&(o[0]=o[0]()),"function"==typeof o[1]&&(o[1]=o[1]()),o},_to=function(e,t){if(null!=e&&void 0!==e){var o=P(this),a=o.data(H),n=a.opt,i=P("#mCSB_"+a.idx+"_container"),r=i.parent(),l=typeof e,s="x"===(t=t||("x"===n.axis?"x":"y"))?i.outerWidth(!1)-r.width():i.outerHeight(!1)-r.height(),c="x"===t?i[0].offsetLeft:i[0].offsetTop,d="x"===t?"left":"top";switch(l){case"function":return e();case"object":var u=e.jquery?e:P(e);if(!u.length)return;return"x"===t?_childPos(u)[1]:_childPos(u)[0];case"string":case"number":if(_isNumeric(e))return Math.abs(e);if(-1!==e.indexOf("%"))return Math.abs(s*parseInt(e)/100);if(-1!==e.indexOf("-="))return Math.abs(c-parseInt(e.split("-=")[1]));if(-1!==e.indexOf("+=")){var h=c+parseInt(e.split("+=")[1]);return 0<=h?0:Math.abs(h)}if(-1!==e.indexOf("px")&&_isNumeric(e.split("px")[0]))return Math.abs(e.split("px")[0]);if("top"===e||"left"===e)return 0;if("bottom"===e)return Math.abs(r.height()-i.outerHeight(!1));if("right"===e)return Math.abs(r.width()-i.outerWidth(!1));if("first"!==e&&"last"!==e)return P(e).length?"x"===t?_childPos(P(e))[1]:_childPos(P(e))[0]:(i.css(d,e),void methods.update.call(null,o[0]));var u=i.find(":"+e);return"x"===t?_childPos(u)[1]:_childPos(u)[0]}}},_autoUpdate=function(e){var t=P(this),o=t.data(H),a=o.opt,n=P("#mCSB_"+o.idx+"_container");if(e)return clearTimeout(n[0].autoUpdate),void _delete(n[0],"autoUpdate");function i(e){if(P(e).hasClass(S[2]))l();else{var t=new Image;t.onload=function(e,t){return function(){return t.apply(e,arguments)}}(t,function(){this.onload=null,P(e).addClass(S[2]),l(2)}),t.src=e.src}}function r(){!0===a.advanced.updateOnSelectorChange&&(a.advanced.updateOnSelectorChange="*");var e=0,t=n.find(a.advanced.updateOnSelectorChange);return a.advanced.updateOnSelectorChange&&0<t.length&&t.each(function(){e+=this.offsetHeight+this.offsetWidth}),e}function l(e){clearTimeout(n[0].autoUpdate),methods.update.call(null,t[0],e)}!function e(){clearTimeout(n[0].autoUpdate),0!==t.parents("html").length?n[0].autoUpdate=setTimeout(function(){return a.advanced.updateOnSelectorChange&&(o.poll.change.n=r(),o.poll.change.n!==o.poll.change.o)?(o.poll.change.o=o.poll.change.n,void l(3)):a.advanced.updateOnContentResize&&(o.poll.size.n=t[0].scrollHeight+t[0].scrollWidth+n[0].offsetHeight+t[0].offsetHeight+t[0].offsetWidth,o.poll.size.n!==o.poll.size.o)?(o.poll.size.o=o.poll.size.n,void l(1)):!a.advanced.updateOnImageLoad||"auto"===a.advanced.updateOnImageLoad&&"y"===a.axis||(o.poll.img.n=n.find("img").length,o.poll.img.n===o.poll.img.o)?void((a.advanced.updateOnSelectorChange||a.advanced.updateOnContentResize||a.advanced.updateOnImageLoad)&&e()):(o.poll.img.o=o.poll.img.n,void n.find("img").each(function(){i(this)}))},a.advanced.autoUpdateTimeout):t=null}()},_snapAmount=function(e,t,o){return Math.round(e/t)*t-o},_stop=function(e){var t=e.data(H),o=P("#mCSB_"+t.idx+"_container,#mCSB_"+t.idx+"_container_wrapper,#mCSB_"+t.idx+"_dragger_vertical,#mCSB_"+t.idx+"_dragger_horizontal");o.each(function(){_stopTween.call(this)})},_scrollTo=function(n,e,i){var t=n.data(H),o=t.opt,a={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:o.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},i=P.extend(a,i),r=[i.dur,i.drag?0:i.dur],l=P("#mCSB_"+t.idx),s=P("#mCSB_"+t.idx+"_container"),c=s.parent(),d=o.callbacks.onTotalScrollOffset?_arr.call(n,o.callbacks.onTotalScrollOffset):[0,0],u=o.callbacks.onTotalScrollBackOffset?_arr.call(n,o.callbacks.onTotalScrollBackOffset):[0,0];if(t.trigger=i.trigger,0===c.scrollTop()&&0===c.scrollLeft()||(P(".mCSB_"+t.idx+"_scrollbar").css("visibility","visible"),c.scrollTop(0).scrollLeft(0)),"_resetY"!==e||t.contentReset.y||(b("onOverflowYNone")&&o.callbacks.onOverflowYNone.call(n[0]),t.contentReset.y=1),"_resetX"!==e||t.contentReset.x||(b("onOverflowXNone")&&o.callbacks.onOverflowXNone.call(n[0]),t.contentReset.x=1),"_resetY"!==e&&"_resetX"!==e){if(!t.contentReset.y&&n[0].mcs||!t.overflowed[0]||(b("onOverflowY")&&o.callbacks.onOverflowY.call(n[0]),t.contentReset.x=null),!t.contentReset.x&&n[0].mcs||!t.overflowed[1]||(b("onOverflowX")&&o.callbacks.onOverflowX.call(n[0]),t.contentReset.x=null),o.snapAmount){var h=o.snapAmount instanceof Array?"x"===i.dir?o.snapAmount[1]:o.snapAmount[0]:o.snapAmount;e=_snapAmount(e,h,o.snapOffset)}switch(i.dir){case"x":var f=P("#mCSB_"+t.idx+"_dragger_horizontal"),m="left",_=s[0].offsetLeft,p=[l.width()-s.outerWidth(!1),f.parent().width()-f.width()],g=[e,0===e?0:e/t.scrollRatio.x],v=d[1],x=u[1],w=0<v?v/t.scrollRatio.x:0,S=0<x?x/t.scrollRatio.x:0;break;case"y":var f=P("#mCSB_"+t.idx+"_dragger_vertical"),m="top",_=s[0].offsetTop,p=[l.height()-s.outerHeight(!1),f.parent().height()-f.height()],g=[e,0===e?0:e/t.scrollRatio.y],v=d[0],x=u[0],w=0<v?v/t.scrollRatio.y:0,S=0<x?x/t.scrollRatio.y:0}g[1]<0||0===g[0]&&0===g[1]?g=[0,0]:g[1]>=p[1]?g=[p[0],p[1]]:g[0]=-g[0],n[0].mcs||(C(),b("onInit")&&o.callbacks.onInit.call(n[0])),clearTimeout(s[0].onCompleteTimeout),_tweenTo(f[0],m,Math.round(g[1]),r[1],i.scrollEasing),!t.tweenRunning&&(0===_&&0<=g[0]||_===p[0]&&g[0]<=p[0])||_tweenTo(s[0],m,Math.round(g[0]),r[0],i.scrollEasing,i.overwrite,{onStart:function(){i.callbacks&&i.onStart&&!t.tweenRunning&&(b("onScrollStart")&&(C(),o.callbacks.onScrollStart.call(n[0])),t.tweenRunning=!0,_onDragClasses(f),t.cbOffsets=[o.callbacks.alwaysTriggerOffsets||_>=p[0]+v,o.callbacks.alwaysTriggerOffsets||_<=-x])},onUpdate:function(){i.callbacks&&i.onUpdate&&b("whileScrolling")&&(C(),o.callbacks.whileScrolling.call(n[0]))},onComplete:function(){if(i.callbacks&&i.onComplete){"yx"===o.axis&&clearTimeout(s[0].onCompleteTimeout);var e=s[0].idleTimer||0;s[0].onCompleteTimeout=setTimeout(function(){b("onScroll")&&(C(),o.callbacks.onScroll.call(n[0])),b("onTotalScroll")&&g[1]>=p[1]-w&&t.cbOffsets[0]&&(C(),o.callbacks.onTotalScroll.call(n[0])),b("onTotalScrollBack")&&g[1]<=S&&t.cbOffsets[1]&&(C(),o.callbacks.onTotalScrollBack.call(n[0])),t.tweenRunning=!1,s[0].idleTimer=0,_onDragClasses(f,"hide")},e)}}})}function b(e){return t&&o.callbacks[e]&&"function"==typeof o.callbacks[e]}function C(){var e=[s[0].offsetTop,s[0].offsetLeft],t=[f[0].offsetTop,f[0].offsetLeft],o=[s.outerHeight(!1),s.outerWidth(!1)],a=[l.height(),l.width()];n[0].mcs={content:s,top:e[0],left:e[1],draggerTop:t[0],draggerLeft:t[1],topPct:Math.round(100*Math.abs(e[0])/(Math.abs(o[0])-a[0])),leftPct:Math.round(100*Math.abs(e[1])/(Math.abs(o[1])-a[1])),direction:i.dir}}},_tweenTo=function(e,t,o,a,n,i,r){e&&!e._mTween&&(e._mTween={top:{},left:{}});var l,s,r=r||{},c=r.onStart||function(){},d=r.onUpdate||function(){},u=r.onComplete||function(){},h=_getTime(),f=0,m=e.offsetTop,_=e.style,p=e._mTween[t];"left"===t&&(m=e.offsetLeft);var g=o-m;function v(){p.stop||(f||c.call(),f=_getTime()-h,x(),f>=p.time&&(p.time=f>p.time?f+l-(f-p.time):f+l-1,p.time<f+1&&(p.time=f+1)),p.time<a?p.id=s(v):u.call())}function x(){0<a?(p.currVal=function(e,t,o,a,n){switch(n){case"linear":case"mcsLinear":return o*e/a+t;case"mcsLinearOut":return e/=a,e--,o*Math.sqrt(1-e*e)+t;case"easeInOutSmooth":return(e/=a/2)<1?o/2*e*e+t:-o/2*(--e*(e-2)-1)+t;case"easeInOutStrong":return(e/=a/2)<1?o/2*Math.pow(2,10*(e-1))+t:(e--,o/2*(2-Math.pow(2,-10*e))+t);case"easeInOut":case"mcsEaseInOut":return(e/=a/2)<1?o/2*e*e*e+t:o/2*((e-=2)*e*e+2)+t;case"easeOutSmooth":return e/=a,-o*(--e*e*e*e-1)+t;case"easeOutStrong":return o*(1-Math.pow(2,-10*e/a))+t;case"easeOut":case"mcsEaseOut":default:var i=(e/=a)*e,r=i*e;return t+o*(.499999999999997*r*i+-2.5*i*i+5.5*r+-6.5*i+4*e)}}(p.time,m,g,a,n),_[t]=Math.round(p.currVal)+"px"):_[t]=o+"px",d.call()}p.stop=0,"none"===i||null!=p.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(p.id):clearTimeout(p.id),p.id=null),l=1e3/60,p.time=f+l,s=window.requestAnimationFrame?window.requestAnimationFrame:function(e){return x(),setTimeout(e,.01)},p.id=s(v)},_getTime=function(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},_stopTween=function(){var e=this;e._mTween||(e._mTween={top:{},left:{}});for(var t=["top","left"],o=0;o<t.length;o++){var a=t[o];e._mTween[a].id&&(window.requestAnimationFrame?window.cancelAnimationFrame(e._mTween[a].id):clearTimeout(e._mTween[a].id),e._mTween[a].id=null,e._mTween[a].stop=1)}},_delete=function(t,o){try{delete t[o]}catch(e){t[o]=null}},_mouseBtnLeft=function(e){return!(e.which&&1!==e.which)},_pointerTouch=function(e){var t=e.originalEvent.pointerType;return!(t&&"touch"!==t&&2!==t)},_isNumeric=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},_childPos=function(e){var t=e.parents(".mCSB_container");return[e.offset().top-t.offset().top,e.offset().left-t.offset().left]},_isTabHidden=function(){var e=function(){var e=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var t=0;t<e.length;t++)if(e[t]+"Hidden"in document)return e[t]+"Hidden";return null}();return!!e&&document[e]},P.fn[f]=function(e){return methods[e]?methods[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void P.error("Method "+e+" does not exist"):methods.init.apply(this,arguments)},P[f]=function(e){return methods[e]?methods[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void P.error("Method "+e+" does not exist"):methods.init.apply(this,arguments)},P[f].defaults=n,window[f]=!0,P(window).bind("load",function(){P(a)[f](),P.extend(P.expr[":"],{mcsInView:P.expr[":"].mcsInView||function(e){var t,o,a=P(e),n=a.parents(".mCSB_container");if(n.length)return t=n.parent(),0<=(o=[n[0].offsetTop,n[0].offsetLeft])[0]+_childPos(a)[0]&&o[0]+_childPos(a)[0]<t.height()-a.outerHeight(!1)&&0<=o[1]+_childPos(a)[1]&&o[1]+_childPos(a)[1]<t.width()-a.outerWidth(!1)},mcsInSight:P.expr[":"].mcsInSight||function(e,t,o){var a,n,i,r,l=P(e),s=l.parents(".mCSB_container"),c="exact"===o[3]?[[1,0],[1,0]]:[[.9,.1],[.6,.4]];if(s.length)return a=[l.outerHeight(!1),l.outerWidth(!1)],i=[s[0].offsetTop+_childPos(l)[0],s[0].offsetLeft+_childPos(l)[1]],n=[s.parent()[0].offsetHeight,s.parent()[0].offsetWidth],i[0]-n[0]*(r=[a[0]<n[0]?c[0]:c[1],a[1]<n[1]?c[0]:c[1]])[0][0]<0&&0<=i[0]+a[0]-n[0]*r[0][1]&&i[1]-n[1]*r[1][0]<0&&0<=i[1]+a[1]-n[1]*r[1][1]},mcsOverflow:P.expr[":"].mcsOverflow||function(e){var t=P(e).data(H);if(t)return t.overflowed[0]||t.overflowed[1]}})})});