text: !function(e){e.fn.extend({slimScroll:function(i){var s=e.extend({width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:.2,railDraggable:!0,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,wheelStep:20,touchScrollStep:200,borderRadius:"7px",railBorderRadius:"7px"},i);return this.each(function(){function o(t){if(h){var i=0;(t=t||window.event).wheelDelta&&(i=-t.wheelDelta/120),t.detail&&(i=t.detail/3),e(t.target||t.srcTarget||t.srcElement).closest("."+s.wrapperClass).is(w.parent())&&a(i,!0),t.preventDefault&&!v&&t.preventDefault(),v||(t.returnValue=!1)}}function a(e,t,i){v=!1;var o=w.outerHeight()-y.outerHeight();t&&(t=parseInt(y.css("top"))+e*parseInt(s.wheelStep)/100*y.outerHeight(),t=Math.min(Math.max(t,0),o),t=0<e?Math.ceil(t):Math.floor(t),y.css({top:t+"px"})),t=(f=parseInt(y.css("top"))/(w.outerHeight()-y.outerHeight()))*(w[0].scrollHeight-w.outerHeight()),i&&(e=(t=e)/w[0].scrollHeight*w.outerHeight(),e=Math.min(Math.max(e,0),o),y.css({top:e+"px"})),w.scrollTop(t),w.trigger("slimscrolling",~~t),l(),n()}function r(){g=Math.max(w.outerHeight()/w[0].scrollHeight*w.outerHeight(),30),y.css({height:g+"px"});var e=g==w.outerHeight()?"none":"block";y.css({display:e})}function l(){r(),clearTimeout(d),f==~~f?(v=s.allowPageScroll,b!=f&&w.trigger("slimscroll",0==~~f?"top":"bottom")):v=!1,b=f,g>=w.outerHeight()?v=!0:(y.stop(!0,!0).fadeIn("fast"),s.railVisible&&x.stop(!0,!0).fadeIn("fast"))}function n(){s.alwaysVisible||(d=setTimeout(function(){s.disableFadeOut&&h||c||u||(y.fadeOut("slow"),x.fadeOut("slow"))},1e3))}var h,c,u,d,p,g,f,b,v=!1,w=e(this);if(w.parent().hasClass(s.wrapperClass)){var m=w.scrollTop(),y=w.siblings("."+s.barClass),x=w.siblings("."+s.railClass);if(r(),e.isPlainObject(i)){if("height"in i&&"auto"==i.height){w.parent().css("height","auto"),w.css("height","auto");var C=w.parent().parent().height();w.parent().css("height",C),w.css("height",C)}else"height"in i&&(C=i.height,w.parent().css("height",C),w.css("height",C));if("scrollTo"in i)m=parseInt(s.scrollTo);else if("scrollBy"in i)m+=parseInt(s.scrollBy);else if("destroy"in i)return y.remove(),x.remove(),void w.unwrap();a(m,!1,!0)}}else if(!(e.isPlainObject(i)&&"destroy"in i)){s.height="auto"==s.height?w.parent().height():s.height,m=e("<div></div>").addClass(s.wrapperClass).css({position:"relative",overflow:"hidden",width:s.width,height:s.height}),w.css({overflow:"hidden",width:s.width,height:s.height});x=e("<div></div>").addClass(s.railClass).css({width:s.size,height:"100%",position:"absolute",top:0,display:s.alwaysVisible&&s.railVisible?"block":"none","border-radius":s.railBorderRadius,background:s.railColor,opacity:s.railOpacity,zIndex:90}),y=e("<div></div>").addClass(s.barClass).css({background:s.color,width:s.size,position:"absolute",top:0,opacity:s.opacity,display:s.alwaysVisible?"block":"none","border-radius":s.borderRadius,BorderRadius:s.borderRadius,MozBorderRadius:s.borderRadius,WebkitBorderRadius:s.borderRadius,zIndex:99}),C="right"==s.position?{right:s.distance}:{left:s.distance};x.css(C),y.css(C),w.wrap(m),w.parent().append(y),w.parent().append(x),s.railDraggable&&y.bind("mousedown",function(i){var s=e(document);return u=!0,t=parseFloat(y.css("top")),pageY=i.pageY,s.bind("mousemove.slimscroll",function(e){currTop=t+e.pageY-pageY,y.css("top",currTop),a(0,y.position().top,!1)}),s.bind("mouseup.slimscroll",function(e){u=!1,n(),s.unbind(".slimscroll")}),!1}).bind("selectstart.slimscroll",function(e){return e.stopPropagation(),e.preventDefault(),!1}),x.hover(function(){l()},function(){n()}),y.hover(function(){c=!0},function(){c=!1}),w.hover(function(){h=!0,l(),n()},function(){h=!1,n()}),w.bind("touchstart",function(e,t){e.originalEvent.touches.length&&(p=e.originalEvent.touches[0].pageY)}),w.bind("touchmove",function(e){v||e.originalEvent.preventDefault(),e.originalEvent.touches.length&&(a((p-e.originalEvent.touches[0].pageY)/s.touchScrollStep,!0),p=e.originalEvent.touches[0].pageY)}),r(),"bottom"===s.start?(y.css({top:w.outerHeight()-y.outerHeight()}),a(0,!0)):"top"!==s.start&&(a(e(s.start).position().top,null,!0),s.alwaysVisible||y.hide()),window.addEventListener?(this.addEventListener("DOMMouseScroll",o,!1),this.addEventListener("mousewheel",o,!1)):document.attachEvent("onmousewheel",o)}}),this}}),e.fn.extend({slimscroll:e.fn.slimScroll})}(jQuery);