uTools-Manuals/assets/jquery.nicescroll.min.js
2019-09-23 11:37:39 +08:00

14 lines
64 KiB
JavaScript

(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{if(typeof exports==="object"){module.exports=a(require("jquery"))}else{a(jQuery)}}}(function(q){var h=false,o=false,m=0,s=2000,f=0;var g=q,c=document,n=window,t=g(n);var x=[];function y(){var B=c.currentScript||(function(){var D=c.getElementsByTagName("script");return(D.length)?D[D.length-1]:false})();var C=B?B.src.split("?")[0]:"";return(C.split("/").length>0)?C.split("/").slice(0,-1).join("/")+"/":""}var i=n.requestAnimationFrame||n.webkitRequestAnimationFrame||n.mozRequestAnimationFrame||false;var l=n.cancelAnimationFrame||n.webkitCancelAnimationFrame||n.mozCancelAnimationFrame||false;if(!i){var z=0;i=function(F,C){var B=new Date().getTime();var D=Math.max(0,16-(B-z));var E=n.setTimeout(function(){F(B+D)},D);z=B+D;return E};l=function(B){n.clearTimeout(B)}}else{if(!n.cancelAnimationFrame){l=function(B){}}}var b=n.MutationObserver||n.WebKitMutationObserver||false;var a=Date.now||function(){return new Date().getTime()};var e={zindex:"auto",cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"6px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:40,mousescrollstep:9*3,touchbehavior:false,emulatetouch:false,hwacceleration:true,usetransition:true,boxzoom:false,dblclickzoom:true,gesturezoom:true,grabcursorenabled:true,autohidemode:true,background:"",iframeautoresize:true,cursorminheight:32,preservenativescrolling:true,railoffset:false,railhoffset:false,bouncescroll:true,spacebarenabled:true,railpadding:{top:0,right:0,left:0,bottom:0},disableoutline:true,horizrailenabled:true,railalign:"right",railvalign:"bottom",enabletranslate3d:true,enablemousewheel:true,enablekeyboard:true,smoothscroll:true,sensitiverail:true,enablemouselockapi:true,cursorfixedheight:false,directionlockdeadzone:6,hidecursordelay:400,nativeparentscrolling:true,enablescrollonselection:true,overflowx:true,overflowy:true,cursordragspeed:0.3,rtlmode:"auto",cursordragontouch:false,oneaxismousemode:"auto",scriptpath:y(),preventmultitouchscrolling:true,disablemutationobserver:false,enableobserver:true,scrollbarid:false,scrollCLass:false};var k=false;var w=function(){if(k){return k}var G=c.createElement("DIV"),C=G.style,B=navigator.userAgent,D=navigator.platform,E={};E.haspointerlock="pointerLockElement" in c||"webkitPointerLockElement" in c||"mozPointerLockElement" in c;E.isopera=("opera" in n);E.isopera12=(E.isopera&&("getUserMedia" in navigator));E.isoperamini=(Object.prototype.toString.call(n.operamini)==="[object OperaMini]");E.isie=(("all" in c)&&("attachEvent" in G)&&!E.isopera);E.isieold=(E.isie&&!("msInterpolationMode" in C));E.isie7=E.isie&&!E.isieold&&(!("documentMode" in c)||(c.documentMode===7));E.isie8=E.isie&&("documentMode" in c)&&(c.documentMode===8);E.isie9=E.isie&&("performance" in n)&&(c.documentMode===9);E.isie10=E.isie&&("performance" in n)&&(c.documentMode===10);E.isie11=("msRequestFullscreen" in G)&&(c.documentMode>=11);E.ismsedge=("msCredentials" in n);E.ismozilla=("MozAppearance" in C);E.iswebkit=!E.ismsedge&&("WebkitAppearance" in C);E.ischrome=E.iswebkit&&("chrome" in n);E.ischrome38=(E.ischrome&&("touchAction" in C));E.ischrome22=(!E.ischrome38)&&(E.ischrome&&E.haspointerlock);E.ischrome26=(!E.ischrome38)&&(E.ischrome&&("transition" in C));E.cantouch=("ontouchstart" in c.documentElement)||("ontouchstart" in n);E.hasw3ctouch=(n.PointerEvent||false)&&((navigator.maxTouchPoints>0)||(navigator.msMaxTouchPoints>0));E.hasmstouch=(!E.hasw3ctouch)&&(n.MSPointerEvent||false);E.ismac=/^mac$/i.test(D);E.isios=E.cantouch&&/iphone|ipad|ipod/i.test(D);E.isios4=E.isios&&!("seal" in Object);E.isios7=E.isios&&("webkitHidden" in c);E.isios8=E.isios&&("hidden" in c);E.isios10=E.isios&&n.Proxy;E.isandroid=(/android/i.test(B));E.haseventlistener=("addEventListener" in G);E.trstyle=false;E.hastransform=false;E.hastranslate3d=false;E.transitionstyle=false;E.hastransition=false;E.transitionend=false;E.trstyle="transform";E.hastransform=("transform" in C)||(function(){var I=["msTransform","webkitTransform","MozTransform","OTransform"];for(var H=0,J=I.length;H<J;H++){if(C[I[H]]!==undefined){E.trstyle=I[H];break}}E.hastransform=(!!E.trstyle)})();if(E.hastransform){C[E.trstyle]="translate3d(1px,2px,3px)";E.hastranslate3d=/translate3d/.test(C[E.trstyle])}E.transitionstyle="transition";E.prefixstyle="";E.transitionend="transitionend";E.hastransition=("transition" in C)||(function(){E.transitionend=false;var I=["webkitTransition","msTransition","MozTransition","OTransition","OTransition","KhtmlTransition"];var K=["-webkit-","-ms-","-moz-","-o-","-o","-khtml-"];var J=["webkitTransitionEnd","msTransitionEnd","transitionend","otransitionend","oTransitionEnd","KhtmlTransitionEnd"];for(var H=0,L=I.length;H<L;H++){if(I[H] in C){E.transitionstyle=I[H];E.prefixstyle=K[H];E.transitionend=J[H];break}}if(E.ischrome26){E.prefixstyle=K[1]}E.hastransition=(E.transitionstyle)})();function F(){var H=["grab","-webkit-grab","-moz-grab"];if((E.ischrome&&!E.ischrome38)||E.isie){H=[]
}for(var J=0,I=H.length;J<I;J++){var K=H[J];C.cursor=K;if(C.cursor==K){return K}}return"url(https://cdnjs.cloudflare.com/ajax/libs/slider-pro/1.3.0/css/images/openhand.cur),n-resize"}E.cursorgrabvalue=F();E.hasmousecapture=("setCapture" in G);E.hasMutationObserver=(b!==false);G=null;k=E;return E};var d=function(J,ab){var S=this;this.version="3.7.6";this.name="nicescroll";this.me=ab;var T=g("body");var D=this.opt={doc:T,win:false};g.extend(D,e);D.snapbackspeed=80;if(J||false){for(var aa in D){if(J[aa]!==undefined){D[aa]=J[aa]}}}if(D.disablemutationobserver){b=false}this.doc=D.doc;this.iddoc=(this.doc&&this.doc[0])?this.doc[0].id||"":"";this.ispage=/^BODY|HTML/.test((D.win)?D.win[0].nodeName:this.doc[0].nodeName);this.haswrapper=(D.win!==false);this.win=D.win||(this.ispage?t:this.doc);this.docscroll=(this.ispage&&!this.haswrapper)?t:this.win;this.body=T;this.viewport=false;this.isfixed=false;this.iframe=false;this.isiframe=((this.doc[0].nodeName=="IFRAME")&&(this.win[0].nodeName=="IFRAME"));this.istextarea=(this.win[0].nodeName=="TEXTAREA");this.forcescreen=false;this.canshowonmouseevent=(D.autohidemode!="scroll");this.onmousedown=false;this.onmouseup=false;this.onmousemove=false;this.onmousewheel=false;this.onkeypress=false;this.ongesturezoom=false;this.onclick=false;this.onscrollstart=false;this.onscrollend=false;this.onscrollcancel=false;this.onzoomin=false;this.onzoomout=false;this.view=false;this.page=false;this.scroll={x:0,y:0};this.scrollratio={x:0,y:0};this.cursorheight=20;this.scrollvaluemax=0;if(D.rtlmode=="auto"){var ac=this.win[0]==n?this.body:this.win;var K=ac.css("writing-mode")||ac.css("-webkit-writing-mode")||ac.css("-ms-writing-mode")||ac.css("-moz-writing-mode");if(K=="horizontal-tb"||K=="lr-tb"||K===""){this.isrtlmode=(ac.css("direction")=="rtl");this.isvertical=false}else{this.isrtlmode=(K=="vertical-rl"||K=="tb"||K=="tb-rl"||K=="rl-tb");this.isvertical=(K=="vertical-rl"||K=="tb"||K=="tb-rl")}}else{this.isrtlmode=(D.rtlmode===true);this.isvertical=false}this.scrollrunning=false;this.scrollmom=false;this.observer=false;this.observerremover=false;this.observerbody=false;if(D.scrollbarid!==false){this.id=D.scrollbarid}else{do{this.id="ascrail"+(s++)}while(c.getElementById(this.id))}this.rail=false;this.cursor=false;this.cursorfreezed=false;this.selectiondrag=false;this.zoom=false;this.zoomactive=false;this.hasfocus=false;this.hasmousefocus=false;this.railslocked=false;this.locked=false;this.hidden=false;this.cursoractive=true;this.wheelprevented=false;this.overflowx=D.overflowx;this.overflowy=D.overflowy;this.nativescrollingarea=false;this.checkarea=0;this.events=[];this.saved={};this.delaylist={};this.synclist={};this.lastdeltax=0;this.lastdeltay=0;this.detected=w();var M=g.extend({},this.detected);this.canhwscroll=(M.hastransform&&D.hwacceleration);this.ishwscroll=(this.canhwscroll&&S.haswrapper);if(!this.isrtlmode){this.hasreversehr=false}else{if(this.isvertical){this.hasreversehr=!(M.iswebkit||M.isie||M.isie11)}else{this.hasreversehr=!(M.iswebkit||(M.isie&&!M.isie10&&!M.isie11))}}this.istouchcapable=false;if(!M.cantouch&&(M.hasw3ctouch||M.hasmstouch)){this.istouchcapable=true}else{if(M.cantouch&&!M.isios&&!M.isandroid&&(M.iswebkit||M.ismozilla)){this.istouchcapable=true}}if(!D.enablemouselockapi){M.hasmousecapture=false;M.haspointerlock=false}this.debounced=function(af,ag,ae){if(!S){return}var ad=S.delaylist[af]||false;if(!ad){S.delaylist[af]={h:i(function(){S.delaylist[af].fn.call(S);S.delaylist[af]=false},ae)};ag.call(S)}S.delaylist[af].fn=ag};this.synched=function(ad,ae){if(S.synclist[ad]){S.synclist[ad]=ae}else{S.synclist[ad]=ae;i(function(){if(!S){return}S.synclist[ad]&&S.synclist[ad].call(S);S.synclist[ad]=null})}};this.unsynched=function(ad){if(S.synclist[ad]){S.synclist[ad]=false}};this.css=function(ae,ad){for(var af in ad){S.saved.css.push([ae,af,ae.css(af)]);ae.css(af,ad[af])}};this.scrollTop=function(ad){return(ad===undefined)?S.getScrollTop():S.setScrollTop(ad)};this.scrollLeft=function(ad){return(ad===undefined)?S.getScrollLeft():S.setScrollLeft(ad)};var G=function(ae,ad,af,aj,ai,ah,ag){this.st=ae;this.ed=ad;this.spd=af;this.p1=aj||0;this.p2=ai||1;this.p3=ah||0;this.p4=ag||1;this.ts=a();this.df=ad-ae};G.prototype={B2:function(ad){return 3*(1-ad)*(1-ad)*ad},B3:function(ad){return 3*(1-ad)*ad*ad},B4:function(ad){return ad*ad*ad},getPos:function(){return(a()-this.ts)/this.spd},getNow:function(){var ad=(a()-this.ts)/this.spd;var ae=this.B2(ad)+this.B3(ad)+this.B4(ad);return(ad>=1)?this.ed:this.st+(this.df*ae)|0},update:function(ad,ae){this.st=this.getNow();this.ed=ad;this.spd=ae;this.ts=a();this.df=this.ed-this.st;return this}};function L(){var ad=S.doc.css(M.trstyle);if(ad&&(ad.substr(0,6)=="matrix")){return ad.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/)}return false}if(this.ishwscroll){this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"};if(M.hastranslate3d&&M.isios){this.doc.css("-webkit-backface-visibility","hidden")}this.getScrollTop=function(ae){if(!ae){var ad=L();
if(ad){return(ad.length==16)?-ad[13]:-ad[5]}if(S.timerscroll&&S.timerscroll.bz){return S.timerscroll.bz.getNow()}}return S.doc.translate.y};this.getScrollLeft=function(ae){if(!ae){var ad=L();if(ad){return(ad.length==16)?-ad[12]:-ad[4]}if(S.timerscroll&&S.timerscroll.bh){return S.timerscroll.bh.getNow()}}return S.doc.translate.x};this.notifyScrollEvent=function(ad){var ae=c.createEvent("UIEvents");ae.initUIEvent("scroll",false,false,n,1);ae.niceevent=true;ad.dispatchEvent(ae)};var O=(this.isrtlmode)?1:-1;if(M.hastranslate3d&&D.enabletranslate3d){this.setScrollTop=function(ae,ad){S.doc.translate.y=ae;S.doc.translate.ty=(ae*-1)+"px";S.doc.css(M.trstyle,"translate3d("+S.doc.translate.tx+","+S.doc.translate.ty+",0)");if(!ad){S.notifyScrollEvent(S.win[0])}};this.setScrollLeft=function(ae,ad){S.doc.translate.x=ae;S.doc.translate.tx=(ae*O)+"px";S.doc.css(M.trstyle,"translate3d("+S.doc.translate.tx+","+S.doc.translate.ty+",0)");if(!ad){S.notifyScrollEvent(S.win[0])}}}else{this.setScrollTop=function(ae,ad){S.doc.translate.y=ae;S.doc.translate.ty=(ae*-1)+"px";S.doc.css(M.trstyle,"translate("+S.doc.translate.tx+","+S.doc.translate.ty+")");if(!ad){S.notifyScrollEvent(S.win[0])}};this.setScrollLeft=function(ae,ad){S.doc.translate.x=ae;S.doc.translate.tx=(ae*O)+"px";S.doc.css(M.trstyle,"translate("+S.doc.translate.tx+","+S.doc.translate.ty+")");if(!ad){S.notifyScrollEvent(S.win[0])}}}}else{this.getScrollTop=function(){return S.docscroll.scrollTop()};this.setScrollTop=function(ad){S.docscroll.scrollTop(ad)};this.getScrollLeft=function(){var ad;if(!S.hasreversehr){ad=S.docscroll.scrollLeft()}else{if(S.detected.ismozilla){ad=S.page.maxw-Math.abs(S.docscroll.scrollLeft())}else{ad=S.page.maxw-S.docscroll.scrollLeft()}}return ad};this.setScrollLeft=function(ad){return setTimeout(function(){if(!S){return}if(S.hasreversehr){if(S.detected.ismozilla){ad=-(S.page.maxw-ad)}else{ad=S.page.maxw-ad}}return S.docscroll.scrollLeft(ad)},1)}}this.getTarget=function(ad){if(!ad){return false}if(ad.target){return ad.target}if(ad.srcElement){return ad.srcElement}return false};this.hasParent=function(ae,af){if(!ae){return false}var ad=ae.target||ae.srcElement||ae||false;while(ad&&ad.id!=af){ad=ad.parentNode||false}return(ad!==false)};function Q(){var ae=S.win;if("zIndex" in ae){return ae.zIndex()}while(ae.length>0){if(ae[0].nodeType==9){return false}var ad=ae.css("zIndex");if(!isNaN(ad)&&ad!==0){return parseInt(ad)}ae=ae.parent()}return false}var Z={"thin":1,"medium":3,"thick":5};function I(ag,ai,af){var ae=ag.css(ai);var ad=parseFloat(ae);if(isNaN(ad)){ad=Z[ae]||0;var ah=(ad==3)?((af)?(S.win.outerHeight()-S.win.innerHeight()):(S.win.outerWidth()-S.win.innerWidth())):1;if(S.isie8&&ad){ad+=1}return(ah)?ad:0}return ad}this.getDocumentScrollOffset=function(){return{top:n.pageYOffset||c.documentElement.scrollTop,left:n.pageXOffset||c.documentElement.scrollLeft}};this.getOffset=function(){if(S.isfixed){var af=S.win.offset();var ae=S.getDocumentScrollOffset();af.top-=ae.top;af.left-=ae.left;return af}var ag=S.win.offset();if(!S.viewport){return ag}var ad=S.viewport.offset();return{top:ag.top-ad.top,left:ag.left-ad.left}};this.updateScrollBar=function(ae){var ai,ag;if(S.ishwscroll){S.rail.css({height:S.win.innerHeight()-(D.railpadding.top+D.railpadding.bottom)});if(S.railh){S.railh.css({width:S.win.innerWidth()-(D.railpadding.left+D.railpadding.right)})}}else{var af=S.getOffset();ai={top:af.top,left:af.left-(D.railpadding.left+D.railpadding.right)};ai.top+=I(S.win,"border-top-width",true);ai.left+=(S.rail.align)?S.win.outerWidth()-I(S.win,"border-right-width")-S.rail.width:I(S.win,"border-left-width");ag=D.railoffset;if(ag){if(ag.top){ai.top+=ag.top}if(ag.left){ai.left+=ag.left}}if(!S.railslocked){S.rail.css({top:ai.top,left:ai.left,height:((ae)?ae.h:S.win.innerHeight())-(D.railpadding.top+D.railpadding.bottom)})}if(S.zoom){S.zoom.css({top:ai.top+1,left:(S.rail.align==1)?ai.left-20:ai.left+S.rail.width+4})}if(S.railh&&!S.railslocked){ai={top:af.top,left:af.left};ag=D.railhoffset;if(ag){if(ag.top){ai.top+=ag.top}if(ag.left){ai.left+=ag.left}}var ah=(S.railh.align)?ai.top+I(S.win,"border-top-width",true)+S.win.innerHeight()-S.railh.height:ai.top+I(S.win,"border-top-width",true);var ad=ai.left+I(S.win,"border-left-width");S.railh.css({top:ah-(D.railpadding.top+D.railpadding.bottom),left:ad,width:S.railh.width})}}};this.doRailClick=function(ag,af,ae){var ad,aj,ah,ai;if(S.railslocked){return}S.cancelEvent(ag);if(!("pageY" in ag)){ag.pageX=ag.clientX+c.documentElement.scrollLeft;ag.pageY=ag.clientY+c.documentElement.scrollTop}if(af){ad=(ae)?S.doScrollLeft:S.doScrollTop;ah=(ae)?((ag.pageX-S.railh.offset().left-(S.cursorwidth/2))*S.scrollratio.x):((ag.pageY-S.rail.offset().top-(S.cursorheight/2))*S.scrollratio.y);S.unsynched("relativexy");ad(ah|0)}else{ad=(ae)?S.doScrollLeftBy:S.doScrollBy;ah=(ae)?S.scroll.x:S.scroll.y;ai=(ae)?ag.pageX-S.railh.offset().left:ag.pageY-S.rail.offset().top;aj=(ae)?S.view.w:S.view.h;ad((ah>=ai)?aj:-aj)}};S.newscrolly=S.newscrollx=0;
S.hasanimationframe=("requestAnimationFrame" in n);S.hascancelanimationframe=("cancelAnimationFrame" in n);S.hasborderbox=false;this.init=function(){S.saved.css=[];if(M.isoperamini){return true}if(M.isandroid&&!("hidden" in c)){return true}D.emulatetouch=D.emulatetouch||D.touchbehavior;S.hasborderbox=n.getComputedStyle&&(n.getComputedStyle(c.body)["box-sizing"]==="border-box");var ai={"overflow-y":"hidden"};if(M.isie11||M.isie10){ai["-ms-overflow-style"]="none"}if(S.ishwscroll){this.doc.css(M.transitionstyle,M.prefixstyle+"transform 0ms ease-out");if(M.transitionend){S.bind(S.doc,M.transitionend,S.onScrollTransitionEnd,false)}}S.zindex="auto";if(!S.ispage&&D.zindex=="auto"){S.zindex=Q()||"auto"}else{S.zindex=D.zindex}if(!S.ispage&&S.zindex!="auto"&&S.zindex>f){f=S.zindex}if(S.isie&&S.zindex===0&&D.zindex=="auto"){S.zindex="auto"}if(!S.ispage||!M.isieold){var ah=S.docscroll;if(S.ispage){ah=(S.haswrapper)?S.win:S.doc}S.css(ah,ai);if(S.ispage&&(M.isie11||M.isie)){S.css(g("html"),ai)}if(M.isios&&!S.ispage&&!S.haswrapper){S.css(T,{"-webkit-overflow-scrolling":"touch"})}var aj=g(c.createElement("div"));aj.css({position:"relative",top:0,"float":"right",width:D.cursorwidth,height:0,"background-color":D.cursorcolor,border:D.cursorborder,"background-clip":"padding-box","-webkit-border-radius":D.cursorborderradius,"-moz-border-radius":D.cursorborderradius,"border-radius":D.cursorborderradius});aj.addClass("nicescroll-cursors");S.cursor=aj;var ag=g(c.createElement("div"));ag.attr("id",S.id);ag.addClass("nicescroll-rails nicescroll-rails-vr");if(D.scrollCLass){ag.addClass(D.scrollCLass)}var ap,aw,ae=["left","right","top","bottom"];for(var aq in ae){aw=ae[aq];ap=D.railpadding[aw]||0;ap&&ag.css("padding-"+aw,ap+"px")}ag.append(aj);ag.width=Math.max(parseFloat(D.cursorwidth),aj.outerWidth());ag.css({width:ag.width+"px",zIndex:S.zindex,background:D.background,cursor:"default"});ag.visibility=true;ag.scrollable=true;ag.align=(D.railalign=="left")?0:1;S.rail=ag;S.rail.drag=false;var ad=false;if(D.boxzoom&&!S.ispage&&!M.isieold){ad=c.createElement("div");S.bind(ad,"click",S.doZoom);S.bind(ad,"mouseenter",function(){S.zoom.css("opacity",D.cursoropacitymax)});S.bind(ad,"mouseleave",function(){S.zoom.css("opacity",D.cursoropacitymin)});S.zoom=g(ad);S.zoom.css({cursor:"pointer",zIndex:S.zindex,backgroundImage:"url("+D.scriptpath+"zoomico.png)",height:18,width:18,backgroundPosition:"0 0"});if(D.dblclickzoom){S.bind(S.win,"dblclick",S.doZoom)}if(M.cantouch&&D.gesturezoom){S.ongesturezoom=function(ay){if(ay.scale>1.5){S.doZoomIn(ay)}if(ay.scale<0.8){S.doZoomOut(ay)}return S.cancelEvent(ay)};S.bind(S.win,"gestureend",S.ongesturezoom)}}S.railh=false;var ao;if(D.horizrailenabled){S.css(ah,{overflowX:"hidden"});aj=g(c.createElement("div"));aj.css({position:"absolute",top:0,height:D.cursorwidth,width:0,backgroundColor:D.cursorcolor,border:D.cursorborder,backgroundClip:"padding-box","-webkit-border-radius":D.cursorborderradius,"-moz-border-radius":D.cursorborderradius,"border-radius":D.cursorborderradius});if(M.isieold){aj.css("overflow","hidden")}aj.addClass("nicescroll-cursors");S.cursorh=aj;ao=g(c.createElement("div"));ao.attr("id",S.id+"-hr");ao.addClass("nicescroll-rails nicescroll-rails-hr");if(D.scrollCLass){ao.addClass(D.scrollCLass)}ao.height=Math.max(parseFloat(D.cursorwidth),aj.outerHeight());ao.css({height:ao.height+"px","zIndex":S.zindex,"background":D.background});ao.append(aj);ao.visibility=true;ao.scrollable=true;ao.align=(D.railvalign=="top")?0:1;S.railh=ao;S.railh.drag=false}if(S.ispage){ag.css({position:"fixed",top:0,height:"100%"});ag.css((ag.align)?{right:0}:{left:0});S.body.append(ag);if(S.railh){ao.css({position:"fixed",left:0,width:"100%"});ao.css((ao.align)?{bottom:0}:{top:0});S.body.append(ao)}}else{if(S.ishwscroll){if(S.win.css("position")=="static"){S.css(S.win,{"position":"relative"})}var ak=(S.win[0].nodeName=="HTML")?S.body:S.win;g(ak).scrollTop(0).scrollLeft(0);if(S.zoom){S.zoom.css({position:"absolute",top:1,right:0,"margin-right":ag.width+4});ak.append(S.zoom)}ag.css({position:"absolute",top:0});ag.css((ag.align)?{right:0}:{left:0});ak.append(ag);if(ao){ao.css({position:"absolute",left:0,bottom:0});ao.css((ao.align)?{bottom:0}:{top:0});ak.append(ao)}}else{S.isfixed=(S.win.css("position")=="fixed");var ar=(S.isfixed)?"fixed":"absolute";if(!S.isfixed){S.viewport=S.getViewport(S.win[0])}if(S.viewport){S.body=S.viewport;if(!(/fixed|absolute/.test(S.viewport.css("position")))){S.css(S.viewport,{"position":"relative"})}}ag.css({position:ar});if(S.zoom){S.zoom.css({position:ar})}S.updateScrollBar();S.body.append(ag);if(S.zoom){S.body.append(S.zoom)}if(S.railh){ao.css({position:ar});S.body.append(ao)}}if(M.isios){S.css(S.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"})}if(D.disableoutline){if(M.isie){S.win.attr("hideFocus","true")}if(M.iswebkit){S.win.css("outline","none")}}}if(D.autohidemode===false){S.autohidedom=false;S.rail.css({opacity:D.cursoropacitymax});if(S.railh){S.railh.css({opacity:D.cursoropacitymax})
}}else{if((D.autohidemode===true)||(D.autohidemode==="leave")){S.autohidedom=g().add(S.rail);if(M.isie8){S.autohidedom=S.autohidedom.add(S.cursor)}if(S.railh){S.autohidedom=S.autohidedom.add(S.railh)}if(S.railh&&M.isie8){S.autohidedom=S.autohidedom.add(S.cursorh)}}else{if(D.autohidemode=="scroll"){S.autohidedom=g().add(S.rail);if(S.railh){S.autohidedom=S.autohidedom.add(S.railh)}}else{if(D.autohidemode=="cursor"){S.autohidedom=g().add(S.cursor);if(S.railh){S.autohidedom=S.autohidedom.add(S.cursorh)}}else{if(D.autohidemode=="hidden"){S.autohidedom=false;S.hide();S.railslocked=false}}}}}if(M.cantouch||S.istouchcapable||D.emulatetouch||M.hasmstouch){S.scrollmom=new v(S);var al=null;S.ontouchstart=function(aC){if(S.locked){return false}if(aC.pointerType&&(aC.pointerType==="mouse"||aC.pointerType===aC.MSPOINTER_TYPE_MOUSE)){return false}S.hasmoving=false;if(S.scrollmom.timer){S.triggerScrollEnd();S.scrollmom.stop()}if(!S.railslocked){var az=S.getTarget(aC);if(az){var aI=(/INPUT/i.test(az.nodeName))&&(/range/i.test(az.type));if(aI){return S.stopPropagation(aC)}}var aG=(aC.type==="mousedown");if(!("clientX" in aC)&&("changedTouches" in aC)){aC.clientX=aC.changedTouches[0].clientX;aC.clientY=aC.changedTouches[0].clientY}if(S.forcescreen){var ay=aC;aC={"original":(aC.original)?aC.original:aC};aC.clientX=ay.screenX;aC.clientY=ay.screenY}S.rail.drag={x:aC.clientX,y:aC.clientY,sx:S.scroll.x,sy:S.scroll.y,st:S.getScrollTop(),sl:S.getScrollLeft(),pt:2,dl:false,tg:az};if(S.ispage||!D.directionlockdeadzone){S.rail.drag.dl="f"}else{var aH={w:t.width(),h:t.height()};var aD=S.getContentSize();var aA=aD.h-aH.h;var aF=aD.w-aH.w;if(S.rail.scrollable&&!S.railh.scrollable){S.rail.drag.ck=(aA>0)?"v":false}else{if(!S.rail.scrollable&&S.railh.scrollable){S.rail.drag.ck=(aF>0)?"h":false}else{S.rail.drag.ck=false}}}if(D.emulatetouch&&S.isiframe&&M.isie){var aE=S.win.position();S.rail.drag.x+=aE.left;S.rail.drag.y+=aE.top}S.hasmoving=false;S.lastmouseup=false;S.scrollmom.reset(aC.clientX,aC.clientY);if(az&&aG){var aB=/INPUT|SELECT|BUTTON|TEXTAREA/i.test(az.nodeName);if(!aB){if(M.hasmousecapture){az.setCapture()}if(D.emulatetouch){if(az.onclick&&!(az._onclick||false)){az._onclick=az.onclick;az.onclick=function(aJ){if(S.hasmoving){return false}az._onclick.call(this,aJ)}}return S.cancelEvent(aC)}return S.stopPropagation(aC)}if(/SUBMIT|CANCEL|BUTTON/i.test(g(az).attr("type"))){S.preventclick={"tg":az,"click":false}}}}};S.ontouchend=function(ay){if(!S.rail.drag){return true}if(S.rail.drag.pt==2){if(ay.pointerType&&(ay.pointerType==="mouse"||ay.pointerType===ay.MSPOINTER_TYPE_MOUSE)){return false}S.rail.drag=false;var az=(ay.type==="mouseup");if(S.hasmoving){S.scrollmom.doMomentum();S.lastmouseup=true;S.hideCursor();if(M.hasmousecapture){c.releaseCapture()}if(az){return S.cancelEvent(ay)}}}else{if(S.rail.drag.pt==1){return S.onmouseup(ay)}}};var au=(D.emulatetouch&&S.isiframe&&!M.hasmousecapture);var am=D.directionlockdeadzone*0.3|0;S.ontouchmove=function(aH,aC){if(!S.rail.drag){return true}if(aH.targetTouches&&D.preventmultitouchscrolling){if(aH.targetTouches.length>1){return true}}if(aH.pointerType&&(aH.pointerType==="mouse"||aH.pointerType===aH.MSPOINTER_TYPE_MOUSE)){return true}if(S.rail.drag.pt==2){if(("changedTouches" in aH)){aH.clientX=aH.changedTouches[0].clientX;aH.clientY=aH.changedTouches[0].clientY}var aD,aE;aE=aD=0;if(au&&!aC){var aI=S.win.position();aE=-aI.left;aD=-aI.top}var aA=aH.clientY+aD;var aJ=(aA-S.rail.drag.y);var aB=aH.clientX+aE;var aK=(aB-S.rail.drag.x);var aF=S.rail.drag.st-aJ;if(S.ishwscroll&&D.bouncescroll){if(aF<0){aF=Math.round(aF/2)}else{if(aF>S.page.maxh){aF=S.page.maxh+Math.round((aF-S.page.maxh)/2)}}}else{if(aF<0){aF=0;aA=0}else{if(aF>S.page.maxh){aF=S.page.maxh;aA=0}}if(aA===0&&!S.hasmoving){if(!S.ispage){S.rail.drag=false}return true}}var aG=S.getScrollLeft();if(S.railh&&S.railh.scrollable){aG=(S.isrtlmode)?aK-S.rail.drag.sl:S.rail.drag.sl-aK;if(S.ishwscroll&&D.bouncescroll){if(aG<0){aG=Math.round(aG/2)}else{if(aG>S.page.maxw){aG=S.page.maxw+Math.round((aG-S.page.maxw)/2)}}}else{if(aG<0){aG=0;aB=0}if(aG>S.page.maxw){aG=S.page.maxw;aB=0}}}if(!S.hasmoving){if(S.rail.drag.y===aH.clientY&&S.rail.drag.x===aH.clientX){return S.cancelEvent(aH)}var aM=Math.abs(aJ);var az=Math.abs(aK);var aL=D.directionlockdeadzone;if(!S.rail.drag.ck){if(aM>aL&&az>aL){S.rail.drag.dl="f"}else{if(aM>aL){S.rail.drag.dl=(az>am)?"f":"v"}else{if(az>aL){S.rail.drag.dl=(aM>am)?"f":"h"}}}}else{if(S.rail.drag.ck=="v"){if(az>aL&&aM<=am){S.rail.drag=false}else{if(aM>aL){S.rail.drag.dl="v"}}}else{if(S.rail.drag.ck=="h"){if(aM>aL&&az<=am){S.rail.drag=false}else{if(az>aL){S.rail.drag.dl="h"}}}}}if(!S.rail.drag.dl){return S.cancelEvent(aH)}S.triggerScrollStart(aH.clientX,aH.clientY,0,0,0);S.hasmoving=true}if(S.preventclick&&!S.preventclick.click){S.preventclick.click=S.preventclick.tg.onclick||false;S.preventclick.tg.onclick=S.onpreventclick}if(S.rail.drag.dl){if(S.rail.drag.dl=="v"){aG=S.rail.drag.sl}else{if(S.rail.drag.dl=="h"){aF=S.rail.drag.st}}}S.synched("touchmove",function(){if(S.rail.drag&&(S.rail.drag.pt==2)){if(S.prepareTransition){S.resetTransition()
}if(S.rail.scrollable){S.setScrollTop(aF)}S.scrollmom.update(aB,aA);if(S.railh&&S.railh.scrollable){S.setScrollLeft(aG);S.showCursor(aF,aG)}else{S.showCursor(aF)}if(M.isie10){c.selection.clear()}}});return S.cancelEvent(aH)}else{if(S.rail.drag.pt==1){return S.onmousemove(aH)}}};S.ontouchstartCursor=function(aA,ay){if(S.rail.drag&&S.rail.drag.pt!=3){return}if(S.locked){return S.cancelEvent(aA)}S.cancelScroll();S.rail.drag={x:aA.touches[0].clientX,y:aA.touches[0].clientY,sx:S.scroll.x,sy:S.scroll.y,pt:3,hr:(!!ay)};var az=S.getTarget(aA);if(!S.ispage&&M.hasmousecapture){az.setCapture()}if(S.isiframe&&!M.hasmousecapture){S.saved.csspointerevents=S.doc.css("pointer-events");S.css(S.doc,{"pointer-events":"none"})}return S.cancelEvent(aA)};S.ontouchendCursor=function(ay){if(S.rail.drag){if(M.hasmousecapture){c.releaseCapture()}if(S.isiframe&&!M.hasmousecapture){S.doc.css("pointer-events",S.saved.csspointerevents)}if(S.rail.drag.pt!=3){return}S.rail.drag=false;return S.cancelEvent(ay)}};S.ontouchmoveCursor=function(az){if(S.rail.drag){if(S.rail.drag.pt!=3){return}S.cursorfreezed=true;if(S.rail.drag.hr){S.scroll.x=S.rail.drag.sx+(az.touches[0].clientX-S.rail.drag.x);if(S.scroll.x<0){S.scroll.x=0}var aA=S.scrollvaluemaxw;if(S.scroll.x>aA){S.scroll.x=aA}}else{S.scroll.y=S.rail.drag.sy+(az.touches[0].clientY-S.rail.drag.y);if(S.scroll.y<0){S.scroll.y=0}var ay=S.scrollvaluemax;if(S.scroll.y>ay){S.scroll.y=ay}}S.synched("touchmove",function(){if(S.rail.drag&&(S.rail.drag.pt==3)){S.showCursor();if(S.rail.drag.hr){S.doScrollLeft(Math.round(S.scroll.x*S.scrollratio.x),D.cursordragspeed)}else{S.doScrollTop(Math.round(S.scroll.y*S.scrollratio.y),D.cursordragspeed)}}});return S.cancelEvent(az)}}}S.onmousedown=function(aA,ay){if(S.rail.drag&&S.rail.drag.pt!=1){return}if(S.railslocked){return S.cancelEvent(aA)}S.cancelScroll();S.rail.drag={x:aA.clientX,y:aA.clientY,sx:S.scroll.x,sy:S.scroll.y,pt:1,hr:ay||false};var az=S.getTarget(aA);if(M.hasmousecapture){az.setCapture()}if(S.isiframe&&!M.hasmousecapture){S.saved.csspointerevents=S.doc.css("pointer-events");S.css(S.doc,{"pointer-events":"none"})}S.hasmoving=false;return S.cancelEvent(aA)};S.onmouseup=function(ay){if(S.rail.drag){if(S.rail.drag.pt!=1){return true}if(M.hasmousecapture){c.releaseCapture()}if(S.isiframe&&!M.hasmousecapture){S.doc.css("pointer-events",S.saved.csspointerevents)}S.rail.drag=false;S.cursorfreezed=false;if(S.hasmoving){S.triggerScrollEnd()}return S.cancelEvent(ay)}};S.onmousemove=function(az){if(S.rail.drag){if(S.rail.drag.pt!==1){return}if(M.ischrome&&az.which===0){return S.onmouseup(az)}S.cursorfreezed=true;if(!S.hasmoving){S.triggerScrollStart(az.clientX,az.clientY,0,0,0)}S.hasmoving=true;if(S.rail.drag.hr){S.scroll.x=S.rail.drag.sx+(az.clientX-S.rail.drag.x);if(S.scroll.x<0){S.scroll.x=0}var aA=S.scrollvaluemaxw;if(S.scroll.x>aA){S.scroll.x=aA}}else{S.scroll.y=S.rail.drag.sy+(az.clientY-S.rail.drag.y);if(S.scroll.y<0){S.scroll.y=0}var ay=S.scrollvaluemax;if(S.scroll.y>ay){S.scroll.y=ay}}S.synched("mousemove",function(){if(S.cursorfreezed){S.showCursor();if(S.rail.drag.hr){S.scrollLeft(Math.round(S.scroll.x*S.scrollratio.x))}else{S.scrollTop(Math.round(S.scroll.y*S.scrollratio.y))}}});return S.cancelEvent(az)}else{S.checkarea=0}};if(M.cantouch||D.emulatetouch){S.onpreventclick=function(ay){if(S.preventclick){S.preventclick.tg.onclick=S.preventclick.click;S.preventclick=false;return S.cancelEvent(ay)}};S.onclick=(M.isios)?false:function(ay){if(S.lastmouseup){S.lastmouseup=false;return S.cancelEvent(ay)}else{return true}};if(D.grabcursorenabled&&M.cursorgrabvalue){S.css((S.ispage)?S.doc:S.win,{"cursor":M.cursorgrabvalue});S.css(S.rail,{"cursor":M.cursorgrabvalue})}}else{var af=function(aA){if(!S.selectiondrag){return}if(aA){var az=S.win.outerHeight();var aB=(aA.pageY-S.selectiondrag.top);if(aB>0&&aB<az){aB=0}if(aB>=az){aB-=az}S.selectiondrag.df=aB}if(S.selectiondrag.df===0){return}var ay=-(S.selectiondrag.df*2/6)|0;S.doScrollBy(ay);S.debounced("doselectionscroll",function(){af()},50)};if("getSelection" in c){S.hasTextSelected=function(){return(c.getSelection().rangeCount>0)}}else{if("selection" in c){S.hasTextSelected=function(){return(c.selection.type!="None")}}else{S.hasTextSelected=function(){return false}}}S.onselectionstart=function(ay){if(S.ispage){return}S.selectiondrag=S.win.offset()};S.onselectionend=function(ay){S.selectiondrag=false};S.onselectiondrag=function(ay){if(!S.selectiondrag){return}if(S.hasTextSelected()){S.debounced("selectionscroll",function(){af(ay)},250)}}}if(M.hasw3ctouch){S.css((S.ispage)?g("html"):S.win,{"touch-action":"none"});S.css(S.rail,{"touch-action":"none"});S.css(S.cursor,{"touch-action":"none"});S.bind(S.win,"pointerdown",S.ontouchstart);S.bind(c,"pointerup",S.ontouchend);S.delegate(c,"pointermove",S.ontouchmove)}else{if(M.hasmstouch){S.css((S.ispage)?g("html"):S.win,{"-ms-touch-action":"none"});S.css(S.rail,{"-ms-touch-action":"none"});S.css(S.cursor,{"-ms-touch-action":"none"});S.bind(S.win,"MSPointerDown",S.ontouchstart);
S.bind(c,"MSPointerUp",S.ontouchend);S.delegate(c,"MSPointerMove",S.ontouchmove);S.bind(S.cursor,"MSGestureHold",function(ay){ay.preventDefault()});S.bind(S.cursor,"contextmenu",function(ay){ay.preventDefault()})}else{if(M.cantouch){S.bind(S.win,"touchstart",S.ontouchstart,false,true);S.bind(c,"touchend",S.ontouchend,false,true);S.bind(c,"touchcancel",S.ontouchend,false,true);S.delegate(c,"touchmove",S.ontouchmove,false,true)}}}if(D.emulatetouch){S.bind(S.win,"mousedown",S.ontouchstart,false,true);S.bind(c,"mouseup",S.ontouchend,false,true);S.bind(c,"mousemove",S.ontouchmove,false,true)}if(D.cursordragontouch||(!M.cantouch&&!D.emulatetouch)){S.rail.css({cursor:"default"});S.railh&&S.railh.css({cursor:"default"});S.jqbind(S.rail,"mouseenter",function(){if(!S.ispage&&!S.win.is(":visible")){return false}if(S.canshowonmouseevent){S.showCursor()}S.rail.active=true});S.jqbind(S.rail,"mouseleave",function(){S.rail.active=false;if(!S.rail.drag){S.hideCursor()}});if(D.sensitiverail){S.bind(S.rail,"click",function(ay){S.doRailClick(ay,false,false)});S.bind(S.rail,"dblclick",function(ay){S.doRailClick(ay,true,false)});S.bind(S.cursor,"click",function(ay){S.cancelEvent(ay)});S.bind(S.cursor,"dblclick",function(ay){S.cancelEvent(ay)})}if(S.railh){S.jqbind(S.railh,"mouseenter",function(){if(!S.ispage&&!S.win.is(":visible")){return false}if(S.canshowonmouseevent){S.showCursor()}S.rail.active=true});S.jqbind(S.railh,"mouseleave",function(){S.rail.active=false;if(!S.rail.drag){S.hideCursor()}});if(D.sensitiverail){S.bind(S.railh,"click",function(ay){S.doRailClick(ay,false,true)});S.bind(S.railh,"dblclick",function(ay){S.doRailClick(ay,true,true)});S.bind(S.cursorh,"click",function(ay){S.cancelEvent(ay)});S.bind(S.cursorh,"dblclick",function(ay){S.cancelEvent(ay)})}}}if(D.cursordragontouch&&(this.istouchcapable||M.cantouch)){S.bind(S.cursor,"touchstart",S.ontouchstartCursor);S.bind(S.cursor,"touchmove",S.ontouchmoveCursor);S.bind(S.cursor,"touchend",S.ontouchendCursor);S.cursorh&&S.bind(S.cursorh,"touchstart",function(ay){S.ontouchstartCursor(ay,true)});S.cursorh&&S.bind(S.cursorh,"touchmove",S.ontouchmoveCursor);S.cursorh&&S.bind(S.cursorh,"touchend",S.ontouchendCursor)}if(!D.emulatetouch&&!M.isandroid&&!M.isios){S.bind((M.hasmousecapture)?S.win:c,"mouseup",S.onmouseup);S.bind(c,"mousemove",S.onmousemove);if(S.onclick){S.bind(c,"click",S.onclick)}S.bind(S.cursor,"mousedown",S.onmousedown);S.bind(S.cursor,"mouseup",S.onmouseup);if(S.railh){S.bind(S.cursorh,"mousedown",function(ay){S.onmousedown(ay,true)});S.bind(S.cursorh,"mouseup",S.onmouseup)}if(!S.ispage&&D.enablescrollonselection){S.bind(S.win[0],"mousedown",S.onselectionstart);S.bind(c,"mouseup",S.onselectionend);S.bind(S.cursor,"mouseup",S.onselectionend);if(S.cursorh){S.bind(S.cursorh,"mouseup",S.onselectionend)}S.bind(c,"mousemove",S.onselectiondrag)}if(S.zoom){S.jqbind(S.zoom,"mouseenter",function(){if(S.canshowonmouseevent){S.showCursor()}S.rail.active=true});S.jqbind(S.zoom,"mouseleave",function(){S.rail.active=false;if(!S.rail.drag){S.hideCursor()}})}}else{S.bind((M.hasmousecapture)?S.win:c,"mouseup",S.ontouchend);if(S.onclick){S.bind(c,"click",S.onclick)}if(D.cursordragontouch){S.bind(S.cursor,"mousedown",S.onmousedown);S.bind(S.cursor,"mouseup",S.onmouseup);S.cursorh&&S.bind(S.cursorh,"mousedown",function(ay){S.onmousedown(ay,true)});S.cursorh&&S.bind(S.cursorh,"mouseup",S.onmouseup)}else{S.bind(S.rail,"mousedown",function(ay){ay.preventDefault()});S.railh&&S.bind(S.railh,"mousedown",function(ay){ay.preventDefault()})}}if(D.enablemousewheel){if(!S.isiframe){S.mousewheel((M.isie&&S.ispage)?c:S.win,S.onmousewheel)}S.mousewheel(S.rail,S.onmousewheel);if(S.railh){S.mousewheel(S.railh,S.onmousewheelhr)}}if(!S.ispage&&!M.cantouch&&!(/HTML|^BODY/.test(S.win[0].nodeName))){if(!S.win.attr("tabindex")){S.win.attr({"tabindex":++m})}S.bind(S.win,"focus",function(ay){h=(S.getTarget(ay)).id||S.getTarget(ay)||false;S.hasfocus=true;if(S.canshowonmouseevent){S.noticeCursor()}});S.bind(S.win,"blur",function(ay){h=false;S.hasfocus=false});S.bind(S.win,"mouseenter",function(ay){o=(S.getTarget(ay)).id||S.getTarget(ay)||false;S.hasmousefocus=true;if(S.canshowonmouseevent){S.noticeCursor()}});S.bind(S.win,"mouseleave",function(ay){o=false;S.hasmousefocus=false;if(!S.rail.drag){S.hideCursor()}})}S.onkeypress=function(aD){if(S.railslocked&&S.page.maxh===0){return true}aD=aD||n.event;var aC=S.getTarget(aD);if(aC&&/INPUT|TEXTAREA|SELECT|OPTION/.test(aC.nodeName)){var aE=aC.getAttribute("type")||aC.type||false;if((!aE)||!(/submit|button|cancel/i.tp)){return true}}if(g(aC).attr("contenteditable")){return true}if(S.hasfocus||(S.hasmousefocus&&!h)||(S.ispage&&!h&&!o)){var aA=aD.keyCode;if(S.railslocked&&aA!=27){return S.cancelEvent(aD)}var aB=aD.ctrlKey||false;var ay=aD.shiftKey||false;var az=false;switch(aA){case 38:case 63233:S.doScrollBy(24*3);az=true;break;case 40:case 63235:S.doScrollBy(-24*3);az=true;break;case 37:case 63232:if(S.railh){(aB)?S.doScrollLeft(0):S.doScrollLeftBy(24*3);az=true
}break;case 39:case 63234:if(S.railh){(aB)?S.doScrollLeft(S.page.maxw):S.doScrollLeftBy(-24*3);az=true}break;case 33:case 63276:S.doScrollBy(S.view.h);az=true;break;case 34:case 63277:S.doScrollBy(-S.view.h);az=true;break;case 36:case 63273:(S.railh&&aB)?S.doScrollPos(0,0):S.doScrollTo(0);az=true;break;case 35:case 63275:(S.railh&&aB)?S.doScrollPos(S.page.maxw,S.page.maxh):S.doScrollTo(S.page.maxh);az=true;break;case 32:if(D.spacebarenabled){(ay)?S.doScrollBy(S.view.h):S.doScrollBy(-S.view.h);az=true}break;case 27:if(S.zoomactive){S.doZoom();az=true}break}if(az){return S.cancelEvent(aD)}}};if(D.enablekeyboard){S.bind(c,(M.isopera&&!M.isopera12)?"keypress":"keydown",S.onkeypress)}S.bind(c,"keydown",function(az){var ay=az.ctrlKey||false;if(ay){S.wheelprevented=true}});S.bind(c,"keyup",function(az){var ay=az.ctrlKey||false;if(!ay){S.wheelprevented=false}});S.bind(n,"blur",function(ay){S.wheelprevented=false});S.bind(n,"resize",S.onscreenresize);S.bind(n,"orientationchange",S.onscreenresize);S.bind(n,"load",S.lazyResize);if(M.ischrome&&!S.ispage&&!S.haswrapper){var at=S.win.attr("style");var ax=parseFloat(S.win.css("width"))+1;S.win.css("width",ax);S.synched("chromefix",function(){S.win.attr("style",at)})}S.onAttributeChange=function(ay){S.lazyResize(S.isieold?250:30)};if(D.enableobserver){if((!S.isie11)&&(b!==false)){S.observerbody=new b(function(ay){ay.forEach(function(az){if(az.type=="attributes"){return(T.hasClass("modal-open")&&T.hasClass("modal-dialog")&&!g.contains(g(".modal-dialog")[0],S.doc[0]))?S.hide():S.show()}});if(S.me.clientWidth!=S.page.width||S.me.clientHeight!=S.page.height){return S.lazyResize(30)}});S.observerbody.observe(c.body,{childList:true,subtree:true,characterData:false,attributes:true,attributeFilter:["class"]})}if(!S.ispage&&!S.haswrapper){var av=S.win[0];if(b!==false){S.observer=new b(function(ay){ay.forEach(S.onAttributeChange)});S.observer.observe(av,{childList:true,characterData:false,attributes:true,subtree:false});S.observerremover=new b(function(ay){ay.forEach(function(aA){if(aA.removedNodes.length>0){for(var az in aA.removedNodes){if(!!S&&(aA.removedNodes[az]===av)){return S.remove()}}}})});S.observerremover.observe(av.parentNode,{childList:true,characterData:false,attributes:false,subtree:false})}else{S.bind(av,(M.isie&&!M.isie9)?"propertychange":"DOMAttrModified",S.onAttributeChange);if(M.isie9){av.attachEvent("onpropertychange",S.onAttributeChange)}S.bind(av,"DOMNodeRemoved",function(ay){if(ay.target===av){S.remove()}})}}}if(!S.ispage&&D.boxzoom){S.bind(n,"resize",S.resizeZoom)}if(S.istextarea){S.bind(S.win,"keydown",S.lazyResize);S.bind(S.win,"mouseup",S.lazyResize)}S.lazyResize(30)}if(this.doc[0].nodeName=="IFRAME"){var an=function(){S.iframexd=false;var aB;try{aB="contentDocument" in this?this.contentDocument:this.contentWindow._doc;var ay=aB.domain}catch(aA){S.iframexd=true;aB=false}if(S.iframexd){if("console" in n){console.log("NiceScroll error: policy restriced iframe")}return true}S.forcescreen=true;if(S.isiframe){S.iframe={"doc":g(aB),"html":S.doc.contents().find("html")[0],"body":S.doc.contents().find("body")[0]};S.getContentSize=function(){return{w:Math.max(S.iframe.html.scrollWidth,S.iframe.body.scrollWidth),h:Math.max(S.iframe.html.scrollHeight,S.iframe.body.scrollHeight)}};S.docscroll=g(S.iframe.body)}if(!M.isios&&D.iframeautoresize&&!S.isiframe){S.win.scrollTop(0);S.doc.height("");var az=Math.max(aB.getElementsByTagName("html")[0].scrollHeight,aB.body.scrollHeight);S.doc.height(az)}S.lazyResize(30);S.css(g(S.iframe.body),ai);if(M.isios&&S.haswrapper){S.css(g(aB.body),{"-webkit-transform":"translate3d(0,0,0)"})}if("contentWindow" in this){S.bind(this.contentWindow,"scroll",S.onscroll)}else{S.bind(aB,"scroll",S.onscroll)}if(D.enablemousewheel){S.mousewheel(aB,S.onmousewheel)}if(D.enablekeyboard){S.bind(aB,(M.isopera)?"keypress":"keydown",S.onkeypress)}if(M.cantouch){S.bind(aB,"touchstart",S.ontouchstart);S.bind(aB,"touchmove",S.ontouchmove)}else{if(D.emulatetouch){S.bind(aB,"mousedown",S.ontouchstart);S.bind(aB,"mousemove",function(aC){return S.ontouchmove(aC,true)});if(D.grabcursorenabled&&M.cursorgrabvalue){S.css(g(aB.body),{"cursor":M.cursorgrabvalue})}}}S.bind(aB,"mouseup",S.ontouchend);if(S.zoom){if(D.dblclickzoom){S.bind(aB,"dblclick",S.doZoom)}if(S.ongesturezoom){S.bind(aB,"gestureend",S.ongesturezoom)}}};if(this.doc[0].readyState&&this.doc[0].readyState==="complete"){setTimeout(function(){an.call(S.doc[0],false)},500)}S.bind(this.doc,"load",an)}};this.showCursor=function(ad,ae){if(S.cursortimeout){clearTimeout(S.cursortimeout);S.cursortimeout=0}if(!S.rail){return}if(S.autohidedom){S.autohidedom.stop().css({opacity:D.cursoropacitymax});S.cursoractive=true}if(!S.rail.drag||S.rail.drag.pt!=1){if(ad!==undefined&&ad!==false){S.scroll.y=(ad/S.scrollratio.y)|0}if(ae!==undefined){S.scroll.x=(ae/S.scrollratio.x)|0}}S.cursor.css({height:S.cursorheight,top:S.scroll.y});if(S.cursorh){var af=(S.hasreversehr)?S.scrollvaluemaxw-S.scroll.x:S.scroll.x;S.cursorh.css({width:S.cursorwidth,left:(!S.rail.align&&S.rail.visibility)?af+S.rail.width:af});
S.cursoractive=true}if(S.zoom){S.zoom.stop().css({opacity:D.cursoropacitymax})}};this.hideCursor=function(ad){if(S.cursortimeout){return}if(!S.rail){return}if(!S.autohidedom){return}if(S.hasmousefocus&&D.autohidemode==="leave"){return}S.cursortimeout=setTimeout(function(){if(!S.rail.active||!S.showonmouseevent){S.autohidedom.stop().animate({opacity:D.cursoropacitymin});if(S.zoom){S.zoom.stop().animate({opacity:D.cursoropacitymin})}S.cursoractive=false}S.cursortimeout=0},ad||D.hidecursordelay)};this.noticeCursor=function(ad,ae,af){S.showCursor(ae,af);if(!S.rail.active){S.hideCursor(ad)}};this.getContentSize=(S.ispage)?function(){return{w:Math.max(c.body.scrollWidth,c.documentElement.scrollWidth),h:Math.max(c.body.scrollHeight,c.documentElement.scrollHeight)}}:(S.haswrapper)?function(){return{w:S.doc[0].offsetWidth,h:S.doc[0].offsetHeight}}:function(){return{w:S.docscroll[0].scrollWidth,h:S.docscroll[0].scrollHeight}};this.onResize=function(ah,aj){if(!S||!S.win){return false}var ae=S.page.maxh,ai=S.page.maxw,ad=S.view.h,ag=S.view.w;S.view={w:(S.ispage)?S.win.width():S.win[0].clientWidth,h:(S.ispage)?S.win.height():S.win[0].clientHeight};S.page=(aj)?aj:S.getContentSize();S.page.maxh=Math.max(0,S.page.h-S.view.h);S.page.maxw=Math.max(0,S.page.w-S.view.w);if((S.page.maxh==ae)&&(S.page.maxw==ai)&&(S.view.w==ag)&&(S.view.h==ad)){if(!S.ispage){var al=S.win.offset();if(S.lastposition){var af=S.lastposition;if((af.top==al.top)&&(af.left==al.left)){return S}}S.lastposition=al}else{return S}}if(S.page.maxh===0){S.hideRail();S.scrollvaluemax=0;S.scroll.y=0;S.scrollratio.y=0;S.cursorheight=0;S.setScrollTop(0);if(S.rail){S.rail.scrollable=false}}else{S.page.maxh-=(D.railpadding.top+D.railpadding.bottom);S.rail.scrollable=true}if(S.page.maxw===0){S.hideRailHr();S.scrollvaluemaxw=0;S.scroll.x=0;S.scrollratio.x=0;S.cursorwidth=0;S.setScrollLeft(0);if(S.railh){S.railh.scrollable=false}}else{S.page.maxw-=(D.railpadding.left+D.railpadding.right);if(S.railh){S.railh.scrollable=(D.horizrailenabled)}}S.railslocked=(S.locked)||((S.page.maxh===0)&&(S.page.maxw===0));if(S.railslocked){if(!S.ispage){S.updateScrollBar(S.view)}return false}if(!S.hidden){if(!S.rail.visibility){S.showRail()}if(S.railh&&!S.railh.visibility){S.showRailHr()}}if(S.istextarea&&S.win.css("resize")&&S.win.css("resize")!="none"){S.view.h-=20}S.cursorheight=Math.min(S.view.h,Math.round(S.view.h*(S.view.h/S.page.h)));S.cursorheight=(D.cursorfixedheight)?D.cursorfixedheight:Math.max(D.cursorminheight,S.cursorheight);S.cursorwidth=Math.min(S.view.w,Math.round(S.view.w*(S.view.w/S.page.w)));S.cursorwidth=(D.cursorfixedheight)?D.cursorfixedheight:Math.max(D.cursorminheight,S.cursorwidth);S.scrollvaluemax=S.view.h-S.cursorheight-(D.railpadding.top+D.railpadding.bottom);if(!S.hasborderbox){S.scrollvaluemax-=S.cursor[0].offsetHeight-S.cursor[0].clientHeight}if(S.railh){S.railh.width=(S.page.maxh>0)?(S.view.w-S.rail.width):S.view.w;S.scrollvaluemaxw=S.railh.width-S.cursorwidth-(D.railpadding.left+D.railpadding.right)}if(!S.ispage){S.updateScrollBar(S.view)}S.scrollratio={x:(S.page.maxw/S.scrollvaluemaxw),y:(S.page.maxh/S.scrollvaluemax)};var ak=S.getScrollTop();if(ak>S.page.maxh){S.doScrollTop(S.page.maxh)}else{S.scroll.y=(S.getScrollTop()/S.scrollratio.y)|0;S.scroll.x=(S.getScrollLeft()/S.scrollratio.x)|0;if(S.cursoractive){S.noticeCursor()}}if(S.scroll.y&&(S.getScrollTop()===0)){S.doScrollTo((S.scroll.y*S.scrollratio.y)|0)}return S};this.resize=S.onResize;var X=0;this.onscreenresize=function(ae){clearTimeout(X);var ad=(!S.ispage&&!S.haswrapper);if(ad){S.hideRails()}X=setTimeout(function(){if(S){if(ad){S.showRails()}S.resize()}X=0},120)};this.lazyResize=function(ad){clearTimeout(X);ad=isNaN(ad)?240:ad;X=setTimeout(function(){S&&S.resize();X=0},ad);return S};function U(ag,ae,af,ad){S._bind(ag,ae,function(ai){ai=ai||n.event;var ah={original:ai,target:ai.target||ai.srcElement,type:"wheel",deltaMode:ai.type=="MozMousePixelScroll"?0:1,deltaX:0,deltaZ:0,preventDefault:function(){ai.preventDefault?ai.preventDefault():ai.returnValue=false;return false},stopImmediatePropagation:function(){(ai.stopImmediatePropagation)?ai.stopImmediatePropagation():ai.cancelBubble=true}};if(ae=="mousewheel"){ai.wheelDeltaX&&(ah.deltaX=-1/40*ai.wheelDeltaX);ai.wheelDeltaY&&(ah.deltaY=-1/40*ai.wheelDeltaY);!ah.deltaY&&!ah.deltaX&&(ah.deltaY=-1/40*ai.wheelDelta)}else{ah.deltaY=ai.detail}return af.call(ag,ah)},ad)}this.jqbind=function(af,ad,ae){S.events.push({e:af,n:ad,f:ae,q:true});g(af).on(ad,ae)};this.mousewheel=function(ah,ag,ad){var af=("jquery" in ah)?ah[0]:ah;if("onwheel" in c.createElement("div")){S._bind(af,"wheel",ag,ad||false)}else{var ae=(c.onmousewheel!==undefined)?"mousewheel":"DOMMouseScroll";U(af,ae,ag,ad||false);if(ae=="DOMMouseScroll"){U(af,"MozMousePixelScroll",ag,ad||false)}}};var H=false;if(M.haseventlistener){try{var E=Object.defineProperty({},"passive",{get:function(){H=!0}});n.addEventListener("test",null,E)}catch(F){}this.stopPropagation=function(ad){if(!ad){return false}ad=(ad.original)?ad.original:ad;
ad.stopPropagation();return false};this.cancelEvent=function(ad){if(ad.cancelable){ad.preventDefault()}ad.stopImmediatePropagation();if(ad.preventManipulation){ad.preventManipulation()}return false}}else{Event.prototype.preventDefault=function(){this.returnValue=false};Event.prototype.stopPropagation=function(){this.cancelBubble=true};n.constructor.prototype.addEventListener=c.constructor.prototype.addEventListener=Element.prototype.addEventListener=function(ae,af,ad){this.attachEvent("on"+ae,af)};n.constructor.prototype.removeEventListener=c.constructor.prototype.removeEventListener=Element.prototype.removeEventListener=function(ae,af,ad){this.detachEvent("on"+ae,af)};this.cancelEvent=function(ad){ad=ad||n.event;if(ad){ad.cancelBubble=true;ad.cancel=true;ad.returnValue=false}return false};this.stopPropagation=function(ad){ad=ad||n.event;if(ad){ad.cancelBubble=true}return false}}this.delegate=function(ah,ae,af,ad,ag){var ai=x[ae]||false;if(!ai){ai={a:[],l:[],f:function(an){var aj=ai.l,al=aj.length-1;var am=false;for(var ak=al;ak>=0;ak--){am=aj[ak].call(an.target,an);if(am===false){return false}}return am}};S.bind(ah,ae,ai.f,ad,ag);x[ae]=ai}if(S.ispage){ai.a=[S.id].concat(ai.a);ai.l=[af].concat(ai.l)}else{ai.a.push(S.id);ai.l.push(af)}};this.undelegate=function(aj,ag,ah,af,ai){var ak=x[ag]||false;if(ak&&ak.l){for(var ae=0,ad=ak.l.length;ae<ad;ae++){if(ak.a[ae]===S.id){ak.a.splice(ae);ak.l.splice(ae);if(ak.a.length===0){S._unbind(aj,ag,ak.l.f);x[ag]=null}}}}};this.bind=function(ai,ae,ag,ad,ah){var af=("jquery" in ai)?ai[0]:ai;S._bind(af,ae,ag,ad||false,ah||false)};this._bind=function(ag,ae,af,ad,ah){S.events.push({e:ag,n:ae,f:af,b:ad,q:false});(H&&(ah||ag==window.document||ag==window.document.body||ag==window))?ag.addEventListener(ae,af,{passive:false,capture:ad}):ag.addEventListener(ae,af,ad||false)};this._unbind=function(af,ad,ae,ag){if(x[ad]){S.undelegate(af,ad,ae,ag)}else{af.removeEventListener(ad,ae,ag)}};this.unbindAll=function(){for(var ad=0;ad<S.events.length;ad++){var ae=S.events[ad];(ae.q)?ae.e.unbind(ae.n,ae.f):S._unbind(ae.e,ae.n,ae.f,ae.b)}};this.showRails=function(){return S.showRail().showRailHr()};this.showRail=function(){if((S.page.maxh!==0)&&(S.ispage||S.win.css("display")!="none")){S.rail.visibility=true;S.rail.css("display","block")}return S};this.showRailHr=function(){if(S.railh){if((S.page.maxw!==0)&&(S.ispage||S.win.css("display")!="none")){S.railh.visibility=true;S.railh.css("display","block")}}return S};this.hideRails=function(){return S.hideRail().hideRailHr()};this.hideRail=function(){S.rail.visibility=false;S.rail.css("display","none");return S};this.hideRailHr=function(){if(S.railh){S.railh.visibility=false;S.railh.css("display","none")}return S};this.show=function(){S.hidden=false;S.railslocked=false;return S.showRails()};this.hide=function(){S.hidden=true;S.railslocked=true;return S.hideRails()};this.toggle=function(){return(S.hidden)?S.show():S.hide()};this.remove=function(){S.stop();if(S.cursortimeout){clearTimeout(S.cursortimeout)}for(var ah in S.delaylist){if(S.delaylist[ah]){l(S.delaylist[ah].h)}}S.doZoomOut();S.unbindAll();if(M.isie9){S.win[0].detachEvent("onpropertychange",S.onAttributeChange)}if(S.observer!==false){S.observer.disconnect()}if(S.observerremover!==false){S.observerremover.disconnect()}if(S.observerbody!==false){S.observerbody.disconnect()}S.events=null;if(S.cursor){S.cursor.remove()}if(S.cursorh){S.cursorh.remove()}if(S.rail){S.rail.remove()}if(S.railh){S.railh.remove()}if(S.zoom){S.zoom.remove()}for(var ae=0;ae<S.saved.css.length;ae++){var ag=S.saved.css[ae];ag[0].css(ag[1],(ag[2]===undefined)?"":ag[2])}S.saved=false;S.me.data("__nicescroll","");var ad=g.nicescroll;ad.each(function(aj){if(!this){return}if(this.id===S.id){delete ad[aj];for(var ai=++aj;ai<ad.length;ai++,aj++){ad[aj]=ad[ai]}ad.length--;if(ad.length){delete ad[ad.length]}}});for(var af in S){S[af]=null;delete S[af]}S=null};this.scrollstart=function(ad){this.onscrollstart=ad;return S};this.scrollend=function(ad){this.onscrollend=ad;return S};this.scrollcancel=function(ad){this.onscrollcancel=ad;return S};this.zoomin=function(ad){this.onzoomin=ad;return S};this.zoomout=function(ad){this.onzoomout=ad;return S};this.isScrollable=function(af){var ag=(af.target)?af.target:af;if(ag.nodeName=="OPTION"){return true}while(ag&&(ag.nodeType==1)&&(ag!==this.me[0])&&!(/^BODY|HTML/.test(ag.nodeName))){var ad=g(ag);var ae=ad.css("overflowY")||ad.css("overflowX")||ad.css("overflow")||"";if(/scroll|auto/.test(ae)){return(ag.clientHeight!=ag.scrollHeight)}ag=(ag.parentNode)?ag.parentNode:false}return false};this.getViewport=function(af){var ag=(af&&af.parentNode)?af.parentNode:false;while(ag&&(ag.nodeType==1)&&!(/^BODY|HTML/.test(ag.nodeName))){var ad=g(ag);if(/fixed|absolute/.test(ad.css("position"))){return ad}var ae=ad.css("overflowY")||ad.css("overflowX")||ad.css("overflow")||"";if((/scroll|auto/.test(ae))&&(ag.clientHeight!=ag.scrollHeight)){return ad}if(ad.getNiceScroll().length>0){return ad}ag=(ag.parentNode)?ag.parentNode:false
}return false};this.triggerScrollStart=function(ad,ai,ah,af,ae){if(S.onscrollstart){var ag={type:"scrollstart",current:{x:ad,y:ai},request:{x:ah,y:af},end:{x:S.newscrollx,y:S.newscrolly},speed:ae};S.onscrollstart.call(S,ag)}};this.triggerScrollEnd=function(){if(S.onscrollend){var ae=S.getScrollLeft();var ad=S.getScrollTop();var af={type:"scrollend",current:{x:ae,y:ad},end:{x:ae,y:ad}};S.onscrollend.call(S,af)}};var N=0,P=0,C=0,V=1;function R(ai,ah,aj,af){if(!S.scrollrunning){S.newscrolly=S.getScrollTop();S.newscrollx=S.getScrollLeft();C=a()}var ag=(a()-C);C=a();if(ag>350){V=1}else{V+=(2-V)/10}ai=ai*V|0;ah=ah*V|0;if(ai){if(af){if(ai<0){if(S.getScrollLeft()>=S.page.maxw){return true}}else{if(S.getScrollLeft()<=0){return true}}}var al=ai>0?1:-1;if(P!==al){if(S.scrollmom){S.scrollmom.stop()}S.newscrollx=S.getScrollLeft();P=al}S.lastdeltax-=ai}if(ah){var ae=(function(){var am=S.getScrollTop();if(ah<0){if(am>=S.page.maxh){return true}}else{if(am<=0){return true}}})();if(ae){if(D.nativeparentscrolling&&aj&&!S.ispage&&!S.zoomactive){return true}var ad=S.view.h>>1;if(S.newscrolly<-ad){S.newscrolly=-ad;ah=-1}else{if(S.newscrolly>S.page.maxh+ad){S.newscrolly=S.page.maxh+ad;ah=1}else{ah=0}}}var ak=ah>0?1:-1;if(N!==ak){if(S.scrollmom){S.scrollmom.stop()}S.newscrolly=S.getScrollTop();N=ak}S.lastdeltay-=ah}if(ah||ai){S.synched("relativexy",function(){var am=S.lastdeltay+S.newscrolly;S.lastdeltay=0;var an=S.lastdeltax+S.newscrollx;S.lastdeltax=0;if(!S.rail.drag){S.doScrollPos(an,am)}})}}var B=false;function Y(aj,ag,ai){var af,ae;if(!ai&&B){return true}if(aj.deltaMode===0){af=-(aj.deltaX*(D.mousescrollstep/(18*3)))|0;ae=-(aj.deltaY*(D.mousescrollstep/(18*3)))|0}else{if(aj.deltaMode===1){af=-(aj.deltaX*D.mousescrollstep*50/80)|0;ae=-(aj.deltaY*D.mousescrollstep*50/80)|0}}if(ag&&D.oneaxismousemode&&(af===0)&&ae){af=ae;ae=0;if(ai){var ah=(af<0)?(S.getScrollLeft()>=S.page.maxw):(S.getScrollLeft()<=0);if(ah){ae=af;af=0}}}if(S.isrtlmode){af=-af}var ad=R(af,ae,ai,true);if(ad){if(ai){B=true}}else{B=false;aj.stopImmediatePropagation();return aj.preventDefault()}}this.onmousewheel=function(ag){if(S.wheelprevented||S.locked){return false}if(S.railslocked){S.debounced("checkunlock",S.resize,250);return false}if(S.rail.drag){return S.cancelEvent(ag)}if(D.oneaxismousemode==="auto"&&ag.deltaX!==0){D.oneaxismousemode=false}if(D.oneaxismousemode&&ag.deltaX===0){if(!S.rail.scrollable){if(S.railh&&S.railh.scrollable){return S.onmousewheelhr(ag)}else{return true}}}var ae=a();var ad=false;if(D.preservenativescrolling&&((S.checkarea+600)<ae)){S.nativescrollingarea=S.isScrollable(ag);ad=true}S.checkarea=ae;if(S.nativescrollingarea){return true}var af=Y(ag,false,ad);if(af){S.checkarea=0}return af};this.onmousewheelhr=function(af){if(S.wheelprevented){return}if(S.railslocked||!S.railh.scrollable){return true}if(S.rail.drag){return S.cancelEvent(af)}var ae=a();var ad=false;if(D.preservenativescrolling&&((S.checkarea+600)<ae)){S.nativescrollingarea=S.isScrollable(af);ad=true}S.checkarea=ae;if(S.nativescrollingarea){return true}if(S.railslocked){return S.cancelEvent(af)}return Y(af,true,ad)};this.stop=function(){S.cancelScroll();if(S.scrollmon){S.scrollmon.stop()}S.cursorfreezed=false;S.scroll.y=Math.round(S.getScrollTop()*(1/S.scrollratio.y));S.noticeCursor();return S};this.getTransitionSpeed=function(ad){return 80+(ad/72)*D.scrollspeed|0};if(!D.smoothscroll){this.doScrollLeft=function(ad,ae){var af=S.getScrollTop();S.doScrollPos(ad,af,ae)};this.doScrollTop=function(af,ae){var ad=S.getScrollLeft();S.doScrollPos(ad,af,ae)};this.doScrollPos=function(ae,ah,af){var ad=(ae>S.page.maxw)?S.page.maxw:ae;if(ad<0){ad=0}var ag=(ah>S.page.maxh)?S.page.maxh:ah;if(ag<0){ag=0}S.synched("scroll",function(){S.setScrollTop(ag);S.setScrollLeft(ad)})};this.cancelScroll=function(){}}else{if(S.ishwscroll&&M.hastransition&&D.usetransition&&!!D.smoothscroll){var W="";this.resetTransition=function(){W="";S.doc.css(M.prefixstyle+"transition-duration","0ms")};this.prepareTransition=function(ag,ad){var af=(ad)?ag:S.getTransitionSpeed(ag);var ae=af+"ms";if(W!==ae){W=ae;S.doc.css(M.prefixstyle+"transition-duration",ae)}return af};this.doScrollLeft=function(ad,ae){var af=(S.scrollrunning)?S.newscrolly:S.getScrollTop();S.doScrollPos(ad,af,ae)};this.doScrollTop=function(af,ae){var ad=(S.scrollrunning)?S.newscrollx:S.getScrollLeft();S.doScrollPos(ad,af,ae)};this.cursorupdate={running:false,start:function(){var ad=this;if(ad.running){return}ad.running=true;var ae=function(){if(ad.running){i(ae)}S.showCursor(S.getScrollTop(),S.getScrollLeft());S.notifyScrollEvent(S.win[0])};i(ae)},stop:function(){this.running=false}};this.doScrollPos=function(aj,ag,af){var ai=S.getScrollTop();var ak=S.getScrollLeft();if(((S.newscrolly-ai)*(ag-ai)<0)||((S.newscrollx-ak)*(aj-ak)<0)){S.cancelScroll()}if(!D.bouncescroll){if(ag<0){ag=0}else{if(ag>S.page.maxh){ag=S.page.maxh}}if(aj<0){aj=0}else{if(aj>S.page.maxw){aj=S.page.maxw}}}else{if(ag<0){ag=ag/2|0}else{if(ag>S.page.maxh){ag=S.page.maxh+(ag-S.page.maxh)/2|0
}}if(aj<0){aj=aj/2|0}else{if(aj>S.page.maxw){aj=S.page.maxw+(aj-S.page.maxw)/2|0}}}if(S.scrollrunning&&aj==S.newscrollx&&ag==S.newscrolly){return false}S.newscrolly=ag;S.newscrollx=aj;var ah=S.getScrollTop();var am=S.getScrollLeft();var ae={};ae.x=aj-am;ae.y=ag-ah;var al=Math.sqrt((ae.x*ae.x)+(ae.y*ae.y))|0;var ad=S.prepareTransition(al);if(!S.scrollrunning){S.scrollrunning=true;S.triggerScrollStart(am,ah,aj,ag,ad);S.cursorupdate.start()}S.scrollendtrapped=true;if(!M.transitionend){if(S.scrollendtrapped){clearTimeout(S.scrollendtrapped)}S.scrollendtrapped=setTimeout(S.onScrollTransitionEnd,ad)}S.setScrollTop(S.newscrolly);S.setScrollLeft(S.newscrollx)};this.cancelScroll=function(){if(!S.scrollendtrapped){return true}var ad=S.getScrollTop();var ae=S.getScrollLeft();S.scrollrunning=false;if(!M.transitionend){clearTimeout(M.transitionend)}S.scrollendtrapped=false;S.resetTransition();S.setScrollTop(ad);if(S.railh){S.setScrollLeft(ae)}if(S.timerscroll&&S.timerscroll.tm){clearInterval(S.timerscroll.tm)}S.timerscroll=false;S.cursorfreezed=false;S.cursorupdate.stop();S.showCursor(ad,ae);return S};this.onScrollTransitionEnd=function(){if(!S.scrollendtrapped){return}var ad=S.getScrollTop();var ae=S.getScrollLeft();if(ad<0){ad=0}else{if(ad>S.page.maxh){ad=S.page.maxh}}if(ae<0){ae=0}else{if(ae>S.page.maxw){ae=S.page.maxw}}if((ad!=S.newscrolly)||(ae!=S.newscrollx)){return S.doScrollPos(ae,ad,D.snapbackspeed)}if(S.scrollrunning){S.triggerScrollEnd()}S.scrollrunning=false;S.scrollendtrapped=false;S.resetTransition();S.timerscroll=false;S.setScrollTop(ad);if(S.railh){S.setScrollLeft(ae)}S.cursorupdate.stop();S.noticeCursor(false,ad,ae);S.cursorfreezed=false}}else{this.doScrollLeft=function(ad,ae){var af=(S.scrollrunning)?S.newscrolly:S.getScrollTop();S.doScrollPos(ad,af,ae)};this.doScrollTop=function(af,ae){var ad=(S.scrollrunning)?S.newscrollx:S.getScrollLeft();S.doScrollPos(ad,af,ae)};this.doScrollPos=function(aj,ah,ag){var ai=S.getScrollTop();var al=S.getScrollLeft();if(((S.newscrolly-ai)*(ah-ai)<0)||((S.newscrollx-al)*(aj-al)<0)){S.cancelScroll()}var ae=false;if(!S.bouncescroll||!S.rail.visibility){if(ah<0){ah=0;ae=true}else{if(ah>S.page.maxh){ah=S.page.maxh;ae=true}}}if(!S.bouncescroll||!S.railh.visibility){if(aj<0){aj=0;ae=true}else{if(aj>S.page.maxw){aj=S.page.maxw;ae=true}}}if(S.scrollrunning&&(S.newscrolly===ah)&&(S.newscrollx===aj)){return true}S.newscrolly=ah;S.newscrollx=aj;S.dst={};S.dst.x=aj-al;S.dst.y=ah-ai;S.dst.px=al;S.dst.py=ai;var am=Math.sqrt((S.dst.x*S.dst.x)+(S.dst.y*S.dst.y))|0;var ad=S.getTransitionSpeed(am);S.bzscroll={};var ak=(ae)?1:0.58;S.bzscroll.x=new G(al,S.newscrollx,ad,0,0,ak,1);S.bzscroll.y=new G(ai,S.newscrolly,ad,0,0,ak,1);var an=a();var af=function(){if(!S.scrollrunning){return}var ao=S.bzscroll.y.getPos();S.setScrollLeft(S.bzscroll.x.getNow());S.setScrollTop(S.bzscroll.y.getNow());if(ao<=1){S.timer=i(af)}else{S.scrollrunning=false;S.timer=0;S.triggerScrollEnd()}};if(!S.scrollrunning){S.triggerScrollStart(al,ai,aj,ah,ad);S.scrollrunning=true;S.timer=i(af)}};this.cancelScroll=function(){if(S.timer){l(S.timer)}S.timer=0;S.bzscroll=false;S.scrollrunning=false;return S}}}this.doScrollBy=function(ad,ae){R(0,ad)};this.doScrollLeftBy=function(ad,ae){R(ad,0)};this.doScrollTo=function(af,ad){var ae=(ad)?Math.round(af*S.scrollratio.y):af;if(ae<0){ae=0}else{if(ae>S.page.maxh){ae=S.page.maxh}}S.cursorfreezed=false;S.doScrollTop(af)};this.checkContentSize=function(){var ad=S.getContentSize();if((ad.h!=S.page.h)||(ad.w!=S.page.w)){S.resize(false,ad)}};S.onscroll=function(ad){if(S.rail.drag){return}if(!S.cursorfreezed){S.synched("scroll",function(){S.scroll.y=Math.round(S.getScrollTop()/S.scrollratio.y);if(S.railh){S.scroll.x=Math.round(S.getScrollLeft()/S.scrollratio.x)}S.noticeCursor()})}};S.bind(S.docscroll,"scroll",S.onscroll);this.doZoomIn=function(ai){if(S.zoomactive){return}S.zoomactive=true;S.zoomrestore={style:{}};var ad=["position","top","left","zIndex","backgroundColor","marginTop","marginBottom","marginLeft","marginRight"];var ah=S.win[0].style;for(var af in ad){var ae=ad[af];S.zoomrestore.style[ae]=(ah[ae]!==undefined)?ah[ae]:""}S.zoomrestore.style.width=S.win.css("width");S.zoomrestore.style.height=S.win.css("height");S.zoomrestore.padding={w:S.win.outerWidth()-S.win.width(),h:S.win.outerHeight()-S.win.height()};if(M.isios4){S.zoomrestore.scrollTop=t.scrollTop();t.scrollTop(0)}S.win.css({position:(M.isios4)?"absolute":"fixed",top:0,left:0,zIndex:f+100,margin:0});var ag=S.win.css("backgroundColor");if(""===ag||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(ag)){S.win.css("backgroundColor","#fff")}S.rail.css({zIndex:f+101});S.zoom.css({zIndex:f+102});S.zoom.css("backgroundPosition","0 -18px");S.resizeZoom();if(S.onzoomin){S.onzoomin.call(S)}return S.cancelEvent(ai)};this.doZoomOut=function(ad){if(!S.zoomactive){return}S.zoomactive=false;S.win.css("margin","");S.win.css(S.zoomrestore.style);if(M.isios4){t.scrollTop(S.zoomrestore.scrollTop)}S.rail.css({"z-index":S.zindex});S.zoom.css({"z-index":S.zindex});
S.zoomrestore=false;S.zoom.css("backgroundPosition","0 0");S.onResize();if(S.onzoomout){S.onzoomout.call(S)}return S.cancelEvent(ad)};this.doZoom=function(ad){return(S.zoomactive)?S.doZoomOut(ad):S.doZoomIn(ad)};this.resizeZoom=function(){if(!S.zoomactive){return}var ad=S.getScrollTop();S.win.css({width:t.width()-S.zoomrestore.padding.w+"px",height:t.height()-S.zoomrestore.padding.h+"px"});S.onResize();S.setScrollTop(Math.min(S.page.maxh,ad))};this.init();g.nicescroll.push(this)};var v=function(C){var B=this;this.nc=C;this.lastx=0;this.lasty=0;this.speedx=0;this.speedy=0;this.lasttime=0;this.steptime=0;this.snapx=false;this.snapy=false;this.demulx=0;this.demuly=0;this.lastscrollx=-1;this.lastscrolly=-1;this.chkx=0;this.chky=0;this.timer=0;this.reset=function(E,D){B.stop();B.steptime=0;B.lasttime=a();B.speedx=0;B.speedy=0;B.lastx=E;B.lasty=D;B.lastscrollx=-1;B.lastscrolly=-1};this.update=function(I,H){var J=a();B.steptime=J-B.lasttime;B.lasttime=J;var K=H-B.lasty;var L=I-B.lastx;var F=B.nc.getScrollTop();var G=B.nc.getScrollLeft();var D=F+K;var E=G+L;B.snapx=(E<0)||(E>B.nc.page.maxw);B.snapy=(D<0)||(D>B.nc.page.maxh);B.speedx=L;B.speedy=K;B.lastx=I;B.lasty=H};this.stop=function(){B.nc.unsynched("domomentum2d");if(B.timer){clearTimeout(B.timer)}B.timer=0;B.lastscrollx=-1;B.lastscrolly=-1};this.doSnapy=function(E,F){var D=false;if(F<0){F=0;D=true}else{if(F>B.nc.page.maxh){F=B.nc.page.maxh;D=true}}if(E<0){E=0;D=true}else{if(E>B.nc.page.maxw){E=B.nc.page.maxw;D=true}}(D)?B.nc.doScrollPos(E,F,B.nc.opt.snapbackspeed):B.nc.triggerScrollEnd()};this.doMomentum=function(E){var Q=a();var F=(E)?Q+E:B.lasttime;var G=B.nc.getScrollLeft();var R=B.nc.getScrollTop();var M=B.nc.page.maxh;var D=B.nc.page.maxw;B.speedx=(D>0)?Math.min(60,B.speedx):0;B.speedy=(M>0)?Math.min(60,B.speedy):0;var L=F&&(Q-F)<=60;if((R<0)||(R>M)||(G<0)||(G>D)){L=false}var N=(B.speedy&&L)?B.speedy:false;var O=(B.speedx&&L)?B.speedx:false;if(N||O){var P=Math.max(16,B.steptime);if(P>50){var J=P/50;B.speedx*=J;B.speedy*=J;P=50}B.demulxy=0;B.lastscrollx=B.nc.getScrollLeft();B.chkx=B.lastscrollx;B.lastscrolly=B.nc.getScrollTop();B.chky=B.lastscrolly;var I=B.lastscrollx;var H=B.lastscrolly;var K=function(){var S=((a()-Q)>600)?0.04:0.02;if(B.speedx){I=Math.floor(B.lastscrollx-(B.speedx*(1-B.demulxy)));B.lastscrollx=I;if((I<0)||(I>D)){S=0.1}}if(B.speedy){H=Math.floor(B.lastscrolly-(B.speedy*(1-B.demulxy)));B.lastscrolly=H;if((H<0)||(H>M)){S=0.1}}B.demulxy=Math.min(1,B.demulxy+S);B.nc.synched("domomentum2d",function(){if(B.speedx){var U=B.nc.getScrollLeft();B.chkx=I;B.nc.setScrollLeft(I)}if(B.speedy){var T=B.nc.getScrollTop();B.chky=H;B.nc.setScrollTop(H)}if(!B.timer){B.nc.hideCursor();B.doSnapy(I,H)}});if(B.demulxy<1){B.timer=setTimeout(K,P)}else{B.stop();B.nc.hideCursor();B.doSnapy(I,H)}};K()}else{B.doSnapy(B.nc.getScrollLeft(),B.nc.getScrollTop())}}};var p=q.fn.scrollTop;q.cssHooks.pageYOffset={get:function(E,D,B){var C=g.data(E,"__nicescroll")||false;return(C&&C.ishwscroll)?C.getScrollTop():p.call(E)},set:function(C,D){var B=g.data(C,"__nicescroll")||false;(B&&B.ishwscroll)?B.setScrollTop(parseInt(D)):p.call(C,D);return this}};q.fn.scrollTop=function(C){if(C===undefined){var B=(this[0])?g.data(this[0],"__nicescroll")||false:false;return(B&&B.ishwscroll)?B.getScrollTop():p.call(this)}else{return this.each(function(){var D=g.data(this,"__nicescroll")||false;(D&&D.ishwscroll)?D.setScrollTop(parseInt(C)):p.call(g(this),C)})}};var u=q.fn.scrollLeft;g.cssHooks.pageXOffset={get:function(E,D,B){var C=g.data(E,"__nicescroll")||false;return(C&&C.ishwscroll)?C.getScrollLeft():u.call(E)},set:function(C,D){var B=g.data(C,"__nicescroll")||false;(B&&B.ishwscroll)?B.setScrollLeft(parseInt(D)):u.call(C,D);return this}};q.fn.scrollLeft=function(C){if(C===undefined){var B=(this[0])?g.data(this[0],"__nicescroll")||false:false;return(B&&B.ishwscroll)?B.getScrollLeft():u.call(this)}else{return this.each(function(){var D=g.data(this,"__nicescroll")||false;(D&&D.ishwscroll)?D.setScrollLeft(parseInt(C)):u.call(g(this),C)})}};var A=function(E){var C=this;this.length=0;this.name="nicescrollarray";this.each=function(F){g.each(C,F);return C};this.push=function(F){C[C.length]=F;C.length++};this.eq=function(F){return C[F]};if(E){for(var B=0;B<E.length;B++){var D=g.data(E[B],"__nicescroll")||false;if(D){this[this.length]=D;this.length++}}}return this};function r(F,B,E){for(var D=0,C=B.length;D<C;D++){E(F,B[D])}}r(A.prototype,["show","hide","toggle","onResize","resize","remove","stop","doScrollPos"],function(B,C){B[C]=function(){var D=arguments;return this.each(function(){this[C].apply(this,D)})}});q.fn.getNiceScroll=function(B){if(B===undefined){return new A(this)}else{return this[B]&&g.data(this[B],"__nicescroll")||false}};var j=q.expr.pseudos||q.expr[":"];j.nicescroll=function(B){return g.data(B,"__nicescroll")!==undefined};g.fn.niceScroll=function(D,C){if(C===undefined&&typeof D=="object"&&!("jquery" in D)){C=D;D=false}var B=new A();this.each(function(){var I=g(this);var F=g.extend({},C);
if(D||false){var E=g(D);F.doc=(E.length>1)?g(D,I):E;F.win=I}var H=!("doc" in F);if(!H&&!("win" in F)){F.win=I}var G=I.data("__nicescroll")||false;if(!G){F.doc=F.doc||I;G=new d(F,I);I.data("__nicescroll",G)}B.push(G)});return(B.length===1)?B[0]:B};n.NiceScroll={getjQuery:function(){return q}};if(!g.nicescroll){g.nicescroll=new A();g.nicescroll.options=e}}));