!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(jQuery||require("jquery")):e(jQuery)}(function(ye){ye.fn.jScrollPane=function(o){function s(m,e){var w,y,k,b,T,C,x,S,D,B,H,P,z,A,W,Y,M,X,R,t,L,E,I,F,V,q,O,G,N,K,Q,U,$,J,Z=this,r=!0,a=!0,l=!1,c=!1,o=m.clone(!1,!1).empty(),_=!1,ee=ye.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp",te=function(){0').css("padding",U).append(m.children()),T=ye('
').css({width:k+"px",height:b+"px"}).append(y).appendTo(m);else{if(m.css("width",""),T.css({width:"auto",height:"auto"}),y.css("position","static"),r=m.innerWidth()+$,a=m.innerHeight(),y.css("position","absolute"),v=w.stickToBottom&&(c=x-b,1!=w.maintainPosition||20<=c&&c-me()<10),j=w.stickToRight&&(l=C-k,1!=w.maintainPosition||20<=l&&l-je()<10),s=r!==k||a!==b,k=r,b=a,T.css({width:k+"px",height:b+"px"}),!s&&J==C&&y.outerHeight()==x)return void m.width(k);J=C,y.css("width",""),m.width(k),T.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}y.css("overflow","auto"),C=e.contentWidth?e.contentWidth:y[0].scrollWidth,x=y[0].scrollHeight,y.css("overflow",""),S=C/k,B=1<(D=x/b)||w.alwaysShowVScroll,(H=1').append(ye('
'),ye('
').append(ye('
').append(ye('
'),ye('
'))),ye('
'))),X=T.find(">.jspVerticalBar"),R=X.find(">.jspTrack"),P=R.find(">.jspDrag"),w.showArrows&&(I=ye('').on("mousedown.jsp",ae(0,-1)).on("click.jsp",we),F=ye('').on("mousedown.jsp",ae(0,1)).on("click.jsp",we),w.arrowScrollOnHover&&(I.on("mouseover.jsp",ae(0,-1,I)),F.on("mouseover.jsp",ae(0,1,F))),re(R,w.verticalArrowPositions,I,F)),L=b,T.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){L-=ye(this).outerHeight()}),P.on("mouseenter",function(){P.addClass("jspHover")}).on("mouseleave",function(){P.removeClass("jspHover")}).on("mousedown.jsp",function(e){ye("html").on("dragstart.jsp selectstart.jsp",we),P.addClass("jspActive");var t=e.pageY-P.position().top;return ye("html").on("mousemove.jsp",function(e){pe(e.pageY-t,!1)}).on("mouseup.jsp mouseleave.jsp",ce),!1}),ie()),H&&(T.append(ye('
').append(ye('
'),ye('
').append(ye('
').append(ye('
'),ye('
'))),ye('
'))),V=T.find(">.jspHorizontalBar"),q=V.find(">.jspTrack"),W=q.find(">.jspDrag"),w.showArrows&&(N=ye('').on("mousedown.jsp",ae(-1,0)).on("click.jsp",we),K=ye('').on("mousedown.jsp",ae(1,0)).on("click.jsp",we),w.arrowScrollOnHover&&(N.on("mouseover.jsp",ae(-1,0,N)),K.on("mouseover.jsp",ae(1,0,K))),re(q,w.horizontalArrowPositions,N,K)),W.on("mouseenter",function(){W.addClass("jspHover")}).on("mouseleave",function(){W.removeClass("jspHover")}).on("mousedown.jsp",function(e){ye("html").on("dragstart.jsp selectstart.jsp",we),W.addClass("jspActive");var t=e.pageX-W.position().left;return ye("html").on("mousemove.jsp",function(e){ue(e.pageX-t,!1)}).on("mouseup.jsp mouseleave.jsp",ce),!1}),O=T.innerWidth(),ne()),function(){{var e,t;H&&B&&(e=q.outerHeight(),t=R.outerWidth(),L-=e,ye(V).find(">.jspCap:visible,>.jspArrow").each(function(){O+=ye(this).outerWidth()}),O-=t,b-=t,k-=e,q.parent().append(ye('
').css("width",e+"px")),ie(),ne())}H&&y.width(T.outerWidth()-$+"px");x=y.outerHeight(),D=x/b,H&&((G=Math.ceil(1/S*O))>w.horizontalDragMaxWidth?G=w.horizontalDragMaxWidth:Gw.verticalDragMaxHeight?E=w.verticalDragMaxHeight:Ei+ye(window).height())&&s[0].scrollIntoView()),e.preventDefault())}})}()):(m.removeClass("jspScrollable"),y.css({top:"0",left:"0",width:T.width()-$}),T.off(ee),y.find(":input,a").off("focus.jsp"),m.attr("tabindex","-1").removeAttr("tabindex").off("keydown.jsp keypress.jsp"),y.off(".jsp"),le()),w.resizeSensor||!w.autoReinitialise||Q?w.resizeSensor||w.autoReinitialise||!Q||clearInterval(Q):Q=setInterval(function(){oe(w)},w.autoReinitialiseDelay),w.resizeSensor&&!_&&(se(y,te),se(m,te),se(m.parent(),te),window.addEventListener("resize",te),_=!0),i&&m.scrollTop(0)&&he(i,!1),n&&m.scrollLeft(0)&&ge(n,!1),m.trigger("jsp-initialised",[H||B])}function se(e,t){var o,s,i=document.createElement("div"),n=document.createElement("div"),r=document.createElement("div"),a=document.createElement("div"),l=document.createElement("div");i.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: scroll; z-index: -1; visibility: hidden;",n.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: scroll; z-index: -1; visibility: hidden;",a.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: scroll; z-index: -1; visibility: hidden;",r.style.cssText="position: absolute; left: 0; top: 0;",l.style.cssText="position: absolute; left: 0; top: 0; width: 200%; height: 200%;";function c(){r.style.width=n.offsetWidth+10+"px",r.style.height=n.offsetHeight+10+"px",n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight,a.scrollLeft=a.scrollWidth,a.scrollTop=a.scrollHeight,o=e.width(),s=e.height()}n.addEventListener("scroll",function(){(e.width()>o||e.height()>s)&&t.apply(this,[]),c()}.bind(this)),a.addEventListener("scroll",function(){(e.width().jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){O-=ye(this).outerWidth()}),q.width(O+"px"),M=0}function re(e,t,o,s){var i,n="before",r="after";"os"==t&&(t=/Mac/.test(navigator.platform)?"after":"split"),t==n?r=t:t==r&&(n=t,i=o,o=s,s=i),e[n](o)[r](s)}function ae(e,t,o){return function(){return function(e,t,o,s){o=ye(o).addClass("jspActive");var i,n,r=!0,a=function(){0!==e&&Z.scrollByX(e*w.arrowButtonSpeed),0!==t&&Z.scrollByY(t*w.arrowButtonSpeed),n=setTimeout(a,r?w.initialDelay:w.arrowRepeatFreq),r=!1};a(),i=s?"mouseout.jsp":"mouseup.jsp",(s=s||ye("html")).on(i,function(){o.removeClass("jspActive"),n&&clearTimeout(n),n=null,s.off(i)})}(e,t,this,o),this.blur(),!1}}function le(){q&&q.off("mousedown.jsp"),R&&R.off("mousedown.jsp")}function ce(){ye("html").off("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp"),P&&P.removeClass("jspActive"),W&&W.removeClass("jspActive")}function pe(e,t){var o,s,i,n,r;B&&(e<0?e=0:z