(function(n){jQuery.fn.extend({slimScroll:function(i){var r=n.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 l(t){var t,i,f;u.data("over")&&(t=t||window.event,i=0,t.wheelDelta&&(i=-t.wheelDelta/120),t.detail&&(i=t.detail/3),f=t.target||t.srcTarget||t.srcElement,n(f).closest("."+r.wrapperClass).is(u.parent())&&h(i,!0),t.preventDefault&&!o&&t.preventDefault(),o||(t.returnValue=!1))}function h(n,t,i){var s,l,h;o=!1;s=n;l=u.outerHeight()-f.outerHeight();t&&(s=parseInt(f.css("top"))+n*parseInt(r.wheelStep)/100*f.outerHeight(),s=Math.min(Math.max(s,0),l),s=n>0?Math.ceil(s):Math.floor(s),f.css({top:s+"px"}));e=parseInt(f.css("top"))/(u.outerHeight()-f.outerHeight());s=e*(u[0].scrollHeight-u.outerHeight());i&&(s=n,h=s/u[0].scrollHeight*u.outerHeight(),h=Math.min(Math.max(h,0),l),f.css({top:h+"px"}));u.scrollTop(s);u.trigger("slimscrolling",~~s);p();c()}function ut(){window.addEventListener?(this.addEventListener("DOMMouseScroll",l,!1),this.addEventListener("mousewheel",l,!1),this.addEventListener("MozMousePixelScroll",l,!1)):document.attachEvent("onmousewheel",l)}function y(){a=Math.max(u.outerHeight()/u[0].scrollHeight*u.outerHeight(),ft);f.css({height:a+"px"});var n=a==u.outerHeight()?"none":"block";f.css({display:n})}function p(){if(y(),clearTimeout(nt),e==~~e){if(o=r.allowPageScroll,tt!=e){var n=~~e==0?"top":"bottom";u.trigger("slimscroll",n)}}else o=!1;if(tt=e,a>=u.outerHeight()){o=!0;return}f.stop(!0,!0).fadeIn("fast");r.railVisible&&s.stop(!0,!0).fadeIn("fast")}function c(){r.alwaysVisible||(nt=setTimeout(function(){r.disableFadeOut&&u.data("over")||w||b||(f.fadeOut("slow"),s.fadeOut("slow"))},1e3))}var w,b,nt,k,a,e,tt,d="