text: /* --------------------------------------------------------
   TIME PICKER PLUGIN
  ----------------------------------------------------------- */
  !function(i){i.fn.timepicki=function(t){var n={format_output:function(i,t,n){return e.show_meridian?((i=Math.min(Math.max(parseInt(i),1),12))<10&&(i="0"+i),(t=Math.min(Math.max(parseInt(t),0),59))<10&&(t="0"+t),i+":"+t+" "+n):((i=Math.min(Math.max(parseInt(i),0),23))<10&&(i="0"+i),(t=Math.min(Math.max(parseInt(t),0),59))<10&&(t="0"+t),i+":"+t)},increase_direction:"up",custom_classes:"",min_hour_value:1,max_hour_value:12,show_meridian:!0,step_size_hours:"1",step_size_minutes:"1",overflow_minutes:!1,disable_keyboard_mobile:!1,reset:!1,on_change:null,input_writable:!1},e=i.extend({},n,t);return this.each(function(){var t=i(this),n=t.outerHeight();n+=10,i(t).wrap("<div class='time_pick'>");var a=i(this).parents(".time_pick"),s="down"===e.increase_direction?"<div class='tprev action-prev'></div>":"<div class='tprev action-next'></div>",r="down"===e.increase_direction?"<div class='tnext action-next'></div>":"<div class='tnext action-prev'></div>",m=i("<div class='timepicker_wrap "+e.custom_classes+"'><div class='arrow_top'></div><div class='time'>"+s+"<div class='ti_tx'><input type='text' class='timepicki-input'"+(e.disable_keyboard_mobile?"readonly":"")+"></div>"+r+"</div><div class='mins'>"+s+"<div class='mi_tx'><input type='text' class='timepicki-input'"+(e.disable_keyboard_mobile?"readonly":"")+"></div>"+r+"</div>");e.show_meridian&&m.append("<div class='meridian'>"+s+"<div class='mer_tx'><input type='text' class='timepicki-input' readonly></div>"+r+"</div>"),e.reset&&m.append("<div><a href='#' class='reset_time'>Reset</a></div>"),a.append(m);var o=i(this).next(".timepicker_wrap"),l=(o.find("div"),a.find("input"));function u(t){return i.contains(a[0],t[0])||a.is(t)}function d(i,n){var a=o.find(".ti_tx input").val(),s=o.find(".mi_tx input").val(),r="";e.show_meridian&&(r=o.find(".mer_tx input").val()),0===a.length||0===s.length||e.show_meridian&&0===r.length||(t.attr("data-timepicki-tim",a),t.attr("data-timepicki-mini",s),e.show_meridian?(t.attr("data-timepicki-meri",r),t.val(e.format_output(a,s,r))):t.val(e.format_output(a,s))),null!==e.on_change&&e.on_change(t[0]),n&&p()}function c(){if(function(i){var n,a,s,r;t.is("[data-timepicki-tim]")?(a=Number(t.attr("data-timepicki-tim")),s=Number(t.attr("data-timepicki-mini")),e.show_meridian&&(r=t.attr("data-timepicki-meri"))):"object"==typeof i?(a=Number(i[0]),s=Number(i[1]),e.show_meridian&&(r=i[2])):(n=new Date,a=n.getHours(),s=n.getMinutes(),r="AM",e.show_meridian&&(0==a?a=12:12==a?r="PM":a>12&&(a-=12,r="PM")));a<10?o.find(".ti_tx input").val("0"+a):o.find(".ti_tx input").val(a);s<10?o.find(".mi_tx input").val("0"+s):o.find(".mi_tx input").val(s);e.show_meridian&&(r<10?o.find(".mer_tx input").val("0"+r):o.find(".mer_tx input").val(r))}(e.start_time),o.fadeIn(),!e.input_writable){var n=o.find("input:visible").first();n.focus()}var a=function(e){if(9===e.which&&e.shiftKey){n.off("keydown",a);var s=i(":input:visible:not(.timepicki-input)"),r=s.index(t);s.get(r-1).focus()}};n.on("keydown",a)}function p(){o.fadeOut()}function v(i,t){var n=Number(o.find(".time .ti_tx input").val()),a=Number(e.min_hour_value),s=Number(e.max_hour_value),r=Number(e.step_size_hours);if(i&&i.hasClass("action-next")||"next"===t)if(n+r>s){var m=a;m=m<10?"0"+m:String(m),o.find(".time .ti_tx input").val(m)}else(n+=r)<10&&(n="0"+n),o.find(".time .ti_tx input").val(n);else if(i&&i.hasClass("action-prev")||"prev"===t){if(n-r<Number(e.min_hour_value)){var l=s;l=l<10?"0"+l:String(l),o.find(".time .ti_tx input").val(l)}else(n-=r)<10&&(n="0"+n),o.find(".time .ti_tx input").val(n)}}function _(i,t){var n=Number(o.find(".mins .mi_tx input").val()),a=Number(e.step_size_minutes);i&&i.hasClass("action-next")||"next"===t?n+a>59?(o.find(".mins .mi_tx input").val("00"),e.overflow_minutes&&v(null,"next")):(n+=a)<10?o.find(".mins .mi_tx input").val("0"+n):o.find(".mins .mi_tx input").val(n):(i&&i.hasClass("action-prev")||"prev"===t)&&(n-a<=-1?(o.find(".mins .mi_tx input").val(60-a),e.overflow_minutes&&v(null,"prev")):(n-=a)<10?o.find(".mins .mi_tx input").val("0"+n):o.find(".mins .mi_tx input").val(n))}function f(i,t){var n,e="meridian";n=o.find("."+e+" .mer_tx input").val(),i&&i.hasClass("action-next")||"next"===t?"AM"==n?o.find("."+e+" .mer_tx input").val("PM"):o.find("."+e+" .mer_tx input").val("AM"):(i&&i.hasClass("action-prev")||"prev"===t)&&("AM"==n?o.find("."+e+" .mer_tx input").val("PM"):o.find("."+e+" .mer_tx input").val("AM"))}i(".reset_time").on("click",function(i){t.val(""),p()}),i(".timepicki-input").keydown(function(t){if(13==t.keyCode)return t.preventDefault(),d(),void p();var n=i(this).parent().parent(),a=i(this),s=a.val();done=!1,setTimeout(function(){done||(function(){var i=/^\d+$/.test(a.val()),r=""===a.val();if(n.hasClass("time"))if(i){var m=e.show_meridian?Math.min(Math.max(parseInt(a.val()),1),12):Math.min(Math.max(parseInt(a.val()),0),23);a.val(m)}else r||a.val(s);else if(n.hasClass("mins"))if(i){var o=Math.min(Math.max(parseInt(a.val()),0),59);a.val(o)}else r||a.val(s);else n.hasClass("meridian")&&t.preventDefault()}(),done=!0)},0)}),i(document).on("touchstart",function(t){u(i(t.target))||p()}),i(document).on("click",function(e){if(!i(e.target).is(o)&&"block"==o.css("display")&&!i(e.target).is(i(".reset_time")))if(i(e.target).is(t)){o.css({top:n+"px",left:"0px"}),c()}else d(e,!u(i(e.target)))}),t.on("focus",c),l.on("focus",function(){var n=i(this);n.is(t)||n.select()}),l.on("keydown",function(t){var n,a=i(this);38===t.which?n="down"===e.increase_direction?"prev":"next":40===t.which&&(n="down"===e.increase_direction?"next":"prev"),a.closest(".timepicker_wrap .time").length?v(null,n):a.closest(".timepicker_wrap .mins").length?_(null,n):a.closest(".timepicker_wrap .meridian").length&&e.show_meridian&&f(null,n)}),l.on("blur",function(){setTimeout(function(){var t=i(document.activeElement);t.is(":input")&&!u(t)&&(d(),p())},0)});var h=o.find(".action-next"),x=o.find(".action-prev");i(x).add(h).on("click",function(){var t=i(this);"time"==t.parent().attr("class")?v(t):"mins"==t.parent().attr("class")?_(t):e.show_meridian&&f(t)})})}}(jQuery);
  
  /* --------------------------------------------------------
   CUSTOME SCROLLBAR PLUGIN
  ----------------------------------------------------------- */
  !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof module&&module.exports?module.exports=e:e(jQuery,window,document)}(function(e){var t,o,a,n,i,r,l,s,c,d,u,f,h,m,p,g,v,x,_,w,S,b,C,y,B,T,k,M,O,I,D,E,W,R,A,L,z,P,H,U,F,q,j,Y,X,N,V,Q,G,J,K,Z,$,ee,te,oe,ae,ne,ie,re;ne="function"==typeof define&&define.amd,ie="undefined"!=typeof module&&module.exports,re="https:"==document.location.protocol?"https:":"http:",ne||(ie?require("jquery-mousewheel")(e):e.event.special.mousewheel||e("head").append(decodeURI("%3Cscript src="+re+"//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js%3E%3C/script%3E"))),o="mCustomScrollbar",a="mCS",n=".mCustomScrollbar",i={setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,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}},r=0,l={},s=window.attachEvent&&!window.addEventListener?1:0,c=!1,d=["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","mCSB_buttonRight"],u={init:function(t){var t=e.extend(!0,{},i,t),o=f.call(this);if(t.live){var s=t.liveSelector||this.selector||n,c=e(s);if("off"===t.live)return void m(s);l[s]=setTimeout(function(){c.mCustomScrollbar(t),"once"===t.live&&c.length&&m(s)},500)}else m(s);return t.setWidth=t.set_width?t.set_width:t.setWidth,t.setHeight=t.set_height?t.set_height:t.setHeight,t.axis=t.horizontalScroll?"x":p(t.axis),t.scrollInertia=t.scrollInertia>0&&t.scrollInertia<17?17:t.scrollInertia,"object"!=typeof t.mouseWheel&&1==t.mouseWheel&&(t.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),t.mouseWheel.scrollAmount=t.mouseWheelPixels?t.mouseWheelPixels:t.mouseWheel.scrollAmount,t.mouseWheel.normalizeDelta=t.advanced.normalizeMouseWheelDelta?t.advanced.normalizeMouseWheelDelta:t.mouseWheel.normalizeDelta,t.scrollButtons.scrollType=g(t.scrollButtons.scrollType),h(t),e(o).each(function(){var o=e(this);if(!o.data(a)){o.data(a,{idx:++r,opt:t,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:o.css("direction"),cbOffsets:null,trigger:null,poll:{size:{o:0,n:0},img:{o:0,n:0},change:{o:0,n:0}}});var n=o.data(a),i=n.opt,l=o.data("mcs-axis"),s=o.data("mcs-scrollbar-position"),c=o.data("mcs-theme");l&&(i.axis=l),s&&(i.scrollbarPosition=s),c&&(i.theme=c,h(i)),v.call(this),n&&i.callbacks.onCreate&&"function"==typeof i.callbacks.onCreate&&i.callbacks.onCreate.call(this),e("#mCSB_"+n.idx+"_container img:not(."+d[2]+")").addClass(d[2]),u.update.call(null,o)}})},update:function(t,o){var n=t||f.call(this);return e(n).each(function(){var t=e(this);if(t.data(a)){var n=t.data(a),i=n.opt,r=e("#mCSB_"+n.idx+"_container"),l=e("#mCSB_"+n.idx),s=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")];if(!r.length)return;n.tweenRunning&&V(t),o&&n&&i.callbacks.onBeforeUpdate&&"function"==typeof i.callbacks.onBeforeUpdate&&i.callbacks.onBeforeUpdate.call(this),t.hasClass(d[3])&&t.removeClass(d[3]),t.hasClass(d[4])&&t.removeClass(d[4]),l.css("max-height","none"),l.height()!==t.height()&&l.css("max-height",t.height()),_.call(this),"y"===i.axis||i.advanced.autoExpandHorizontalScroll||r.css("width",x(r)),n.overflowed=y.call(this),M.call(this),i.autoDraggerLength&&S.call(this),b.call(this),T.call(this);var c=[Math.abs(r[0].offsetTop),Math.abs(r[0].offsetLeft)];"x"!==i.axis&&(n.overflowed[0]?s[0].height()>s[0].parent().height()?B.call(this):(Q(t,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}),n.contentReset.y=null):(B.call(this),"y"===i.axis?k.call(this):"yx"===i.axis&&n.overflowed[1]&&Q(t,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==i.axis&&(n.overflowed[1]?s[1].width()>s[1].parent().width()?B.call(this):(Q(t,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}),n.contentReset.x=null):(B.call(this),"x"===i.axis?k.call(this):"yx"===i.axis&&n.overflowed[0]&&Q(t,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),o&&n&&(2===o&&i.callbacks.onImageLoad&&"function"==typeof i.callbacks.onImageLoad?i.callbacks.onImageLoad.call(this):3===o&&i.callbacks.onSelectorChange&&"function"==typeof i.callbacks.onSelectorChange?i.callbacks.onSelectorChange.call(this):i.callbacks.onUpdate&&"function"==typeof i.callbacks.onUpdate&&i.callbacks.onUpdate.call(this)),N.call(this)}})},scrollTo:function(t,o){if(void 0!==t&&null!=t){var n=f.call(this);return e(n).each(function(){var n=e(this);if(n.data(a)){var i=n.data(a),r=i.opt,l={trigger:"external",scrollInertia:r.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},s=e.extend(!0,{},l,o),c=Y.call(this,t),d=s.scrollInertia>0&&s.scrollInertia<17?17:s.scrollInertia;c[0]=X.call(this,c[0],"y"),c[1]=X.call(this,c[1],"x"),s.moveDragger&&(c[0]*=i.scrollRatio.y,c[1]*=i.scrollRatio.x),s.dur=ae()?0:d,setTimeout(function(){null!==c[0]&&void 0!==c[0]&&"x"!==r.axis&&i.overflowed[0]&&(s.dir="y",s.overwrite="all",Q(n,c[0].toString(),s)),null!==c[1]&&void 0!==c[1]&&"y"!==r.axis&&i.overflowed[1]&&(s.dir="x",s.overwrite="none",Q(n,c[1].toString(),s))},s.timeout)}})}},stop:function(){var t=f.call(this);return e(t).each(function(){var t=e(this);t.data(a)&&V(t)})},disable:function(t){var o=f.call(this);return e(o).each(function(){var o=e(this);o.data(a)&&(o.data(a),N.call(this,"remove"),k.call(this),t&&B.call(this),M.call(this,!0),o.addClass(d[3]))})},destroy:function(){var t=f.call(this);return e(t).each(function(){var n=e(this);if(n.data(a)){var i=n.data(a),r=i.opt,l=e("#mCSB_"+i.idx),s=e("#mCSB_"+i.idx+"_container"),c=e(".mCSB_"+i.idx+"_scrollbar");r.live&&m(r.liveSelector||e(t).selector),N.call(this,"remove"),k.call(this),B.call(this),n.removeData(a),Z(this,"mcs"),c.remove(),s.find("img."+d[2]).removeClass(d[2]),l.replaceWith(s.contents()),n.removeClass(o+" _"+a+"_"+i.idx+" "+d[6]+" "+d[7]+" "+d[5]+" "+d[3]).addClass(d[4])}})}},f=function(){return"object"!=typeof e(this)||e(this).length<1?n:this},h=function(t){t.autoDraggerLength=!(e.inArray(t.theme,["rounded","rounded-dark","rounded-dots","rounded-dots-dark"])>-1)&&t.autoDraggerLength,t.autoExpandScrollbar=!(e.inArray(t.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)&&t.autoExpandScrollbar,t.scrollButtons.enable=!(e.inArray(t.theme,["minimal","minimal-dark"])>-1)&&t.scrollButtons.enable,t.autoHideScrollbar=e.inArray(t.theme,["minimal","minimal-dark"])>-1||t.autoHideScrollbar,t.scrollbarPosition=e.inArray(t.theme,["minimal","minimal-dark"])>-1?"outside":t.scrollbarPosition},m=function(e){l[e]&&(clearTimeout(l[e]),Z(l,e))},p=function(e){return"yx"===e||"xy"===e||"auto"===e?"yx":"x"===e||"horizontal"===e?"x":"y"},g=function(e){return"stepped"===e||"pixels"===e||"step"===e||"click"===e?"stepped":"stepless"},v=function(){var t=e(this),n=t.data(a),i=n.opt,r=i.autoExpandScrollbar?" "+d[1]+"_expand":"",l=["<div id='mCSB_"+n.idx+"_scrollbar_vertical' class='mCSB_scrollTools mCSB_"+n.idx+"_scrollbar mCS-"+i.theme+" mCSB_scrollTools_vertical"+r+"'><div class='"+d[12]+"'><div id='mCSB_"+n.idx+"_dragger_vertical' class='mCSB_dragger' style='position:absolute;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>","<div id='mCSB_"+n.idx+"_scrollbar_horizontal' class='mCSB_scrollTools mCSB_"+n.idx+"_scrollbar mCS-"+i.theme+" mCSB_scrollTools_horizontal"+r+"'><div class='"+d[12]+"'><div id='mCSB_"+n.idx+"_dragger_horizontal' class='mCSB_dragger' style='position:absolute;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>"],s="yx"===i.axis?"mCSB_vertical_horizontal":"x"===i.axis?"mCSB_horizontal":"mCSB_vertical",c="yx"===i.axis?l[0]+l[1]:"x"===i.axis?l[1]:l[0],u="yx"===i.axis?"<div id='mCSB_"+n.idx+"_container_wrapper' class='mCSB_container_wrapper' />":"",f=i.autoHideScrollbar?" "+d[6]:"",h="x"!==i.axis&&"rtl"===n.langDir?" "+d[7]:"";i.setWidth&&t.css("width",i.setWidth),i.setHeight&&t.css("height",i.setHeight),i.setLeft="y"!==i.axis&&"rtl"===n.langDir?"989999px":i.setLeft,t.addClass(o+" _"+a+"_"+n.idx+f+h).wrapInner("<div id='mCSB_"+n.idx+"' class='mCustomScrollBox mCS-"+i.theme+" "+s+"'><div id='mCSB_"+n.idx+"_container' class='mCSB_container' style='position:relative; top:"+i.setTop+"; left:"+i.setLeft+";' dir='"+n.langDir+"' /></div>");var m=e("#mCSB_"+n.idx),p=e("#mCSB_"+n.idx+"_container");"y"===i.axis||i.advanced.autoExpandHorizontalScroll||p.css("width",x(p)),"outside"===i.scrollbarPosition?("static"===t.css("position")&&t.css("position","relative"),t.css("overflow","visible"),m.addClass("mCSB_outside").after(c)):(m.addClass("mCSB_inside").append(c),p.wrap(u)),w.call(this);var g=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")];g[0].css("min-height",g[0].height()),g[1].css("min-width",g[1].width())},x=function(t){var o=[t[0].scrollWidth,Math.max.apply(Math,t.children().map(function(){return e(this).outerWidth(!0)}).get())],a=t.parent().width();return o[0]>a?o[0]:o[1]>a?o[1]:"100%"},_=function(){var t=e(this),o=t.data(a),n=o.opt,i=e("#mCSB_"+o.idx+"_container");if(n.advanced.autoExpandHorizontalScroll&&"y"!==n.axis){i.css({width:"auto","min-width":0,"overflow-x":"scroll"});var r=Math.ceil(i[0].scrollWidth);3===n.advanced.autoExpandHorizontalScroll||2!==n.advanced.autoExpandHorizontalScroll&&r>i.parent().width()?i.css({width:r,"min-width":"100%","overflow-x":"inherit"}):i.css({"overflow-x":"inherit",position:"absolute"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:Math.ceil(i[0].getBoundingClientRect().right+.4)-Math.floor(i[0].getBoundingClientRect().left),"min-width":"100%",position:"relative"}).unwrap()}},w=function(){var t=e(this),o=t.data(a),n=o.opt,i=e(".mCSB_"+o.idx+"_scrollbar:first"),r=te(n.scrollButtons.tabindex)?"tabindex='"+n.scrollButtons.tabindex+"'":"",l=["<a href='#' class='"+d[13]+"' "+r+" />","<a href='#' class='"+d[14]+"' "+r+" />","<a href='#' class='"+d[15]+"' "+r+" />","<a href='#' class='"+d[16]+"' "+r+" />"],s=["x"===n.axis?l[2]:l[0],"x"===n.axis?l[3]:l[1],l[2],l[3]];n.scrollButtons.enable&&i.prepend(s[0]).append(s[1]).next(".mCSB_scrollTools").prepend(s[2]).append(s[3])},S=function(){var t=e(this),o=t.data(a),n=e("#mCSB_"+o.idx),i=e("#mCSB_"+o.idx+"_container"),r=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")],l=[n.height()/i.outerHeight(!1),n.width()/i.outerWidth(!1)],c=[parseInt(r[0].css("min-height")),Math.round(l[0]*r[0].parent().height()),parseInt(r[1].css("min-width")),Math.round(l[1]*r[1].parent().width())],d=s&&c[1]<c[0]?c[0]:c[1],u=s&&c[3]<c[2]?c[2]:c[3];r[0].css({height:d,"max-height":r[0].parent().height()-10}).find(".mCSB_dragger_bar").css({"line-height":c[0]+"px"}),r[1].css({width:u,"max-width":r[1].parent().width()-10})},b=function(){var t=e(this),o=t.data(a),n=e("#mCSB_"+o.idx),i=e("#mCSB_"+o.idx+"_container"),r=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")],l=[i.outerHeight(!1)-n.height(),i.outerWidth(!1)-n.width()],s=[l[0]/(r[0].parent().height()-r[0].height()),l[1]/(r[1].parent().width()-r[1].width())];o.scrollRatio={y:s[0],x:s[1]}},C=function(e,t,o){var a=o?d[0]+"_expanded":"",n=e.closest(".mCSB_scrollTools");"active"===t?(e.toggleClass(d[0]+" "+a),n.toggleClass(d[1]),e[0]._draggable=e[0]._draggable?0:1):e[0]._draggable||("hide"===t?(e.removeClass(d[0]),n.removeClass(d[1])):(e.addClass(d[0]),n.addClass(d[1])))},y=function(){var t=e(this),o=t.data(a),n=e("#mCSB_"+o.idx),i=e("#mCSB_"+o.idx+"_container"),r=null==o.overflowed?i.height():i.outerHeight(!1),l=null==o.overflowed?i.width():i.outerWidth(!1),s=i[0].scrollHeight,c=i[0].scrollWidth;return s>r&&(r=s),c>l&&(l=c),[r>n.height(),l>n.width()]},B=function(){var t=e(this),o=t.data(a),n=o.opt,i=e("#mCSB_"+o.idx),r=e("#mCSB_"+o.idx+"_container"),l=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")];if(V(t),("x"!==n.axis&&!o.overflowed[0]||"y"===n.axis&&o.overflowed[0])&&(l[0].add(r).css("top",0),Q(t,"_resetY")),"y"!==n.axis&&!o.overflowed[1]||"x"===n.axis&&o.overflowed[1]){var s=dx=0;"rtl"===o.langDir&&(s=i.width()-r.outerWidth(!1),dx=Math.abs(s/o.scrollRatio.x)),r.css("left",s),l[1].css("left",dx),Q(t,"_resetX")}},T=function(){var t,o=e(this),n=o.data(a),i=n.opt;n.bindEvents||(I.call(this),i.contentTouchScroll&&D.call(this),E.call(this),i.mouseWheel.enable&&function a(){t=setTimeout(function(){e.event.special.mousewheel?(clearTimeout(t),W.call(o[0])):a()},100)}(),P.call(this),U.call(this),i.advanced.autoScrollOnFocus&&H.call(this),i.scrollButtons.enable&&F.call(this),i.keyboard.enable&&q.call(this),n.bindEvents=!0)},k=function(){var t=e(this),o=t.data(a),n=o.opt,i=a+"_"+o.idx,r=".mCSB_"+o.idx+"_scrollbar",l=e("#mCSB_"+o.idx+",#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,"+r+" ."+d[12]+",#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal,"+r+">a"),s=e("#mCSB_"+o.idx+"_container");n.advanced.releaseDraggableSelectors&&l.add(e(n.advanced.releaseDraggableSelectors)),n.advanced.extraDraggableSelectors&&l.add(e(n.advanced.extraDraggableSelectors)),o.bindEvents&&(e(document).add(e(!A()||top.document)).unbind("."+i),l.each(function(){e(this).unbind("."+i)}),clearTimeout(t[0]._focusTimeout),Z(t[0],"_focusTimeout"),clearTimeout(o.sequential.step),Z(o.sequential,"step"),clearTimeout(s[0].onCompleteTimeout),Z(s[0],"onCompleteTimeout"),o.bindEvents=!1)},M=function(t){var o=e(this),n=o.data(a),i=n.opt,r=e("#mCSB_"+n.idx+"_container_wrapper"),l=r.length?r:e("#mCSB_"+n.idx+"_container"),s=[e("#mCSB_"+n.idx+"_scrollbar_vertical"),e("#mCSB_"+n.idx+"_scrollbar_horizontal")],c=[s[0].find(".mCSB_dragger"),s[1].find(".mCSB_dragger")];"x"!==i.axis&&(n.overflowed[0]&&!t?(s[0].add(c[0]).add(s[0].children("a")).css("display","block"),l.removeClass(d[8]+" "+d[10])):(i.alwaysShowScrollbar?(2!==i.alwaysShowScrollbar&&c[0].css("display","none"),l.removeClass(d[10])):(s[0].css("display","none"),l.addClass(d[10])),l.addClass(d[8]))),"y"!==i.axis&&(n.overflowed[1]&&!t?(s[1].add(c[1]).add(s[1].children("a")).css("display","block"),l.removeClass(d[9]+" "+d[11])):(i.alwaysShowScrollbar?(2!==i.alwaysShowScrollbar&&c[1].css("display","none"),l.removeClass(d[11])):(s[1].css("display","none"),l.addClass(d[11])),l.addClass(d[9]))),n.overflowed[0]||n.overflowed[1]?o.removeClass(d[5]):o.addClass(d[5])},O=function(t){var o=t.type,a=t.target.ownerDocument!==document&&null!==frameElement?[e(frameElement).offset().top,e(frameElement).offset().left]:null,n=A()&&t.target.ownerDocument!==top.document&&null!==frameElement?[e(t.view.frameElement).offset().top,e(t.view.frameElement).offset().left]:[0,0];switch(o){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return a?[t.originalEvent.pageY-a[0]+n[0],t.originalEvent.pageX-a[1]+n[1],!1]:[t.originalEvent.pageY,t.originalEvent.pageX,!1];case"touchstart":case"touchmove":case"touchend":var i=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],r=t.originalEvent.touches.length||t.originalEvent.changedTouches.length;return t.target.ownerDocument!==document?[i.screenY,i.screenX,r>1]:[i.pageY,i.pageX,r>1];default:return a?[t.pageY-a[0]+n[0],t.pageX-a[1]+n[1],!1]:[t.pageY,t.pageX,!1]}},I=function(){function t(e,t,a,n){if(h[0].idleTimer=d.scrollInertia<233?250:0,o.attr("id")===f[1])var i="x",s=(o[0].offsetLeft-t+n)*l.scrollRatio.x;else var i="y",s=(o[0].offsetTop-e+a)*l.scrollRatio.y;Q(r,s.toString(),{dir:i,drag:!0})}var o,n,i,r=e(this),l=r.data(a),d=l.opt,u=a+"_"+l.idx,f=["mCSB_"+l.idx+"_dragger_vertical","mCSB_"+l.idx+"_dragger_horizontal"],h=e("#mCSB_"+l.idx+"_container"),m=e("#"+f[0]+",#"+f[1]),p=d.advanced.releaseDraggableSelectors?m.add(e(d.advanced.releaseDraggableSelectors)):m,g=d.advanced.extraDraggableSelectors?e(!A()||top.document).add(e(d.advanced.extraDraggableSelectors)):e(!A()||top.document);m.bind("contextmenu."+u,function(e){e.preventDefault()}).bind("mousedown."+u+" touchstart."+u+" pointerdown."+u+" MSPointerDown."+u,function(t){if(t.stopImmediatePropagation(),t.preventDefault(),$(t)){c=!0,s&&(document.onselectstart=function(){return!1}),L.call(h,!1),V(r);var a=(o=e(this)).offset(),l=O(t)[0]-a.top,u=O(t)[1]-a.left,f=o.height()+a.top,m=o.width()+a.left;f>l&&l>0&&m>u&&u>0&&(n=l,i=u),C(o,"active",d.autoExpandScrollbar)}}).bind("touchmove."+u,function(e){e.stopImmediatePropagation(),e.preventDefault();var a=o.offset(),r=O(e)[0]-a.top,l=O(e)[1]-a.left;t(n,i,r,l)}),e(document).add(g).bind("mousemove."+u+" pointermove."+u+" MSPointerMove."+u,function(e){if(o){var a=o.offset(),r=O(e)[0]-a.top,l=O(e)[1]-a.left;if(n===r&&i===l)return;t(n,i,r,l)}}).add(p).bind("mouseup."+u+" touchend."+u+" pointerup."+u+" MSPointerUp."+u,function(){o&&(C(o,"active",d.autoExpandScrollbar),o=null),c=!1,s&&(document.onselectstart=null),L.call(h,!0)})},D=function(){function o(e){if(!ee(e)||c||O(e)[2])t=0;else{t=1,b=0,C=0,d=1,y.removeClass("mCS_touch_action");var o=I.offset();u=O(e)[0]-o.top,f=O(e)[1]-o.left,z=[O(e)[0],O(e)[1]]}}function n(e){if(ee(e)&&!c&&!O(e)[2]&&(T.documentTouchScroll||e.preventDefault(),e.stopImmediatePropagation(),(!C||b)&&d)){g=J();var t=M.offset(),o=O(e)[0]-t.top,a=O(e)[1]-t.left,n="mcsLinearOut";if(E.push(o),W.push(a),z[2]=Math.abs(O(e)[0]-z[0]),z[3]=Math.abs(O(e)[1]-z[1]),B.overflowed[0])var i=D[0].parent().height()-D[0].height(),r=u-o>0&&o-u>-i*B.scrollRatio.y&&(2*z[3]<z[2]||"yx"===T.axis);if(B.overflowed[1])var l=D[1].parent().width()-D[1].width(),h=f-a>0&&a-f>-l*B.scrollRatio.x&&(2*z[2]<z[3]||"yx"===T.axis);r||h?(U||e.preventDefault(),b=1):(C=1,y.addClass("mCS_touch_action")),U&&e.preventDefault(),w="yx"===T.axis?[u-o,f-a]:"x"===T.axis?[null,f-a]:[u-o,null],I[0].idleTimer=250,B.overflowed[0]&&s(w[0],R,n,"y","all",!0),B.overflowed[1]&&s(w[1],R,n,"x",L,!0)}}function i(e){if(!ee(e)||c||O(e)[2])t=0;else{t=1,e.stopImmediatePropagation(),V(y),p=J();var o=M.offset();h=O(e)[0]-o.top,m=O(e)[1]-o.left,E=[],W=[]}}function r(e){if(ee(e)&&!c&&!O(e)[2]){d=0,e.stopImmediatePropagation(),b=0,C=0,v=J();var t=M.offset(),o=O(e)[0]-t.top,a=O(e)[1]-t.left;if(!(v-g>30)){var n="mcsEaseOut",i=2.5>(_=1e3/(v-p)),r=i?[E[E.length-2],W[W.length-2]]:[0,0];x=i?[o-r[0],a-r[1]]:[o-h,a-m];var u=[Math.abs(x[0]),Math.abs(x[1])];_=i?[Math.abs(x[0]/4),Math.abs(x[1]/4)]:[_,_];var f=[Math.abs(I[0].offsetTop)-x[0]*l(u[0]/_[0],_[0]),Math.abs(I[0].offsetLeft)-x[1]*l(u[1]/_[1],_[1])];w="yx"===T.axis?[f[0],f[1]]:"x"===T.axis?[null,f[1]]:[f[0],null],S=[4*u[0]+T.scrollInertia,4*u[1]+T.scrollInertia];var y=parseInt(T.contentTouchScroll)||0;w[0]=u[0]>y?w[0]:0,w[1]=u[1]>y?w[1]:0,B.overflowed[0]&&s(w[0],S[0],n,"y",L,!1),B.overflowed[1]&&s(w[1],S[1],n,"x",L,!1)}}}function l(e,t){var o=[1.5*t,2*t,t/1.5,t/2];return e>90?t>4?o[0]:o[3]:e>60?t>3?o[3]:o[2]:e>30?t>8?o[1]:t>6?o[0]:t>4?t:o[2]:t>8?t:o[3]}function s(e,t,o,a,n,i){e&&Q(y,e.toString(),{dur:t,scrollEasing:o,dir:a,overwrite:n,drag:i})}var d,u,f,h,m,p,g,v,x,_,w,S,b,C,y=e(this),B=y.data(a),T=B.opt,k=a+"_"+B.idx,M=e("#mCSB_"+B.idx),I=e("#mCSB_"+B.idx+"_container"),D=[e("#mCSB_"+B.idx+"_dragger_vertical"),e("#mCSB_"+B.idx+"_dragger_horizontal")],E=[],W=[],R=0,L="yx"===T.axis?"none":"all",z=[],P=I.find("iframe"),H=["touchstart."+k+" pointerdown."+k+" MSPointerDown."+k,"touchmove."+k+" pointermove."+k+" MSPointerMove."+k,"touchend."+k+" pointerup."+k+" MSPointerUp."+k],U=void 0!==document.body.style.touchAction&&""!==document.body.style.touchAction;I.bind(H[0],function(e){o(e)}).bind(H[1],function(e){n(e)}),M.bind(H[0],function(e){i(e)}).bind(H[2],function(e){r(e)}),P.length&&P.each(function(){e(this).bind("load",function(){A(this)&&e(this.contentDocument||this.contentWindow.document).bind(H[0],function(e){o(e),i(e)}).bind(H[1],function(e){n(e)}).bind(H[2],function(e){r(e)})})})},E=function(){function o(e,t,o){s.type=o&&n?"stepped":"stepless",s.scrollAmount=10,j(i,e,t,"mcsLinearOut",o?60:null)}var n,i=e(this),r=i.data(a),l=r.opt,s=r.sequential,d=a+"_"+r.idx,u=e("#mCSB_"+r.idx+"_container"),f=u.parent();u.bind("mousedown."+d,function(){t||n||(n=1,c=!0)}).add(document).bind("mousemove."+d,function(e){if(!t&&n&&(window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type&&document.selection.createRange().text)){var a=u.offset(),i=O(e)[0]-a.top+u[0].offsetTop,c=O(e)[1]-a.left+u[0].offsetLeft;i>0&&i<f.height()&&c>0&&c<f.width()?s.step&&o("off",null,"stepped"):("x"!==l.axis&&r.overflowed[0]&&(0>i?o("on",38):i>f.height()&&o("on",40)),"y"!==l.axis&&r.overflowed[1]&&(0>c?o("on",37):c>f.width()&&o("on",39)))}}).bind("mouseup."+d+" dragend."+d,function(){t||(n&&(n=0,o("off",null)),c=!1)})},W=function(){function t(t,a){if(V(o),!z(o,t.target)){var r="auto"!==i.mouseWheel.deltaFactor?parseInt(i.mouseWheel.deltaFactor):s&&t.deltaFactor<100?100:t.deltaFactor||100,d=i.scrollInertia;if("x"===i.axis||"x"===i.mouseWheel.axis)var u="x",f=[Math.round(r*n.scrollRatio.x),parseInt(i.mouseWheel.scrollAmount)],h="auto"!==i.mouseWheel.scrollAmount?f[1]:f[0]>=l.width()?.9*l.width():f[0],m=Math.abs(e("#mCSB_"+n.idx+"_container")[0].offsetLeft),p=c[1][0].offsetLeft,g=c[1].parent().width()-c[1].width(),v="y"===i.mouseWheel.axis?t.deltaY||a:t.deltaX;else var u="y",f=[Math.round(r*n.scrollRatio.y),parseInt(i.mouseWheel.scrollAmount)],h="auto"!==i.mouseWheel.scrollAmount?f[1]:f[0]>=l.height()?.9*l.height():f[0],m=Math.abs(e("#mCSB_"+n.idx+"_container")[0].offsetTop),p=c[0][0].offsetTop,g=c[0].parent().height()-c[0].height(),v=t.deltaY||a;"y"===u&&!n.overflowed[0]||"x"===u&&!n.overflowed[1]||((i.mouseWheel.invert||t.webkitDirectionInvertedFromDevice)&&(v=-v),i.mouseWheel.normalizeDelta&&(v=0>v?-1:1),(v>0&&0!==p||0>v&&p!==g||i.mouseWheel.preventDefault)&&(t.stopImmediatePropagation(),t.preventDefault()),t.deltaFactor<5&&!i.mouseWheel.normalizeDelta&&(h=t.deltaFactor,d=17),Q(o,(m-v*h).toString(),{dir:u,dur:d}))}}if(e(this).data(a)){var o=e(this),n=o.data(a),i=n.opt,r=a+"_"+n.idx,l=e("#mCSB_"+n.idx),c=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")],d=e("#mCSB_"+n.idx+"_container").find("iframe");d.length&&d.each(function(){e(this).bind("load",function(){A(this)&&e(this.contentDocument||this.contentWindow.document).bind("mousewheel."+r,function(e,o){t(e,o)})})}),l.bind("mousewheel."+r,function(e,o){t(e,o)})}},R=new Object,A=function(t){var o=!1,a=!1,n=null;if(void 0===t?a="#empty":void 0!==e(t).attr("id")&&(a=e(t).attr("id")),!1!==a&&void 0!==R[a])return R[a];if(t){try{var i=t.contentDocument||t.contentWindow.document;n=i.body.innerHTML}catch(e){}o=null!==n}else{try{var i=top.document;n=i.body.innerHTML}catch(e){}o=null!==n}return!1!==a&&(R[a]=o),o},L=function(e){var t=this.find("iframe");if(t.length){var o=e?"auto":"none";t.css("pointer-events",o)}},z=function(t,o){var n=o.nodeName.toLowerCase(),i=t.data(a).opt.mouseWheel.disableOver;return e.inArray(n,i)>-1&&!(e.inArray(n,["select","textarea"])>-1&&!e(o).is(":focus"))},P=function(){var t,o=e(this),n=o.data(a),i=a+"_"+n.idx,r=e("#mCSB_"+n.idx+"_container"),l=r.parent(),s=e(".mCSB_"+n.idx+"_scrollbar ."+d[12]);s.bind("mousedown."+i+" touchstart."+i+" pointerdown."+i+" MSPointerDown."+i,function(o){c=!0,e(o.target).hasClass("mCSB_dragger")||(t=1)}).bind("touchend."+i+" pointerup."+i+" MSPointerUp."+i,function(){c=!1}).bind("click."+i,function(a){if(t&&(t=0,e(a.target).hasClass(d[12])||e(a.target).hasClass("mCSB_draggerRail"))){V(o);var i=e(this),s=i.find(".mCSB_dragger");if(i.parent(".mCSB_scrollTools_horizontal").length>0){if(!n.overflowed[1])return;var c="x",u=a.pageX>s.offset().left?-1:1,f=Math.abs(r[0].offsetLeft)-u*(.9*l.width())}else{if(!n.overflowed[0])return;var c="y",u=a.pageY>s.offset().top?-1:1,f=Math.abs(r[0].offsetTop)-u*(.9*l.height())}Q(o,f.toString(),{dir:c,scrollEasing:"mcsEaseInOut"})}})},H=function(){var t=e(this),o=t.data(a),n=o.opt,i=a+"_"+o.idx,r=e("#mCSB_"+o.idx+"_container"),l=r.parent();r.bind("focusin."+i,function(){var o=e(document.activeElement),a=r.find(".mCustomScrollBox").length;o.is(n.advanced.autoScrollOnFocus)&&(V(t),clearTimeout(t[0]._focusTimeout),t[0]._focusTimer=a?17*a:0,t[0]._focusTimeout=setTimeout(function(){var e=[oe(o)[0],oe(o)[1]],a=[r[0].offsetTop,r[0].offsetLeft],i=[a[0]+e[0]>=0&&a[0]+e[0]<l.height()-o.outerHeight(!1),a[1]+e[1]>=0&&a[0]+e[1]<l.width()-o.outerWidth(!1)],s="yx"!==n.axis||i[0]||i[1]?"all":"none";"x"===n.axis||i[0]||Q(t,e[0].toString(),{dir:"y",scrollEasing:"mcsEaseInOut",overwrite:s,dur:0}),"y"===n.axis||i[1]||Q(t,e[1].toString(),{dir:"x",scrollEasing:"mcsEaseInOut",overwrite:s,dur:0})},t[0]._focusTimer))})},U=function(){var t=e(this),o=t.data(a),n=a+"_"+o.idx,i=e("#mCSB_"+o.idx+"_container").parent();i.bind("scroll."+n,function(){0===i.scrollTop()&&0===i.scrollLeft()||e(".mCSB_"+o.idx+"_scrollbar").css("visibility","hidden")})},F=function(){var t=e(this),o=t.data(a),n=o.opt,i=o.sequential,r=a+"_"+o.idx,l=".mCSB_"+o.idx+"_scrollbar",s=e(l+">a");s.bind("contextmenu."+r,function(e){e.preventDefault()}).bind("mousedown."+r+" touchstart."+r+" pointerdown."+r+" MSPointerDown."+r+" mouseup."+r+" touchend."+r+" pointerup."+r+" MSPointerUp."+r+" mouseout."+r+" pointerout."+r+" MSPointerOut."+r+" click."+r,function(a){function r(e,o){i.scrollAmount=n.scrollButtons.scrollAmount,j(t,e,o)}if(a.preventDefault(),$(a)){var l=e(this).attr("class");switch(i.type=n.scrollButtons.scrollType,a.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===i.type)return;c=!0,o.tweenRunning=!1,r("on",l);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===i.type)return;c=!1,i.dir&&r("off",l);break;case"click":if("stepped"!==i.type||o.tweenRunning)return;r("on",l)}}})},q=function(){function t(t){function a(e,t){r.type=i.keyboard.scrollType,r.scrollAmount=i.keyboard.scrollAmount,"stepped"===r.type&&n.tweenRunning||j(o,e,t)}switch(t.type){case"blur":n.tweenRunning&&r.dir&&a("off",null);break;case"keydown":case"keyup":var l=t.keyCode?t.keyCode:t.which,s="on";if("x"!==i.axis&&(38===l||40===l)||"y"!==i.axis&&(37===l||39===l)){if((38===l||40===l)&&!n.overflowed[0]||(37===l||39===l)&&!n.overflowed[1])return;"keyup"===t.type&&(s="off"),e(document.activeElement).is(u)||(t.preventDefault(),t.stopImmediatePropagation(),a(s,l))}else if(33===l||34===l){if((n.overflowed[0]||n.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type){V(o);var f=34===l?-1:1;if("x"===i.axis||"yx"===i.axis&&n.overflowed[1]&&!n.overflowed[0])var h="x",m=Math.abs(c[0].offsetLeft)-f*(.9*d.width());else var h="y",m=Math.abs(c[0].offsetTop)-f*(.9*d.height());Q(o,m.toString(),{dir:h,scrollEasing:"mcsEaseInOut"})}}else if((35===l||36===l)&&!e(document.activeElement).is(u)&&((n.overflowed[0]||n.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type)){if("x"===i.axis||"yx"===i.axis&&n.overflowed[1]&&!n.overflowed[0])var h="x",m=35===l?Math.abs(d.width()-c.outerWidth(!1)):0;else var h="y",m=35===l?Math.abs(d.height()-c.outerHeight(!1)):0;Q(o,m.toString(),{dir:h,scrollEasing:"mcsEaseInOut"})}}}var o=e(this),n=o.data(a),i=n.opt,r=n.sequential,l=a+"_"+n.idx,s=e("#mCSB_"+n.idx),c=e("#mCSB_"+n.idx+"_container"),d=c.parent(),u="input,textarea,select,datalist,keygen,[contenteditable='true']",f=c.find("iframe"),h=["blur."+l+" keydown."+l+" keyup."+l];f.length&&f.each(function(){e(this).bind("load",function(){A(this)&&e(this.contentDocument||this.contentWindow.document).bind(h[0],function(e){t(e)})})}),s.attr("tabindex","0").bind(h[0],function(e){t(e)})},j=function(t,o,n,i,r){function l(e){c.snapAmount&&(u.scrollAmount=c.snapAmount instanceof Array?"x"===u.dir[0]?c.snapAmount[1]:c.snapAmount[0]:c.snapAmount);var o="stepped"!==u.type,a=r||(e?o?m/1.5:p:1e3/60),n=e?o?7.5:40:2.5,d=[Math.abs(f[0].offsetTop),Math.abs(f[0].offsetLeft)],h=[s.scrollRatio.y>10?10:s.scrollRatio.y,s.scrollRatio.x>10?10:s.scrollRatio.x],g="x"===u.dir[0]?d[1]+u.dir[1]*(h[1]*n):d[0]+u.dir[1]*(h[0]*n),v="x"===u.dir[0]?d[1]+u.dir[1]*parseInt(u.scrollAmount):d[0]+u.dir[1]*parseInt(u.scrollAmount),x="auto"!==u.scrollAmount?v:g,_=i||(e?o?"mcsLinearOut":"mcsEaseInOut":"mcsLinear"),w=!!e;return e&&17>a&&(x="x"===u.dir[0]?d[1]:d[0]),Q(t,x.toString(),{dir:u.dir[0],scrollEasing:_,dur:a,onComplete:w}),e?void(u.dir=!1):(clearTimeout(u.step),void(u.step=setTimeout(function(){l()},a)))}var s=t.data(a),c=s.opt,u=s.sequential,f=e("#mCSB_"+s.idx+"_container"),h="stepped"===u.type,m=c.scrollInertia<26?26:c.scrollInertia,p=c.scrollInertia<1?17:c.scrollInertia;switch(o){case"on":if(u.dir=[n===d[16]||n===d[15]||39===n||37===n?"x":"y",n===d[13]||n===d[15]||38===n||37===n?-1:1],V(t),te(n)&&"stepped"===u.type)return;l(h);break;case"off":clearTimeout(u.step),Z(u,"step"),V(t),(h||s.tweenRunning&&u.dir)&&l(!0)}},Y=function(t){var o=e(this).data(a).opt,n=[];return"function"==typeof t&&(t=t()),t instanceof Array?n=t.length>1?[t[0],t[1]]:"x"===o.axis?[null,t[0]]:[t[0],null]:(n[0]=t.y?t.y:t.x||"x"===o.axis?null:t,n[1]=t.x?t.x:t.y||"y"===o.axis?null:t),"function"==typeof n[0]&&(n[0]=n[0]()),"function"==typeof n[1]&&(n[1]=n[1]()),n},X=function(t,o){if(null!=t&&void 0!==t){var n=e(this),i=n.data(a),r=i.opt,l=e("#mCSB_"+i.idx+"_container"),s=l.parent(),c=typeof t;o||(o="x"===r.axis?"x":"y");var d="x"===o?l.outerWidth(!1)-s.width():l.outerHeight(!1)-s.height(),f="x"===o?l[0].offsetLeft:l[0].offsetTop,h="x"===o?"left":"top";switch(c){case"function":return t();case"object":var m=t.jquery?t:e(t);if(!m.length)return;return"x"===o?oe(m)[1]:oe(m)[0];case"string":case"number":if(te(t))return Math.abs(t);if(-1!==t.indexOf("%"))return Math.abs(d*parseInt(t)/100);if(-1!==t.indexOf("-="))return Math.abs(f-parseInt(t.split("-=")[1]));if(-1!==t.indexOf("+=")){var p=f+parseInt(t.split("+=")[1]);return p>=0?0:Math.abs(p)}if(-1!==t.indexOf("px")&&te(t.split("px")[0]))return Math.abs(t.split("px")[0]);if("top"===t||"left"===t)return 0;if("bottom"===t)return Math.abs(s.height()-l.outerHeight(!1));if("right"===t)return Math.abs(s.width()-l.outerWidth(!1));if("first"===t||"last"===t){var m=l.find(":"+t);return"x"===o?oe(m)[1]:oe(m)[0]}return e(t).length?"x"===o?oe(e(t))[1]:oe(e(t))[0]:(l.css(h,t),void u.update.call(null,n[0]))}}},N=function(t){function o(e){clearTimeout(l[0].autoUpdate),u.update.call(null,n[0],e)}var n=e(this),i=n.data(a),r=i.opt,l=e("#mCSB_"+i.idx+"_container");return t?(clearTimeout(l[0].autoUpdate),void Z(l[0],"autoUpdate")):void function t(){return clearTimeout(l[0].autoUpdate),0===n.parents("html").length?void(n=null):void(l[0].autoUpdate=setTimeout(function(){return r.advanced.updateOnSelectorChange&&(i.poll.change.n=function(){!0===r.advanced.updateOnSelectorChange&&(r.advanced.updateOnSelectorChange="*");var e=0,t=l.find(r.advanced.updateOnSelectorChange);return r.advanced.updateOnSelectorChange&&t.length>0&&t.each(function(){e+=this.offsetHeight+this.offsetWidth}),e}(),i.poll.change.n!==i.poll.change.o)?(i.poll.change.o=i.poll.change.n,void o(3)):r.advanced.updateOnContentResize&&(i.poll.size.n=n[0].scrollHeight+n[0].scrollWidth+l[0].offsetHeight+n[0].offsetHeight+n[0].offsetWidth,i.poll.size.n!==i.poll.size.o)?(i.poll.size.o=i.poll.size.n,void o(1)):!r.advanced.updateOnImageLoad||"auto"===r.advanced.updateOnImageLoad&&"y"===r.axis||(i.poll.img.n=l.find("img").length,i.poll.img.n===i.poll.img.o)?void((r.advanced.updateOnSelectorChange||r.advanced.updateOnContentResize||r.advanced.updateOnImageLoad)&&t()):(i.poll.img.o=i.poll.img.n,void l.find("img").each(function(){!function(t){if(e(t).hasClass(d[2]))o();else{var a=new Image;a.onload=function(e,t){return function(){return t.apply(e,arguments)}}(a,function(){this.onload=null,e(t).addClass(d[2]),o(2)}),a.src=t.src}}(this)}))},r.advanced.autoUpdateTimeout))}()},V=function(t){var o=t.data(a),n=e("#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal");n.each(function(){K.call(this)})},Q=function(t,o,n){function i(e){return d&&u.callbacks[e]&&"function"==typeof u.callbacks[e]}function r(){var e=[p[0].offsetTop,p[0].offsetLeft],o=[w[0].offsetTop,w[0].offsetLeft],a=[p.outerHeight(!1),p.outerWidth(!1)],i=[m.height(),m.width()];t[0].mcs={content:p,top:e[0],left:e[1],draggerTop:o[0],draggerLeft:o[1],topPct:Math.round(100*Math.abs(e[0])/(Math.abs(a[0])-i[0])),leftPct:Math.round(100*Math.abs(e[1])/(Math.abs(a[1])-i[1])),direction:n.dir}}var l,s,c,d=t.data(a),u=d.opt,f={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:u.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},n=e.extend(f,n),h=[n.dur,n.drag?0:n.dur],m=e("#mCSB_"+d.idx),p=e("#mCSB_"+d.idx+"_container"),g=p.parent(),v=u.callbacks.onTotalScrollOffset?Y.call(t,u.callbacks.onTotalScrollOffset):[0,0],x=u.callbacks.onTotalScrollBackOffset?Y.call(t,u.callbacks.onTotalScrollBackOffset):[0,0];if(d.trigger=n.trigger,0===g.scrollTop()&&0===g.scrollLeft()||(e(".mCSB_"+d.idx+"_scrollbar").css("visibility","visible"),g.scrollTop(0).scrollLeft(0)),"_resetY"!==o||d.contentReset.y||(i("onOverflowYNone")&&u.callbacks.onOverflowYNone.call(t[0]),d.contentReset.y=1),"_resetX"!==o||d.contentReset.x||(i("onOverflowXNone")&&u.callbacks.onOverflowXNone.call(t[0]),d.contentReset.x=1),"_resetY"!==o&&"_resetX"!==o){if(!d.contentReset.y&&t[0].mcs||!d.overflowed[0]||(i("onOverflowY")&&u.callbacks.onOverflowY.call(t[0]),d.contentReset.x=null),!d.contentReset.x&&t[0].mcs||!d.overflowed[1]||(i("onOverflowX")&&u.callbacks.onOverflowX.call(t[0]),d.contentReset.x=null),u.snapAmount){var _=u.snapAmount instanceof Array?"x"===n.dir?u.snapAmount[1]:u.snapAmount[0]:u.snapAmount;l=o,s=_,c=u.snapOffset,o=Math.round(l/s)*s-c}switch(n.dir){case"x":var w=e("#mCSB_"+d.idx+"_dragger_horizontal"),S="left",b=p[0].offsetLeft,y=[m.width()-p.outerWidth(!1),w.parent().width()-w.width()],B=[o,0===o?0:o/d.scrollRatio.x],T=v[1],k=x[1],M=T>0?T/d.scrollRatio.x:0,O=k>0?k/d.scrollRatio.x:0;break;case"y":var w=e("#mCSB_"+d.idx+"_dragger_vertical"),S="top",b=p[0].offsetTop,y=[m.height()-p.outerHeight(!1),w.parent().height()-w.height()],B=[o,0===o?0:o/d.scrollRatio.y],T=v[0],k=x[0],M=T>0?T/d.scrollRatio.y:0,O=k>0?k/d.scrollRatio.y:0}B[1]<0||0===B[0]&&0===B[1]?B=[0,0]:B[1]>=y[1]?B=[y[0],y[1]]:B[0]=-B[0],t[0].mcs||(r(),i("onInit")&&u.callbacks.onInit.call(t[0])),clearTimeout(p[0].onCompleteTimeout),G(w[0],S,Math.round(B[1]),h[1],n.scrollEasing),!d.tweenRunning&&(0===b&&B[0]>=0||b===y[0]&&B[0]<=y[0])||G(p[0],S,Math.round(B[0]),h[0],n.scrollEasing,n.overwrite,{onStart:function(){n.callbacks&&n.onStart&&!d.tweenRunning&&(i("onScrollStart")&&(r(),u.callbacks.onScrollStart.call(t[0])),d.tweenRunning=!0,C(w),d.cbOffsets=[u.callbacks.alwaysTriggerOffsets||b>=y[0]+T,u.callbacks.alwaysTriggerOffsets||-k>=b])},onUpdate:function(){n.callbacks&&n.onUpdate&&i("whileScrolling")&&(r(),u.callbacks.whileScrolling.call(t[0]))},onComplete:function(){if(n.callbacks&&n.onComplete){"yx"===u.axis&&clearTimeout(p[0].onCompleteTimeout);var e=p[0].idleTimer||0;p[0].onCompleteTimeout=setTimeout(function(){i("onScroll")&&(r(),u.callbacks.onScroll.call(t[0])),i("onTotalScroll")&&B[1]>=y[1]-M&&d.cbOffsets[0]&&(r(),u.callbacks.onTotalScroll.call(t[0])),i("onTotalScrollBack")&&B[1]<=O&&d.cbOffsets[1]&&(r(),u.callbacks.onTotalScrollBack.call(t[0])),d.tweenRunning=!1,p[0].idleTimer=0,C(w,"hide")},e)}}})}},G=function(e,t,o,a,n,i,r){function l(){x.stop||(p||u.call(),p=J()-m,s(),p>=x.time&&(x.time=p>x.time?p+c-(p-x.time):p+c-1,x.time<p+1&&(x.time=p+1)),x.time<a?x.id=d(l):h.call())}function s(){a>0?(x.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 1>(e/=a/2)?o/2*e*e+t:-o/2*(--e*(e-2)-1)+t;case"easeInOutStrong":return 1>(e/=a/2)?o/2*Math.pow(2,10*(e-1))+t:(e--,o/2*(2-Math.pow(2,-10*e))+t);case"easeInOut":case"mcsEaseInOut":return 1>(e/=a/2)?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)}}(x.time,g,_,a,n),v[t]=Math.round(x.currVal)+"px"):v[t]=o+"px",f.call()}e._mTween||(e._mTween={top:{},left:{}});var c,d,r=r||{},u=r.onStart||function(){},f=r.onUpdate||function(){},h=r.onComplete||function(){},m=J(),p=0,g=e.offsetTop,v=e.style,x=e._mTween[t];"left"===t&&(g=e.offsetLeft);var _=o-g;x.stop=0,"none"!==i&&null!=x.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(x.id):clearTimeout(x.id),x.id=null),c=1e3/60,x.time=p+c,d=window.requestAnimationFrame?window.requestAnimationFrame:function(e){return s(),setTimeout(e,.01)},x.id=d(l)},J=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()},K=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)}},Z=function(e,t){try{delete e[t]}catch(o){e[t]=null}},$=function(e){return!(e.which&&1!==e.which)},ee=function(e){var t=e.originalEvent.pointerType;return!(t&&"touch"!==t&&2!==t)},te=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},oe=function(e){var t=e.parents(".mCSB_container");return[e.offset().top-t.offset().top,e.offset().left-t.offset().left]},ae=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]},e.fn[o]=function(t){return u[t]?u[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist"):u.init.apply(this,arguments)},e[o]=function(t){return u[t]?u[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist"):u.init.apply(this,arguments)},e[o].defaults=i,window[o]=!0,e(window).bind("load",function(){e(n)[o](),e.extend(e.expr[":"],{mcsInView:e.expr[":"].mcsInView||function(t){var o,a,n=e(t),i=n.parents(".mCSB_container");if(i.length)return o=i.parent(),a=[i[0].offsetTop,i[0].offsetLeft],a[0]+oe(n)[0]>=0&&a[0]+oe(n)[0]<o.height()-n.outerHeight(!1)&&a[1]+oe(n)[1]>=0&&a[1]+oe(n)[1]<o.width()-n.outerWidth(!1)},mcsInSight:e.expr[":"].mcsInSight||function(t,o,a){var n,i,r,l,s=e(t),c=s.parents(".mCSB_container"),d="exact"===a[3]?[[1,0],[1,0]]:[[.9,.1],[.6,.4]];if(c.length)return n=[s.outerHeight(!1),s.outerWidth(!1)],r=[c[0].offsetTop+oe(s)[0],c[0].offsetLeft+oe(s)[1]],i=[c.parent()[0].offsetHeight,c.parent()[0].offsetWidth],l=[n[0]<i[0]?d[0]:d[1],n[1]<i[1]?d[0]:d[1]],r[0]-i[0]*l[0][0]<0&&r[0]+n[0]-i[0]*l[0][1]>=0&&r[1]-i[1]*l[1][0]<0&&r[1]+n[1]-i[1]*l[1][1]>=0},mcsOverflow:e.expr[":"].mcsOverflow||function(t){var o=e(t).data(a);if(o)return o.overflowed[0]||o.overflowed[1]}})})});
  
  
  /* --------------------------------------------------------
   JQUERY FUNCTION CALL
  ----------------------------------------------------------- */
  (function ($) {
   "use strict";
  
  	$('[data-toggle="tooltip"]').tooltip();
  	
  	if($("#quizTimeout").length){
  		$('#quizTimeout').modal('show');
  	}
  	
  	$('body').delegate('.c-card .st-modal','click',function(){
  		var btndata = $(this).data('target');
  		var modaldata = $(this).parents('.c-card').find('.custome-modal').attr('id');
  		if(btndata === modaldata){
  			//$('body').addClass('modal-open');
  			$('body').append('<div class="modal-overlay"></div>');
  			$('#'+modaldata).fadeIn('fast');
  		}
  	});
  	
  	$('body').delegate('.menu--accord .panel-title','click',function(){
  		var thisParent = $(this).parents('.menu--accord');
  		thisParent.hasClass('st-opened') ? thisParent.removeClass('st-opened') : thisParent.addClass('st-opened');
  	});
  	
  	$('body').delegate('.d_sect_parent .panel-title','click',function(){
  		var par_title = $(this).parent('.panel-heading');
  		if(par_title.hasClass('st-selected')){
  			par_title.removeClass('st-selected');
  		}else{
  			par_title.addClass('st-selected');
  		}
  	});
  	
  	/* --------------------------------------------------------
  	 Unit folder selection
  	----------------------------------------------------------- */
  	$('body').delegate('.sect__unitlist .unit__btn','click',function(){
  		$(this).addClass('st-active').siblings().removeClass('st-active');
  	});
  	
  	/* --------------------------------------------------------
  	 WEEKDAY SELECTOR
  	----------------------------------------------------------- */
  	$('body').delegate('.weekDays-selector > button','click',function(){
  		$(this).hasClass('st-selected') ? $(this).removeClass('st-selected') : $(this).addClass('st-selected');
  	});
  	/* --------------------------------------------------------
  	 SIDEBAR MSCROLL
  	----------------------------------------------------------- */
  	$(".c-sidebar,.c-card__items,.weekdays--fields").mCustomScrollbar({
  		theme:"light",
  		autoHideScrollbar: true,
  		mouseWheel:{ enable: true },
  		advanced:{ updateOnContentResize: true }
  	});
  	
  	$(".custome-modal__body,.subjectBody,.c-batchSelect, .c-queList").mCustomScrollbar({
  		theme:"dark",
  		mouseWheel:{ enable: true },
  		advanced:{ updateOnContentResize: true }
  	});
  	
  	if($(".student-Listing").length){
  		$(".student-Listing").mCustomScrollbar({
  			theme:"dark",
  			mouseWheel:{ enable: true },
  			advanced:{ updateOnContentResize: true }
  		});
  	}
  	
  	/* --------------------------------------------------------
  	 ESCAPE KEY PRESS
  	----------------------------------------------------------- */
  	$(document).keydown(function(e) { 
  		if (e.keyCode == 27) { 
  			closeModalonEsc();
  		} 
  	});
  	
  	$(document).mouseup(function(e) 
  	{
  		var container = $(".custome-modal,.datepicker");
  		if (!container.is(e.target) && container.has(e.target).length === 0) 
  		{
  			closeModalonEsc();
  		}
  	});
  	
  	$('body').delegate('.act-c-modal','click',function(){
  		closeModalonEsc();
  	});
  	
  	
  	// ---- Data Table 
  	if($(".data--table").length){
  		$('.data--table').DataTable({
  			"dom": '<"top">rt<"bottom"ilp><"clear">',
  			"pagingType": "full_numbers",
  			"language": {
  				"emptyTable": "No data available in table"
  			},
  			"columnDefs": [
  				{ "orderable": false, "aTargets": 'nosort' }
  			]
  		});
  	}
  	
  	// ---- Date Picker for TimeTable
  	if($(".c-inline-calender").length){
  		$('.c-inline-calender').datepicker({
  			//todayHighlight: true,
  			startDate: new Date()
  		});
  	}
  	
  	// ---- Date Picker
  	if($(".fld--date").length){
  		$('.fld--date').datepicker({
  			format: 'dd/mm/yyyy',
  			autoclose: true,
  			startDate: new Date()
  		});
  	}
  	
  	// ---- Time Picker
  	if($(".fld--time").length){
  		$('.fld--time').timepicki(); 
  	}
  	
  	if($(".c-calculator").length){
  		var displayBox=document.getElementById("display"),hasEvaluated=!1;function clickNumbers(i){"0"===displayBox.innerHTML||!0===hasEvaluated&&!isNaN(displayBox.innerHTML)?displayBox.innerHTML=i:displayBox.innerHTML+=i,hasEvaluated=!1}function evaluate(){displayBox.innerHTML=displayBox.innerHTML.replace(",",""),displayBox.innerHTML=displayBox.innerHTML.replace("×","*"),displayBox.innerHTML=displayBox.innerHTML.replace("÷","/"),-1!==displayBox.innerHTML.indexOf("/0")&&($("button").prop("disabled",!1),$(".clear").attr("disabled",!1),displayBox.innerHTML="Division by 0 is undefined!");var evaluate=eval(displayBox.innerHTML);-1!==evaluate.toString().indexOf(".")&&(evaluate=evaluate.toFixed(5)),checkLength(evaluate),displayBox.innerHTML=evaluate}function checkLength(i){i.toString().length>7&&i.toString().length<14||i.toString().length>16&&(i="Infinity",$("button").prop("disabled",!0),$(".clear").attr("disabled",!1))}function trimIfNecessary(){file="standard ignore";var i=displayBox.innerHTML.length;i>7&&i<14||i>14&&(displayBox.innerHTML="Infinity",$("button").prop("disabled",!0),$(".clear").attr("disabled",!1))}$("#plus_minus").click(function(){eval(displayBox.innerHTML)>0?displayBox.innerHTML="-"+displayBox.innerHTML:displayBox.innerHTML=displayBox.innerHTML.replace("-","")}),$("#clear").click(function(){displayBox.innerHTML="0",$("button").prop("disabled",!1)}),$("#one").click(function(){checkLength(displayBox.innerHTML),clickNumbers(1)}),$("#two").click(function(){checkLength(displayBox.innerHTML),clickNumbers(2)}),$("#three").click(function(){checkLength(displayBox.innerHTML),clickNumbers(3)}),$("#four").click(function(){checkLength(displayBox.innerHTML),clickNumbers(4)}),$("#five").click(function(){checkLength(displayBox.innerHTML),clickNumbers(5)}),$("#six").click(function(){checkLength(displayBox.innerHTML),clickNumbers(6)}),$("#seven").click(function(){checkLength(displayBox.innerHTML),clickNumbers(7)}),$("#eight").click(function(){checkLength(displayBox.innerHTML),clickNumbers(8)}),$("#nine").click(function(){checkLength(displayBox.innerHTML),clickNumbers(9)}),$("#zero").click(function(){checkLength(displayBox.innerHTML),clickNumbers(0)}),$("#decimal").click(function(){(-1===displayBox.innerHTML.indexOf(".")||-1!==displayBox.innerHTML.indexOf(".")&&-1!==displayBox.innerHTML.indexOf("+")||-1!==displayBox.innerHTML.indexOf(".")&&-1!==displayBox.innerHTML.indexOf("-")||-1!==displayBox.innerHTML.indexOf(".")&&-1!==displayBox.innerHTML.indexOf("×")||-1!==displayBox.innerHTML.indexOf(".")&&-1!==displayBox.innerHTML.indexOf("÷"))&&clickNumbers(".")}),$("#add").click(function(){evaluate(),checkLength(displayBox.innerHTML),displayBox.innerHTML+="+"}),$("#subtract").click(function(){evaluate(),checkLength(displayBox.innerHTML),displayBox.innerHTML+="-"}),$("#multiply").click(function(){evaluate(),checkLength(displayBox.innerHTML),displayBox.innerHTML+="×"}),$("#divide").click(function(){evaluate(),checkLength(displayBox.innerHTML),displayBox.innerHTML+="÷"}),$("#square").click(function(){var i=Number(displayBox.innerHTML);checkLength(i*=i),displayBox.innerHTML=i}),$("#sqrt").click(function(){var i=parseFloat(displayBox.innerHTML);i=Math.sqrt(i),displayBox.innerHTML=Number(i.toFixed(5))}),$("#equals").click(function(){evaluate(),hasEvaluated=!0});
  	}
  	
  	if($(".c-btnRadio").length){
  		$('body').delegate('.c-btnRadio > button','click',function(){
  			$(this).addClass('st-active')
  			.siblings()
  			.removeClass('st-active');
  		});
  	}
  	
  })(jQuery);
  
  
  // ---------- Function to close modal 
  
  function closeModalonEsc(e){
  	//$('body').removeClass('modal-open')
  	$('.modal-overlay').fadeOut('fast',function(){
  		$(this).remove();
  	});
  	$(".custome-modal").fadeOut('fast');
  }
  