/*! perfect-scrollbar - v0.4.4 * http://noraesae.github.com/perfect-scrollbar/ * Copyright (c) 2013 HyeonJe Jun; Licensed MIT */ "use strict";(function(e){var t={wheelSpeed:10,wheelPropagation:!1,minScrollbarLength:null};e.fn.perfectScrollbar=function(o,r){return this.each(function(){var n=e.extend(!0,{},t),l=e(this);if("object"==typeof o?e.extend(!0,n,o):r=o,"update"===r)return l.data("perfect-scrollbar-update")&&l.data("perfect-scrollbar-update")(),l;if("destroy"===r)return l.data("perfect-scrollbar-destroy")&&l.data("perfect-scrollbar-destroy")(),l;if(l.data("perfect-scrollbar"))return l.data("perfect-scrollbar");l.addClass("ps-container");var s,c,a,i,p,u,f,d,h=e("
").appendTo(l),v=e("").appendTo(l),g=parseInt(h.css("bottom"),10),m=parseInt(v.css("right"),10),b=function(){var e=parseInt(d*(i-c)/(c-f),10);l.scrollTop(e),h.css({bottom:g-e})},w=function(){var e=parseInt(u*(a-s)/(s-p),10);l.scrollLeft(e),v.css({right:m-e})},T=function(e){return n.minScrollbarLength&&(e=Math.max(e,n.minScrollbarLength)),e},L=function(){h.css({left:u+l.scrollLeft(),bottom:g-l.scrollTop(),width:p}),v.css({top:d+l.scrollTop(),right:m-l.scrollLeft(),height:f})},I=function(){s=l.width(),c=l.height(),a=l.prop("scrollWidth"),i=l.prop("scrollHeight"),a>s?(p=T(parseInt(s*s/a,10)),u=parseInt(l.scrollLeft()*(s-p)/(a-s),10)):(p=0,u=0,l.scrollLeft(0)),i>c?(f=T(parseInt(c*c/i,10)),d=parseInt(l.scrollTop()*(c-f)/(i-c),10)):(f=0,d=0,l.scrollTop(0)),d>=c-f&&(d=c-f),u>=s-p&&(u=s-p),L()},D=function(e,t){var o=e+t,r=s-p;u=0>o?0:o>r?r:o,h.css({left:u+l.scrollLeft()})},C=function(e,t){var o=e+t,r=c-f;d=0>o?0:o>r?r:o,v.css({top:d+l.scrollTop()})},y=function(){var t,o;h.bind("mousedown.perfect-scroll",function(e){o=e.pageX,t=h.position().left,h.addClass("in-scrolling"),e.stopPropagation(),e.preventDefault()}),e(document).bind("mousemove.perfect-scroll",function(e){h.hasClass("in-scrolling")&&(w(),D(t,e.pageX-o),e.stopPropagation(),e.preventDefault())}),e(document).bind("mouseup.perfect-scroll",function(){h.hasClass("in-scrolling")&&h.removeClass("in-scrolling")}),t=o=null},x=function(){var t,o;v.bind("mousedown.perfect-scroll",function(e){o=e.pageY,t=v.position().top,v.addClass("in-scrolling"),e.stopPropagation(),e.preventDefault()}),e(document).bind("mousemove.perfect-scroll",function(e){v.hasClass("in-scrolling")&&(b(),C(t,e.pageY-o),e.stopPropagation(),e.preventDefault())}),e(document).bind("mouseup.perfect-scroll",function(){v.hasClass("in-scrolling")&&v.removeClass("in-scrolling")}),t=o=null},P=function(){var e=function(e,t){var o=l.scrollTop();if(0===o&&t>0&&0===e)return!n.wheelPropagation;if(o>=i-c&&0>t&&0===e)return!n.wheelPropagation;var r=l.scrollLeft();return 0===r&&0>e&&0===t?!n.wheelPropagation:r>=a-s&&e>0&&0===t?!n.wheelPropagation:!0},t=!1;l.bind("mousewheel.perfect-scroll",function(o,r,s,c){l.scrollTop(l.scrollTop()-c*n.wheelSpeed),l.scrollLeft(l.scrollLeft()+s*n.wheelSpeed),I(),t=e(s,c),t&&o.preventDefault()}),l.bind("MozMousePixelScroll.perfect-scroll",function(e){t&&e.preventDefault()})},X=function(){var t=function(e,t){l.scrollTop(l.scrollTop()-t),l.scrollLeft(l.scrollLeft()-e),I()},o={},r=0,n={},s=null,c=!1;e(window).bind("touchstart.perfect-scroll",function(){c=!0}),e(window).bind("touchend.perfect-scroll",function(){c=!1}),l.bind("touchstart.perfect-scroll",function(e){var t=e.originalEvent.targetTouches[0];o.pageX=t.pageX,o.pageY=t.pageY,r=(new Date).getTime(),null!==s&&clearInterval(s),e.stopPropagation()}),l.bind("touchmove.perfect-scroll",function(e){if(!c&&1===e.originalEvent.targetTouches.length){var l=e.originalEvent.targetTouches[0],s={};s.pageX=l.pageX,s.pageY=l.pageY;var a=s.pageX-o.pageX,i=s.pageY-o.pageY;t(a,i),o=s;var p=(new Date).getTime();n.x=a/(p-r),n.y=i/(p-r),r=p,e.preventDefault()}}),l.bind("touchend.perfect-scroll",function(){clearInterval(s),s=setInterval(function(){return.01>Math.abs(n.x)&&.01>Math.abs(n.y)?(clearInterval(s),void 0):(t(30*n.x,30*n.y),n.x*=.8,n.y*=.8,void 0)},10)})},S=function(){l.unbind(".perfect-scroll"),e(window).unbind(".perfect-scroll"),e(document).unbind(".perfect-scroll"),l.data("perfect-scrollbar",null),l.data("perfect-scrollbar-update",null),l.data("perfect-scrollbar-destroy",null),h.remove(),v.remove(),h=v=s=c=a=i=p=u=g=f=d=m=null},Y=function(t){l.addClass("ie").addClass("ie"+t);var o=function(){var t=function(){e(this).addClass("hover")},o=function(){e(this).removeClass("hover")};l.bind("mouseenter.perfect-scroll",t).bind("mouseleave.perfect-scroll",o),h.bind("mouseenter.perfect-scroll",t).bind("mouseleave.perfect-scroll",o),v.bind("mouseenter.perfect-scroll",t).bind("mouseleave.perfect-scroll",o)},r=function(){L=function(){h.css({left:u+l.scrollLeft(),bottom:g,width:p}),v.css({top:d+l.scrollTop(),right:m,height:f}),h.hide().show(),v.hide().show()},b=function(){var e=parseInt(d*i/c,10);l.scrollTop(e),h.css({bottom:g}),h.hide().show()},w=function(){var e=parseInt(u*a/s,10);l.scrollLeft(e),v.hide().show()}};6===t&&(o(),r())},M="ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch,E=function(){var e=navigator.userAgent.toLowerCase().match(/(msie) ([\w.]+)/);e&&"msie"===e[1]&&Y(parseInt(e[2],10)),I(),y(),x(),M&&X(),l.mousewheel&&P(),l.data("perfect-scrollbar",l),l.data("perfect-scrollbar-update",I),l.data("perfect-scrollbar-destroy",S)};return E(),l})}})(jQuery),function(e){function t(t){var o=t||window.event,r=[].slice.call(arguments,1),n=0,l=0,s=0;return t=e.event.fix(o),t.type="mousewheel",o.wheelDelta&&(n=o.wheelDelta/120),o.detail&&(n=-o.detail/3),s=n,void 0!==o.axis&&o.axis===o.HORIZONTAL_AXIS&&(s=0,l=-1*n),void 0!==o.wheelDeltaY&&(s=o.wheelDeltaY/120),void 0!==o.wheelDeltaX&&(l=-1*o.wheelDeltaX/120),r.unshift(t,n,l,s),(e.event.dispatch||e.event.handle).apply(this,r)}var o=["DOMMouseScroll","mousewheel"];if(e.event.fixHooks)for(var r=o.length;r;)e.event.fixHooks[o[--r]]=e.event.mouseHooks;e.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var e=o.length;e;)this.addEventListener(o[--e],t,!1);else this.onmousewheel=t},teardown:function(){if(this.removeEventListener)for(var e=o.length;e;)this.removeEventListener(o[--e],t,!1);else this.onmousewheel=null}},e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}(jQuery);