(function(n){n.fn.addBack=n.fn.addBack||n.fn.andSelf;n.fn.extend({actual:function(t,i){var s,u,h,c;if(!this[t])throw'$.actual => The jQuery method "'+t+'" you called does not exist';var f=n.extend({absolute:!1,clone:!1,includeMargin:!1},i),r=this.eq(0),e,o;return f.clone===!0?(e=function(){r=r.clone().attr("style","position: absolute !important; top: -1000 !important; ").appendTo("body")},o=function(){r.remove()}):(s=[],u="",e=function(){h=r.parents().addBack().filter(":hidden");u+="visibility: hidden !important; display: block !important; ";f.absolute===!0&&(u+="position: absolute !important; ");h.each(function(){var i=n(this),t=i.attr("style");s.push(t);i.attr("style",t?t+";"+u:u)})},o=function(){h.each(function(t){var i=n(this),r=s[t];r===undefined?i.removeAttr("style"):i.attr("style",r)})}),e(),c=/(outer)/.test(t)?r[t](f.includeMargin):r[t](),o(),c}})})(jQuery);jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(n,t,i,r,u){return jQuery.easing[jQuery.easing.def](n,t,i,r,u)},easeInQuad:function(n,t,i,r,u){return r*(t/=u)*t+i},easeOutQuad:function(n,t,i,r,u){return-r*(t/=u)*(t-2)+i},easeInOutQuad:function(n,t,i,r,u){return(t/=u/2)<1?r/2*t*t+i:-r/2*(--t*(t-2)-1)+i},easeInCubic:function(n,t,i,r,u){return r*(t/=u)*t*t+i},easeOutCubic:function(n,t,i,r,u){return r*((t=t/u-1)*t*t+1)+i},easeInOutCubic:function(n,t,i,r,u){return(t/=u/2)<1?r/2*t*t*t+i:r/2*((t-=2)*t*t+2)+i},easeInQuart:function(n,t,i,r,u){return r*(t/=u)*t*t*t+i},easeOutQuart:function(n,t,i,r,u){return-r*((t=t/u-1)*t*t*t-1)+i},easeInOutQuart:function(n,t,i,r,u){return(t/=u/2)<1?r/2*t*t*t*t+i:-r/2*((t-=2)*t*t*t-2)+i},easeInQuint:function(n,t,i,r,u){return r*(t/=u)*t*t*t*t+i},easeOutQuint:function(n,t,i,r,u){return r*((t=t/u-1)*t*t*t*t+1)+i},easeInOutQuint:function(n,t,i,r,u){return(t/=u/2)<1?r/2*t*t*t*t*t+i:r/2*((t-=2)*t*t*t*t+2)+i},easeInSine:function(n,t,i,r,u){return-r*Math.cos(t/u*(Math.PI/2))+r+i},easeOutSine:function(n,t,i,r,u){return r*Math.sin(t/u*(Math.PI/2))+i},easeInOutSine:function(n,t,i,r,u){return-r/2*(Math.cos(Math.PI*t/u)-1)+i},easeInExpo:function(n,t,i,r,u){return t==0?i:r*Math.pow(2,10*(t/u-1))+i},easeOutExpo:function(n,t,i,r,u){return t==u?i+r:r*(-Math.pow(2,-10*t/u)+1)+i},easeInOutExpo:function(n,t,i,r,u){return t==0?i:t==u?i+r:(t/=u/2)<1?r/2*Math.pow(2,10*(t-1))+i:r/2*(-Math.pow(2,-10*--t)+2)+i},easeInCirc:function(n,t,i,r,u){return-r*(Math.sqrt(1-(t/=u)*t)-1)+i},easeOutCirc:function(n,t,i,r,u){return r*Math.sqrt(1-(t=t/u-1)*t)+i},easeInOutCirc:function(n,t,i,r,u){return(t/=u/2)<1?-r/2*(Math.sqrt(1-t*t)-1)+i:r/2*(Math.sqrt(1-(t-=2)*t)+1)+i},easeInElastic:function(n,t,i,r,u){var o=1.70158,f=0,e=r;return t==0?i:(t/=u)==1?i+r:(f||(f=u*.3),e<Math.abs(r)?(e=r,o=f/4):o=f/(2*Math.PI)*Math.asin(r/e),-(e*Math.pow(2,10*(t-=1))*Math.sin((t*u-o)*2*Math.PI/f))+i)},easeOutElastic:function(n,t,i,r,u){var o=1.70158,f=0,e=r;return t==0?i:(t/=u)==1?i+r:(f||(f=u*.3),e<Math.abs(r)?(e=r,o=f/4):o=f/(2*Math.PI)*Math.asin(r/e),e*Math.pow(2,-10*t)*Math.sin((t*u-o)*2*Math.PI/f)+r+i)},easeInOutElastic:function(n,t,i,r,u){var o=1.70158,f=0,e=r;return t==0?i:(t/=u/2)==2?i+r:(f||(f=u*.3*1.5),e<Math.abs(r)?(e=r,o=f/4):o=f/(2*Math.PI)*Math.asin(r/e),t<1)?-.5*e*Math.pow(2,10*(t-=1))*Math.sin((t*u-o)*2*Math.PI/f)+i:e*Math.pow(2,-10*(t-=1))*Math.sin((t*u-o)*2*Math.PI/f)*.5+r+i},easeInBack:function(n,t,i,r,u,f){return f==undefined&&(f=1.70158),r*(t/=u)*t*((f+1)*t-f)+i},easeOutBack:function(n,t,i,r,u,f){return f==undefined&&(f=1.70158),r*((t=t/u-1)*t*((f+1)*t+f)+1)+i},easeInOutBack:function(n,t,i,r,u,f){return(f==undefined&&(f=1.70158),(t/=u/2)<1)?r/2*t*t*(((f*=1.525)+1)*t-f)+i:r/2*((t-=2)*t*(((f*=1.525)+1)*t+f)+2)+i},easeInBounce:function(n,t,i,r,u){return r-jQuery.easing.easeOutBounce(n,u-t,0,r,u)+i},easeOutBounce:function(n,t,i,r,u){return(t/=u)<1/2.75?r*7.5625*t*t+i:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+i:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+i:r*(7.5625*(t-=2.625/2.75)*t+.984375)+i},easeInOutBounce:function(n,t,i,r,u){return t<u/2?jQuery.easing.easeInBounce(n,t*2,0,r,u)*.5+i:jQuery.easing.easeOutBounce(n,t*2-u,0,r,u)*.5+r*.5+i}});!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof exports?module.exports=n:n(jQuery)}(function(n){function u(r){var u=r||window.event,w=c.call(arguments,1),l=0,s=0,e=0,a=0,b=0,k=0,v,y,p;if(r=n.event.fix(u),r.type="mousewheel","detail"in u&&(e=-1*u.detail),"wheelDelta"in u&&(e=u.wheelDelta),"wheelDeltaY"in u&&(e=u.wheelDeltaY),"wheelDeltaX"in u&&(s=-1*u.wheelDeltaX),"axis"in u&&u.axis===u.HORIZONTAL_AXIS&&(s=-1*e,e=0),l=0===e?s:e,"deltaY"in u&&(e=-1*u.deltaY,l=e),"deltaX"in u&&(s=u.deltaX,0===e&&(l=-1*s)),0!==e||0!==s)return 1===u.deltaMode?(v=n.data(this,"mousewheel-line-height"),l*=v,e*=v,s*=v):2===u.deltaMode&&(y=n.data(this,"mousewheel-page-height"),l*=y,e*=y,s*=y),(a=Math.max(Math.abs(e),Math.abs(s)),(!t||t>a)&&(t=a,o(u,a)&&(t/=40)),o(u,a)&&(l/=40,s/=40,e/=40),l=Math[l>=1?"floor":"ceil"](l/t),s=Math[s>=1?"floor":"ceil"](s/t),e=Math[e>=1?"floor":"ceil"](e/t),i.settings.normalizeOffset&&this.getBoundingClientRect)&&(p=this.getBoundingClientRect(),b=r.clientX-p.left,k=r.clientY-p.top),r.deltaX=s,r.deltaY=e,r.deltaFactor=t,r.offsetX=b,r.offsetY=k,r.deltaMode=0,w.unshift(r,l,s,e),f&&clearTimeout(f),f=setTimeout(h,200),(n.event.dispatch||n.event.handle).apply(this,w)}function h(){t=null}function o(n,t){return i.settings.adjustOldDeltas&&"mousewheel"===n.type&&t%120==0}var f,t,s=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],r="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],c=Array.prototype.slice,e,i;if(n.event.fixHooks)for(e=s.length;e;)n.event.fixHooks[s[--e]]=n.event.mouseHooks;i=n.event.special.mousewheel={version:"3.1.11",setup:function(){if(this.addEventListener)for(var t=r.length;t;)this.addEventListener(r[--t],u,!1);else this.onmousewheel=u;n.data(this,"mousewheel-line-height",i.getLineHeight(this));n.data(this,"mousewheel-page-height",i.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var t=r.length;t;)this.removeEventListener(r[--t],u,!1);else this.onmousewheel=null;n.removeData(this,"mousewheel-line-height");n.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var i=n(t)["offsetParent"in n.fn?"offsetParent":"parent"]();return i.length||(i=n("body")),parseInt(i.css("fontSize"),10)},getPageHeight:function(t){return n(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};n.fn.extend({mousewheel:function(n){return n?this.bind("mousewheel",n):this.trigger("mousewheel")},unmousewheel:function(n){return this.unbind("mousewheel",n)}})}),function(n,t){(function(n){n(jQuery)})(function(i){var o="mCustomScrollbar",u="mCS",l=".mCustomScrollbar",a={setWidth:!1,setHeight:!1,setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:!0,autoHideScrollbar:!1,autoExpandScrollbar:!1,alwaysShowScrollbar:0,snapAmount:null,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1,disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{enable:!1,scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,advanced:{autoExpandHorizontalScroll:!1,autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:!0,updateOnSelectorChange:!1},theme:"light",callbacks:{onScrollStart:!1,onScroll:!1,onTotalScroll:!1,onTotalScrollBack:!1,whileScrolling:!1,onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0,onOverflowY:!1,onOverflowX:!1,onOverflowYNone:!1,onOverflowXNone:!1},live:!1,liveSelector:null},v=0,h={},c=function(n){h[n]&&(clearTimeout(h[n]),r._delete.call(null,h[n]))},s=n.attachEvent&&!n.addEventListener?1:0,f=!1,e={init:function(n){var n=i.extend(!0,{},a,n),o=r._selector.call(this),t,f;if(n.live){if(t=n.liveSelector||this.selector||l,f=i(t),n.live==="off"){c(t);return}h[t]=setTimeout(function(){f.mCustomScrollbar(n);n.live==="once"&&f.length&&c(t)},500)}else c(t);return n.setWidth=n.set_width?n.set_width:n.setWidth,n.setHeight=n.set_height?n.set_height:n.setHeight,n.axis=n.horizontalScroll?"x":r._findAxis.call(null,n.axis),n.scrollInertia=n.scrollInertia>0&&n.scrollInertia<17?17:n.scrollInertia,typeof n.mouseWheel!="object"&&n.mouseWheel==!0&&(n.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),n.mouseWheel.scrollAmount=n.mouseWheelPixels?n.mouseWheelPixels:n.mouseWheel.scrollAmount,n.mouseWheel.normalizeDelta=n.advanced.normalizeMouseWheelDelta?n.advanced.normalizeMouseWheelDelta:n.mouseWheel.normalizeDelta,n.scrollButtons.scrollType=r._findScrollButtonsType.call(null,n.scrollButtons.scrollType),r._theme.call(null,n),i(o).each(function(){var t=i(this);if(!t.data(u)){t.data(u,{idx:++v,opt:n,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:t.css("direction"),cbOffsets:null,trigger:null});var f=t.data(u).opt,o=t.data("mcs-axis"),s=t.data("mcs-scrollbar-position"),h=t.data("mcs-theme");o&&(f.axis=o);s&&(f.scrollbarPosition=s);h&&(f.theme=h,r._theme.call(null,f));r._pluginMarkup.call(this);e.update.call(null,t)}})},update:function(n){var t=n||r._selector.call(this);return i(t).each(function(){var t=i(this),o;if(t.data(u)){var n=t.data(u),f=n.opt,e=i("#mCSB_"+n.idx+"_container"),s=[i("#mCSB_"+n.idx+"_dragger_vertical"),i("#mCSB_"+n.idx+"_dragger_horizontal")];if(!e.length)return;n.tweenRunning&&r._stop.call(null,t);t.hasClass("mCS_disabled")&&t.removeClass("mCS_disabled");t.hasClass("mCS_destroyed")&&t.removeClass("mCS_destroyed");r._maxHeight.call(this);r._expandContentHorizontally.call(this);f.axis==="y"||f.advanced.autoExpandHorizontalScroll||e.css("width",r._contentWidth(e.children()));n.overflowed=r._overflowed.call(this);r._scrollbarVisibility.call(this);f.autoDraggerLength&&r._setDraggerLength.call(this);r._scrollRatio.call(this);r._bindEvents.call(this);o=[Math.abs(e[0].offsetTop),Math.abs(e[0].offsetLeft)];f.axis!=="x"&&(n.overflowed[0]?s[0].height()>s[0].parent().height()?r._resetContentPosition.call(this):(r._scrollTo.call(this,t,o[0].toString(),{dir:"y",dur:0,overwrite:"none"}),n.contentReset.y=null):(r._resetContentPosition.call(this),f.axis==="y"?r._unbindEvents.call(this):f.axis==="yx"&&n.overflowed[1]&&r._scrollTo.call(this,t,o[1].toString(),{dir:"x",dur:0,overwrite:"none"})));f.axis!=="y"&&(n.overflowed[1]?s[1].width()>s[1].parent().width()?r._resetContentPosition.call(this):(r._scrollTo.call(this,t,o[1].toString(),{dir:"x",dur:0,overwrite:"none"}),n.contentReset.x=null):(r._resetContentPosition.call(this),f.axis==="x"?r._unbindEvents.call(this):f.axis==="yx"&&n.overflowed[0]&&r._scrollTo.call(this,t,o[0].toString(),{dir:"y",dur:0,overwrite:"none"})));r._autoUpdate.call(this)}})},scrollTo:function(n,t){if(typeof n!="undefined"&&n!=null){var f=r._selector.call(this);return i(f).each(function(){var s=i(this);if(s.data(u)){var o=s.data(u),h=o.opt,c={trigger:"external",scrollInertia:h.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},f=i.extend(!0,{},c,t),e=r._arr.call(this,n),l=f.scrollInertia>0&&f.scrollInertia<17?17:f.scrollInertia;e[0]=r._to.call(this,e[0],"y");e[1]=r._to.call(this,e[1],"x");f.moveDragger&&(e[0]*=o.scrollRatio.y,e[1]*=o.scrollRatio.x);f.dur=l;setTimeout(function(){e[0]!==null&&typeof e[0]!="undefined"&&h.axis!=="x"&&o.overflowed[0]&&(f.dir="y",f.overwrite="all",r._scrollTo.call(this,s,e[0].toString(),f));e[1]!==null&&typeof e[1]!="undefined"&&h.axis!=="y"&&o.overflowed[1]&&(f.dir="x",f.overwrite="none",r._scrollTo.call(this,s,e[1].toString(),f))},f.timeout)}})}},stop:function(){var n=r._selector.call(this);return i(n).each(function(){var n=i(this);n.data(u)&&r._stop.call(null,n)})},disable:function(n){var t=r._selector.call(this);return i(t).each(function(){var t=i(this),f,e;t.data(u)&&(f=t.data(u),e=f.opt,r._autoUpdate.call(this,"remove"),r._unbindEvents.call(this),n&&r._resetContentPosition.call(this),r._scrollbarVisibility.call(this,!0),t.addClass("mCS_disabled"))})},destroy:function(){var n=r._selector.call(this);return i(n).each(function(){var f=i(this);if(f.data(u)){var t=f.data(u),e=t.opt,s=i("#mCSB_"+t.idx),h=i("#mCSB_"+t.idx+"_container"),l=i(".mCSB_"+t.idx+"_scrollbar");e.live&&c(n);r._autoUpdate.call(this,"remove");r._unbindEvents.call(this);r._resetContentPosition.call(this);f.removeData(u);r._delete.call(null,this.mcs);l.remove();s.replaceWith(h.contents());f.removeClass(o+" _"+u+"_"+t.idx+" mCS-autoHide mCS-dir-rtl mCS_no_scrollbar mCS_disabled").addClass("mCS_destroyed")}})}},r={_selector:function(){return typeof i(this)!="object"||i(this).length<1?l:this},_theme:function(n){n.autoDraggerLength=i.inArray(n.theme,["rounded","rounded-dark","rounded-dots","rounded-dots-dark"])>-1?!1:n.autoDraggerLength;n.autoExpandScrollbar=i.inArray(n.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"])>-1?!1:n.autoExpandScrollbar;n.scrollButtons.enable=i.inArray(n.theme,["minimal","minimal-dark"])>-1?!1:n.scrollButtons.enable;n.autoHideScrollbar=i.inArray(n.theme,["minimal","minimal-dark"])>-1?!0:n.autoHideScrollbar;n.scrollbarPosition=i.inArray(n.theme,["minimal","minimal-dark"])>-1?"outside":n.scrollbarPosition},_findAxis:function(n){return n==="yx"||n==="xy"||n==="auto"?"yx":n==="x"||n==="horizontal"?"x":"y"},_findScrollButtonsType:function(n){return n==="stepped"||n==="pixels"||n==="step"||n==="click"?"stepped":"stepless"},_pluginMarkup:function(){var f=i(this),t=f.data(u),n=t.opt,l=n.autoExpandScrollbar?" mCSB_scrollTools_onDrag_expand":"",s=["<div id='mCSB_"+t.idx+"_scrollbar_vertical' class='mCSB_scrollTools mCSB_"+t.idx+"_scrollbar mCS-"+n.theme+" mCSB_scrollTools_vertical"+l+"'><div class='mCSB_draggerContainer'><div id='mCSB_"+t.idx+"_dragger_vertical' class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><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-"+n.theme+" mCSB_scrollTools_horizontal"+l+"'><div class='mCSB_draggerContainer'><div id='mCSB_"+t.idx+"_dragger_horizontal' class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' /><\/div><div class='mCSB_draggerRail' /><\/div><\/div>"],v=n.axis==="yx"?"mCSB_vertical_horizontal":n.axis==="x"?"mCSB_horizontal":"mCSB_vertical",a=n.axis==="yx"?s[0]+s[1]:n.axis==="x"?s[1]:s[0],y=n.axis==="yx"?"<div id='mCSB_"+t.idx+"_container_wrapper' class='mCSB_container_wrapper' />":"",p=n.autoHideScrollbar?" mCS-autoHide":"",w=n.axis!=="x"&&t.langDir==="rtl"?" mCS-dir-rtl":"",c,h,e;n.setWidth&&f.css("width",n.setWidth);n.setHeight&&f.css("height",n.setHeight);n.setLeft=n.axis!=="y"&&t.langDir==="rtl"?"989999px":n.setLeft;f.addClass(o+" _"+u+"_"+t.idx+p+w).wrapInner("<div id='mCSB_"+t.idx+"' class='mCustomScrollBox mCS-"+n.theme+" "+v+"'><div id='mCSB_"+t.idx+"_container' class='mCSB_container' style='position:relative; top:"+n.setTop+"; left:"+n.setLeft+";' dir="+t.langDir+" /><\/div>");c=i("#mCSB_"+t.idx);h=i("#mCSB_"+t.idx+"_container");n.axis==="y"||n.advanced.autoExpandHorizontalScroll||h.css("width",r._contentWidth(h.children()));n.scrollbarPosition==="outside"?(f.css("position")==="static"&&f.css("position","relative"),f.css("overflow","visible"),c.addClass("mCSB_outside").after(a)):(c.addClass("mCSB_inside").append(a),h.wrap(y));r._scrollButtons.call(this);e=[i("#mCSB_"+t.idx+"_dragger_vertical"),i("#mCSB_"+t.idx+"_dragger_horizontal")];e[0].css("min-height",e[0].height());e[1].css("min-width",e[1].width())},_contentWidth:function(n){return Math.max.apply(Math,n.map(function(){return i(this).outerWidth(!0)}).get())},_expandContentHorizontally:function(){var f=i(this),t=f.data(u),r=t.opt,n=i("#mCSB_"+t.idx+"_container");r.advanced.autoExpandHorizontalScroll&&r.axis!=="y"&&n.css({position:"absolute",width:"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:Math.ceil(n[0].getBoundingClientRect().right+.4)-Math.floor(n[0].getBoundingClientRect().left),position:"relative"}).unwrap()},_scrollButtons:function(){var e=i(this),f=e.data(u),r=f.opt,o=i(".mCSB_"+f.idx+"_scrollbar:first"),n=["<a href='#' class='mCSB_buttonUp' oncontextmenu='return false;' />","<a href='#' class='mCSB_buttonDown' oncontextmenu='return false;' />","<a href='#' class='mCSB_buttonLeft' oncontextmenu='return false;' />","<a href='#' class='mCSB_buttonRight' oncontextmenu='return false;' />"],t=[r.axis==="x"?n[2]:n[0],r.axis==="x"?n[3]:n[1],n[2],n[3]];r.scrollButtons.enable&&o.prepend(t[0]).append(t[1]).next(".mCSB_scrollTools").prepend(t[2]).append(t[3])},_maxHeight:function(){var n=i(this),f=n.data(u),h=f.opt,e=i("#mCSB_"+f.idx),t=n.css("max-height"),o=t.indexOf("%")!==-1,s=n.css("box-sizing"),r;t!=="none"&&(r=o?n.parent().height()*parseInt(t)/100:parseInt(t),s==="border-box"&&(r-=n.innerHeight()-n.height()+(n.outerHeight()-n.innerHeight())),e.css("max-height",Math.round(r)))},_setDraggerLength:function(){var h=i(this),r=h.data(u),f=i("#mCSB_"+r.idx),e=i("#mCSB_"+r.idx+"_container"),t=[i("#mCSB_"+r.idx+"_dragger_vertical"),i("#mCSB_"+r.idx+"_dragger_horizontal")],o=[f.height()/e.outerHeight(!1),f.width()/e.outerWidth(!1)],n=[parseInt(t[0].css("min-height")),Math.round(o[0]*t[0].parent().height()),parseInt(t[1].css("min-width")),Math.round(o[1]*t[1].parent().width())],c=s&&n[1]<n[0]?n[0]:n[1],l=s&&n[3]<n[2]?n[2]:n[3];t[0].css({height:c,"max-height":t[0].parent().height()-10}).find(".mCSB_dragger_bar").css({"line-height":n[0]+"px"});t[1].css({width:l,"max-width":t[1].parent().width()-10})},_scrollRatio:function(){var s=i(this),n=s.data(u),r=i("#mCSB_"+n.idx),f=i("#mCSB_"+n.idx+"_container"),t=[i("#mCSB_"+n.idx+"_dragger_vertical"),i("#mCSB_"+n.idx+"_dragger_horizontal")],e=[f.outerHeight(!1)-r.height(),f.outerWidth(!1)-r.width()],o=[e[0]/(t[0].parent().height()-t[0].height()),e[1]/(t[1].parent().width()-t[1].width())];n.scrollRatio={y:o[0],x:o[1]}},_onDragClasses:function(n,t,i){var f=i?"mCSB_dragger_onDrag_expanded":"",r=["mCSB_dragger_onDrag","mCSB_scrollTools_onDrag"],u=n.closest(".mCSB_scrollTools");t==="active"?(n.toggleClass(r[0]+" "+f),u.toggleClass(r[1]),n[0]._draggable=n[0]._draggable?0:1):n[0]._draggable||(t==="hide"?(n.removeClass(r[0]),u.removeClass(r[1])):(n.addClass(r[0]),u.addClass(r[1])))},_overflowed:function(){var f=i(this),n=f.data(u),r=i("#mCSB_"+n.idx),t=i("#mCSB_"+n.idx+"_container"),e=n.overflowed==null?t.height():t.outerHeight(!1),o=n.overflowed==null?t.width():t.outerWidth(!1);return[e>r.height(),o>r.width()]},_resetContentPosition:function(){var t=i(this),n=t.data(u),f=n.opt,h=i("#mCSB_"+n.idx),o=i("#mCSB_"+n.idx+"_container"),s=[i("#mCSB_"+n.idx+"_dragger_vertical"),i("#mCSB_"+n.idx+"_dragger_horizontal")],e;r._stop(t);(f.axis!=="x"&&!n.overflowed[0]||f.axis==="y"&&n.overflowed[0])&&(s[0].add(o).css("top",0),r._scrollTo(t,"_resetY"));(f.axis!=="y"&&!n.overflowed[1]||f.axis==="x"&&n.overflowed[1])&&(e=dx=0,n.langDir==="rtl"&&(e=h.width()-o.outerWidth(!1),dx=Math.abs(e/n.scrollRatio.x)),o.css("left",e),s[1].css("left",dx),r._scrollTo(t,"_resetX"))},_bindEvents:function(){var f=i(this),t=f.data(u),n=t.opt,o;if(!t.bindEvents){if(r._draggable.call(this),n.contentTouchScroll&&r._contentDraggable.call(this),n.mouseWheel.enable){function e(){o=setTimeout(function(){i.event.special.mousewheel?(clearTimeout(o),r._mousewheel.call(f[0])):e()},1e3)}e()}r._draggerRail.call(this);r._wrapperScroll.call(this);n.advanced.autoScrollOnFocus&&r._focus.call(this);n.scrollButtons.enable&&r._buttons.call(this);n.keyboard.enable&&r._keyboard.call(this);t.bindEvents=!0}},_unbindEvents:function(){var f=i(this),n=f.data(u),e=u+"_"+n.idx,o=".mCSB_"+n.idx+"_scrollbar",h=i("#mCSB_"+n.idx+",#mCSB_"+n.idx+"_container,#mCSB_"+n.idx+"_container_wrapper,"+o+" .mCSB_draggerContainer,#mCSB_"+n.idx+"_dragger_vertical,#mCSB_"+n.idx+"_dragger_horizontal,"+o+">a"),s=i("#mCSB_"+n.idx+"_container");n.bindEvents&&(i(t).unbind("."+e),h.each(function(){i(this).unbind("."+e)}),clearTimeout(f[0]._focusTimeout),r._delete.call(null,f[0]._focusTimeout),clearTimeout(n.sequential.step),r._delete.call(null,n.sequential.step),clearTimeout(s[0].onCompleteTimeout),r._delete.call(null,s[0].onCompleteTimeout),n.bindEvents=!1)},_scrollbarVisibility:function(n){var s=i(this),r=s.data(u),e=r.opt,h=i("#mCSB_"+r.idx+"_container_wrapper"),f=h.length?h:i("#mCSB_"+r.idx+"_container"),t=[i("#mCSB_"+r.idx+"_scrollbar_vertical"),i("#mCSB_"+r.idx+"_scrollbar_horizontal")],o=[t[0].find(".mCSB_dragger"),t[1].find(".mCSB_dragger")];e.axis!=="x"&&(r.overflowed[0]&&!n?(t[0].add(o[0]).add(t[0].children("a")).css("display","block"),f.removeClass("mCS_no_scrollbar_y mCS_y_hidden")):(e.alwaysShowScrollbar?(e.alwaysShowScrollbar!==2&&o[0].add(t[0].children("a")).css("display","none"),f.removeClass("mCS_y_hidden")):(t[0].css("display","none"),f.addClass("mCS_y_hidden")),f.addClass("mCS_no_scrollbar_y")));e.axis!=="y"&&(r.overflowed[1]&&!n?(t[1].add(o[1]).add(t[1].children("a")).css("display","block"),f.removeClass("mCS_no_scrollbar_x mCS_x_hidden")):(e.alwaysShowScrollbar?(e.alwaysShowScrollbar!==2&&o[1].add(t[1].children("a")).css("display","none"),f.removeClass("mCS_x_hidden")):(t[1].css("display","none"),f.addClass("mCS_x_hidden")),f.addClass("mCS_no_scrollbar_x")));r.overflowed[0]||r.overflowed[1]?s.removeClass("mCS_no_scrollbar"):s.addClass("mCS_no_scrollbar")},_coordinates:function(n){var i=n.type,t;switch(i){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return[n.originalEvent.pageY,n.originalEvent.pageX];case"touchstart":case"touchmove":case"touchend":return t=n.originalEvent.touches[0]||n.originalEvent.changedTouches[0],[t.pageY,t.pageX];default:return[n.pageY,n.pageX]}},_draggable:function(){function w(n){var t=y.find("iframe"),i;t.length&&(i=n?"auto":"none",t.css("pointer-events",i))}function b(t,i,u,f){var e,s;y[0].idleTimer=l.scrollInertia<233?250:0;n.attr("id")===a[1]?(e="x",s=(n[0].offsetLeft-i+f)*o.scrollRatio.x):(e="y",s=(n[0].offsetTop-t+u)*o.scrollRatio.y);r._scrollTo(c,s.toString(),{dir:e,drag:!0})}var c=i(this),o=c.data(u),l=o.opt,e=u+"_"+o.idx,a=["mCSB_"+o.idx+"_dragger_vertical","mCSB_"+o.idx+"_dragger_horizontal"],y=i("#mCSB_"+o.idx+"_container"),p=i("#"+a[0]+",#"+a[1]),n,h,v;p.bind("mousedown."+e+" touchstart."+e+" pointerdown."+e+" MSPointerDown."+e,function(u){if(u.stopImmediatePropagation(),u.preventDefault(),r._mouseBtnLeft(u)){f=!0;s&&(t.onselectstart=function(){return!1});w(!1);r._stop(c);n=i(this);var e=n.offset(),o=r._coordinates(u)[0]-e.top,a=r._coordinates(u)[1]-e.left,y=n.height()+e.top,p=n.width()+e.left;o<y&&o>0&&a<p&&a>0&&(h=o,v=a);r._onDragClasses(n,"active",l.autoExpandScrollbar)}}).bind("touchmove."+e,function(t){t.stopImmediatePropagation();t.preventDefault();var i=n.offset(),u=r._coordinates(t)[0]-i.top,f=r._coordinates(t)[1]-i.left;b(h,v,u,f)});i(t).bind("mousemove."+e+" pointermove."+e+" MSPointerMove."+e,function(t){if(n){var i=n.offset(),u=r._coordinates(t)[0]-i.top,f=r._coordinates(t)[1]-i.left;if(h===u)return;b(h,v,u,f)}}).add(p).bind("mouseup."+e+" touchend."+e+" pointerup."+e+" MSPointerUp."+e,function(){n&&(r._onDragClasses(n,"active",l.autoExpandScrollbar),n=null);f=!1;s&&(t.onselectstart=null);w(!0)})},_contentDraggable:function(){function et(n,t){var i=[t*1.5,t*2,t/1.5,t/2];return n>90?t>4?i[0]:i[3]:n>60?t>3?i[3]:i[2]:n>30?t>8?i[1]:t>6?i[0]:t>4?t:i[2]:t>8?t:i[3]}function b(n,t,i,u,f,e){n&&r._scrollTo(k,n.toString(),{dur:t,scrollEasing:i,dir:u,overwrite:f,drag:e})}var k=i(this),n=k.data(u),s=n.opt,t=u+"_"+n.idx,v=i("#mCSB_"+n.idx),c=i("#mCSB_"+n.idx+"_container"),y=[i("#mCSB_"+n.idx+"_dragger_vertical"),i("#mCSB_"+n.idx+"_dragger_horizontal")],l,a,tt,it,p=[],w=[],rt,ut,d,h,o,e,ft=0,g,nt=s.axis==="yx"?"none":"all";c.bind("touchstart."+t+" pointerdown."+t+" MSPointerDown."+t,function(n){if(r._pointerTouch(n)&&!f){var t=c.offset();l=r._coordinates(n)[0]-t.top;a=r._coordinates(n)[1]-t.left}}).bind("touchmove."+t+" pointermove."+t+" MSPointerMove."+t,function(t){var k,d,g,tt;if(r._pointerTouch(t)&&!f){t.stopImmediatePropagation();ut=r._getTime();var o=v.offset(),i=r._coordinates(t)[0]-o.top,u=r._coordinates(t)[1]-o.left,h="mcsLinearOut";p.push(i);w.push(u);n.overflowed[0]&&(k=y[0].parent().height()-y[0].height(),d=l-i>0&&i-l>-(k*n.scrollRatio.y));n.overflowed[1]&&(g=y[1].parent().width()-y[1].width(),tt=a-u>0&&u-a>-(g*n.scrollRatio.x));(d||tt)&&t.preventDefault();e=s.axis==="yx"?[l-i,a-u]:s.axis==="x"?[null,a-u]:[l-i,null];c[0].idleTimer=250;n.overflowed[0]&&b(e[0],ft,h,"y","all",!0);n.overflowed[1]&&b(e[1],ft,h,"x",nt,!0)}});v.bind("touchstart."+t+" pointerdown."+t+" MSPointerDown."+t,function(n){if(r._pointerTouch(n)&&!f){n.stopImmediatePropagation();r._stop(k);rt=r._getTime();var t=v.offset();tt=r._coordinates(n)[0]-t.top;it=r._coordinates(n)[1]-t.left;p=[];w=[]}}).bind("touchend."+t+" pointerup."+t+" MSPointerUp."+t,function(t){var i,u,a;if(r._pointerTouch(t)&&!f){t.stopImmediatePropagation();d=r._getTime();var y=v.offset(),k=r._coordinates(t)[0]-y.top,ft=r._coordinates(t)[1]-y.left;if(!(d-ut>30)){o=1e3/(d-rt);var ot="mcsEaseOut",l=o<2.5,st=l?[p[p.length-2],w[w.length-2]]:[0,0];h=l?[k-st[0],ft-st[1]]:[k-tt,ft-it];i=[Math.abs(h[0]),Math.abs(h[1])];o=l?[Math.abs(h[0]/4),Math.abs(h[1]/4)]:[o,o];u=[Math.abs(c[0].offsetTop)-h[0]*et(i[0]/o[0],o[0]),Math.abs(c[0].offsetLeft)-h[1]*et(i[1]/o[1],o[1])];e=s.axis==="yx"?[u[0],u[1]]:s.axis==="x"?[null,u[1]]:[u[0],null];g=[i[0]*4+s.scrollInertia,i[1]*4+s.scrollInertia];a=parseInt(s.contentTouchScroll)||0;e[0]=i[0]>a?e[0]:0;e[1]=i[1]>a?e[1]:0;n.overflowed[0]&&b(e[0],g[0],ot,"y",nt,!1);n.overflowed[1]&&b(e[1],g[1],ot,"x",nt,!1)}}})},_mousewheel:function(){function a(n){var t=null,i;try{i=n.contentDocument||n.contentWindow.document;t=i.body.innerHTML}catch(r){}return t!==null}var o=i(this),n=o.data(u);if(n){var t=n.opt,l=u+"_"+n.idx,e=i("#mCSB_"+n.idx),f=[i("#mCSB_"+n.idx+"_dragger_vertical"),i("#mCSB_"+n.idx+"_dragger_horizontal")],c=i("#mCSB_"+n.idx+"_container").find("iframe"),h=e;c.length&&c.each(function(){var n=this;a(n)&&(h=h.add(i(n).contents().find("body")))});h.bind("mousewheel."+l,function(u,h){var a;if(r._stop(o),!r._disableMousewheel(o,u.target)){if(a=t.mouseWheel.deltaFactor!=="auto"?parseInt(t.mouseWheel.deltaFactor):s&&u.deltaFactor<100?100:u.deltaFactor||100,t.axis==="x"||t.mouseWheel.axis==="x")var v="x",l=[Math.round(a*n.scrollRatio.x),parseInt(t.mouseWheel.scrollAmount)],p=t.mouseWheel.scrollAmount!=="auto"?l[1]:l[0]>=e.width()?e.width()*.9:l[0],w=Math.abs(i("#mCSB_"+n.idx+"_container")[0].offsetLeft),y=f[1][0].offsetLeft,b=f[1].parent().width()-f[1].width(),c=u.deltaX||u.deltaY||h;else var v="y",l=[Math.round(a*n.scrollRatio.y),parseInt(t.mouseWheel.scrollAmount)],p=t.mouseWheel.scrollAmount!=="auto"?l[1]:l[0]>=e.height()?e.height()*.9:l[0],w=Math.abs(i("#mCSB_"+n.idx+"_container")[0].offsetTop),y=f[0][0].offsetTop,b=f[0].parent().height()-f[0].height(),c=u.deltaY||h;(v!=="y"||n.overflowed[0])&&(v!=="x"||n.overflowed[1])&&(t.mouseWheel.invert&&(c=-c),t.mouseWheel.normalizeDelta&&(c=c<0?-1:1),(c>0&&y!==0||c<0&&y!==b||t.mouseWheel.preventDefault)&&(u.stopImmediatePropagation(),u.preventDefault()),r._scrollTo(o,(w-c*p).toString(),{dir:v}))}})}},_disableMousewheel:function(n,t){var r=t.nodeName.toLowerCase(),f=n.data(u).opt.mouseWheel.disableOver;return i.inArray(r,f)>-1&&!(i.inArray(r,["select","textarea"])>-1&&!i(t).is(":focus"))},_draggerRail:function(){var e=i(this),t=e.data(u),n=u+"_"+t.idx,o=i("#mCSB_"+t.idx+"_container"),s=o.parent(),h=i(".mCSB_"+t.idx+"_scrollbar .mCSB_draggerContainer");h.bind("touchstart."+n+" pointerdown."+n+" MSPointerDown."+n,function(){f=!0}).bind("touchend."+n+" pointerup."+n+" MSPointerUp."+n,function(){f=!1}).bind("click."+n,function(n){var u,f;if(i(n.target).hasClass("mCSB_draggerContainer")||i(n.target).hasClass("mCSB_draggerRail")){if(r._stop(e),u=i(this),f=u.find(".mCSB_dragger"),u.parent(".mCSB_scrollTools_horizontal").length>0){if(!t.overflowed[1])return;var c="x",h=n.pageX>f.offset().left?-1:1,l=Math.abs(o[0].offsetLeft)-h*s.width()*.9}else{if(!t.overflowed[0])return;var c="y",h=n.pageY>f.offset().top?-1:1,l=Math.abs(o[0].offsetTop)-h*s.height()*.9}r._scrollTo(e,l.toString(),{dir:c,scrollEasing:"mcsEaseInOut"})}})},_focus:function(){var n=i(this),o=n.data(u),e=o.opt,h=u+"_"+o.idx,f=i("#mCSB_"+o.idx+"_container"),s=f.parent();f.bind("focusin."+h,function(){var u=i(t.activeElement),h=f.find(".mCustomScrollBox").length,o=0;u.is(e.advanced.autoScrollOnFocus)&&(r._stop(n),clearTimeout(n[0]._focusTimeout),n[0]._focusTimer=h?(o+17)*h:0,n[0]._focusTimeout=setTimeout(function(){var t=[u.offset().top-f.offset().top,u.offset().left-f.offset().left],i=[f[0].offsetTop,f[0].offsetLeft],h=[i[0]+t[0]>=0&&i[0]+t[0]<s.height()-u.outerHeight(!1),i[1]+t[1]>=0&&i[0]+t[1]<s.width()-u.outerWidth(!1)],c=e.axis==="yx"&&!h[0]&&!h[1]?"none":"all";e.axis==="x"||h[0]||r._scrollTo(n,t[0].toString(),{dir:"y",scrollEasing:"mcsEaseInOut",overwrite:c,dur:o});e.axis==="y"||h[1]||r._scrollTo(n,t[1].toString(),{dir:"x",scrollEasing:"mcsEaseInOut",overwrite:c,dur:o})},n[0]._focusTimer))})},_wrapperScroll:function(){var r=i(this),n=r.data(u),f=u+"_"+n.idx,t=i("#mCSB_"+n.idx+"_container").parent();t.bind("scroll."+f,function(){t.scrollTop(0).scrollLeft(0)})},_buttons:function(){var s=i(this),t=s.data(u),o=t.opt,e=t.sequential,n=u+"_"+t.idx,l=i("#mCSB_"+t.idx+"_container"),h=".mCSB_"+t.idx+"_scrollbar",c=i(h+">a");c.bind("mousedown."+n+" touchstart."+n+" pointerdown."+n+" MSPointerDown."+n+" mouseup."+n+" touchend."+n+" pointerup."+n+" MSPointerUp."+n+" mouseout."+n+" pointerout."+n+" MSPointerOut."+n+" click."+n,function(n){function h(n,t){e.scrollAmount=o.snapAmount||o.scrollButtons.scrollAmount;r._sequentialScroll.call(this,s,n,t)}if(n.preventDefault(),r._mouseBtnLeft(n)){var u=i(this).attr("class");e.type=o.scrollButtons.scrollType;switch(n.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if(e.type==="stepped")return;f=!0;t.tweenRunning=!1;h("on",u);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if(e.type==="stepped")return;f=!1;e.dir&&h("off",u);break;case"click":if(e.type!=="stepped"||t.tweenRunning)return;h("on",u)}}})},_keyboard:function(){var e=i(this),n=e.data(u),f=n.opt,s=n.sequential,c=u+"_"+n.idx,a=i("#mCSB_"+n.idx),o=i("#mCSB_"+n.idx+"_container"),h=o.parent(),l="input,textarea,select,datalist,keygen,[contenteditable='true']";a.attr("tabindex","0").bind("blur."+c+" keydown."+c+" keyup."+c,function(u){function w(t,i){(s.type=f.keyboard.scrollType,s.scrollAmount=f.snapAmount||f.keyboard.scrollAmount,s.type==="stepped"&&n.tweenRunning)||r._sequentialScroll.call(this,e,t,i)}var c,y,p,a,v;switch(u.type){case"blur":n.tweenRunning&&s.dir&&w("off",null);break;case"keydown":case"keyup":if(c=u.keyCode?u.keyCode:u.which,y="on",f.axis!=="x"&&(c===38||c===40)||f.axis!=="y"&&(c===37||c===39)){if((c===38||c===40)&&!n.overflowed[0]||(c===37||c===39)&&!n.overflowed[1])return;u.type==="keyup"&&(y="off");i(t.activeElement).is(l)||(u.preventDefault(),u.stopImmediatePropagation(),w(y,c))}else c===33||c===34?((n.overflowed[0]||n.overflowed[1])&&(u.preventDefault(),u.stopImmediatePropagation()),u.type==="keyup"&&(r._stop(e),p=c===34?-1:1,f.axis==="x"||f.axis==="yx"&&n.overflowed[1]&&!n.overflowed[0]?(a="x",v=Math.abs(o[0].offsetLeft)-p*h.width()*.9):(a="y",v=Math.abs(o[0].offsetTop)-p*h.height()*.9),r._scrollTo(e,v.toString(),{dir:a,scrollEasing:"mcsEaseInOut"}))):(c===35||c===36)&&(i(t.activeElement).is(l)||((n.overflowed[0]||n.overflowed[1])&&(u.preventDefault(),u.stopImmediatePropagation()),u.type==="keyup"&&(f.axis==="x"||f.axis==="yx"&&n.overflowed[1]&&!n.overflowed[0]?(a="x",v=c===35?Math.abs(h.width()-o.outerWidth(!1)):0):(a="y",v=c===35?Math.abs(h.height()-o.outerHeight(!1)):0),r._scrollTo(e,v.toString(),{dir:a,scrollEasing:"mcsEaseInOut"}))))}})},_sequentialScroll:function(n,t,f){function s(t){var u=e.type!=="stepped",f=t?u?h.scrollInertia/1.5:h.scrollInertia:1e3/60,l=t?u?7.5:40:2.5,i=[Math.abs(c[0].offsetTop),Math.abs(c[0].offsetLeft)],a=[o.scrollRatio.y>10?10:o.scrollRatio.y,o.scrollRatio.x>10?10:o.scrollRatio.x],y=e.dir[0]==="x"?i[1]+e.dir[1]*a[1]*l:i[0]+e.dir[1]*a[0]*l,p=e.dir[0]==="x"?i[1]+e.dir[1]*parseInt(e.scrollAmount):i[0]+e.dir[1]*parseInt(e.scrollAmount),v=e.scrollAmount!=="auto"?p:y,w=t?u?"mcsLinearOut":"mcsEaseInOut":"mcsLinear",b=t?!0:!1;if(t&&f<17&&(v=e.dir[0]==="x"?i[1]:i[0]),r._scrollTo(n,v.toString(),{dir:e.dir[0],scrollEasing:w,dur:f,onComplete:b}),t){e.dir=!1;return}clearTimeout(e.step);e.step=setTimeout(function(){s()},f)}function a(){clearTimeout(e.step);r._stop(n)}var o=n.data(u),h=o.opt,e=o.sequential,c=i("#mCSB_"+o.idx+"_container"),l=e.type==="stepped"?!0:!1;switch(t){case"on":if(e.dir=[f==="mCSB_buttonRight"||f==="mCSB_buttonLeft"||f===39||f===37?"x":"y",f==="mCSB_buttonUp"||f==="mCSB_buttonLeft"||f===38||f===37?-1:1],r._stop(n),r._isNumeric(f)&&e.type==="stepped")return;s(l);break;case"off":a();(l||o.tweenRunning&&e.dir)&&s(!0)}},_arr:function(n){var r=i(this).data(u).opt,t=[];return typeof n=="function"&&(n=n()),n instanceof Array?t=n.length>1?[n[0],n[1]]:r.axis==="x"?[null,n[0]]:[n[0],null]:(t[0]=n.y?n.y:n.x||r.axis==="x"?null:n,t[1]=n.x?n.x:n.y||r.axis==="y"?null:n),typeof t[0]=="function"&&(t[0]=t[0]()),typeof t[1]=="function"&&(t[1]=t[1]()),t},_to:function(n,t){var h,c,o;if(n!=null&&typeof n!="undefined"){var l=i(this),a=l.data(u),p=a.opt,f=i("#mCSB_"+a.idx+"_container"),v=f.parent(),w=typeof n;t||(t=p.axis==="x"?"x":"y");var b=t==="x"?f.outerWidth(!1):f.outerHeight(!1),s=t==="x"?f.offset().left:f.offset().top,y=t==="x"?f[0].offsetLeft:f[0].offsetTop,k=t==="x"?"left":"top";switch(w){case"function":return n();case"object":if(n.nodeType)o=t==="x"?i(n).offset().left:i(n).offset().top;else if(n.jquery){if(!n.length)return;o=t==="x"?n.offset().left:n.offset().top}return o-s;case"string":case"number":if(r._isNumeric.call(null,n))return Math.abs(n);if(n.indexOf("%")!==-1)return Math.abs(b*parseInt(n)/100);if(n.indexOf("-=")!==-1)return Math.abs(y-parseInt(n.split("-=")[1]));if(n.indexOf("+=")!==-1)return h=y+parseInt(n.split("+=")[1]),h>=0?0:Math.abs(h);if(n.indexOf("px")!==-1&&r._isNumeric.call(null,n.split("px")[0]))return Math.abs(n.split("px")[0]);if(n==="top"||n==="left")return 0;if(n==="bottom")return Math.abs(v.height()-f.outerHeight(!1));if(n==="right")return Math.abs(v.width()-f.outerWidth(!1));if(n==="first"||n==="last")return c=f.find(":"+n),o=t==="x"?i(c).offset().left:i(c).offset().top,o-s;if(i(n).length)return o=t==="x"?i(n).offset().left:i(n).offset().top,o-s;f.css(k,n);e.update.call(null,l[0]);return}}},_autoUpdate:function(n){function d(){clearTimeout(t[0].autoUpdate);t[0].autoUpdate=setTimeout(function(){if(f.advanced.updateOnSelectorChange&&(v=nt(),v!==b)){p();b=v;return}f.advanced.updateOnContentResize&&(o=[t.outerHeight(!1),t.outerWidth(!1),c.height(),c.width(),a()[0],a()[1]],(o[0]!==s[0]||o[1]!==s[1]||o[2]!==s[2]||o[3]!==s[3]||o[4]!==s[4]||o[5]!==s[5])&&(p(),s=o));f.advanced.updateOnImageLoad&&(y=g(),y!==k&&(t.find("img").each(function(){tt(this.src)}),k=y));(f.advanced.updateOnSelectorChange||f.advanced.updateOnContentResize||f.advanced.updateOnImageLoad)&&d()},60)}function g(){var n=0;return f.advanced.updateOnImageLoad&&(n=t.find("img").length),n}function tt(n){function i(n,t){return function(){return t.apply(n,arguments)}}function r(){this.onload=null;p()}var t=new Image;t.onload=i(t,r);t.src=n}function nt(){f.advanced.updateOnSelectorChange===!0&&(f.advanced.updateOnSelectorChange="*");var n=0,r=t.find(f.advanced.updateOnSelectorChange);return f.advanced.updateOnSelectorChange&&r.length>0&&r.each(function(){n+=i(this).height()+i(this).width()}),n}function p(){clearTimeout(t[0].autoUpdate);e.update.call(null,w[0])}var w=i(this),h=w.data(u),f=h.opt,t=i("#mCSB_"+h.idx+"_container");if(n){clearTimeout(t[0].autoUpdate);r._delete.call(null,t[0].autoUpdate);return}var c=t.parent(),l=[i("#mCSB_"+h.idx+"_scrollbar_vertical"),i("#mCSB_"+h.idx+"_scrollbar_horizontal")],a=function(){return[l[0].is(":visible")?l[0].outerHeight(!0):0,l[1].is(":visible")?l[1].outerWidth(!0):0]},b=nt(),v,s=[t.outerHeight(!1),t.outerWidth(!1),c.height(),c.width(),a()[0],a()[1]],o,k=g(),y;d()},_snapAmount:function(n,t,i){return Math.round(n/t)*t-i},_stop:function(n){var t=n.data(u),f=i("#mCSB_"+t.idx+"_container,#mCSB_"+t.idx+"_container_wrapper,#mCSB_"+t.idx+"_dragger_vertical,#mCSB_"+t.idx+"_dragger_horizontal");f.each(function(){r._stopTween.call(this)})},_scrollTo:function(n,t,f){function l(n){return e&&o.callbacks[n]&&typeof o.callbacks[n]=="function"}function ut(){return[o.callbacks.alwaysTriggerOffsets||b>=a[0]+y,o.callbacks.alwaysTriggerOffsets||b<=-p]}function v(){var t=[s[0].offsetTop,s[0].offsetLeft],i=[c[0].offsetTop,c[0].offsetLeft],r=[s.outerHeight(!1),s.outerWidth(!1)],u=[w.height(),w.width()];n[0].mcs={content:s,top:t[0],left:t[1],draggerTop:i[0],draggerLeft:i[1],topPct:Math.round(100*Math.abs(t[0])/(Math.abs(r[0])-u[0])),leftPct:Math.round(100*Math.abs(t[1])/(Math.abs(r[1])-u[1])),direction:f.dir}}var e=n.data(u),o=e.opt,tt={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:o.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},f=i.extend(tt,f),k=[f.dur,f.drag?0:f.dur],w=i("#mCSB_"+e.idx),s=i("#mCSB_"+e.idx+"_container"),d=o.callbacks.onTotalScrollOffset?r._arr.call(n,o.callbacks.onTotalScrollOffset):[0,0],g=o.callbacks.onTotalScrollBackOffset?r._arr.call(n,o.callbacks.onTotalScrollBackOffset):[0,0];if(e.trigger=f.trigger,t!=="_resetY"||e.contentReset.y||(l("onOverflowYNone")&&o.callbacks.onOverflowYNone.call(n[0]),e.contentReset.y=1),t!=="_resetX"||e.contentReset.x||(l("onOverflowXNone")&&o.callbacks.onOverflowXNone.call(n[0]),e.contentReset.x=1),t!=="_resetY"&&t!=="_resetX"){(e.contentReset.y||!n[0].mcs)&&e.overflowed[0]&&(l("onOverflowY")&&o.callbacks.onOverflowY.call(n[0]),e.contentReset.x=null);(e.contentReset.x||!n[0].mcs)&&e.overflowed[1]&&(l("onOverflowX")&&o.callbacks.onOverflowX.call(n[0]),e.contentReset.x=null);o.snapAmount&&(t=r._snapAmount(t,o.snapAmount,o.snapOffset));switch(f.dir){case"x":var c=i("#mCSB_"+e.idx+"_dragger_horizontal"),nt="left",b=s[0].offsetLeft,a=[w.width()-s.outerWidth(!1),c.parent().width()-c.width()],h=[t,t===0?0:t/e.scrollRatio.x],y=d[1],p=g[1],it=y>0?y/e.scrollRatio.x:0,rt=p>0?p/e.scrollRatio.x:0;break;case"y":var c=i("#mCSB_"+e.idx+"_dragger_vertical"),nt="top",b=s[0].offsetTop,a=[w.height()-s.outerHeight(!1),c.parent().height()-c.height()],h=[t,t===0?0:t/e.scrollRatio.y],y=d[0],p=g[0],it=y>0?y/e.scrollRatio.y:0,rt=p>0?p/e.scrollRatio.y:0}(h[1]<0||h[0]===0&&h[1]===0?h=[0,0]:h[1]>=a[1]?h=[a[0],a[1]]:h[0]=-h[0],n[0].mcs||v(),clearTimeout(s[0].onCompleteTimeout),!e.tweenRunning&&(b===0&&h[0]>=0||b===a[0]&&h[0]<=a[0]))||(r._tweenTo.call(null,c[0],nt,Math.round(h[1]),k[1],f.scrollEasing),r._tweenTo.call(null,s[0],nt,Math.round(h[0]),k[0],f.scrollEasing,f.overwrite,{onStart:function(){f.callbacks&&f.onStart&&!e.tweenRunning&&(l("onScrollStart")&&(v(),o.callbacks.onScrollStart.call(n[0])),e.tweenRunning=!0,r._onDragClasses(c),e.cbOffsets=ut())},onUpdate:function(){f.callbacks&&f.onUpdate&&l("whileScrolling")&&(v(),o.callbacks.whileScrolling.call(n[0]))},onComplete:function(){if(f.callbacks&&f.onComplete){o.axis==="yx"&&clearTimeout(s[0].onCompleteTimeout);var t=s[0].idleTimer||0;s[0].onCompleteTimeout=setTimeout(function(){l("onScroll")&&(v(),o.callbacks.onScroll.call(n[0]));l("onTotalScroll")&&h[1]>=a[1]-it&&e.cbOffsets[0]&&(v(),o.callbacks.onTotalScroll.call(n[0]));l("onTotalScrollBack")&&h[1]<=rt&&e.cbOffsets[1]&&(v(),o.callbacks.onTotalScrollBack.call(n[0]));e.tweenRunning=!1;s[0].idleTimer=0;r._onDragClasses(c,"hide")},t)}}}))}},_tweenTo:function(t,i,u,f,e,o,s){function p(){t._mcsstop||(h||b.call(),h=r._getTime()-g,w(),h>=t._mcstime&&(t._mcstime=h>t._mcstime?h+c-(h-t._mcstime):h+c-1,t._mcstime<h+1&&(t._mcstime=h+1)),t._mcstime<f?t._mcsid=a(p):d.call())}function w(){f>0?(t._mcscurrVal=it(t._mcstime,l,y,f,e),v[i]=Math.round(t._mcscurrVal)+"px"):v[i]=u+"px";k.call()}function nt(){c=1e3/60;t._mcstime=h+c;a=n.requestAnimationFrame?n.requestAnimationFrame:function(n){return w(),setTimeout(n,.01)};t._mcsid=a(p)}function tt(){t._mcsid!=null&&(n.requestAnimationFrame?n.cancelAnimationFrame(t._mcsid):clearTimeout(t._mcsid),t._mcsid=null)}function it(n,t,i,r,u){switch(u){case"linear":case"mcsLinear":return i*n/r+t;case"mcsLinearOut":return n/=r,n--,i*Math.sqrt(1-n*n)+t;case"easeInOutSmooth":return(n/=r/2,n<1)?i/2*n*n+t:(n--,-i/2*(n*(n-2)-1)+t);case"easeInOutStrong":return(n/=r/2,n<1)?i/2*Math.pow(2,10*(n-1))+t:(n--,i/2*(-Math.pow(2,-10*n)+2)+t);case"easeInOut":case"mcsEaseInOut":return(n/=r/2,n<1)?i/2*n*n*n+t:(n-=2,i/2*(n*n*n+2)+t);case"easeOutSmooth":return n/=r,n--,-i*(n*n*n*n-1)+t;case"easeOutStrong":return i*(-Math.pow(2,-10*n/r)+1)+t;case"easeOut":case"mcsEaseOut":default:var f=(n/=r)*n,e=f*n;return t+i*(.499999999999997*e*f+-2.5*f*f+5.5*e+-6.5*f+4*n)}}var s=s||{},b=s.onStart||function(){},k=s.onUpdate||function(){},d=s.onComplete||function(){},g=r._getTime(),c,h=0,l=t.offsetTop,v=t.style,a,y;i==="left"&&(l=t.offsetLeft);y=u-l;t._mcsstop=0;o!=="none"&&tt();nt()},_getTime:function(){return n.performance&&n.performance.now?n.performance.now():n.performance&&n.performance.webkitNow?n.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},_stopTween:function(){var t=this;t._mcsid!=null&&(n.requestAnimationFrame?n.cancelAnimationFrame(t._mcsid):clearTimeout(t._mcsid),t._mcsid=null,t._mcsstop=1)},_delete:function(n){try{delete n}catch(t){n=null}},_mouseBtnLeft:function(n){return!(n.which&&n.which!==1)},_pointerTouch:function(n){var t=n.originalEvent.pointerType;return!(t&&t!=="touch"&&t!==2)},_isNumeric:function(n){return!isNaN(parseFloat(n))&&isFinite(n)}};i.fn[o]=function(n){if(e[n])return e[n].apply(this,Array.prototype.slice.call(arguments,1));if(typeof n!="object"&&n)i.error("Method "+n+" does not exist");else return e.init.apply(this,arguments)};i[o]=function(n){if(e[n])return e[n].apply(this,Array.prototype.slice.call(arguments,1));if(typeof n!="object"&&n)i.error("Method "+n+" does not exist");else return e.init.apply(this,arguments)};i[o].defaults=a;n[o]=!0;i(n).load(function(){i(l)[o]()})})}(window,document);jQuery.cookie=function(n,t,i){var u,r,f,e;return arguments.length>1&&String(t)!=="[object Object]"?(i=jQuery.extend({},i),(t===null||t===undefined)&&(i.expires=-1),typeof i.expires=="number"&&(u=i.expires,r=i.expires=new Date,r.setDate(r.getDate()+u)),t=String(t),document.cookie=[encodeURIComponent(n),"=",i.raw?t:encodeURIComponent(t),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")):(i=t||{},e=i.raw?function(n){return n}:decodeURIComponent,(f=new RegExp("(?:^|; )"+encodeURIComponent(n)+"=([^;]*)").exec(document.cookie))?e(f[1]):null)},function(n){typeof define=="function"&&define.amd?define(["jquery"],n):typeof exports=="object"?module.exports=n:n(jQuery)}(function(n){function e(i){var r=i||window.event,y=h.call(arguments,1),o=0,e=0,f=0,l=0,a,v;if(i=n.event.fix(r),i.type="mousewheel","detail"in r&&(f=r.detail*-1),"wheelDelta"in r&&(f=r.wheelDelta),"wheelDeltaY"in r&&(f=r.wheelDeltaY),"wheelDeltaX"in r&&(e=r.wheelDeltaX*-1),"axis"in r&&r.axis===r.HORIZONTAL_AXIS&&(e=f*-1,f=0),o=f===0?e:f,"deltaY"in r&&(f=r.deltaY*-1,o=f),"deltaX"in r&&(e=r.deltaX,f===0&&(o=e*-1)),f!==0||e!==0)return r.deltaMode===1?(a=n.data(this,"mousewheel-line-height"),o*=a,f*=a,e*=a):r.deltaMode===2&&(v=n.data(this,"mousewheel-page-height"),o*=v,f*=v,e*=v),l=Math.max(Math.abs(f),Math.abs(e)),(!t||l<t)&&(t=l,s(r,l)&&(t/=40)),s(r,l)&&(o/=10,e/=10,f/=10),o=Math[o>=1?"floor":"ceil"](o/t),e=Math[e>=1?"floor":"ceil"](e/t),f=Math[f>=1?"floor":"ceil"](f/t),i.deltaX=e,i.deltaY=f,i.deltaFactor=t,i.deltaMode=0,y.unshift(i,o,e,f),u&&clearTimeout(u),u=setTimeout(c,200),(n.event.dispatch||n.event.handle).apply(this,y)}function c(){t=null}function s(n,t){return r.settings.adjustOldDeltas&&n.type==="mousewheel"&&t%120==0}var o=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],i="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],h=Array.prototype.slice,u,t,f,r;if(n.event.fixHooks)for(f=o.length;f;)n.event.fixHooks[o[--f]]=n.event.mouseHooks;r=n.event.special.mousewheel={version:"3.1.9",setup:function(){if(this.addEventListener)for(var t=i.length;t;)this.addEventListener(i[--t],e,!1);else this.onmousewheel=e;n.data(this,"mousewheel-line-height",r.getLineHeight(this));n.data(this,"mousewheel-page-height",r.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var n=i.length;n;)this.removeEventListener(i[--n],e,!1);else this.onmousewheel=null},getLineHeight:function(t){return parseInt(n(t)["offsetParent"in n.fn?"offsetParent":"parent"]().css("fontSize"),10)},getPageHeight:function(t){return n(t).height()},settings:{adjustOldDeltas:!0}};n.fn.extend({mousewheel:function(n){return n?this.bind("mousewheel",n):this.trigger("mousewheel")},unmousewheel:function(n){return this.unbind("mousewheel",n)}})});!function(n,t,i){n.fn.jScrollPane=function(r){function u(r,u){function oi(t){var u,d,g,c,p,w,nt=!1,tt=!1;if(f=t,o===i)p=r.scrollTop(),w=r.scrollLeft(),r.css({overflow:"hidden",padding:0}),h=r.innerWidth()+st,s=r.innerHeight(),r.width(h),o=n('<div class="jspPane" />').css("padding",ai).append(r.children()),e=n('<div class="jspContainer" />').css({width:h+"px",height:s+"px"}).append(o).appendTo(r);else{if(r.css("width",""),nt=f.stickToBottom&&or(),tt=f.stickToRight&&sr(),c=r.innerWidth()+st!=h||r.outerHeight()!=s,c&&(h=r.innerWidth()+st,s=r.innerHeight(),e.css({width:h+"px",height:s+"px"})),!c&&gi==y&&o.outerHeight()==v)return r.width(h),void 0;gi=y;o.css("width","");r.width(h);e.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}o.css("overflow","auto");y=t.contentWidth?t.contentWidth:o[0].scrollWidth;v=o[0].scrollHeight;o.css("overflow","");ci=y/h;ni=v/s;k=ni>1;b=ci>1;b||k?(r.addClass("jspScrollable"),u=f.maintainPosition&&(l||a),u&&(d=rt(),g=ut()),nr(),tr(),ir(),u&&(at(tt?y-h:d,!1),it(nt?v-s:g,!1)),lr(),hr(),br(),f.enableKeyboardNavigation&&vr(),f.clickOnTrack&&ur(),pr(),f.hijackInternalLinks&&wr()):(r.removeClass("jspScrollable"),o.css({top:0,left:0,width:e.width()-st}),cr(),ar(),yr(),ki());f.autoReinitialise&&!pt?pt=setInterval(function(){oi(f)},f.autoReinitialiseDelay):!f.autoReinitialise&&pt&&clearInterval(pt);p&&r.scrollTop(0)&&it(p,!1);w&&r.scrollLeft(0)&&at(w,!1);r.trigger("jsp-initialised",[b||k])}function nr(){k&&(e.append(n('<div class="jspVerticalBar" />').append(n('<div class="jspCap jspCapTop" />'),n('<div class="jspTrack" />').append(n('<div class="jspDrag" />').append(n('<div class="jspDragTop" />'),n('<div class="jspDragBottom" />'))),n('<div class="jspCap jspCapBottom" />'))),ti=e.find(">.jspVerticalBar"),g=ti.find(">.jspTrack"),p=g.find(">.jspDrag"),f.showArrows&&(wt=n('<a class="jspArrow jspArrowUp" />').bind("mousedown.jsp",tt(0,-1)).bind("click.jsp",vt),bt=n('<a class="jspArrow jspArrowDown" />').bind("mousedown.jsp",tt(0,1)).bind("click.jsp",vt),f.arrowScrollOnHover&&(wt.bind("mouseover.jsp",tt(0,-1,wt)),bt.bind("mouseover.jsp",tt(0,1,bt))),bi(g,f.verticalArrowPositions,wt,bt)),yt=s,e.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){yt-=n(this).outerHeight()}),p.hover(function(){p.addClass("jspHover")},function(){p.removeClass("jspHover")}).bind("mousedown.jsp",function(t){n("html").bind("dragstart.jsp selectstart.jsp",vt);p.addClass("jspActive");var i=t.pageY-p.position().top;return n("html").bind("mousemove.jsp",function(n){ht(n.pageY-i,!1)}).bind("mouseup.jsp mouseleave.jsp",di),!1}),pi())}function pi(){g.height(yt+"px");l=0;li=f.verticalGutter+g.outerWidth();o.width(h-li-st);try{0===ti.position().left&&o.css("margin-left",li+"px")}catch(n){}}function tr(){b&&(e.append(n('<div class="jspHorizontalBar" />').append(n('<div class="jspCap jspCapLeft" />'),n('<div class="jspTrack" />').append(n('<div class="jspDrag" />').append(n('<div class="jspDragLeft" />'),n('<div class="jspDragRight" />'))),n('<div class="jspCap jspCapRight" />'))),ii=e.find(">.jspHorizontalBar"),nt=ii.find(">.jspTrack"),w=nt.find(">.jspDrag"),f.showArrows&&(kt=n('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp",tt(-1,0)).bind("click.jsp",vt),dt=n('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp",tt(1,0)).bind("click.jsp",vt),f.arrowScrollOnHover&&(kt.bind("mouseover.jsp",tt(-1,0,kt)),dt.bind("mouseover.jsp",tt(1,0,dt))),bi(nt,f.horizontalArrowPositions,kt,dt)),w.hover(function(){w.addClass("jspHover")},function(){w.removeClass("jspHover")}).bind("mousedown.jsp",function(t){n("html").bind("dragstart.jsp selectstart.jsp",vt);w.addClass("jspActive");var i=t.pageX-w.position().left;return n("html").bind("mousemove.jsp",function(n){lt(n.pageX-i,!1)}).bind("mouseup.jsp mouseleave.jsp",di),!1}),ct=e.innerWidth(),wi())}function wi(){e.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){ct-=n(this).outerWidth()});nt.width(ct+"px");a=0}function ir(){if(b&&k){var t=nt.outerHeight(),i=g.outerWidth();yt-=t;n(ii).find(">.jspCap:visible,>.jspArrow").each(function(){ct+=n(this).outerWidth()});ct-=i;s-=i;h-=t;nt.parent().append(n('<div class="jspCorner" />').css("width",t+"px"));pi();wi()}b&&o.width(e.outerWidth()-st+"px");v=o.outerHeight();ni=v/s;b&&(ot=Math.ceil(1/ci*ct),ot>f.horizontalDragMaxWidth?ot=f.horizontalDragMaxWidth:ot<f.horizontalDragMinWidth&&(ot=f.horizontalDragMinWidth),w.width(ot+"px"),ft=ct-ot,hi(a));k&&(et=Math.ceil(1/ni*yt),et>f.verticalDragMaxHeight?et=f.verticalDragMaxHeight:et<f.verticalDragMinHeight&&(et=f.verticalDragMinHeight),p.height(et+"px"),d=yt-et,si(l))}function bi(n,t,i,r){var e,u="before",f="after";"os"==t&&(t=/Mac/.test(navigator.platform)?"after":"split");t==u?f=t:t==f&&(u=t,e=i,i=r,r=e);n[u](i)[f](r)}function tt(n,t,i){return function(){return rr(n,t,this,i),this.blur(),!1}}function rr(t,i,r,u){r=n(r).addClass("jspActive");var o,e,s=!0,h=function(){0!==t&&c.scrollByX(t*f.arrowButtonSpeed);0!==i&&c.scrollByY(i*f.arrowButtonSpeed);e=setTimeout(h,s?f.initialDelay:f.arrowRepeatFreq);s=!1};h();o=u?"mouseout.jsp":"mouseup.jsp";u=u||n("html");u.bind(o,function(){r.removeClass("jspActive");e&&clearTimeout(e);e=null;u.unbind(o)})}function ur(){ki();k&&g.bind("mousedown.jsp",function(t){if(t.originalTarget===i||t.originalTarget==t.currentTarget){var r,e=n(this),y=e.offset(),o=t.pageY-y.top-l,h=!0,a=function(){var p=e.offset(),n=t.pageY-p.top-et/2,i=s*f.scrollPagePercent,y=d*i/(v-s);if(0>o)l-y>n?c.scrollByY(-i):ht(n);else{if(!(o>0))return u(),void 0;n>l+y?c.scrollByY(i):ht(n)}r=setTimeout(a,h?f.initialDelay:f.trackClickRepeatFreq);h=!1},u=function(){r&&clearTimeout(r);r=null;n(document).unbind("mouseup.jsp",u)};return a(),n(document).bind("mouseup.jsp",u),!1}});b&&nt.bind("mousedown.jsp",function(t){if(t.originalTarget===i||t.originalTarget==t.currentTarget){var r,e=n(this),v=e.offset(),o=t.pageX-v.left-a,s=!0,l=function(){var p=e.offset(),n=t.pageX-p.left-ot/2,i=h*f.scrollPagePercent,v=ft*i/(y-h);if(0>o)a-v>n?c.scrollByX(-i):lt(n);else{if(!(o>0))return u(),void 0;n>a+v?c.scrollByX(i):lt(n)}r=setTimeout(l,s?f.initialDelay:f.trackClickRepeatFreq);s=!1},u=function(){r&&clearTimeout(r);r=null;n(document).unbind("mouseup.jsp",u)};return l(),n(document).bind("mouseup.jsp",u),!1}})}function ki(){nt&&nt.unbind("mousedown.jsp");g&&g.unbind("mousedown.jsp")}function di(){n("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp");p&&p.removeClass("jspActive");w&&w.removeClass("jspActive")}function ht(n,t){k&&(0>n?n=0:n>d&&(n=d),t===i&&(t=f.animateScroll),t?c.animate(p,"top",n,si):(p.css("top",n),si(n)))}function si(n){n===i&&(n=p.position().top);e.scrollTop(0);l=n;var t=0===l,u=l==d,h=n/d,f=-h*(v-s);(ri!=t||fi!=u)&&(ri=t,fi=u,r.trigger("jsp-arrow-change",[ri,fi,ui,ei]));fr(t,u);o.css("top",f);r.trigger("jsp-scroll-y",[-f,t,u]).trigger("scroll")}function lt(n,t){b&&(0>n?n=0:n>ft&&(n=ft),t===i&&(t=f.animateScroll),t?c.animate(w,"left",n,hi):(w.css("left",n),hi(n)))}function hi(n){n===i&&(n=w.position().left);e.scrollTop(0);a=n;var t=0===a,u=a==ft,s=n/ft,f=-s*(y-h);(ui!=t||ei!=u)&&(ui=t,ei=u,r.trigger("jsp-arrow-change",[ri,fi,ui,ei]));er(t,u);o.css("left",f);r.trigger("jsp-scroll-x",[-f,t,u]).trigger("scroll")}function fr(n,t){f.showArrows&&(wt[n?"addClass":"removeClass"]("jspDisabled"),bt[t?"addClass":"removeClass"]("jspDisabled"))}function er(n,t){f.showArrows&&(kt[n?"addClass":"removeClass"]("jspDisabled"),dt[t?"addClass":"removeClass"]("jspDisabled"))}function it(n,t){var i=n/(v-s);ht(i*d,t)}function at(n,t){var i=n/(y-h);lt(i*ft,t)}function gt(t,i,r){var u,v,y,p,w,b,k,l,a,o=0,c=0;try{u=n(t)}catch(d){return}for(v=u.outerHeight(),y=u.outerWidth(),e.scrollTop(0),e.scrollLeft(0);!u.is(".jspPane");)if(o+=u.position().top,c+=u.position().left,u=u.offsetParent(),/^body|html$/i.test(u[0].nodeName))return;p=ut();b=p+s;p>o||i?l=o-f.horizontalGutter:o+v>b&&(l=o-s+v+f.horizontalGutter);isNaN(l)||it(l,r);w=rt();k=w+h;w>c||i?a=c-f.horizontalGutter:c+y>k&&(a=c-h+y+f.horizontalGutter);isNaN(a)||at(a,r)}function rt(){return-o.position().left}function ut(){return-o.position().top}function or(){var n=v-s;return n>20&&n-ut()<10}function sr(){var n=y-h;return n>20&&n-rt()<10}function hr(){e.unbind(yi).bind(yi,function(n,t,i,r){var e=a,o=l,u=n.deltaFactor||f.mouseWheelSpeed;return c.scrollBy(i*u,-r*u,!1),e==a&&o==l})}function cr(){e.unbind(yi)}function vt(){return!1}function lr(){o.find(":input,a").unbind("focus.jsp").bind("focus.jsp",function(n){gt(n.target,!1)})}function ar(){o.find(":input,a").unbind("focus.jsp")}function vr(){function h(){var n=a,r=l;switch(t){case 40:c.scrollByY(f.keyboardSpeed,!1);break;case 38:c.scrollByY(-f.keyboardSpeed,!1);break;case 34:case 32:c.scrollByY(s*f.scrollPagePercent,!1);break;case 33:c.scrollByY(-s*f.scrollPagePercent,!1);break;case 39:c.scrollByX(f.keyboardSpeed,!1);break;case 37:c.scrollByX(-f.keyboardSpeed,!1)}return i=n!=a||r!=l}var t,i,u=[];b&&u.push(ii[0]);k&&u.push(ti[0]);o.focus(function(){r.focus()});r.attr("tabindex",0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp",function(r){if(r.target===this||u.length&&n(r.target).closest(u).length){var f=a,e=l;switch(r.keyCode){case 40:case 38:case 34:case 32:case 33:case 39:case 37:t=r.keyCode;h();break;case 35:it(v-s);t=null;break;case 36:it(0);t=null}return i=r.keyCode==t&&f!=a||e!=l,!i}}).bind("keypress.jsp",function(n){return n.keyCode==t&&h(),!i});f.hideFocus?(r.css("outline","none"),"hideFocus"in e[0]&&r.attr("hideFocus",!0)):(r.css("outline",""),"hideFocus"in e[0]&&r.attr("hideFocus",!1))}function yr(){r.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp")}function pr(){if(location.hash&&location.hash.length>1){var t,r,i=escape(location.hash.substr(1));try{t=n("#"+i+', a[name="'+i+'"]')}catch(u){return}t.length&&o.find(i)&&(0===e.scrollTop()?r=setInterval(function(){e.scrollTop()>0&&(gt(t,!0),n(document).scrollTop(e.position().top),clearInterval(r))},50):(gt(t,!0),n(document).scrollTop(e.position().top)))}}function wr(){n(document.body).data("jspHijack")||(n(document.body).data("jspHijack",!0),n(document.body).delegate("a[href*=#]","click",function(i){var f,r,u,s,e,o,c=this.href.substr(0,this.href.indexOf("#")),h=location.href;if(-1!==location.href.indexOf("#")&&(h=location.href.substr(0,location.href.indexOf("#"))),c===h){f=escape(this.href.substr(this.href.indexOf("#")+1));try{r=n("#"+f+', a[name="'+f+'"]')}catch(l){return}r.length&&(u=r.closest(".jspScrollable"),s=u.data("jsp"),s.scrollToElement(r,!0),u[0].scrollIntoView&&(e=n(t).scrollTop(),o=r.offset().top,(e>o||o>e+n(t).height())&&u[0].scrollIntoView()),i.preventDefault())}}))}function br(){var u,f,t,i,n,r=!1;e.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp",function(e){var o=e.originalEvent.touches[0];u=rt();f=ut();t=o.pageX;i=o.pageY;n=!1;r=!0}).bind("touchmove.jsp",function(e){if(r){var o=e.originalEvent.touches[0],s=a,h=l;return c.scrollTo(u+t-o.pageX,f+i-o.pageY),n=n||Math.abs(t-o.pageX)>5||Math.abs(i-o.pageY)>5,s==a&&h==l}}).bind("touchend.jsp",function(){r=!1}).bind("click.jsp-touchclick",function(){if(n)return(n=!1,!1)})}function kr(){var n=ut(),t=rt();r.removeClass("jspScrollable").unbind(".jsp");r.replaceWith(vi.append(o.children()));vi.scrollTop(n);vi.scrollLeft(t);pt&&clearInterval(pt)}var f,o,h,s,e,y,v,ci,ni,k,b,p,d,l,w,ft,a,ti,g,li,yt,et,wt,bt,ii,nt,ct,ot,kt,dt,pt,ai,st,gi,c=this,ri=!0,ui=!0,fi=!1,ei=!1,vi=r.clone(!1,!1).empty(),yi=n.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp";"border-box"===r.css("box-sizing")?(ai=0,st=0):(ai=r.css("paddingTop")+" "+r.css("paddingRight")+" "+r.css("paddingBottom")+" "+r.css("paddingLeft"),st=(parseInt(r.css("paddingLeft"),10)||0)+(parseInt(r.css("paddingRight"),10)||0));n.extend(c,{reinitialise:function(t){t=n.extend({},f,t);oi(t)},scrollToElement:function(n,t,i){gt(n,t,i)},scrollTo:function(n,t,i){at(n,i);it(t,i)},scrollToX:function(n,t){at(n,t)},scrollToY:function(n,t){it(n,t)},scrollToPercentX:function(n,t){at(n*(y-h),t)},scrollToPercentY:function(n,t){it(n*(v-s),t)},scrollBy:function(n,t,i){c.scrollByX(n,i);c.scrollByY(t,i)},scrollByX:function(n,t){var i=rt()+Math[0>n?"floor":"ceil"](n),r=i/(y-h);lt(r*ft,t)},scrollByY:function(n,t){var i=ut()+Math[0>n?"floor":"ceil"](n),r=i/(v-s);ht(r*d,t)},positionDragX:function(n,t){lt(n,t)},positionDragY:function(n,t){ht(n,t)},animate:function(n,t,i,r){var u={};u[t]=i;n.animate(u,{duration:f.animateDuration,easing:f.animateEase,queue:!1,step:r})},getContentPositionX:function(){return rt()},getContentPositionY:function(){return ut()},getContentWidth:function(){return y},getContentHeight:function(){return v},getPercentScrolledX:function(){return rt()/(y-h)},getPercentScrolledY:function(){return ut()/(v-s)},getIsScrollableH:function(){return b},getIsScrollableV:function(){return k},getContentPane:function(){return o},scrollToBottom:function(n){ht(d,n)},hijackInternalLinks:n.noop,destroy:function(){kr()}});oi(u)}return r=n.extend({},n.fn.jScrollPane.defaults,r),n.each(["arrowButtonSpeed","trackClickSpeed","keyboardSpeed"],function(){r[this]=r[this]||r.speed}),this.each(function(){var t=n(this),i=t.data("jsp");i?i.reinitialise(r):(n("script",t).filter('[type="text/javascript"],:not([type])').remove(),i=new u(t,r),t.data("jsp",i))})};n.fn.jScrollPane.defaults={showArrows:!1,maintainPosition:!0,stickToBottom:!1,stickToRight:!1,clickOnTrack:!0,autoReinitialise:!1,autoReinitialiseDelay:500,verticalDragMinHeight:0,verticalDragMaxHeight:99999,horizontalDragMinWidth:0,horizontalDragMaxWidth:99999,contentWidth:i,animateScroll:!1,animateDuration:300,animateEase:"linear",hijackInternalLinks:!1,verticalGutter:4,horizontalGutter:4,mouseWheelSpeed:10,arrowButtonSpeed:0,arrowRepeatFreq:50,arrowScrollOnHover:!1,trackClickSpeed:0,trackClickRepeatFreq:70,verticalArrowPositions:"split",horizontalArrowPositions:"split",enableKeyboardNavigation:!0,hideFocus:!1,keyboardSpeed:0,initialDelay:300,speed:30,scrollPagePercent:.8}}(jQuery,this);!function(n){n.fn.scrollbox=function(t){return t=n.extend({linear:!1,startDelay:2,delay:3,step:5,speed:32,switchItems:1,direction:"vertical",distance:"auto",autoPlay:!0,onMouseOverPause:!0,paused:!1,queue:null,listElement:"ul",listItemElement:"li",infiniteLoop:!0,switchAmount:0,afterForward:null,afterBackward:null},t),t.scrollOffset="vertical"===t.direction?"scrollTop":"scrollLeft",t.queue&&(t.queue=n("#"+t.queue)),this.each(function(){var r,c,e,l,h,a,v,y,i=n(this),u=null,f=null,o=!1,s=0;t.onMouseOverPause&&(i.bind("mouseover",function(){o=!0}),i.bind("mouseout",function(){o=!1}));r=i.children(t.listElement+":first-child");t.infiniteLoop===!1&&0===t.switchAmount&&(t.switchAmount=r.children().length);h=function(){if(!o){var l,a,c,h,v;if(l=r.children(t.listItemElement+":first-child"),h="auto"!==t.distance?t.distance:"vertical"===t.direction?l.outerHeight(!0):l.outerWidth(!0),t.linear?c=Math.min(i[0][t.scrollOffset]+t.step,h):(v=Math.max(3,parseInt(.3*(h-i[0][t.scrollOffset]),10)),c=Math.min(i[0][t.scrollOffset]+v,h)),i[0][t.scrollOffset]=c,c>=h){for(a=0;a<t.switchItems;a++)t.queue&&t.queue.find(t.listItemElement).length>0?(r.append(t.queue.find(t.listItemElement)[0]),r.children(t.listItemElement+":first-child").remove()):r.append(r.children(t.listItemElement+":first-child")),++s;if(i[0][t.scrollOffset]=0,clearInterval(u),n.isFunction(t.afterForward)&&t.afterForward.call(i,{switchCount:s,currentFirstChild:r.children(t.listItemElement+":first-child")}),t.infiniteLoop===!1&&s>=t.switchAmount)return;t.autoPlay&&(f=setTimeout(e,1e3*t.delay))}}};a=function(){if(!o){var c,l,h,a,v;if(0===i[0][t.scrollOffset]){for(l=0;l<t.switchItems;l++)r.children(t.listItemElement+":last-child").insertBefore(r.children(t.listItemElement+":first-child"));c=r.children(t.listItemElement+":first-child");a="auto"!==t.distance?t.distance:"vertical"===t.direction?c.height():c.width();i[0][t.scrollOffset]=a}t.linear?h=Math.max(i[0][t.scrollOffset]-t.step,0):(v=Math.max(3,parseInt(.3*i[0][t.scrollOffset],10)),h=Math.max(i[0][t.scrollOffset]-v,0));i[0][t.scrollOffset]=h;0===h&&(--s,clearInterval(u),n.isFunction(t.afterBackward)&&t.afterBackward.call(i,{switchCount:s,currentFirstChild:r.children(t.listItemElement+":first-child")}),t.autoPlay&&(f=setTimeout(e,1e3*t.delay)))}};e=function(){clearInterval(u);u=setInterval(h,t.speed)};v=function(){t.autoPlay=!0;o=!1;clearInterval(u);u=setInterval(h,t.speed)};y=function(){o=!0};c=function(){clearInterval(u);u=setInterval(a,t.speed)};l=function(n){t.delay=n||t.delay;clearTimeout(f);t.autoPlay&&(f=setTimeout(e,1e3*t.delay))};t.autoPlay&&(f=setTimeout(e,1e3*t.startDelay));i.bind("resetClock",function(n){l(n)});i.bind("forward",function(){clearTimeout(f);e()});i.bind("pauseHover",function(){y()});i.bind("forwardHover",function(){v()});i.bind("backward",function(){clearTimeout(f);c()});i.bind("speedUp",function(n){"undefined"===n&&(n=Math.max(1,parseInt(t.speed/2,10)));t.speed=n});i.bind("speedDown",function(n){"undefined"===n&&(n=2*t.speed);t.speed=n});i.bind("updateConfig",function(i){t=n.extend(t,i)})})}}(jQuery)