text: /*! enscroll - v0.4.3 - 2013-11-24
  * Copyright (c) 2013 ; Licensed  */
  !function(a){if(!a.browser){var b={},c=navigator.userAgent.toLowerCase(),d=/(chrome)[ \/]([\w.]+)/.exec(c)||/(webkit)[ \/]([\w.]+)/.exec(c)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(c)||/(msie) ([\w.]+)/.exec(c)||c.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(c)||[],e={browser:d[1]||"",version:d[2]||0};e.browser&&(b[e.browser]=!0,b.version=e.version),b.chrome?b.webkit=!0:b.webkit&&(b.safari=!0),a.browser=b}}(jQuery),function(a,b,c,d){var e={getEvent:function(a){return a||b.event},preventDefault:function(a){a.preventDefault?a.preventDefault():a.returnValue=!1}},f=b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,1e3/60)},g=function(b){var c=a(this).data("enscroll"),d=this,e=c.settings,f=function(){var b=a(this).data("enscroll"),c=b.settings;b&&c.showOnHover&&(c.verticalScrolling&&"none"!==a(b.verticalTrackWrapper).css("display")&&a(b.verticalTrackWrapper).stop().fadeTo("fast",0),c.horizontalScrolling&&"none"!==a(b.horizontalTrackWrapper).css("display")&&a(b.horizontalTrackWrapper).stop().fadeTo("fast",0),b._fadeTimer=null)};c&&e.showOnHover&&(c._fadeTimer?clearTimeout(c._fadeTimer):(e.verticalScrolling&&"none"!==a(c.verticalTrackWrapper).css("display")&&a(c.verticalTrackWrapper).stop().fadeTo("fast",1),e.horizontalScrolling&&"none"!==a(c.horizontalTrackWrapper).css("display")&&a(c.horizontalTrackWrapper).stop().fadeTo("fast",1)),b!==!1&&(c._fadeTimer=setTimeout(function(){f.call(d)},1500)))},h=function(b,c){var d=a(b),e=d.data("enscroll"),f=d.scrollTop();e&&e.settings.verticalScrolling&&(d.scrollTop(f+c),e.settings.showOnHover&&g.call(b))},i=function(b,c){var d=a(b),e=d.data("enscroll"),f=d.scrollLeft();e&&e.settings.horizontalScrolling&&(d.scrollLeft(f+c),e.settings.showOnHover&&g.call(b))},j=function(b){if(1===b.which){var d,e,h,i,j,k,l,m,n,o=b.data.pane,p=a(o).data("enscroll"),q=!0,r=function(){q&&(h!==i&&(a(o).scrollTop(h*n/m),i=h),f(r),g.call(o))},s=function(a){return q&&(h=a.clientY-k-j,h=Math.min(0>h?0:h,m)),!1},t=function(){return q=!1,c.body.style.cursor=l,this.style.cursor="",d.removeClass("dragging"),a(c.body).off("mousemove.enscroll.vertical").off("mouseup.enscroll.vertical"),a(c).off("mouseout.enscroll.vertical"),!1};return d=a(p.verticalTrackWrapper).find(".enscroll-track"),e=d.children().first()[0],h=parseInt(e.style.top,10),n=o.scrollHeight-a(o).innerHeight(),j=b.clientY-a(e).offset().top,m=d.height()-a(e).outerHeight(),k=d.offset().top,a(c.body).on({"mousemove.enscroll.vertical":s,"mouseup.enscroll.vertical":function(a){t.call(e,a)}}),a(c).on("mouseout.enscroll.vertical",function(a){a.target.nodeName&&"HTML"===a.target.nodeName.toUpperCase()&&t.call(e,a)}),d.hasClass("dragging")||(d.addClass("dragging"),l=a(c.body).css("cursor"),this.style.cursor=c.body.style.cursor="ns-resize"),r(),!1}},k=function(b){if(1===b.which){var d,e,h,i,j,k,l,m,n,o=b.data.pane,p=a(o).data("enscroll"),q=!0,r=function(){q&&(h!==i&&(a(o).scrollLeft(h*j/n),i=h),f(r),g.call(o))},s=function(a){return q&&(h=a.clientX-l-k,h=Math.min(0>h?0:h,n),g.call(o)),!1},t=function(){return q=!1,d.removeClass("dragging"),c.body.style.cursor=m,this.style.cursor="",d.removeClass("dragging"),a(c.body).off("mousemove.enscroll.horizontal").off("mouseup.enscroll.horizontal"),a(c).off("mouseout.enscroll.horizontal"),!1};return d=a(p.horizontalTrackWrapper).find(".enscroll-track"),e=d.children().first()[0],h=parseInt(e.style.left,10),j=o.scrollWidth-a(o).innerWidth(),k=b.clientX-a(e).offset().left,n=d.width()-a(e).outerWidth(),l=d.offset().left,a(c.body).on({"mousemove.enscroll.horizontal":s,"mouseup.enscroll.horizontal":function(a){t.call(e,a)}}),a(c).on("mouseout.enscroll.horizontal",function(a){a.target.nodeName&&"HTML"===a.target.nodeName.toUpperCase()&&t.call(e,a)}),d.hasClass("dragging")||(d.addClass("dragging"),m=a("body").css("cursor"),this.style.cursor=c.body.style.cursor="ew-resize"),r(),!1}},l=function(a){var c,d,f,g,j=this.data("enscroll");j&&(a=e.getEvent(a),f=a.detail?-a.detail:b.client&&b.client.engine.opera&&b.client.engine.opera<9.5?-a.wheelDelta:a.wheelDelta,g=j.settings.scrollIncrement,a.wheelDelta&&a.wheelDeltaX&&a.wheelDelta===a.wheelDeltaX||a.axis&&a.HORIZONTAL_AXIS&&a.axis===a.HORIZONTAL_AXIS?(c=this.scrollLeft(),i(this,0>f?g:-g),c!==this.scrollLeft()&&e.preventDefault(a)):(d=this.scrollTop(),h(this,0>f?g:-g),d!==this.scrollTop()&&e.preventDefault(a)))},m=function(){var b,c,d,e=a(this),f=e.data("enscroll");f&&(f.settings.verticalScrolling&&(c=a(f.verticalTrackWrapper).find(".enscroll-track")[0],b=c.firstChild,d=e.scrollTop()/(this.scrollHeight-e.innerHeight()),d=isNaN(d)?0:d,b.style.top=d*(a(c).height()-a(b).outerHeight())+"px"),f.settings.horizontalScrolling&&(c=a(f.horizontalTrackWrapper).find(".enscroll-track")[0],b=c.firstChild,d=e.scrollLeft()/(this.scrollWidth-e.innerWidth()),d=isNaN(d)?0:d,b.style.left=d*(a(c).width()-a(b).innerWidth())+"px"))},n=function(b){var c,d=a(this),e=d.data("enscroll");if(b.target===this&&e){switch(c=e.settings.scrollIncrement,b.keyCode){case 32:case 34:return h(this,d.height()),!1;case 33:return h(this,-d.height()),!1;case 35:return h(this,this.scrollHeight),!1;case 36:return h(this,-this.scrollHeight),!1;case 37:return i(this,-c),!1;case 38:return h(this,-c),!1;case 39:return i(this,c),!1;case 40:return h(this,c),!1}return!0}},o=function(a){var b,c,e,g,j,k,l,m=this,n=function(a){b=a.touches[0].clientX,c=a.touches[0].clientY,e||(e=c===j&&b===g?d:Math.abs(j-c)>Math.abs(g-b)?"y":"x"),a.preventDefault()},o=function(){k&&("y"===e?(h(m,j-c),l=j-c,j=c):"x"===e&&(i(m,g-b),l=g-b,g=b),f(o))},p=function(){var a=0,b=Math.round(Math.abs(1.75*l)),c=10*l*Math.log(2);this.removeEventListener("touchmove",n,!1),this.removeEventListener("touchend",p,!1),k=!1,f(function d(){if(a!==b&&!k){var g=Math.round(c/b*Math.pow(2,-10*a/b+1));isNaN(g)||0===g||(a+=1,"y"===e?h(m,g):i(m,g),f(d))}})};1===a.touches.length&&(g=a.touches[0].clientX,j=a.touches[0].clientY,k=!0,this.addEventListener("touchmove",n,!1),this.addEventListener("touchend",p,!1),f(o))},p={reposition:function(){return this.each(function(){var b,c,d,e,f,g=a(this),h=g.data("enscroll"),i=function(a,b,c){a.style.left=b+"px",a.style.top=c+"px"},j=function(b,c){var d=a(b).css(c),e=/^-?\d+/.exec(d);return e?+e[0]:0};h&&(d=g.position(),f=a.browser.msie&&/^6/.test(a.browser.version),f&&(e=g.offsetParent()[0]),b=h.corner,h.settings.verticalScrolling&&(c=h.verticalTrackWrapper,i(c,d.left+g.outerWidth()-a(c).width()-j(this,"border-right-width")-(f?j(e,"padding-left"):0),d.top+j(this,"border-top-width")+(f?j(e,"border-top-width"):0))),h.settings.horizontalScrolling&&(c=h.horizontalTrackWrapper,i(c,d.left+j(this,"border-left-width")-(f?j(e,"padding-left"):0),d.top+g.outerHeight()-a(c).height()-j(this,"border-bottom-width")+(f?j(e,"border-bottom-width"):0))),b&&i(b,d.left+g.outerWidth()-a(b).outerWidth()-j(this,"border-right-width")-(f?j(e,"padding-left"):0),d.top+g.outerHeight()-a(b).outerHeight()-j(this,"border-bottom-width")+(f?j(e,"border-bottom-width"):0)))})},resize:function(){return this.each(function(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r=a(this),s=r.data("enscroll");return s?(b=s.settings,r.is(":visible")?(b.verticalScrolling&&(e=s.verticalTrackWrapper,c=r.innerHeight(),f=c/this.scrollHeight,g=a(e).find(".enscroll-track")[0],j=a(e).find("."+b.scrollUpButtonClass),k=a(e).find("."+b.scrollDownButtonClass),i=b.horizontalScrolling?c-a(s.horizontalTrackWrapper).find(".enscroll-track").outerHeight():c,i-=a(g).outerHeight()-a(g).height()+j.outerHeight()+k.outerHeight(),n=g.firstChild,p=Math.max(f*i,b.minScrollbarLength),p-=a(n).outerHeight()-a(n).height(),e.style.display="none",g.style.height=i+"px",n.style.height=p+"px",1>f&&(f=r.scrollTop()/(this.scrollHeight-r.height()),n.style.top=f*(i-p)+"px",e.style.display="block")),b.horizontalScrolling&&(e=s.horizontalTrackWrapper,d=r.innerWidth(),f=d/this.scrollWidth,g=a(e).find(".enscroll-track")[0],l=a(e).find("."+b.scrollLeftButtonClass),m=a(e).find("."+b.scrollRightButtonClass),h=b.verticalScrolling?d-a(s.verticalTrackWrapper).find(".enscroll-track").outerWidth():d,h-=a(g).outerWidth()-a(g).width()+l.outerWidth()+m.outerWidth(),n=g.firstChild,o=Math.max(f*h,b.minScrollbarLength),o-=a(n).outerWidth()-a(n).width(),e.style.display="none",g.style.width=h+"px",n.style.width=o+"px",1>f&&(f=r.scrollLeft()/(this.scrollWidth-r.width()),n.style.left=f*(h-o)+"px",e.style.display="block"),s._prybar&&(q=s._prybar,this.removeChild(q),b.verticalScrolling&&(q.style.width=this.scrollWidth+a(s.verticalTrackWrapper).find(".enscroll-track").outerWidth()+"px",this.appendChild(q)))),s.corner&&(s.corner.style.display=s.verticalTrackWrapper&&s.horizontalTrackWrapper&&a(s.verticalTrackWrapper).is(":visible")&&a(s.horizontalTrackWrapper).is(":visible")?"":"none")):(b.verticalScrolling&&(s.verticalTrackWrapper.style.display="none"),b.horizontalScrolling&&(s.horizontalTrackWrapper.style.display="none"),s.corner&&(s.corner.style.display="none")),void 0):!0})},startPolling:function(){return this.each(function(){var b,c=a(this).data("enscroll"),d=this,e=a(d),f=-1,g=-1,h=-1,i=-1,j=function(){if(c.settings.pollChanges){var a=d.scrollWidth,k=d.scrollHeight,l=e.width(),m=e.height(),n=e.offset();(c.settings.verticalScrolling&&(m!==g||k!==i)||c.settings.horizontalScrolling&&(l!==f||a!==h))&&(h=a,i=k,p.resize.call(e)),(b.left!==n.left||b.top!==n.top||l!==f||m!==g)&&(b=n,f=l,g=m,p.reposition.call(e)),setTimeout(j,350)}};c&&(c.settings.pollChanges=!0,i=d.scrollHeight,h=d.scrollWidth,b=e.offset(),j())})},stopPolling:function(){return this.each(function(){var b=a(this).data("enscroll");b&&(b.settings.pollChanges=!1)})},destroy:function(){return this.each(function(){var c,d,e=a(this),f=e.data("enscroll");f&&(p.stopPolling.call(e),d=f._mouseScrollHandler,f.settings.verticalScrolling&&(c=f.verticalTrackWrapper,a(c).remove(),c=null),f.settings.horizontalScrolling&&(c=f.horizontalTrackWrapper,a(c).remove(),c=null),f._fadeTimer&&clearTimeout(f._fadeTimer),f.corner&&a(f.corner).remove(),f._prybar&&f._prybar.parentNode&&f._prybar.parentNode===this&&a(f._prybar).remove(),this.setAttribute("style",f._style||""),f._hadTabIndex||e.removeAttr("tabindex"),e.off("scroll.enscroll.pane").off("keydown.enscroll.pane").off("mouseenter.enscroll.pane").data("enscroll",null),this.removeEventListener?(this.removeEventListener("mousewheel",d,!1),this.removeEventListener("DOMMouseScroll",d,!1),this.removeEventListener("touchstart",o,!1)):this.detachEvent&&this.detachEvent("onmousewheel",d),a(b).off("resize.enscroll.window"))})}};a.fn.enscroll=function(d){if(p[d])return p[d].call(this);var e=a.extend({verticalScrolling:!0,horizontalScrolling:!1,showOnHover:!1,scrollIncrement:20,minScrollbarLength:40,pollChanges:!0,drawCorner:!0,drawScrollButtons:!1,clickTrackToScroll:!0,verticalTrackClass:"vertical-track",horizontalTrackClass:"horizontal-track",horizontalHandleClass:"horizontal-handle",verticalHandleClass:"vertical-handle",scrollUpButtonClass:"scroll-up-btn",scrollDownButtonClass:"scroll-down-btn",scrollLeftButtonClass:"scroll-left-btn",scrollRightButtonClass:"scroll-right-btn",cornerClass:"scrollbar-corner",zIndex:1,addPaddingToPane:!0,horizontalHandleHTML:'<div class="left"></div><div class="right"></div>',verticalHandleHTML:'<div class="top"></div><div class="bottom"></div>'},d);return this.each(function(){if(e.verticalScrolling||e.horizontalScrolling){var d,f,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F=a(this),G=this,H=F.attr("style"),I=!0,J={position:"absolute","z-index":e.zIndex,margin:0,padding:0},K=function(a){l.call(F,a)},L=function(b,c){"string"==typeof c?a(b).html(c):"object"==typeof c&&null!==c&&c.nodeType&&1===c.nodeType&&b.appendChild(c)};if(e.verticalScrolling){f=c.createElement("div"),r=c.createElement("div"),t=c.createElement("a"),a(r).css("position","relative").addClass("enscroll-track").addClass(e.verticalTrackClass).appendTo(f),e.drawScrollButtons&&(u=c.createElement("a"),v=c.createElement("a"),a(u).css({display:"block","text-decoration":"none"}).attr("href","").html("&nbsp;").addClass(e.scrollUpButtonClass).on("click",function(){return h(G,-e.scrollIncrement),!1}).insertBefore(r),a(v).css({display:"block","text-decoration":"none"}).attr("href","").html("&nbsp;").on("click",function(){return h(G,e.scrollIncrement),!1}).addClass(e.scrollDownButtonClass).appendTo(f)),e.clickTrackToScroll&&a(r).on("click",function(b){b.target===this&&h(G,b.pageY>a(t).offset().top?F.height():-F.height())}),a(t).css({position:"absolute","z-index":1}).attr("href","").addClass(e.verticalHandleClass).mousedown({pane:this},j).click(function(){return!1}).appendTo(r),L(t,e.verticalHandleHTML),a(f).css(J).insertAfter(this),e.showOnHover&&a(f).css("opacity",0).on("mouseover.enscroll.vertical",function(){g.call(G,!1)}).on("mouseout.enscroll.vertical",function(){g.call(G)}),z=a(r).outerWidth(),e.addPaddingToPane&&F.css({width:F.width()-z+"px","padding-right":parseInt(F.css("padding-right"),10)+z+"px"});try{D=parseInt(F.css("outline-width"),10),0!==D&&!isNaN(D)||"none"!==F.css("outline-style")||F.css("outline","none")}catch(M){F.css("outline","none")}}e.horizontalScrolling&&(d=c.createElement("div"),q=c.createElement("div"),s=c.createElement("a"),a(q).css({position:"relative","z-index":1}).addClass("enscroll-track").addClass(e.horizontalTrackClass).appendTo(d),e.drawScrollButtons&&(w=c.createElement("a"),x=c.createElement("a"),a(w).css("display","block").attr("href","").on("click",function(){return i(G,-e.scrollIncrement),!1}).addClass(e.scrollLeftButtonClass).insertBefore(q),a(x).css("display","block").attr("href","").on("click",function(){return i(G,e.scrollIncrement),!1}).addClass(e.scrollRightButtonClass).appendTo(d)),e.clickTrackToScroll&&a(q).on("click",function(b){b.target===this&&i(G,b.pageX>a(s).offset().left?F.width():-F.width())}),a(s).css({position:"absolute","z-index":1}).attr("href","").addClass(e.horizontalHandleClass).click(function(){return!1}).mousedown({pane:this},k).appendTo(q),L(s,e.horizontalHandleHTML),a(d).css(J).insertAfter(this),e.showOnHover&&a(d).css("opacity",0).on("mouseover.enscroll.horizontal",function(){g.call(G,!1)}).on("mouseout.enscroll.horizontal",function(){g.call(G)}),y=a(q).outerHeight(),e.addPaddingToPane&&F.css({height:F.height()-y+"px","padding-bottom":parseInt(F.css("padding-bottom"),10)+y+"px"}),(!a.browser.msie||a.browser.msie&&a.browser.version>7)&&(E=c.createElement("div"),a(E).css({width:"1px",height:"1px",visibility:"hidden",padding:0,margin:"-1px"}).appendTo(this))),e.verticalScrolling&&e.horizontalScrolling&&e.drawCorner&&(A=c.createElement("div"),a(A).addClass(e.cornerClass).css(J).insertAfter(this)),C=F.attr("tabindex"),(!C||C.length<1)&&(F.attr("tabindex",0),I=!1);try{B=F.css("outline"),(!B||B.length<1)&&F.css("outline","none")}catch(M){F.css("outline","none")}F.on({"scroll.enscroll.pane":function(a){m.call(this,a)},"keydown.enscroll.pane":n}).css("overflow","hidden").data("enscroll",{settings:e,horizontalTrackWrapper:d,verticalTrackWrapper:f,corner:A,_prybar:E,_mouseScrollHandler:K,_hadTabIndex:I,_style:H}),a(b).on("resize.enscroll.window",function(){p.reposition.call(F)}),e.showOnHover&&F.on("mouseenter.enscroll.pane",function(){g.call(this)}),this.addEventListener?(this.addEventListener("mousewheel",K,!1),this.addEventListener("DOMMouseScroll",K,!1),this.addEventListener("touchstart",o,!1)):this.attachEvent&&this.attachEvent("onmousewheel",K),e.pollChanges?p.startPolling.call(F):(p.resize.call(F),p.reposition.call(F)),a(r,q).removeClass(e.verticalTrackClass).addClass(e.verticalTrackClass)}})}}(jQuery,window,document);