Jelajahi Sumber

2.9.2 - fix browser zoom

zooming show hided scrollbars, jquery bug on innerWidth/innerHeight calculation [issue #35]
Inuyaksa 13 tahun lalu
induk
melakukan
458d4d3a7e
8 mengubah file dengan 124 tambahan dan 106 penghapusan
  1. 1 1
      README
  2. 0 11
      changelog_2.9.0.txt
  3. 11 0
      changelog_2.9.2.txt
  4. 1 1
      demo/index.html
  5. 34 33
      demo/js/jquery.nicescroll.min.js
  6. 42 26
      jquery.nicescroll.js
  7. 34 33
      jquery.nicescroll.min.js
  8. 1 1
      package.json

+ 1 - 1
README

@@ -1,5 +1,5 @@
 jquery.nicescroll
-v. 2.9.0 05-06-2012
+v. 2.9.2 05-29-2012
 copyright 2011-12 InuYaksa*2012
 licensed under the MIT
 http://areaaperta.com/nicescroll

+ 0 - 11
changelog_2.9.0.txt

@@ -1,11 +0,0 @@
-Changelog nicescroll release 2.9.0
-http://areaaperta.com/nicescroll
-https://github.com/inuyaksa/jquery.nicescroll
-
-
-Fixes
-- scrollbar not visible when content has toggled (show/hide) [issue #28]
-- iOS/WebKit, clickable elements breaked after content scrolling [issues #29 #30]
-- iOS, scrolling stuck after action on clickable element [issue #33]
-- iOS, flickering on first scrolling action
-- Chrome and IE9, cursor "grab" not displayed

+ 11 - 0
changelog_2.9.2.txt

@@ -0,0 +1,11 @@
+Changelog nicescroll release 2.9.2
+http://areaaperta.com/nicescroll
+https://github.com/inuyaksa/jquery.nicescroll
+
+Changed features
+- replacing screenX/screenY to clientX/clientY, for smooth drag when browser zoom is enabled
+
+
+Fixes
+- zooming show hided scrollbars, jquery bug on innerWidth/innerHeight calculation [issue #35]
+- rail visibility functions rewritten [issue #35]

+ 1 - 1
demo/index.html

@@ -59,7 +59,7 @@
     // $("#boxscroll").niceScroll({touchbehavior:false,cursorcolor:"#00F",cursoropacitymax:0.7,cursorwidth:11,cursorborder:"1px solid #2848BE",cursorborderradius:"8px"}).cursor.css({"background-image":"url(img/mac6scroll.png)"}); // MAC like scrollbar
 
     $("#boxscroll2").niceScroll("#contentscroll2",{cursorcolor:"#F00",cursoropacitymax:0.7,boxzoom:true,touchbehavior:true});  // Second scrollable DIV
-    $("#boxframe").niceScroll("#boxscroll3",{cursorcolor:"#0F0",cursoropacitymax:0.7,boxzoom:true});  // This is an IFrame (iPad compatible)
+    $("#boxframe").niceScroll("#boxscroll3",{cursorcolor:"#0F0",cursoropacitymax:0.7,boxzoom:true,touchbehavior:true});  // This is an IFrame (iPad compatible)
 	
     $("#boxscroll4").niceScroll("#boxscroll4 .wrapper",{boxzoom:true});  // hw acceleration enabled when using wrapper
     

+ 34 - 33
demo/js/jquery.nicescroll.min.js

@@ -1,10 +1,10 @@
-/* jquery.nicescroll 2.9.0 InuYaksa*2012 MIT http://areaaperta.com/nicescroll */(function(f){var l=false,o=false,r=5E3,s=2E3,t=function(){var e=document.getElementsByTagName("script"),e=e[e.length-1].src.split("?")[0];return e.split("/").length>0?e.split("/").slice(0,-1).join("/")+"/":""}(),m=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||false,n=window.cancelRequestAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||
-window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||false,x=function(e,d){var b=this;this.version="2.9.0";this.name="nicescroll";this.me=d;this.opt={doc:f("body"),win:false,zindex:9E3,cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"5px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:60,mousescrollstep:40,touchbehavior:false,hwacceleration:true,usetransition:true,boxzoom:false,dblclickzoom:true,gesturezoom:true,grabcursorenabled:true,
+/* jquery.nicescroll 2.9.2 InuYaksa*2012 MIT http://areaaperta.com/nicescroll */(function(f){var l=false,o=false,r=5E3,s=2E3,t=function(){var e=document.getElementsByTagName("script"),e=e[e.length-1].src.split("?")[0];return e.split("/").length>0?e.split("/").slice(0,-1).join("/")+"/":""}(),m=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||false,n=window.cancelRequestAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||
+window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||false,x=function(e,d){var b=this;this.version="2.9.2";this.name="nicescroll";this.me=d;this.opt={doc:f("body"),win:false,zindex:9E3,cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"5px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:60,mousescrollstep:40,touchbehavior:false,hwacceleration:true,usetransition:true,boxzoom:false,dblclickzoom:true,gesturezoom:true,grabcursorenabled:true,
 autohidemode:true,background:"",iframeautoresize:true,cursorminheight:20,preservenativescrolling:true,railoffset:false,bouncescroll:false,spacebarenabled:true};if(e)for(var h in b.opt)typeof e[h]!="undefined"&&(b.opt[h]=e[h]);this.iddoc=(this.doc=b.opt.doc)&&this.doc[0]?this.doc[0].id||"":"";this.ispage=/BODY|HTML/.test(b.opt.win?b.opt.win[0].nodeName:this.doc[0].nodeName);this.haswrapper=b.opt.win!==false;this.win=b.opt.win||(this.ispage?f(window):this.doc);this.docscroll=this.ispage&&!this.haswrapper?
 f(window):this.win;this.body=f("body");this.iframe=false;this.isiframe=this.doc[0].nodeName=="IFRAME"&&this.win[0].nodeName=="IFRAME";this.istextarea=this.win[0].nodeName=="TEXTAREA";this.page=this.view=this.onclick=this.ongesturezoom=this.onkeypress=this.onmousewheel=this.onmousemove=this.onmouseup=this.onmousedown=false;this.scroll={x:0,y:0};this.scrollratio={x:0,y:0};this.cursorheight=20;this.scrollvaluemax=0;this.scrollmom=false;do this.id="ascrail"+s++;while(document.getElementById(this.id));
-this.hasmousefocus=this.hasfocus=this.zoomactive=this.zoom=this.cursorfreezed=this.cursor=this.rail=false;this.visibility=true;this.nativescrollingarea=this.locked=false;this.events=[];this.saved={};this.delaylist={};var i=document.createElement("DIV");this.isopera="opera"in window;this.isieold=(this.isie="all"in document&&"attachEvent"in i&&!this.isopera)&&!("msInterpolationMode"in i.style);this.isie7=this.isie&&!this.isieold&&(!("documentMode"in document)||document.documentMode==7);this.isie8=this.isie&&
-"documentMode"in document&&document.documentMode==8;this.isie9=this.isie&&"performance"in window&&document.documentMode>=9;this.ismozilla="MozAppearance"in i.style;this.ischrome="chrome"in window;this.isios4=(this.isios=(this.cantouch="ontouchstart"in document.documentElement)&&/iphone|ipad|ipod/i.test(navigator.platform))&&!("seal"in Object);if(b.opt.hwacceleration){if((this.trstyle=window.opera?"OTransform":document.all?"msTransform":i.style.webkitTransform!==void 0?"webkitTransform":i.style.MozTransform!==
-void 0?"MozTransform":false)&&typeof i.style[this.trstyle]=="undefined")this.trstyle=false;if(this.hastransform=this.trstyle!=false)i.style[this.trstyle]="translate3d(1px,2px,3px)",this.hastranslate3d=/translate3d/.test(i.style[this.trstyle]);this.transitionstyle=false;this.prefixstyle="";this.transitionend=false;var p="transition,webkitTransition,MozTransition,OTransition,msTransition,KhtmlTransition".split(","),k=",-webkit-,-moz-,-o-,-ms-,-khtml-".split(","),u="transitionEnd,webkitTransitionEnd,transitionend,oTransitionEnd,msTransitionEnd,KhtmlTransitionEnd".split(",");
+this.hasmousefocus=this.hasfocus=this.zoomactive=this.zoom=this.cursorfreezed=this.cursor=this.rail=false;this.visibility=true;this.nativescrollingarea=this.hidden=this.locked=false;this.events=[];this.saved={};this.delaylist={};var i=document.createElement("DIV");this.isopera="opera"in window;this.isieold=(this.isie="all"in document&&"attachEvent"in i&&!this.isopera)&&!("msInterpolationMode"in i.style);this.isie7=this.isie&&!this.isieold&&(!("documentMode"in document)||document.documentMode==7);
+this.isie8=this.isie&&"documentMode"in document&&document.documentMode==8;this.isie9=this.isie&&"performance"in window&&document.documentMode>=9;this.ismozilla="MozAppearance"in i.style;this.ischrome="chrome"in window;this.isios4=(this.isios=(this.cantouch="ontouchstart"in document.documentElement)&&/iphone|ipad|ipod/i.test(navigator.platform))&&!("seal"in Object);if(b.opt.hwacceleration){if((this.trstyle=window.opera?"OTransform":document.all?"msTransform":i.style.webkitTransform!==void 0?"webkitTransform":
+i.style.MozTransform!==void 0?"MozTransform":false)&&typeof i.style[this.trstyle]=="undefined")this.trstyle=false;if(this.hastransform=this.trstyle!=false)i.style[this.trstyle]="translate3d(1px,2px,3px)",this.hastranslate3d=/translate3d/.test(i.style[this.trstyle]);this.transitionstyle=false;this.prefixstyle="";this.transitionend=false;var p="transition,webkitTransition,MozTransition,OTransition,msTransition,KhtmlTransition".split(","),k=",-webkit-,-moz-,-o-,-ms-,-khtml-".split(","),u="transitionEnd,webkitTransitionEnd,transitionend,oTransitionEnd,msTransitionEnd,KhtmlTransitionEnd".split(",");
 for(h=0;h<p.length;h++)if(p[h]in i.style){this.transitionstyle=p[h];this.prefixstyle=k[h];this.transitionend=u[h];break}this.hastransition=this.transitionstyle}else this.transitionend=this.hastransition=this.transitionstyle=this.hastranslate3d=this.hastransform=this.trstyle=false;this.cursorgrabvalue="";if(b.opt.grabcursorenabled&&b.opt.touchbehavior)this.cursorgrabvalue=function(){var c=["-moz-grab","-webkit-grab","grab"];if(b.ischrome||b.isie)c=[];for(var g=0;g<c.length;g++){var d=c[g];i.style.cursor=
 d;if(i.style.cursor==d)return d}return"url(http://www.google.com/intl/en_ALL/mapfiles/openhand.cur),n-resize"}();i=null;this.ishwscroll=b.hastransform&&b.opt.hwacceleration&&b.haswrapper;this.delayed=function(c,g,d){var j=b.delaylist[c],e=(new Date).getTime();if(j&&j.tt)return false;if(j&&j.last+d>e&&!j.tt)b.delaylist[c]={last:e+d,tt:setTimeout(function(){b.delaylist[c].tt=0;g.call()},d)};else if(!j||!j.tt)b.delaylist[c]={last:e,tt:0},setTimeout(function(){g.call()},0)};this.css=function(c,g){for(var d in g)b.saved.css.push([c,
 d,c.css(d)]),c.css(d,g[d])};this.scrollTop=function(c){return typeof c=="undefined"?b.getScrollTop():b.setScrollTop(c)};BezierClass=function(b,g,d,j,e,v,f){this.st=b;this.ed=g;this.spd=d;this.p1=j||0;this.p2=e||1;this.p3=v||0;this.p4=f||1;this.ts=(new Date).getTime();this.df=this.ed-this.st};BezierClass.prototype={B2:function(b){return 3*b*b*(1-b)},B3:function(b){return 3*b*(1-b)*(1-b)},B4:function(b){return(1-b)*(1-b)*(1-b)},getNow:function(){var b=1-((new Date).getTime()-this.ts)/this.spd,g=this.B2(b)+
@@ -16,10 +16,10 @@ b.rail.width-1;if(d=b.opt.railoffset)d.top&&(g.top+=d.top),d.left&&(g.left+=d.le
 d.hborder=parseFloat(d.outerHeight()-d.innerHeight());b.cursor=d;c=f(document.createElement("div"));c.attr("id",b.id);c.width=1+Math.max(parseFloat(b.opt.cursorwidth),d.outerWidth());c.css({"padding-left":"0px","padding-right":"1px",width:c.width+"px",zIndex:b.ispage?b.opt.zindex:b.opt.zindex+2,background:b.opt.background});c.append(d);b.rail=c;d=b.rail.drag=false;if(b.opt.boxzoom&&!b.ispage&&!b.isieold&&(d=document.createElement("div"),b.bind(d,"click",b.doZoom),b.zoom=f(d),b.zoom.css({cursor:"pointer",
 "z-index":b.opt.zindex,backgroundImage:"url("+t+"zoomico.png)",height:18,width:18,backgroundPosition:"0px 0px"}),b.opt.dblclickzoom&&b.bind(b.win,"dblclick",b.doZoom),b.cantouch&&b.opt.gesturezoom))b.ongesturezoom=function(c){c.scale>1.5&&b.doZoomIn(c);c.scale<0.8&&b.doZoomOut(c);return b.cancelEvent(c)},b.bind(b.win,"gestureend",b.ongesturezoom);b.ispage?(c.css({position:"fixed",top:"0px",right:"0px",height:"100%"}),b.body.append(c)):(b.ishwscroll?(b.win.css("position")=="static"&&b.css(b.win,{position:"relative"}),
 d=b.win[0].nodeName=="HTML"?b.body:b.win,b.zoom&&(b.zoom.css({position:"absolute",top:1,right:0,"margin-right":c.width+4}),d.append(b.zoom)),c.css({position:"absolute",top:0,right:0}),d.append(c)):(c.css({position:"absolute"}),b.zoom&&b.zoom.css({position:"absolute"}),b.updateScrollBar(),b.body.append(c),b.zoom&&b.body.append(b.zoom)),b.isios&&b.css(b.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}));if(b.opt.autohidemode===false)b.autohidedom=false;else if(b.opt.autohidemode===
-true)b.autohidedom=b.rail;else if(b.opt.autohidemode=="cursor")b.autohidedom=b.cursor;b.cantouch||b.opt.touchbehavior?(b.scrollmom={y:new w(b)},b.onmousedown=function(c){if(!b.locked&&(b.cancelScroll(),b.rail.drag={x:c.screenX,y:c.screenY,sx:b.scroll.x,sy:b.scroll.y,st:b.getScrollTop()},b.hasmoving=false,b.lastmouseup=false,b.scrollmom.y.reset(c.screenY),!b.cantouch))return b.cancelEvent(c)},b.onmouseup=function(c){if(b.rail.drag&&(b.scrollmom.y.doMomentum(),b.rail.drag=false,b.hasmoving&&(b.hasmoving=
-false,b.lastmouseup=true,b.hideCursor(),!b.cantouch)))return b.cancelEvent(c)},b.onclick=b.isios?false:function(c){return b.lastmouseup?(b.lastmouseup=false,b.cancelEvent(c)):true},b.onmousemove=function(c){if(b.rail.drag){if(b.cantouch&&typeof c.original=="undefined")return true;b.hasmoving=true;var d=c.screenY,g=b.rail.drag.st-(c.screenY-b.rail.drag.y);if(b.ishwscroll)g<0?(g=Math.round(g/2),d=0):g>b.page.maxh&&(g=b.page.maxh+Math.round((g-b.page.maxh)/2),d=0);else if(g<0&&(g=0),g>b.page.maxh)g=
-b.page.maxh;b.prepareTransition&&b.prepareTransition(0);b.setScrollTop(g);b.showCursor(g);b.scrollmom.y.update(d);return b.cancelEvent(c)}},b.cursorgrabvalue&&(b.css(b.ispage?b.doc:b.win,{cursor:b.cursorgrabvalue}),b.css(b.rail,{cursor:b.cursorgrabvalue}))):(b.onmousedown=function(c){if(b.locked)return b.cancelEvent(c);b.cancelScroll();b.rail.drag={x:c.screenX,y:c.screenY,sx:b.scroll.x,sy:b.scroll.y};return b.cancelEvent(c)},b.onmouseup=function(c){if(b.rail.drag)return b.rail.drag=false,b.cancelEvent(c)},
-b.onmousemove=function(c){if(b.rail.drag){b.scroll.y=b.rail.drag.sy+(c.screenY-b.rail.drag.y);if(b.scroll.y<0)b.scroll.y=0;var d=b.scrollvaluemax;if(b.scroll.y>d)b.scroll.y=d;b.showCursor();b.cursorfreezed=true;b.doScroll(Math.round(b.scroll.y*b.scrollratio.y));return b.cancelEvent(c)}else b.checkarea=true});(b.cantouch||b.opt.touchbehavior)&&b.bind(b.win,"mousedown",b.onmousedown);b.bind(b.cursor,"mousedown",b.onmousedown);b.bind(b.cursor,"mouseup",function(c){b.rail.drag=false;b.hasmoving=false;
+true)b.autohidedom=b.rail;else if(b.opt.autohidemode=="cursor")b.autohidedom=b.cursor;b.cantouch||b.opt.touchbehavior?(b.scrollmom={y:new w(b)},b.onmousedown=function(c){if(!b.locked&&(b.cancelScroll(),b.rail.drag={x:c.clientX,y:c.clientY,sx:b.scroll.x,sy:b.scroll.y,st:b.getScrollTop()},b.hasmoving=false,b.lastmouseup=false,b.scrollmom.y.reset(c.clientY),!b.cantouch))return b.cancelEvent(c)},b.onmouseup=function(c){if(b.rail.drag&&(b.scrollmom.y.doMomentum(),b.rail.drag=false,b.hasmoving&&(b.hasmoving=
+false,b.lastmouseup=true,b.hideCursor(),!b.cantouch)))return b.cancelEvent(c)},b.onclick=b.isios?false:function(c){return b.lastmouseup?(b.lastmouseup=false,b.cancelEvent(c)):true},b.onmousemove=function(c){if(b.rail.drag){if(b.cantouch&&typeof c.original=="undefined")return true;b.hasmoving=true;var d=c.clientY,g=b.rail.drag.st-(c.clientY-b.rail.drag.y);if(b.ishwscroll)g<0?(g=Math.round(g/2),d=0):g>b.page.maxh&&(g=b.page.maxh+Math.round((g-b.page.maxh)/2),d=0);else if(g<0&&(g=0),g>b.page.maxh)g=
+b.page.maxh;b.prepareTransition&&b.prepareTransition(0);b.setScrollTop(g);b.showCursor(g);b.scrollmom.y.update(d);return b.cancelEvent(c)}},b.cursorgrabvalue&&(b.css(b.ispage?b.doc:b.win,{cursor:b.cursorgrabvalue}),b.css(b.rail,{cursor:b.cursorgrabvalue}))):(b.onmousedown=function(c){if(b.locked)return b.cancelEvent(c);b.cancelScroll();b.rail.drag={x:c.pageX,y:c.clientY,sx:b.scroll.x,sy:b.scroll.y};return b.cancelEvent(c)},b.onmouseup=function(c){if(b.rail.drag)return b.rail.drag=false,b.cancelEvent(c)},
+b.onmousemove=function(c){if(b.rail.drag){b.scroll.y=b.rail.drag.sy+(c.clientY-b.rail.drag.y);if(b.scroll.y<0)b.scroll.y=0;var d=b.scrollvaluemax;if(b.scroll.y>d)b.scroll.y=d;b.showCursor();b.cursorfreezed=true;b.doScroll(Math.round(b.scroll.y*b.scrollratio.y));return b.cancelEvent(c)}else b.checkarea=true});(b.cantouch||b.opt.touchbehavior)&&b.bind(b.win,"mousedown",b.onmousedown);b.bind(b.cursor,"mousedown",b.onmousedown);b.bind(b.cursor,"mouseup",function(c){b.rail.drag=false;b.hasmoving=false;
 b.hideCursor();return b.cancelEvent(c)});b.bind(document,"mouseup",b.onmouseup);b.bind(document,"mousemove",b.onmousemove);b.onclick&&b.bind(document,"click",b.onclick);b.cantouch||(b.rail.mouseenter(function(){b.showCursor();b.rail.active=true}),b.rail.mouseleave(function(){b.rail.active=false;b.rail.drag||b.hideCursor()}),b.isiframe||b.bind(b.isie&&b.ispage?document:b.docscroll,"mousewheel",b.onmousewheel),b.bind(b.rail,"mousewheel",b.onmousewheel));b.zoom&&(b.zoom.mouseenter(function(){b.showCursor();
 b.rail.active=true}),b.zoom.mouseleave(function(){b.rail.active=false;b.rail.drag||b.hideCursor()}));!b.ispage&&!b.cantouch&&!/HTML|BODY/.test(b.win[0].nodeName)&&(b.win.attr("tabindex")||b.win.attr({tabindex:r++}),b.win.focus(function(c){l=b.getTarget(c).id||true;b.hasfocus=true;b.noticeCursor()}),b.win.blur(function(){l=false;b.hasfocus=false}),b.win.mouseenter(function(c){o=b.getTarget(c).id||true;b.hasmousefocus=true;b.noticeCursor()}),b.win.mouseleave(function(){o=false;b.hasmousefocus=false}));
 b.onkeypress=function(c){if(b.locked&&b.page.maxh==0)return true;var c=c?c:window.e,d=b.getTarget(c);if(d&&/INPUT|TEXTAREA|SELECT|OPTION/.test(d.nodeName)&&(!d.getAttribute("type")&&!d.type||!/submit|button|cancel/i.tp))return true;if(b.hasfocus||b.hasmousefocus&&!l||b.ispage&&!l&&!o){d=c.keyCode;if(b.locked&&d!=27)return b.cancelEvent(c);var g=false;switch(d){case 38:case 63233:b.doScrollBy(72);g=true;break;case 40:case 63235:b.doScrollBy(-72);g=true;break;case 33:case 63276:b.doScrollBy(b.view.h);
@@ -29,27 +29,28 @@ b.doc.height("");var g=Math.max(c.getElementsByTagName("html")[0].scrollHeight,c
 b.onmousedown),b.cursorgrabvalue&&b.css(f(c.body),{cursor:b.cursorgrabvalue});b.bind(c,"mousemove",b.onmousemove);b.zoom&&(b.opt.dblclickzoom&&b.bind(c,"dblclick",b.doZoom),b.ongesturezoom&&b.bind(c,"gestureend",b.ongesturezoom))};this.doc[0].readyState&&this.doc[0].readyState=="complete"&&setTimeout(function(){e.call(b.doc[0],false)},500);b.bind(this.doc,"load",e)}};this.showCursor=function(c){if(b.cursortimeout)clearTimeout(b.cursortimeout),b.cursortimeout=0;if(b.rail){b.autohidedom&&b.autohidedom.stop().css({opacity:b.opt.cursoropacitymax});
 if(typeof c!="undefined")b.scroll.y=Math.round(c*1/b.scrollratio.y);b.cursor.css({height:b.cursorheight,top:b.scroll.y});b.zoom&&b.zoom.stop().css({opacity:b.opt.cursoropacitymax})}};this.hideCursor=function(c){if(!b.cursortimeout&&b.rail&&b.autohidedom)b.cursortimeout=setTimeout(function(){b.rail.active||(b.autohidedom.stop().animate({opacity:b.opt.cursoropacitymin}),b.zoom&&b.zoom.stop().animate({opacity:b.opt.cursoropacitymin}));b.cursortimeout=0},c||400)};this.noticeCursor=function(c,d){b.showCursor(d);
 b.hideCursor(c)};this.getContentSize=function(){return b.ispage?{w:Math.max(document.body.scrollWidth,document.documentElement.scrollWidth),h:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}:b.haswrapper?{w:b.doc.outerWidth()+parseInt(b.win.css("paddingLeft"))+parseInt(b.win.css("paddingRight")),h:b.doc.outerHeight()+parseInt(b.win.css("paddingTop"))+parseInt(b.win.css("paddingBottom"))}:b.iframe?{w:Math.max(b.iframe.html.scrollWidth,b.iframe.body.scrollWidth),h:Math.max(b.iframe.html.scrollHeight,
-b.iframe.body.scrollHeight)}:{w:b.docscroll[0].scrollWidth,h:b.docscroll[0].scrollHeight}};this.resize=this.onResize=function(c,d){if(!b.haswrapper&&!b.ispage)if(b.win.css("display")!="none")b.show();else return b.visibility&&b.hide(),false;var e=b.page.maxh,f=b.page.maxw,h=b.view.w;b.view={w:b.ispage?b.win.width():b.win.innerWidth(),h:b.ispage?b.win.height():b.win.innerHeight()};b.page=d?d:b.getContentSize();b.page.maxh=Math.max(0,b.page.h-b.view.h);b.page.maxw=Math.max(0,b.page.w-b.view.w);if(b.page.maxh==
-e&&b.page.maxw==f&&b.view.w==h)if(b.ispage)return b;else{e=b.win.offset();if(b.lastposition&&(f=b.lastposition,f.top==e.top&&f.left==e.left))return b;b.lastposition=e}if(b.page.maxh==0)return b.hide(),b.scrollvaluemax=0,b.scroll.y=0,b.scrollratio={x:0,y:0},b.cursorheight=0,b.locked=true,b.setScrollTop(0),false;else b.visibility||b.show();b.locked=false;b.istextarea&&b.win.css("resize")&&b.win.css("resize")!="none"&&(b.view.h-=20);b.ispage||b.updateScrollBar(b.view);b.cursorheight=Math.min(b.view.h,
-Math.round(b.view.h*(b.view.h/b.page.h)));b.cursorheight=Math.max(b.opt.cursorminheight,b.cursorheight);b.scrollvaluemax=b.view.h-b.cursorheight-b.cursor.hborder;b.scrollratio={x:0,y:b.page.maxh/b.scrollvaluemax};b.getScrollTop()>b.page.maxh?b.doScroll(b.page.maxh):(b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y)),b.noticeCursor());return b};this._bind=function(c,d,e,f){b.events.push({e:c,n:d,f:e});c.addEventListener?c.addEventListener(d,e,f||false):c.attachEvent?c.attachEvent("on"+d,e):
-c["on"+d]=e};this.bind=function(c,d,e,f){var h="jquery"in c?c[0]:c;h.addEventListener?(b.cantouch&&/mouseup|mousedown|mousemove/.test(d)&&b._bind(h,d=="mousedown"?"touchstart":d=="mouseup"?"touchend":"touchmove",function(b){if(b.touches.length<2){var c=b.touches.length?b.touches[0]:b;c.original=b;e.call(this,c)}},f||false),b._bind(h,d,e,f||false),d=="mousewheel"&&b._bind(h,"DOMMouseScroll",e,f||false),b.cantouch&&d=="mouseup"&&b._bind(h,"touchcancel",e,f||false)):b._bind(h,d,function(c){if((c=c||
-window.event||false)&&c.srcElement)c.target=c.srcElement;return e.call(h,c)===false||f===false?b.cancelEvent(c):true})};this._unbind=function(b,d,e){b.removeEventListener?b.removeEventListener(d,e,false):b.detachEvent?b.detachEvent("on"+d,e):b["on"+d]=false};this.unbindAll=function(){for(var c=0;c<b.events.length;c++){var d=b.events[c];b._unbind(d.e,d.n,d.f)}};this.cancelEvent=function(c){c=b.cantouch?c.original?c.original:c||false:c?c:window.event||false;if(!c)return false;c.stopPropagation&&c.stopPropagation();
-c.preventDefault&&c.preventDefault();c.cancelBubble=true;c.cancel=true;return c.returnValue=false};this.show=function(){if(b.page.maxh!=0)b.visibility=true,b.rail.css("display","block");return b};this.hide=function(){b.visibility=false;b.rail.css("display","none");return b};this.remove=function(){b.doZoomOut();b.unbindAll();b.events=[];b.rail.remove();b.zoom&&b.zoom.remove();b.cursor=false;b.rail=false;b.zoom=false;for(var c=0;c<b.saved.css.length;c++){var d=b.saved.css[c];d[0].css(d[1],typeof d[2]==
-"undefined"?"":d[2])}b.saved=false;b.me.data("__nicescroll","");return b};this.isScrollable=function(b){for(b=b.target?b.target:b;b&&b.nodeName&&!/BODY|HTML/.test(b.nodeName);){var d=f(b);if(/scroll|auto/.test(d.css("overflowY")||d.css("overflow")||""))return b.clientHeight!=b.scrollHeight;b=b.parentNode?b.parentNode:false}return false};this.onmousewheel=function(c){if(b.locked&&b.page.maxh==0)return true;if(b.opt.preservenativescrolling&&b.checkarea)b.checkarea=false,b.nativescrollingarea=b.isScrollable(c);
-if(b.nativescrollingarea)return true;if(b.locked)return b.cancelEvent(c);if(b.rail.drag)return b.cancelEvent(c);var d=0;if(d=c.detail?c.detail*-1:c.wheelDelta/40)b.scrollmom&&b.scrollmom.y.stop(),b.doScrollBy(d*b.opt.mousescrollstep);return b.cancelEvent(c)};this.stop=function(){b.cancelScroll();b.scrollmon&&b.scrollmon.stop();b.cursorfreezed=false;b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y));b.noticeCursor();return b};b.ishwscroll&&b.hastransition&&b.opt.usetransition?(this.prepareTransition=
-function(c){var d=Math.round(b.opt.scrollspeed*10),c=Math.min(d,Math.round(c/20*b.opt.scrollspeed)),d=c>20?b.prefixstyle+"transform "+c+"ms ease-out 0s":"";if(!b.lasttransitionstyle||b.lasttransitionstyle!=d)b.lasttransitionstyle=d,b.doc.css(b.transitionstyle,d);return c},this.doScroll=function(c,d){var e=b.getScrollTop();if(c<0&&e<=0)return b.noticeCursor();else if(c>b.page.maxh&&e>=b.page.maxh)return b.checkContentSize(),b.noticeCursor();b.newscrolly=c;b.newscrollspeed=d||false;if(b.timer)return false;
-if(!b.scrollendtrapped)b.scrollendtrapped=true,b.bind(b.doc,b.transitionend,b.onScrollEnd,false);b.timer=setTimeout(function(){var c=b.getScrollTop(),c=b.newscrollspeed?b.newscrollspeed:Math.abs(c-b.newscrolly),d=b.prepareTransition(c);b.timer=setTimeout(function(){if(b.newscrolly<0&&!b.opt.bouncescroll)b.newscrolly=0;else if(b.newscrolly>b.page.maxh&&!b.opt.bouncescroll)b.newscrolly=b.page.maxh;if(b.newscrolly==b.getScrollTop())b.timer=0,b.onScrollEnd();else{var c=b.getScrollTop();b.timerscroll&&
-b.timerscroll.tm&&clearInterval(b.timerscroll.tm);if(d>0&&(b.timerscroll={ts:(new Date).getTime(),s:b.getScrollTop(),e:b.newscrolly,sp:d,bz:new BezierClass(c,b.newscrolly,d,0,1,0,1)},!b.cursorfreezed))b.timerscroll.tm=setInterval(function(){b.showCursor(b.getScrollTop())},60);b.setScrollTop(b.newscrolly);b.timer=0}},15)},b.opt.scrollspeed)},this.cancelScroll=function(){if(!b.scrollendtrapped)return true;var c=b.getScrollTop();b.scrollendtrapped=false;b._unbind(b.doc,b.transitionend,b.onScrollEnd);
-b.prepareTransition(0);b.setScrollTop(c);b.timerscroll&&b.timerscroll.tm&&clearInterval(b.timerscroll.tm);b.timerscroll=false;b.cursorfreezed=false;b.noticeCursor(false,c);return b},this.onScrollEnd=function(){b.scrollendtrapped=false;b._unbind(b.doc,b.transitionend,b.onScrollEnd);b.timerscroll&&b.timerscroll.tm&&clearInterval(b.timerscroll.tm);b.timerscroll=false;b.cursorfreezed=false;var c=b.getScrollTop();b.setScrollTop(c);b.noticeCursor(false,c);c<0?b.doScroll(0,60):c>b.page.maxh&&b.doScroll(b.page.maxh,
-60)}):(this.doScroll=function(c){function d(){if(b.cancelAnimationFrame)return true;if(h=1-h)return b.timer=m(d)||1;var c=b.getScrollTop(),e=b.bzscroll?b.bzscroll.getNow():b.newscrolly,c=e-c;if(c<0&&e<b.newscrolly||c>0&&e>b.newscrolly)e=b.newscrolly;b.setScrollTop(e);e==b.newscrolly?(b.timer=0,b.cursorfreezed=false,b.bzscroll=false,e<0?b.doScroll(0):e>b.page.maxh&&b.doScroll(b.page.maxh)):b.timer=m(d)||1}var e=b.getScrollTop();b.newscrolly=c;if(!b.bouncescroll)if(b.newscrolly<0){if(b.newspeedy)b.newspeedy.x=
-0;b.newscrolly=0}else if(b.newscrolly>b.page.maxh){if(b.newspeedy)b.newspeedy.x=b.page.maxh;b.newscrolly=b.page.maxh}var f=Math.floor(Math.abs(c-e)/40);f>0?(f=Math.min(10,f)*100,b.bzscroll=b.bzscroll?b.bzscroll.update(c,f):new BezierClass(e,c,f,0,1,0,1)):b.bzscroll=false;if(!b.timer){e==b.page.maxh&&c>=b.page.maxh&&b.checkContentSize();var h=1;b.cancelAnimationFrame=false;b.timer=1;d();e==b.page.maxh&&c>=e&&b.checkContentSize();b.noticeCursor()}},this.cancelScroll=function(){b.timer&&n(b.timer);b.timer=
-0;b.bzscroll=false;return b});this.doScrollBy=function(c,d){var e=0,e=d?Math.floor((b.scroll.y-c)*b.scrollratio.y):(b.timer?b.newscrolly:b.getScrollTop(true))-c;if(b.bouncescroll){var f=Math.round(b.view.h/2);e<-f?e=-f:e>b.page.maxh+f&&(e=b.page.maxh+f)}b.cursorfreezed=false;b.doScroll(e)};this.doScrollTo=function(c,d){d&&Math.round(c*b.scrollratio.y);b.cursorfreezed=false;b.doScroll(c)};this.checkContentSize=function(){var c=b.getContentSize();c.h!=b.page.h&&b.resize(false,c)};b.onscroll=function(){b.rail.drag||
-b.cursorfreezed||b.delayed("onscroll",function(){b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y));b.noticeCursor()},30)};b.bind(b.docscroll,"scroll",b.onscroll);this.doZoomIn=function(c){if(!b.zoomactive){b.zoomactive=true;b.zoomrestore={style:{}};var d="position,top,left,zIndex,backgroundColor,marginTop,marginBottom,marginLeft,marginRight".split(","),e=b.win[0].style,h;for(h in d){var i=d[h];b.zoomrestore.style[i]=typeof e[i]!="undefined"?e[i]:""}b.zoomrestore.style.width=b.win.css("width");
-b.zoomrestore.style.height=b.win.css("height");b.zoomrestore.padding={w:b.win.outerWidth()-b.win.width(),h:b.win.outerHeight()-b.win.height()};if(b.isios4)b.zoomrestore.scrollTop=f(window).scrollTop(),f(window).scrollTop(0);b.win.css({position:b.isios4?"absolute":"fixed",top:0,left:0,"z-index":b.opt.zindex+100,margin:"0px"});d=b.win.css("backgroundColor");(d==""||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(d))&&b.win.css("backgroundColor","#fff");b.rail.css({"z-index":b.opt.zindex+110});
-b.zoom.css({"z-index":b.opt.zindex+112});b.zoom.css("backgroundPosition","0px -18px");b.resizeZoom();return b.cancelEvent(c)}};this.doZoomOut=function(c){if(b.zoomactive)return b.zoomactive=false,b.win.css("margin",""),b.win.css(b.zoomrestore.style),b.isios4&&f(window).scrollTop(b.zoomrestore.scrollTop),b.rail.css({"z-index":b.ispage?b.opt.zindex:b.opt.zindex+2}),b.zoom.css({"z-index":b.opt.zindex}),b.zoomrestore=false,b.zoom.css("backgroundPosition","0px 0px"),b.onResize(),b.cancelEvent(c)};this.doZoom=
-function(c){return b.zoomactive?b.doZoomOut(c):b.doZoomIn(c)};this.resizeZoom=function(){if(b.zoomactive){var c=b.getScrollTop();b.win.css({width:f(window).width()-b.zoomrestore.padding.w+"px",height:f(window).height()-b.zoomrestore.padding.h+"px"});b.onResize();b.setScrollTop(Math.min(b.page.maxh,c))}};this.init()},w=function(e){var d=this;this.nc=e;this.lasttime=this.speedy=this.lasty=0;this.snapy=false;this.timer=this.demuly=0;this.time=function(){return(new Date).getTime()};this.reset=function(b){d.stop();
-d.lasttime=d.time();d.speedy=0;d.lasty=b};this.update=function(b){d.lasttime=d.time();var f=b-d.lasty,i=e.getScrollTop()+f;d.snapy=i<0||i>d.nc.page.maxh;d.speedy=f;d.lasty=b};this.stop=function(){if(d.timer)clearTimeout(d.timer),d.timer=0};this.doSnapy=function(b){b<0?d.nc.doScroll(0,60):b>d.nc.page.maxh&&d.nc.doScroll(d.nc.page.maxh,60)};this.doMomentum=function(){var b=d.lasttime,e=d.time();d.speedy=Math.min(60,d.speedy);if(d.speedy&&b&&e-b<=50&&d.speedy){var f=e-b,k=d.nc.page.maxh;d.demuly=0;var l=
-function(){var b=Math.floor(d.nc.getScrollTop()-d.speedy*(1-d.demuly));d.demuly+=b<0||b>k?0.08:0.01;d.nc.setScrollTop(b);d.nc.showCursor(b);d.demuly<1?d.timer=setTimeout(l,f):(d.timer=0,d.nc.hideCursor(),d.doSnapy(b))};l()}else d.snapy&&d.doSnapy(d.nc.getScrollTop())}},k=f.fn.scrollTop;f.cssHooks.scrollTop={get:function(e){var d=f.data(e,"__nicescroll")||false;return d&&d.ishwscroll?d.getScrollTop():k.call(e)},set:function(e,d){var b=f.data(e,"__nicescroll")||false;b&&b.ishwscroll?b.setScrollTop(parseInt(d)):
-k.call(e,d);return this}};f.fn.scrollTop=function(e){if(typeof e=="undefined"){var d=this[0]?f.data(this[0],"__nicescroll")||false:false;return d&&d.ishwscroll?d.getScrollTop():k.call(this)}else return this.each(function(){var b=f.data(this,"__nicescroll")||false;b&&b.ishwscroll?b.setScrollTop(parseInt(e)):k.call(f(this),e)})};var q=function(e){var d=this;this.length=0;this.name="nicescrollarray";this.each=function(b){for(var e=0;e<d.length;e++)b.call(d[e]);return d};this.push=function(b){d[d.length]=
-b;d.length++};this.eq=function(b){return d[b]};if(e)for(a=0;a<e.length;a++){var b=f.data(e[a],"__nicescroll")||false;b&&(this[this.length]=b,this.length++)}return this};(function(e,d,b){for(var f=0;f<d.length;f++)b(e,d[f])})(q.prototype,"show,hide,onResize,resize,remove,stop".split(","),function(e,d){e[d]=function(){return this.each(function(){this[d].call()})}});f.fn.getNiceScroll=function(e){return typeof e=="undefined"?new q(this):f.data(this[e],"__nicescroll")||false};f.extend(f.expr[":"],{nicescroll:function(e){return f.data(e,
-"__nicescroll")?true:false}});f.fn.niceScroll=function(e,d){typeof d=="undefined"&&typeof e=="object"&&!("jquery"in e)&&(d=e,e=false);var b=new q;typeof d=="undefined"&&(d={});if(e)d.doc=f(e),d.win=f(this);var h=!("doc"in d);if(!h&&!("win"in d))d.win=f(this);this.each(function(){var e=f(this).data("__nicescroll")||false;if(!e)d.doc=h?f(this):d.doc,e=new x(d,f(this)),f(this).data("__nicescroll",e);b.push(e)});return b.length==1?b[0]:b};window.NiceScroll={getjQuery:function(){return f}}})(jQuery);
+b.iframe.body.scrollHeight)}:{w:b.docscroll[0].scrollWidth,h:b.docscroll[0].scrollHeight}};this.resize=this.onResize=function(c,d){if(!b.haswrapper&&!b.ispage)if(b.win.css("display")!="none")!b.hidden&&!b.visibility&&b.showRail();else return b.visibility&&b.hideRail(),false;var e=b.page.maxh,f=b.page.maxw,h=b.view.w;b.view={w:b.ispage?b.win.width():parseInt(b.win[0].clientWidth),h:b.ispage?b.win.height():parseInt(b.win[0].clientHeight)};b.page=d?d:b.getContentSize();b.page.maxh=Math.max(0,b.page.h-
+b.view.h);b.page.maxw=Math.max(0,b.page.w-b.view.w);if(b.page.maxh==e&&b.page.maxw==f&&b.view.w==h)if(b.ispage)return b;else{e=b.win.offset();if(b.lastposition&&(f=b.lastposition,f.top==e.top&&f.left==e.left))return b;b.lastposition=e}if(b.page.maxh==0)return b.hideRail(),b.scrollvaluemax=0,b.scroll.y=0,b.scrollratio={x:0,y:0},b.cursorheight=0,b.locked=true,b.setScrollTop(0),false;else if(!b.hidden&&!b.visibility)b.showRail(),b.locked=false;b.istextarea&&b.win.css("resize")&&b.win.css("resize")!=
+"none"&&(b.view.h-=20);b.ispage||b.updateScrollBar(b.view);b.cursorheight=Math.min(b.view.h,Math.round(b.view.h*(b.view.h/b.page.h)));b.cursorheight=Math.max(b.opt.cursorminheight,b.cursorheight);b.scrollvaluemax=b.view.h-b.cursorheight-b.cursor.hborder;b.scrollratio={x:0,y:b.page.maxh/b.scrollvaluemax};b.getScrollTop()>b.page.maxh?b.doScroll(b.page.maxh):(b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y)),b.noticeCursor());return b};this._bind=function(c,d,e,f){b.events.push({e:c,n:d,f:e});
+c.addEventListener?c.addEventListener(d,e,f||false):c.attachEvent?c.attachEvent("on"+d,e):c["on"+d]=e};this.bind=function(c,d,e,f){var h="jquery"in c?c[0]:c;h.addEventListener?(b.cantouch&&/mouseup|mousedown|mousemove/.test(d)&&b._bind(h,d=="mousedown"?"touchstart":d=="mouseup"?"touchend":"touchmove",function(b){if(b.touches.length<2){var c=b.touches.length?b.touches[0]:b;c.original=b;e.call(this,c)}},f||false),b._bind(h,d,e,f||false),d=="mousewheel"&&b._bind(h,"DOMMouseScroll",e,f||false),b.cantouch&&
+d=="mouseup"&&b._bind(h,"touchcancel",e,f||false)):b._bind(h,d,function(c){if((c=c||window.event||false)&&c.srcElement)c.target=c.srcElement;return e.call(h,c)===false||f===false?b.cancelEvent(c):true})};this._unbind=function(b,d,e){b.removeEventListener?b.removeEventListener(d,e,false):b.detachEvent?b.detachEvent("on"+d,e):b["on"+d]=false};this.unbindAll=function(){for(var c=0;c<b.events.length;c++){var d=b.events[c];b._unbind(d.e,d.n,d.f)}};this.cancelEvent=function(c){c=b.cantouch?c.original?c.original:
+c||false:c?c:window.event||false;if(!c)return false;c.stopPropagation&&c.stopPropagation();c.preventDefault&&c.preventDefault();c.cancelBubble=true;c.cancel=true;return c.returnValue=false};this.showRail=function(){if(b.page.maxh!=0&&(b.ispage||b.win.css("display")!="none"))b.visibility=true,b.rail.css("display","block");return b};this.hideRail=function(){b.visibility=false;b.rail.css("display","none");return b};this.show=function(){b.hidden=false;b.locked=false;return b.showRail()};this.hide=function(){b.hidden=
+true;b.locked=true;return b.hideRail()};this.remove=function(){b.doZoomOut();b.unbindAll();b.events=[];b.rail.remove();b.zoom&&b.zoom.remove();b.cursor=false;b.rail=false;b.zoom=false;for(var c=0;c<b.saved.css.length;c++){var d=b.saved.css[c];d[0].css(d[1],typeof d[2]=="undefined"?"":d[2])}b.saved=false;b.me.data("__nicescroll","");return b};this.isScrollable=function(b){for(b=b.target?b.target:b;b&&b.nodeName&&!/BODY|HTML/.test(b.nodeName);){var d=f(b);if(/scroll|auto/.test(d.css("overflowY")||d.css("overflow")||
+""))return b.clientHeight!=b.scrollHeight;b=b.parentNode?b.parentNode:false}return false};this.onmousewheel=function(c){if(b.locked&&b.page.maxh==0)return true;if(b.opt.preservenativescrolling&&b.checkarea)b.checkarea=false,b.nativescrollingarea=b.isScrollable(c);if(b.nativescrollingarea)return true;if(b.locked)return b.cancelEvent(c);if(b.rail.drag)return b.cancelEvent(c);var d=0;if(d=c.detail?c.detail*-1:c.wheelDelta/40)b.scrollmom&&b.scrollmom.y.stop(),b.doScrollBy(d*b.opt.mousescrollstep);return b.cancelEvent(c)};
+this.stop=function(){b.cancelScroll();b.scrollmon&&b.scrollmon.stop();b.cursorfreezed=false;b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y));b.noticeCursor();return b};b.ishwscroll&&b.hastransition&&b.opt.usetransition?(this.prepareTransition=function(c){var d=Math.round(b.opt.scrollspeed*10),c=Math.min(d,Math.round(c/20*b.opt.scrollspeed)),d=c>20?b.prefixstyle+"transform "+c+"ms ease-out 0s":"";if(!b.lasttransitionstyle||b.lasttransitionstyle!=d)b.lasttransitionstyle=d,b.doc.css(b.transitionstyle,
+d);return c},this.doScroll=function(c,d){var e=b.getScrollTop();if(c<0&&e<=0)return b.noticeCursor();else if(c>b.page.maxh&&e>=b.page.maxh)return b.checkContentSize(),b.noticeCursor();b.newscrolly=c;b.newscrollspeed=d||false;if(b.timer)return false;if(!b.scrollendtrapped)b.scrollendtrapped=true,b.bind(b.doc,b.transitionend,b.onScrollEnd,false);b.timer=setTimeout(function(){var c=b.getScrollTop(),c=b.newscrollspeed?b.newscrollspeed:Math.abs(c-b.newscrolly),d=b.prepareTransition(c);b.timer=setTimeout(function(){if(b.newscrolly<
+0&&!b.opt.bouncescroll)b.newscrolly=0;else if(b.newscrolly>b.page.maxh&&!b.opt.bouncescroll)b.newscrolly=b.page.maxh;if(b.newscrolly==b.getScrollTop())b.timer=0,b.onScrollEnd();else{var c=b.getScrollTop();b.timerscroll&&b.timerscroll.tm&&clearInterval(b.timerscroll.tm);if(d>0&&(b.timerscroll={ts:(new Date).getTime(),s:b.getScrollTop(),e:b.newscrolly,sp:d,bz:new BezierClass(c,b.newscrolly,d,0,1,0,1)},!b.cursorfreezed))b.timerscroll.tm=setInterval(function(){b.showCursor(b.getScrollTop())},60);b.setScrollTop(b.newscrolly);
+b.timer=0}},15)},b.opt.scrollspeed)},this.cancelScroll=function(){if(!b.scrollendtrapped)return true;var c=b.getScrollTop();b.scrollendtrapped=false;b._unbind(b.doc,b.transitionend,b.onScrollEnd);b.prepareTransition(0);b.setScrollTop(c);b.timerscroll&&b.timerscroll.tm&&clearInterval(b.timerscroll.tm);b.timerscroll=false;b.cursorfreezed=false;b.noticeCursor(false,c);return b},this.onScrollEnd=function(){b.scrollendtrapped=false;b._unbind(b.doc,b.transitionend,b.onScrollEnd);b.timerscroll&&b.timerscroll.tm&&
+clearInterval(b.timerscroll.tm);b.timerscroll=false;b.cursorfreezed=false;var c=b.getScrollTop();b.setScrollTop(c);b.noticeCursor(false,c);c<0?b.doScroll(0,60):c>b.page.maxh&&b.doScroll(b.page.maxh,60)}):(this.doScroll=function(c){function d(){if(b.cancelAnimationFrame)return true;if(h=1-h)return b.timer=m(d)||1;var c=b.getScrollTop(),e=b.bzscroll?b.bzscroll.getNow():b.newscrolly,c=e-c;if(c<0&&e<b.newscrolly||c>0&&e>b.newscrolly)e=b.newscrolly;b.setScrollTop(e);e==b.newscrolly?(b.timer=0,b.cursorfreezed=
+false,b.bzscroll=false,e<0?b.doScroll(0):e>b.page.maxh&&b.doScroll(b.page.maxh)):b.timer=m(d)||1}var e=b.getScrollTop();b.newscrolly=c;if(!b.bouncescroll)if(b.newscrolly<0){if(b.newspeedy)b.newspeedy.x=0;b.newscrolly=0}else if(b.newscrolly>b.page.maxh){if(b.newspeedy)b.newspeedy.x=b.page.maxh;b.newscrolly=b.page.maxh}var f=Math.floor(Math.abs(c-e)/40);f>0?(f=Math.min(10,f)*100,b.bzscroll=b.bzscroll?b.bzscroll.update(c,f):new BezierClass(e,c,f,0,1,0,1)):b.bzscroll=false;if(!b.timer){e==b.page.maxh&&
+c>=b.page.maxh&&b.checkContentSize();var h=1;b.cancelAnimationFrame=false;b.timer=1;d();e==b.page.maxh&&c>=e&&b.checkContentSize();b.noticeCursor()}},this.cancelScroll=function(){b.timer&&n(b.timer);b.timer=0;b.bzscroll=false;return b});this.doScrollBy=function(c,d){var e=0,e=d?Math.floor((b.scroll.y-c)*b.scrollratio.y):(b.timer?b.newscrolly:b.getScrollTop(true))-c;if(b.bouncescroll){var f=Math.round(b.view.h/2);e<-f?e=-f:e>b.page.maxh+f&&(e=b.page.maxh+f)}b.cursorfreezed=false;b.doScroll(e)};this.doScrollTo=
+function(c,d){d&&Math.round(c*b.scrollratio.y);b.cursorfreezed=false;b.doScroll(c)};this.checkContentSize=function(){var c=b.getContentSize();c.h!=b.page.h&&b.resize(false,c)};b.onscroll=function(){b.rail.drag||b.cursorfreezed||b.delayed("onscroll",function(){b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y));b.noticeCursor()},30)};b.bind(b.docscroll,"scroll",b.onscroll);this.doZoomIn=function(c){if(!b.zoomactive){b.zoomactive=true;b.zoomrestore={style:{}};var d="position,top,left,zIndex,backgroundColor,marginTop,marginBottom,marginLeft,marginRight".split(","),
+e=b.win[0].style,h;for(h in d){var i=d[h];b.zoomrestore.style[i]=typeof e[i]!="undefined"?e[i]:""}b.zoomrestore.style.width=b.win.css("width");b.zoomrestore.style.height=b.win.css("height");b.zoomrestore.padding={w:b.win.outerWidth()-b.win.width(),h:b.win.outerHeight()-b.win.height()};if(b.isios4)b.zoomrestore.scrollTop=f(window).scrollTop(),f(window).scrollTop(0);b.win.css({position:b.isios4?"absolute":"fixed",top:0,left:0,"z-index":b.opt.zindex+100,margin:"0px"});d=b.win.css("backgroundColor");
+(d==""||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(d))&&b.win.css("backgroundColor","#fff");b.rail.css({"z-index":b.opt.zindex+110});b.zoom.css({"z-index":b.opt.zindex+112});b.zoom.css("backgroundPosition","0px -18px");b.resizeZoom();return b.cancelEvent(c)}};this.doZoomOut=function(c){if(b.zoomactive)return b.zoomactive=false,b.win.css("margin",""),b.win.css(b.zoomrestore.style),b.isios4&&f(window).scrollTop(b.zoomrestore.scrollTop),b.rail.css({"z-index":b.ispage?b.opt.zindex:b.opt.zindex+
+2}),b.zoom.css({"z-index":b.opt.zindex}),b.zoomrestore=false,b.zoom.css("backgroundPosition","0px 0px"),b.onResize(),b.cancelEvent(c)};this.doZoom=function(c){return b.zoomactive?b.doZoomOut(c):b.doZoomIn(c)};this.resizeZoom=function(){if(b.zoomactive){var c=b.getScrollTop();b.win.css({width:f(window).width()-b.zoomrestore.padding.w+"px",height:f(window).height()-b.zoomrestore.padding.h+"px"});b.onResize();b.setScrollTop(Math.min(b.page.maxh,c))}};this.init()},w=function(e){var d=this;this.nc=e;this.lasttime=
+this.speedy=this.lasty=0;this.snapy=false;this.timer=this.demuly=0;this.time=function(){return(new Date).getTime()};this.reset=function(b){d.stop();d.lasttime=d.time();d.speedy=0;d.lasty=b};this.update=function(b){d.lasttime=d.time();var f=b-d.lasty,i=e.getScrollTop()+f;d.snapy=i<0||i>d.nc.page.maxh;d.speedy=f;d.lasty=b};this.stop=function(){if(d.timer)clearTimeout(d.timer),d.timer=0};this.doSnapy=function(b){b<0?d.nc.doScroll(0,60):b>d.nc.page.maxh&&d.nc.doScroll(d.nc.page.maxh,60)};this.doMomentum=
+function(){var b=d.lasttime,e=d.time();d.speedy=Math.min(60,d.speedy);if(d.speedy&&b&&e-b<=50&&d.speedy){var f=e-b,k=d.nc.page.maxh;d.demuly=0;var l=function(){var b=Math.floor(d.nc.getScrollTop()-d.speedy*(1-d.demuly));d.demuly+=b<0||b>k?0.08:0.01;d.nc.setScrollTop(b);d.nc.showCursor(b);d.demuly<1?d.timer=setTimeout(l,f):(d.timer=0,d.nc.hideCursor(),d.doSnapy(b))};l()}else d.snapy&&d.doSnapy(d.nc.getScrollTop())}},k=f.fn.scrollTop;f.cssHooks.scrollTop={get:function(e){var d=f.data(e,"__nicescroll")||
+false;return d&&d.ishwscroll?d.getScrollTop():k.call(e)},set:function(e,d){var b=f.data(e,"__nicescroll")||false;b&&b.ishwscroll?b.setScrollTop(parseInt(d)):k.call(e,d);return this}};f.fn.scrollTop=function(e){if(typeof e=="undefined"){var d=this[0]?f.data(this[0],"__nicescroll")||false:false;return d&&d.ishwscroll?d.getScrollTop():k.call(this)}else return this.each(function(){var b=f.data(this,"__nicescroll")||false;b&&b.ishwscroll?b.setScrollTop(parseInt(e)):k.call(f(this),e)})};var q=function(e){var d=
+this;this.length=0;this.name="nicescrollarray";this.each=function(b){for(var e=0;e<d.length;e++)b.call(d[e]);return d};this.push=function(b){d[d.length]=b;d.length++};this.eq=function(b){return d[b]};if(e)for(a=0;a<e.length;a++){var b=f.data(e[a],"__nicescroll")||false;b&&(this[this.length]=b,this.length++)}return this};(function(e,d,b){for(var f=0;f<d.length;f++)b(e,d[f])})(q.prototype,"show,hide,onResize,resize,remove,stop".split(","),function(e,d){e[d]=function(){return this.each(function(){this[d].call()})}});
+f.fn.getNiceScroll=function(e){return typeof e=="undefined"?new q(this):f.data(this[e],"__nicescroll")||false};f.extend(f.expr[":"],{nicescroll:function(e){return f.data(e,"__nicescroll")?true:false}});f.fn.niceScroll=function(e,d){typeof d=="undefined"&&typeof e=="object"&&!("jquery"in e)&&(d=e,e=false);var b=new q;typeof d=="undefined"&&(d={});if(e)d.doc=f(e),d.win=f(this);var h=!("doc"in d);if(!h&&!("win"in d))d.win=f(this);this.each(function(){var e=f(this).data("__nicescroll")||false;if(!e)d.doc=
+h?f(this):d.doc,e=new x(d,f(this)),f(this).data("__nicescroll",e);b.push(e)});return b.length==1?b[0]:b};window.NiceScroll={getjQuery:function(){return f}}})(jQuery);

+ 42 - 26
jquery.nicescroll.js

@@ -1,5 +1,5 @@
 /* jquery.nicescroll
--- version 2.9.0
+-- version 2.9.2
 -- copyright 2011-12 InuYaksa*2012
 -- licensed under the MIT
 --
@@ -49,7 +49,7 @@
 
     var self = this;
 
-    this.version = '2.9.0';
+    this.version = '2.9.2';
     this.name = 'nicescroll';
     
     this.me = me;
@@ -139,6 +139,7 @@
     
     this.visibility = true;
     this.locked = false;
+    this.hidden = false; // rails always hidden
     
     this.nativescrollingarea = false;
     
@@ -474,6 +475,8 @@
           self.autohidedom = self.cursor;
         }        
         
+//        if (self.ie10touch) self.opt.touchbehavior = true; // fix for IE10 & WP7
+        
         if (self.cantouch||self.opt.touchbehavior) {
           self.scrollmom = {
             y:new ScrollMomentumClass(self)
@@ -482,10 +485,10 @@
           self.onmousedown = function(e) {
             if (!self.locked) {
               self.cancelScroll();
-              self.rail.drag = {x:e.screenX,y:e.screenY,sx:self.scroll.x,sy:self.scroll.y,st:self.getScrollTop()};
+              self.rail.drag = {x:e.clientX,y:e.clientY,sx:self.scroll.x,sy:self.scroll.y,st:self.getScrollTop()};
               self.hasmoving = false;
               self.lastmouseup = false;
-              self.scrollmom.y.reset(e.screenY);
+              self.scrollmom.y.reset(e.clientY);
               if (!self.cantouch) return self.cancelEvent(e);
             }
           };
@@ -516,9 +519,9 @@
               if (self.cantouch&&(typeof e.original == "undefined")) return true;  // prevent ios "ghost" events by clickable elements
             
               self.hasmoving = true;
-              var my = (e.screenY-self.rail.drag.y);
+              var my = (e.clientY-self.rail.drag.y);
 
-              var fy = e.screenY;
+              var fy = e.clientY;
               var ny = self.rail.drag.st-my;
               
               if (self.ishwscroll) {
@@ -554,7 +557,7 @@
           self.onmousedown = function(e) {
             if (self.locked) return self.cancelEvent(e);
             self.cancelScroll();
-            self.rail.drag = {x:e.screenX,y:e.screenY,sx:self.scroll.x,sy:self.scroll.y};
+            self.rail.drag = {x:e.pageX,y:e.clientY,sx:self.scroll.x,sy:self.scroll.y};
             return self.cancelEvent(e);
           };
           self.onmouseup = function(e) {
@@ -565,7 +568,7 @@
           };        
           self.onmousemove = function(e) {
             if (self.rail.drag) {
-              self.scroll.y = self.rail.drag.sy + (e.screenY-self.rail.drag.y);
+              self.scroll.y = self.rail.drag.sy + (e.clientY-self.rail.drag.y);
               if (self.scroll.y<0) self.scroll.y=0;
               var my = self.scrollvaluemax;
               if (self.scroll.y>my) self.scroll.y=my;
@@ -854,10 +857,10 @@
       if (!self.haswrapper&&!self.ispage) {        
         var vis = (self.win.css('display')!='none');
         if (!vis) {
-          if (self.visibility) self.hide();
+          if (self.visibility) self.hideRail();
           return false;
         } else {
-          self.show();
+          if (!self.hidden&&!self.visibility) self.showRail();
         }        
       }
     
@@ -865,10 +868,17 @@
       var premaxw = self.page.maxw;
 
       var preview = {h:self.view.h,w:self.view.w};
-      
-      self.view = {
+
+/*      
+      self.view = {      
         w:(self.ispage) ? self.win.width() : self.win.innerWidth(),
         h:(self.ispage) ? self.win.height() : self.win.innerHeight()
+      }
+*/      
+      
+      self.view = {
+        w:(self.ispage) ? self.win.width() : parseInt(self.win[0].clientWidth),
+        h:(self.ispage) ? self.win.height() : parseInt(self.win[0].clientHeight)
       };
       
       self.page = (page) ? page : self.getContentSize();
@@ -891,7 +901,7 @@
       }
       
       if (self.page.maxh==0) {
-        self.hide();        
+        self.hideRail();        
         self.scrollvaluemax = 0;
         self.scroll.y = 0;
         self.scrollratio = {x:0,y:0};
@@ -900,9 +910,10 @@
         self.setScrollTop(0);
         return false;
       } 
-      else if (!self.visibility) self.show();     
-      
-      self.locked = false;
+      else if (!self.hidden&&!self.visibility) {
+        self.showRail();     
+        self.locked = false;
+      }
       
       if (self.istextarea&&self.win.css('resize')&&self.win.css('resize')!='none') self.view.h-=20;      
       if (!self.ispage) self.updateScrollBar(self.view);
@@ -1001,20 +1012,32 @@
       return false;
     };
 
-    this.show = function() {
-      if (self.page.maxh!=0) {
+    this.showRail = function() {
+      if ((self.page.maxh!=0)&&(self.ispage||self.win.css('display')!='none')) {
         self.visibility = true;
         self.rail.css('display','block');
       }
       return self;
     };
 
-    this.hide = function() {
+    this.hideRail = function() {
       self.visibility = false;
       self.rail.css('display','none');
       return self;
     };
     
+    this.show = function() {
+      self.hidden = false;
+      self.locked = false;
+      return self.showRail();
+    };
+
+    this.hide = function() {
+      self.hidden = true;
+      self.locked = true;
+      return self.hideRail();
+    };
+    
     this.remove = function() {
       self.doZoomOut();
       self.unbindAll();
@@ -1459,13 +1482,6 @@
       return this;
     }
   };
-  
-/*  ====================================> TO INSPECT  
-  $.fx.step["scrollTop"] = function(fx){
-    if (fx.start=='') fx.start=$.cssHooks.scrollTop.get(fx.elem);
-    $.cssHooks.scrollTop.set(fx.elem,fx.now+fx.unit);
-  };  
-*/  
  
   jQuery.fn.scrollTop = function(value) {    
     if (typeof value == "undefined") {

+ 34 - 33
jquery.nicescroll.min.js

@@ -1,10 +1,10 @@
-/* jquery.nicescroll 2.9.0 InuYaksa*2012 MIT http://areaaperta.com/nicescroll */(function(f){var l=false,o=false,r=5E3,s=2E3,t=function(){var e=document.getElementsByTagName("script"),e=e[e.length-1].src.split("?")[0];return e.split("/").length>0?e.split("/").slice(0,-1).join("/")+"/":""}(),m=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||false,n=window.cancelRequestAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||
-window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||false,x=function(e,d){var b=this;this.version="2.9.0";this.name="nicescroll";this.me=d;this.opt={doc:f("body"),win:false,zindex:9E3,cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"5px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:60,mousescrollstep:40,touchbehavior:false,hwacceleration:true,usetransition:true,boxzoom:false,dblclickzoom:true,gesturezoom:true,grabcursorenabled:true,
+/* jquery.nicescroll 2.9.2 InuYaksa*2012 MIT http://areaaperta.com/nicescroll */(function(f){var l=false,o=false,r=5E3,s=2E3,t=function(){var e=document.getElementsByTagName("script"),e=e[e.length-1].src.split("?")[0];return e.split("/").length>0?e.split("/").slice(0,-1).join("/")+"/":""}(),m=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||false,n=window.cancelRequestAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||
+window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||false,x=function(e,d){var b=this;this.version="2.9.2";this.name="nicescroll";this.me=d;this.opt={doc:f("body"),win:false,zindex:9E3,cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"5px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:60,mousescrollstep:40,touchbehavior:false,hwacceleration:true,usetransition:true,boxzoom:false,dblclickzoom:true,gesturezoom:true,grabcursorenabled:true,
 autohidemode:true,background:"",iframeautoresize:true,cursorminheight:20,preservenativescrolling:true,railoffset:false,bouncescroll:false,spacebarenabled:true};if(e)for(var h in b.opt)typeof e[h]!="undefined"&&(b.opt[h]=e[h]);this.iddoc=(this.doc=b.opt.doc)&&this.doc[0]?this.doc[0].id||"":"";this.ispage=/BODY|HTML/.test(b.opt.win?b.opt.win[0].nodeName:this.doc[0].nodeName);this.haswrapper=b.opt.win!==false;this.win=b.opt.win||(this.ispage?f(window):this.doc);this.docscroll=this.ispage&&!this.haswrapper?
 f(window):this.win;this.body=f("body");this.iframe=false;this.isiframe=this.doc[0].nodeName=="IFRAME"&&this.win[0].nodeName=="IFRAME";this.istextarea=this.win[0].nodeName=="TEXTAREA";this.page=this.view=this.onclick=this.ongesturezoom=this.onkeypress=this.onmousewheel=this.onmousemove=this.onmouseup=this.onmousedown=false;this.scroll={x:0,y:0};this.scrollratio={x:0,y:0};this.cursorheight=20;this.scrollvaluemax=0;this.scrollmom=false;do this.id="ascrail"+s++;while(document.getElementById(this.id));
-this.hasmousefocus=this.hasfocus=this.zoomactive=this.zoom=this.cursorfreezed=this.cursor=this.rail=false;this.visibility=true;this.nativescrollingarea=this.locked=false;this.events=[];this.saved={};this.delaylist={};var i=document.createElement("DIV");this.isopera="opera"in window;this.isieold=(this.isie="all"in document&&"attachEvent"in i&&!this.isopera)&&!("msInterpolationMode"in i.style);this.isie7=this.isie&&!this.isieold&&(!("documentMode"in document)||document.documentMode==7);this.isie8=this.isie&&
-"documentMode"in document&&document.documentMode==8;this.isie9=this.isie&&"performance"in window&&document.documentMode>=9;this.ismozilla="MozAppearance"in i.style;this.ischrome="chrome"in window;this.isios4=(this.isios=(this.cantouch="ontouchstart"in document.documentElement)&&/iphone|ipad|ipod/i.test(navigator.platform))&&!("seal"in Object);if(b.opt.hwacceleration){if((this.trstyle=window.opera?"OTransform":document.all?"msTransform":i.style.webkitTransform!==void 0?"webkitTransform":i.style.MozTransform!==
-void 0?"MozTransform":false)&&typeof i.style[this.trstyle]=="undefined")this.trstyle=false;if(this.hastransform=this.trstyle!=false)i.style[this.trstyle]="translate3d(1px,2px,3px)",this.hastranslate3d=/translate3d/.test(i.style[this.trstyle]);this.transitionstyle=false;this.prefixstyle="";this.transitionend=false;var p="transition,webkitTransition,MozTransition,OTransition,msTransition,KhtmlTransition".split(","),k=",-webkit-,-moz-,-o-,-ms-,-khtml-".split(","),u="transitionEnd,webkitTransitionEnd,transitionend,oTransitionEnd,msTransitionEnd,KhtmlTransitionEnd".split(",");
+this.hasmousefocus=this.hasfocus=this.zoomactive=this.zoom=this.cursorfreezed=this.cursor=this.rail=false;this.visibility=true;this.nativescrollingarea=this.hidden=this.locked=false;this.events=[];this.saved={};this.delaylist={};var i=document.createElement("DIV");this.isopera="opera"in window;this.isieold=(this.isie="all"in document&&"attachEvent"in i&&!this.isopera)&&!("msInterpolationMode"in i.style);this.isie7=this.isie&&!this.isieold&&(!("documentMode"in document)||document.documentMode==7);
+this.isie8=this.isie&&"documentMode"in document&&document.documentMode==8;this.isie9=this.isie&&"performance"in window&&document.documentMode>=9;this.ismozilla="MozAppearance"in i.style;this.ischrome="chrome"in window;this.isios4=(this.isios=(this.cantouch="ontouchstart"in document.documentElement)&&/iphone|ipad|ipod/i.test(navigator.platform))&&!("seal"in Object);if(b.opt.hwacceleration){if((this.trstyle=window.opera?"OTransform":document.all?"msTransform":i.style.webkitTransform!==void 0?"webkitTransform":
+i.style.MozTransform!==void 0?"MozTransform":false)&&typeof i.style[this.trstyle]=="undefined")this.trstyle=false;if(this.hastransform=this.trstyle!=false)i.style[this.trstyle]="translate3d(1px,2px,3px)",this.hastranslate3d=/translate3d/.test(i.style[this.trstyle]);this.transitionstyle=false;this.prefixstyle="";this.transitionend=false;var p="transition,webkitTransition,MozTransition,OTransition,msTransition,KhtmlTransition".split(","),k=",-webkit-,-moz-,-o-,-ms-,-khtml-".split(","),u="transitionEnd,webkitTransitionEnd,transitionend,oTransitionEnd,msTransitionEnd,KhtmlTransitionEnd".split(",");
 for(h=0;h<p.length;h++)if(p[h]in i.style){this.transitionstyle=p[h];this.prefixstyle=k[h];this.transitionend=u[h];break}this.hastransition=this.transitionstyle}else this.transitionend=this.hastransition=this.transitionstyle=this.hastranslate3d=this.hastransform=this.trstyle=false;this.cursorgrabvalue="";if(b.opt.grabcursorenabled&&b.opt.touchbehavior)this.cursorgrabvalue=function(){var c=["-moz-grab","-webkit-grab","grab"];if(b.ischrome||b.isie)c=[];for(var g=0;g<c.length;g++){var d=c[g];i.style.cursor=
 d;if(i.style.cursor==d)return d}return"url(http://www.google.com/intl/en_ALL/mapfiles/openhand.cur),n-resize"}();i=null;this.ishwscroll=b.hastransform&&b.opt.hwacceleration&&b.haswrapper;this.delayed=function(c,g,d){var j=b.delaylist[c],e=(new Date).getTime();if(j&&j.tt)return false;if(j&&j.last+d>e&&!j.tt)b.delaylist[c]={last:e+d,tt:setTimeout(function(){b.delaylist[c].tt=0;g.call()},d)};else if(!j||!j.tt)b.delaylist[c]={last:e,tt:0},setTimeout(function(){g.call()},0)};this.css=function(c,g){for(var d in g)b.saved.css.push([c,
 d,c.css(d)]),c.css(d,g[d])};this.scrollTop=function(c){return typeof c=="undefined"?b.getScrollTop():b.setScrollTop(c)};BezierClass=function(b,g,d,j,e,v,f){this.st=b;this.ed=g;this.spd=d;this.p1=j||0;this.p2=e||1;this.p3=v||0;this.p4=f||1;this.ts=(new Date).getTime();this.df=this.ed-this.st};BezierClass.prototype={B2:function(b){return 3*b*b*(1-b)},B3:function(b){return 3*b*(1-b)*(1-b)},B4:function(b){return(1-b)*(1-b)*(1-b)},getNow:function(){var b=1-((new Date).getTime()-this.ts)/this.spd,g=this.B2(b)+
@@ -16,10 +16,10 @@ b.rail.width-1;if(d=b.opt.railoffset)d.top&&(g.top+=d.top),d.left&&(g.left+=d.le
 d.hborder=parseFloat(d.outerHeight()-d.innerHeight());b.cursor=d;c=f(document.createElement("div"));c.attr("id",b.id);c.width=1+Math.max(parseFloat(b.opt.cursorwidth),d.outerWidth());c.css({"padding-left":"0px","padding-right":"1px",width:c.width+"px",zIndex:b.ispage?b.opt.zindex:b.opt.zindex+2,background:b.opt.background});c.append(d);b.rail=c;d=b.rail.drag=false;if(b.opt.boxzoom&&!b.ispage&&!b.isieold&&(d=document.createElement("div"),b.bind(d,"click",b.doZoom),b.zoom=f(d),b.zoom.css({cursor:"pointer",
 "z-index":b.opt.zindex,backgroundImage:"url("+t+"zoomico.png)",height:18,width:18,backgroundPosition:"0px 0px"}),b.opt.dblclickzoom&&b.bind(b.win,"dblclick",b.doZoom),b.cantouch&&b.opt.gesturezoom))b.ongesturezoom=function(c){c.scale>1.5&&b.doZoomIn(c);c.scale<0.8&&b.doZoomOut(c);return b.cancelEvent(c)},b.bind(b.win,"gestureend",b.ongesturezoom);b.ispage?(c.css({position:"fixed",top:"0px",right:"0px",height:"100%"}),b.body.append(c)):(b.ishwscroll?(b.win.css("position")=="static"&&b.css(b.win,{position:"relative"}),
 d=b.win[0].nodeName=="HTML"?b.body:b.win,b.zoom&&(b.zoom.css({position:"absolute",top:1,right:0,"margin-right":c.width+4}),d.append(b.zoom)),c.css({position:"absolute",top:0,right:0}),d.append(c)):(c.css({position:"absolute"}),b.zoom&&b.zoom.css({position:"absolute"}),b.updateScrollBar(),b.body.append(c),b.zoom&&b.body.append(b.zoom)),b.isios&&b.css(b.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}));if(b.opt.autohidemode===false)b.autohidedom=false;else if(b.opt.autohidemode===
-true)b.autohidedom=b.rail;else if(b.opt.autohidemode=="cursor")b.autohidedom=b.cursor;b.cantouch||b.opt.touchbehavior?(b.scrollmom={y:new w(b)},b.onmousedown=function(c){if(!b.locked&&(b.cancelScroll(),b.rail.drag={x:c.screenX,y:c.screenY,sx:b.scroll.x,sy:b.scroll.y,st:b.getScrollTop()},b.hasmoving=false,b.lastmouseup=false,b.scrollmom.y.reset(c.screenY),!b.cantouch))return b.cancelEvent(c)},b.onmouseup=function(c){if(b.rail.drag&&(b.scrollmom.y.doMomentum(),b.rail.drag=false,b.hasmoving&&(b.hasmoving=
-false,b.lastmouseup=true,b.hideCursor(),!b.cantouch)))return b.cancelEvent(c)},b.onclick=b.isios?false:function(c){return b.lastmouseup?(b.lastmouseup=false,b.cancelEvent(c)):true},b.onmousemove=function(c){if(b.rail.drag){if(b.cantouch&&typeof c.original=="undefined")return true;b.hasmoving=true;var d=c.screenY,g=b.rail.drag.st-(c.screenY-b.rail.drag.y);if(b.ishwscroll)g<0?(g=Math.round(g/2),d=0):g>b.page.maxh&&(g=b.page.maxh+Math.round((g-b.page.maxh)/2),d=0);else if(g<0&&(g=0),g>b.page.maxh)g=
-b.page.maxh;b.prepareTransition&&b.prepareTransition(0);b.setScrollTop(g);b.showCursor(g);b.scrollmom.y.update(d);return b.cancelEvent(c)}},b.cursorgrabvalue&&(b.css(b.ispage?b.doc:b.win,{cursor:b.cursorgrabvalue}),b.css(b.rail,{cursor:b.cursorgrabvalue}))):(b.onmousedown=function(c){if(b.locked)return b.cancelEvent(c);b.cancelScroll();b.rail.drag={x:c.screenX,y:c.screenY,sx:b.scroll.x,sy:b.scroll.y};return b.cancelEvent(c)},b.onmouseup=function(c){if(b.rail.drag)return b.rail.drag=false,b.cancelEvent(c)},
-b.onmousemove=function(c){if(b.rail.drag){b.scroll.y=b.rail.drag.sy+(c.screenY-b.rail.drag.y);if(b.scroll.y<0)b.scroll.y=0;var d=b.scrollvaluemax;if(b.scroll.y>d)b.scroll.y=d;b.showCursor();b.cursorfreezed=true;b.doScroll(Math.round(b.scroll.y*b.scrollratio.y));return b.cancelEvent(c)}else b.checkarea=true});(b.cantouch||b.opt.touchbehavior)&&b.bind(b.win,"mousedown",b.onmousedown);b.bind(b.cursor,"mousedown",b.onmousedown);b.bind(b.cursor,"mouseup",function(c){b.rail.drag=false;b.hasmoving=false;
+true)b.autohidedom=b.rail;else if(b.opt.autohidemode=="cursor")b.autohidedom=b.cursor;b.cantouch||b.opt.touchbehavior?(b.scrollmom={y:new w(b)},b.onmousedown=function(c){if(!b.locked&&(b.cancelScroll(),b.rail.drag={x:c.clientX,y:c.clientY,sx:b.scroll.x,sy:b.scroll.y,st:b.getScrollTop()},b.hasmoving=false,b.lastmouseup=false,b.scrollmom.y.reset(c.clientY),!b.cantouch))return b.cancelEvent(c)},b.onmouseup=function(c){if(b.rail.drag&&(b.scrollmom.y.doMomentum(),b.rail.drag=false,b.hasmoving&&(b.hasmoving=
+false,b.lastmouseup=true,b.hideCursor(),!b.cantouch)))return b.cancelEvent(c)},b.onclick=b.isios?false:function(c){return b.lastmouseup?(b.lastmouseup=false,b.cancelEvent(c)):true},b.onmousemove=function(c){if(b.rail.drag){if(b.cantouch&&typeof c.original=="undefined")return true;b.hasmoving=true;var d=c.clientY,g=b.rail.drag.st-(c.clientY-b.rail.drag.y);if(b.ishwscroll)g<0?(g=Math.round(g/2),d=0):g>b.page.maxh&&(g=b.page.maxh+Math.round((g-b.page.maxh)/2),d=0);else if(g<0&&(g=0),g>b.page.maxh)g=
+b.page.maxh;b.prepareTransition&&b.prepareTransition(0);b.setScrollTop(g);b.showCursor(g);b.scrollmom.y.update(d);return b.cancelEvent(c)}},b.cursorgrabvalue&&(b.css(b.ispage?b.doc:b.win,{cursor:b.cursorgrabvalue}),b.css(b.rail,{cursor:b.cursorgrabvalue}))):(b.onmousedown=function(c){if(b.locked)return b.cancelEvent(c);b.cancelScroll();b.rail.drag={x:c.pageX,y:c.clientY,sx:b.scroll.x,sy:b.scroll.y};return b.cancelEvent(c)},b.onmouseup=function(c){if(b.rail.drag)return b.rail.drag=false,b.cancelEvent(c)},
+b.onmousemove=function(c){if(b.rail.drag){b.scroll.y=b.rail.drag.sy+(c.clientY-b.rail.drag.y);if(b.scroll.y<0)b.scroll.y=0;var d=b.scrollvaluemax;if(b.scroll.y>d)b.scroll.y=d;b.showCursor();b.cursorfreezed=true;b.doScroll(Math.round(b.scroll.y*b.scrollratio.y));return b.cancelEvent(c)}else b.checkarea=true});(b.cantouch||b.opt.touchbehavior)&&b.bind(b.win,"mousedown",b.onmousedown);b.bind(b.cursor,"mousedown",b.onmousedown);b.bind(b.cursor,"mouseup",function(c){b.rail.drag=false;b.hasmoving=false;
 b.hideCursor();return b.cancelEvent(c)});b.bind(document,"mouseup",b.onmouseup);b.bind(document,"mousemove",b.onmousemove);b.onclick&&b.bind(document,"click",b.onclick);b.cantouch||(b.rail.mouseenter(function(){b.showCursor();b.rail.active=true}),b.rail.mouseleave(function(){b.rail.active=false;b.rail.drag||b.hideCursor()}),b.isiframe||b.bind(b.isie&&b.ispage?document:b.docscroll,"mousewheel",b.onmousewheel),b.bind(b.rail,"mousewheel",b.onmousewheel));b.zoom&&(b.zoom.mouseenter(function(){b.showCursor();
 b.rail.active=true}),b.zoom.mouseleave(function(){b.rail.active=false;b.rail.drag||b.hideCursor()}));!b.ispage&&!b.cantouch&&!/HTML|BODY/.test(b.win[0].nodeName)&&(b.win.attr("tabindex")||b.win.attr({tabindex:r++}),b.win.focus(function(c){l=b.getTarget(c).id||true;b.hasfocus=true;b.noticeCursor()}),b.win.blur(function(){l=false;b.hasfocus=false}),b.win.mouseenter(function(c){o=b.getTarget(c).id||true;b.hasmousefocus=true;b.noticeCursor()}),b.win.mouseleave(function(){o=false;b.hasmousefocus=false}));
 b.onkeypress=function(c){if(b.locked&&b.page.maxh==0)return true;var c=c?c:window.e,d=b.getTarget(c);if(d&&/INPUT|TEXTAREA|SELECT|OPTION/.test(d.nodeName)&&(!d.getAttribute("type")&&!d.type||!/submit|button|cancel/i.tp))return true;if(b.hasfocus||b.hasmousefocus&&!l||b.ispage&&!l&&!o){d=c.keyCode;if(b.locked&&d!=27)return b.cancelEvent(c);var g=false;switch(d){case 38:case 63233:b.doScrollBy(72);g=true;break;case 40:case 63235:b.doScrollBy(-72);g=true;break;case 33:case 63276:b.doScrollBy(b.view.h);
@@ -29,27 +29,28 @@ b.doc.height("");var g=Math.max(c.getElementsByTagName("html")[0].scrollHeight,c
 b.onmousedown),b.cursorgrabvalue&&b.css(f(c.body),{cursor:b.cursorgrabvalue});b.bind(c,"mousemove",b.onmousemove);b.zoom&&(b.opt.dblclickzoom&&b.bind(c,"dblclick",b.doZoom),b.ongesturezoom&&b.bind(c,"gestureend",b.ongesturezoom))};this.doc[0].readyState&&this.doc[0].readyState=="complete"&&setTimeout(function(){e.call(b.doc[0],false)},500);b.bind(this.doc,"load",e)}};this.showCursor=function(c){if(b.cursortimeout)clearTimeout(b.cursortimeout),b.cursortimeout=0;if(b.rail){b.autohidedom&&b.autohidedom.stop().css({opacity:b.opt.cursoropacitymax});
 if(typeof c!="undefined")b.scroll.y=Math.round(c*1/b.scrollratio.y);b.cursor.css({height:b.cursorheight,top:b.scroll.y});b.zoom&&b.zoom.stop().css({opacity:b.opt.cursoropacitymax})}};this.hideCursor=function(c){if(!b.cursortimeout&&b.rail&&b.autohidedom)b.cursortimeout=setTimeout(function(){b.rail.active||(b.autohidedom.stop().animate({opacity:b.opt.cursoropacitymin}),b.zoom&&b.zoom.stop().animate({opacity:b.opt.cursoropacitymin}));b.cursortimeout=0},c||400)};this.noticeCursor=function(c,d){b.showCursor(d);
 b.hideCursor(c)};this.getContentSize=function(){return b.ispage?{w:Math.max(document.body.scrollWidth,document.documentElement.scrollWidth),h:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}:b.haswrapper?{w:b.doc.outerWidth()+parseInt(b.win.css("paddingLeft"))+parseInt(b.win.css("paddingRight")),h:b.doc.outerHeight()+parseInt(b.win.css("paddingTop"))+parseInt(b.win.css("paddingBottom"))}:b.iframe?{w:Math.max(b.iframe.html.scrollWidth,b.iframe.body.scrollWidth),h:Math.max(b.iframe.html.scrollHeight,
-b.iframe.body.scrollHeight)}:{w:b.docscroll[0].scrollWidth,h:b.docscroll[0].scrollHeight}};this.resize=this.onResize=function(c,d){if(!b.haswrapper&&!b.ispage)if(b.win.css("display")!="none")b.show();else return b.visibility&&b.hide(),false;var e=b.page.maxh,f=b.page.maxw,h=b.view.w;b.view={w:b.ispage?b.win.width():b.win.innerWidth(),h:b.ispage?b.win.height():b.win.innerHeight()};b.page=d?d:b.getContentSize();b.page.maxh=Math.max(0,b.page.h-b.view.h);b.page.maxw=Math.max(0,b.page.w-b.view.w);if(b.page.maxh==
-e&&b.page.maxw==f&&b.view.w==h)if(b.ispage)return b;else{e=b.win.offset();if(b.lastposition&&(f=b.lastposition,f.top==e.top&&f.left==e.left))return b;b.lastposition=e}if(b.page.maxh==0)return b.hide(),b.scrollvaluemax=0,b.scroll.y=0,b.scrollratio={x:0,y:0},b.cursorheight=0,b.locked=true,b.setScrollTop(0),false;else b.visibility||b.show();b.locked=false;b.istextarea&&b.win.css("resize")&&b.win.css("resize")!="none"&&(b.view.h-=20);b.ispage||b.updateScrollBar(b.view);b.cursorheight=Math.min(b.view.h,
-Math.round(b.view.h*(b.view.h/b.page.h)));b.cursorheight=Math.max(b.opt.cursorminheight,b.cursorheight);b.scrollvaluemax=b.view.h-b.cursorheight-b.cursor.hborder;b.scrollratio={x:0,y:b.page.maxh/b.scrollvaluemax};b.getScrollTop()>b.page.maxh?b.doScroll(b.page.maxh):(b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y)),b.noticeCursor());return b};this._bind=function(c,d,e,f){b.events.push({e:c,n:d,f:e});c.addEventListener?c.addEventListener(d,e,f||false):c.attachEvent?c.attachEvent("on"+d,e):
-c["on"+d]=e};this.bind=function(c,d,e,f){var h="jquery"in c?c[0]:c;h.addEventListener?(b.cantouch&&/mouseup|mousedown|mousemove/.test(d)&&b._bind(h,d=="mousedown"?"touchstart":d=="mouseup"?"touchend":"touchmove",function(b){if(b.touches.length<2){var c=b.touches.length?b.touches[0]:b;c.original=b;e.call(this,c)}},f||false),b._bind(h,d,e,f||false),d=="mousewheel"&&b._bind(h,"DOMMouseScroll",e,f||false),b.cantouch&&d=="mouseup"&&b._bind(h,"touchcancel",e,f||false)):b._bind(h,d,function(c){if((c=c||
-window.event||false)&&c.srcElement)c.target=c.srcElement;return e.call(h,c)===false||f===false?b.cancelEvent(c):true})};this._unbind=function(b,d,e){b.removeEventListener?b.removeEventListener(d,e,false):b.detachEvent?b.detachEvent("on"+d,e):b["on"+d]=false};this.unbindAll=function(){for(var c=0;c<b.events.length;c++){var d=b.events[c];b._unbind(d.e,d.n,d.f)}};this.cancelEvent=function(c){c=b.cantouch?c.original?c.original:c||false:c?c:window.event||false;if(!c)return false;c.stopPropagation&&c.stopPropagation();
-c.preventDefault&&c.preventDefault();c.cancelBubble=true;c.cancel=true;return c.returnValue=false};this.show=function(){if(b.page.maxh!=0)b.visibility=true,b.rail.css("display","block");return b};this.hide=function(){b.visibility=false;b.rail.css("display","none");return b};this.remove=function(){b.doZoomOut();b.unbindAll();b.events=[];b.rail.remove();b.zoom&&b.zoom.remove();b.cursor=false;b.rail=false;b.zoom=false;for(var c=0;c<b.saved.css.length;c++){var d=b.saved.css[c];d[0].css(d[1],typeof d[2]==
-"undefined"?"":d[2])}b.saved=false;b.me.data("__nicescroll","");return b};this.isScrollable=function(b){for(b=b.target?b.target:b;b&&b.nodeName&&!/BODY|HTML/.test(b.nodeName);){var d=f(b);if(/scroll|auto/.test(d.css("overflowY")||d.css("overflow")||""))return b.clientHeight!=b.scrollHeight;b=b.parentNode?b.parentNode:false}return false};this.onmousewheel=function(c){if(b.locked&&b.page.maxh==0)return true;if(b.opt.preservenativescrolling&&b.checkarea)b.checkarea=false,b.nativescrollingarea=b.isScrollable(c);
-if(b.nativescrollingarea)return true;if(b.locked)return b.cancelEvent(c);if(b.rail.drag)return b.cancelEvent(c);var d=0;if(d=c.detail?c.detail*-1:c.wheelDelta/40)b.scrollmom&&b.scrollmom.y.stop(),b.doScrollBy(d*b.opt.mousescrollstep);return b.cancelEvent(c)};this.stop=function(){b.cancelScroll();b.scrollmon&&b.scrollmon.stop();b.cursorfreezed=false;b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y));b.noticeCursor();return b};b.ishwscroll&&b.hastransition&&b.opt.usetransition?(this.prepareTransition=
-function(c){var d=Math.round(b.opt.scrollspeed*10),c=Math.min(d,Math.round(c/20*b.opt.scrollspeed)),d=c>20?b.prefixstyle+"transform "+c+"ms ease-out 0s":"";if(!b.lasttransitionstyle||b.lasttransitionstyle!=d)b.lasttransitionstyle=d,b.doc.css(b.transitionstyle,d);return c},this.doScroll=function(c,d){var e=b.getScrollTop();if(c<0&&e<=0)return b.noticeCursor();else if(c>b.page.maxh&&e>=b.page.maxh)return b.checkContentSize(),b.noticeCursor();b.newscrolly=c;b.newscrollspeed=d||false;if(b.timer)return false;
-if(!b.scrollendtrapped)b.scrollendtrapped=true,b.bind(b.doc,b.transitionend,b.onScrollEnd,false);b.timer=setTimeout(function(){var c=b.getScrollTop(),c=b.newscrollspeed?b.newscrollspeed:Math.abs(c-b.newscrolly),d=b.prepareTransition(c);b.timer=setTimeout(function(){if(b.newscrolly<0&&!b.opt.bouncescroll)b.newscrolly=0;else if(b.newscrolly>b.page.maxh&&!b.opt.bouncescroll)b.newscrolly=b.page.maxh;if(b.newscrolly==b.getScrollTop())b.timer=0,b.onScrollEnd();else{var c=b.getScrollTop();b.timerscroll&&
-b.timerscroll.tm&&clearInterval(b.timerscroll.tm);if(d>0&&(b.timerscroll={ts:(new Date).getTime(),s:b.getScrollTop(),e:b.newscrolly,sp:d,bz:new BezierClass(c,b.newscrolly,d,0,1,0,1)},!b.cursorfreezed))b.timerscroll.tm=setInterval(function(){b.showCursor(b.getScrollTop())},60);b.setScrollTop(b.newscrolly);b.timer=0}},15)},b.opt.scrollspeed)},this.cancelScroll=function(){if(!b.scrollendtrapped)return true;var c=b.getScrollTop();b.scrollendtrapped=false;b._unbind(b.doc,b.transitionend,b.onScrollEnd);
-b.prepareTransition(0);b.setScrollTop(c);b.timerscroll&&b.timerscroll.tm&&clearInterval(b.timerscroll.tm);b.timerscroll=false;b.cursorfreezed=false;b.noticeCursor(false,c);return b},this.onScrollEnd=function(){b.scrollendtrapped=false;b._unbind(b.doc,b.transitionend,b.onScrollEnd);b.timerscroll&&b.timerscroll.tm&&clearInterval(b.timerscroll.tm);b.timerscroll=false;b.cursorfreezed=false;var c=b.getScrollTop();b.setScrollTop(c);b.noticeCursor(false,c);c<0?b.doScroll(0,60):c>b.page.maxh&&b.doScroll(b.page.maxh,
-60)}):(this.doScroll=function(c){function d(){if(b.cancelAnimationFrame)return true;if(h=1-h)return b.timer=m(d)||1;var c=b.getScrollTop(),e=b.bzscroll?b.bzscroll.getNow():b.newscrolly,c=e-c;if(c<0&&e<b.newscrolly||c>0&&e>b.newscrolly)e=b.newscrolly;b.setScrollTop(e);e==b.newscrolly?(b.timer=0,b.cursorfreezed=false,b.bzscroll=false,e<0?b.doScroll(0):e>b.page.maxh&&b.doScroll(b.page.maxh)):b.timer=m(d)||1}var e=b.getScrollTop();b.newscrolly=c;if(!b.bouncescroll)if(b.newscrolly<0){if(b.newspeedy)b.newspeedy.x=
-0;b.newscrolly=0}else if(b.newscrolly>b.page.maxh){if(b.newspeedy)b.newspeedy.x=b.page.maxh;b.newscrolly=b.page.maxh}var f=Math.floor(Math.abs(c-e)/40);f>0?(f=Math.min(10,f)*100,b.bzscroll=b.bzscroll?b.bzscroll.update(c,f):new BezierClass(e,c,f,0,1,0,1)):b.bzscroll=false;if(!b.timer){e==b.page.maxh&&c>=b.page.maxh&&b.checkContentSize();var h=1;b.cancelAnimationFrame=false;b.timer=1;d();e==b.page.maxh&&c>=e&&b.checkContentSize();b.noticeCursor()}},this.cancelScroll=function(){b.timer&&n(b.timer);b.timer=
-0;b.bzscroll=false;return b});this.doScrollBy=function(c,d){var e=0,e=d?Math.floor((b.scroll.y-c)*b.scrollratio.y):(b.timer?b.newscrolly:b.getScrollTop(true))-c;if(b.bouncescroll){var f=Math.round(b.view.h/2);e<-f?e=-f:e>b.page.maxh+f&&(e=b.page.maxh+f)}b.cursorfreezed=false;b.doScroll(e)};this.doScrollTo=function(c,d){d&&Math.round(c*b.scrollratio.y);b.cursorfreezed=false;b.doScroll(c)};this.checkContentSize=function(){var c=b.getContentSize();c.h!=b.page.h&&b.resize(false,c)};b.onscroll=function(){b.rail.drag||
-b.cursorfreezed||b.delayed("onscroll",function(){b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y));b.noticeCursor()},30)};b.bind(b.docscroll,"scroll",b.onscroll);this.doZoomIn=function(c){if(!b.zoomactive){b.zoomactive=true;b.zoomrestore={style:{}};var d="position,top,left,zIndex,backgroundColor,marginTop,marginBottom,marginLeft,marginRight".split(","),e=b.win[0].style,h;for(h in d){var i=d[h];b.zoomrestore.style[i]=typeof e[i]!="undefined"?e[i]:""}b.zoomrestore.style.width=b.win.css("width");
-b.zoomrestore.style.height=b.win.css("height");b.zoomrestore.padding={w:b.win.outerWidth()-b.win.width(),h:b.win.outerHeight()-b.win.height()};if(b.isios4)b.zoomrestore.scrollTop=f(window).scrollTop(),f(window).scrollTop(0);b.win.css({position:b.isios4?"absolute":"fixed",top:0,left:0,"z-index":b.opt.zindex+100,margin:"0px"});d=b.win.css("backgroundColor");(d==""||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(d))&&b.win.css("backgroundColor","#fff");b.rail.css({"z-index":b.opt.zindex+110});
-b.zoom.css({"z-index":b.opt.zindex+112});b.zoom.css("backgroundPosition","0px -18px");b.resizeZoom();return b.cancelEvent(c)}};this.doZoomOut=function(c){if(b.zoomactive)return b.zoomactive=false,b.win.css("margin",""),b.win.css(b.zoomrestore.style),b.isios4&&f(window).scrollTop(b.zoomrestore.scrollTop),b.rail.css({"z-index":b.ispage?b.opt.zindex:b.opt.zindex+2}),b.zoom.css({"z-index":b.opt.zindex}),b.zoomrestore=false,b.zoom.css("backgroundPosition","0px 0px"),b.onResize(),b.cancelEvent(c)};this.doZoom=
-function(c){return b.zoomactive?b.doZoomOut(c):b.doZoomIn(c)};this.resizeZoom=function(){if(b.zoomactive){var c=b.getScrollTop();b.win.css({width:f(window).width()-b.zoomrestore.padding.w+"px",height:f(window).height()-b.zoomrestore.padding.h+"px"});b.onResize();b.setScrollTop(Math.min(b.page.maxh,c))}};this.init()},w=function(e){var d=this;this.nc=e;this.lasttime=this.speedy=this.lasty=0;this.snapy=false;this.timer=this.demuly=0;this.time=function(){return(new Date).getTime()};this.reset=function(b){d.stop();
-d.lasttime=d.time();d.speedy=0;d.lasty=b};this.update=function(b){d.lasttime=d.time();var f=b-d.lasty,i=e.getScrollTop()+f;d.snapy=i<0||i>d.nc.page.maxh;d.speedy=f;d.lasty=b};this.stop=function(){if(d.timer)clearTimeout(d.timer),d.timer=0};this.doSnapy=function(b){b<0?d.nc.doScroll(0,60):b>d.nc.page.maxh&&d.nc.doScroll(d.nc.page.maxh,60)};this.doMomentum=function(){var b=d.lasttime,e=d.time();d.speedy=Math.min(60,d.speedy);if(d.speedy&&b&&e-b<=50&&d.speedy){var f=e-b,k=d.nc.page.maxh;d.demuly=0;var l=
-function(){var b=Math.floor(d.nc.getScrollTop()-d.speedy*(1-d.demuly));d.demuly+=b<0||b>k?0.08:0.01;d.nc.setScrollTop(b);d.nc.showCursor(b);d.demuly<1?d.timer=setTimeout(l,f):(d.timer=0,d.nc.hideCursor(),d.doSnapy(b))};l()}else d.snapy&&d.doSnapy(d.nc.getScrollTop())}},k=f.fn.scrollTop;f.cssHooks.scrollTop={get:function(e){var d=f.data(e,"__nicescroll")||false;return d&&d.ishwscroll?d.getScrollTop():k.call(e)},set:function(e,d){var b=f.data(e,"__nicescroll")||false;b&&b.ishwscroll?b.setScrollTop(parseInt(d)):
-k.call(e,d);return this}};f.fn.scrollTop=function(e){if(typeof e=="undefined"){var d=this[0]?f.data(this[0],"__nicescroll")||false:false;return d&&d.ishwscroll?d.getScrollTop():k.call(this)}else return this.each(function(){var b=f.data(this,"__nicescroll")||false;b&&b.ishwscroll?b.setScrollTop(parseInt(e)):k.call(f(this),e)})};var q=function(e){var d=this;this.length=0;this.name="nicescrollarray";this.each=function(b){for(var e=0;e<d.length;e++)b.call(d[e]);return d};this.push=function(b){d[d.length]=
-b;d.length++};this.eq=function(b){return d[b]};if(e)for(a=0;a<e.length;a++){var b=f.data(e[a],"__nicescroll")||false;b&&(this[this.length]=b,this.length++)}return this};(function(e,d,b){for(var f=0;f<d.length;f++)b(e,d[f])})(q.prototype,"show,hide,onResize,resize,remove,stop".split(","),function(e,d){e[d]=function(){return this.each(function(){this[d].call()})}});f.fn.getNiceScroll=function(e){return typeof e=="undefined"?new q(this):f.data(this[e],"__nicescroll")||false};f.extend(f.expr[":"],{nicescroll:function(e){return f.data(e,
-"__nicescroll")?true:false}});f.fn.niceScroll=function(e,d){typeof d=="undefined"&&typeof e=="object"&&!("jquery"in e)&&(d=e,e=false);var b=new q;typeof d=="undefined"&&(d={});if(e)d.doc=f(e),d.win=f(this);var h=!("doc"in d);if(!h&&!("win"in d))d.win=f(this);this.each(function(){var e=f(this).data("__nicescroll")||false;if(!e)d.doc=h?f(this):d.doc,e=new x(d,f(this)),f(this).data("__nicescroll",e);b.push(e)});return b.length==1?b[0]:b};window.NiceScroll={getjQuery:function(){return f}}})(jQuery);
+b.iframe.body.scrollHeight)}:{w:b.docscroll[0].scrollWidth,h:b.docscroll[0].scrollHeight}};this.resize=this.onResize=function(c,d){if(!b.haswrapper&&!b.ispage)if(b.win.css("display")!="none")!b.hidden&&!b.visibility&&b.showRail();else return b.visibility&&b.hideRail(),false;var e=b.page.maxh,f=b.page.maxw,h=b.view.w;b.view={w:b.ispage?b.win.width():parseInt(b.win[0].clientWidth),h:b.ispage?b.win.height():parseInt(b.win[0].clientHeight)};b.page=d?d:b.getContentSize();b.page.maxh=Math.max(0,b.page.h-
+b.view.h);b.page.maxw=Math.max(0,b.page.w-b.view.w);if(b.page.maxh==e&&b.page.maxw==f&&b.view.w==h)if(b.ispage)return b;else{e=b.win.offset();if(b.lastposition&&(f=b.lastposition,f.top==e.top&&f.left==e.left))return b;b.lastposition=e}if(b.page.maxh==0)return b.hideRail(),b.scrollvaluemax=0,b.scroll.y=0,b.scrollratio={x:0,y:0},b.cursorheight=0,b.locked=true,b.setScrollTop(0),false;else if(!b.hidden&&!b.visibility)b.showRail(),b.locked=false;b.istextarea&&b.win.css("resize")&&b.win.css("resize")!=
+"none"&&(b.view.h-=20);b.ispage||b.updateScrollBar(b.view);b.cursorheight=Math.min(b.view.h,Math.round(b.view.h*(b.view.h/b.page.h)));b.cursorheight=Math.max(b.opt.cursorminheight,b.cursorheight);b.scrollvaluemax=b.view.h-b.cursorheight-b.cursor.hborder;b.scrollratio={x:0,y:b.page.maxh/b.scrollvaluemax};b.getScrollTop()>b.page.maxh?b.doScroll(b.page.maxh):(b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y)),b.noticeCursor());return b};this._bind=function(c,d,e,f){b.events.push({e:c,n:d,f:e});
+c.addEventListener?c.addEventListener(d,e,f||false):c.attachEvent?c.attachEvent("on"+d,e):c["on"+d]=e};this.bind=function(c,d,e,f){var h="jquery"in c?c[0]:c;h.addEventListener?(b.cantouch&&/mouseup|mousedown|mousemove/.test(d)&&b._bind(h,d=="mousedown"?"touchstart":d=="mouseup"?"touchend":"touchmove",function(b){if(b.touches.length<2){var c=b.touches.length?b.touches[0]:b;c.original=b;e.call(this,c)}},f||false),b._bind(h,d,e,f||false),d=="mousewheel"&&b._bind(h,"DOMMouseScroll",e,f||false),b.cantouch&&
+d=="mouseup"&&b._bind(h,"touchcancel",e,f||false)):b._bind(h,d,function(c){if((c=c||window.event||false)&&c.srcElement)c.target=c.srcElement;return e.call(h,c)===false||f===false?b.cancelEvent(c):true})};this._unbind=function(b,d,e){b.removeEventListener?b.removeEventListener(d,e,false):b.detachEvent?b.detachEvent("on"+d,e):b["on"+d]=false};this.unbindAll=function(){for(var c=0;c<b.events.length;c++){var d=b.events[c];b._unbind(d.e,d.n,d.f)}};this.cancelEvent=function(c){c=b.cantouch?c.original?c.original:
+c||false:c?c:window.event||false;if(!c)return false;c.stopPropagation&&c.stopPropagation();c.preventDefault&&c.preventDefault();c.cancelBubble=true;c.cancel=true;return c.returnValue=false};this.showRail=function(){if(b.page.maxh!=0&&(b.ispage||b.win.css("display")!="none"))b.visibility=true,b.rail.css("display","block");return b};this.hideRail=function(){b.visibility=false;b.rail.css("display","none");return b};this.show=function(){b.hidden=false;b.locked=false;return b.showRail()};this.hide=function(){b.hidden=
+true;b.locked=true;return b.hideRail()};this.remove=function(){b.doZoomOut();b.unbindAll();b.events=[];b.rail.remove();b.zoom&&b.zoom.remove();b.cursor=false;b.rail=false;b.zoom=false;for(var c=0;c<b.saved.css.length;c++){var d=b.saved.css[c];d[0].css(d[1],typeof d[2]=="undefined"?"":d[2])}b.saved=false;b.me.data("__nicescroll","");return b};this.isScrollable=function(b){for(b=b.target?b.target:b;b&&b.nodeName&&!/BODY|HTML/.test(b.nodeName);){var d=f(b);if(/scroll|auto/.test(d.css("overflowY")||d.css("overflow")||
+""))return b.clientHeight!=b.scrollHeight;b=b.parentNode?b.parentNode:false}return false};this.onmousewheel=function(c){if(b.locked&&b.page.maxh==0)return true;if(b.opt.preservenativescrolling&&b.checkarea)b.checkarea=false,b.nativescrollingarea=b.isScrollable(c);if(b.nativescrollingarea)return true;if(b.locked)return b.cancelEvent(c);if(b.rail.drag)return b.cancelEvent(c);var d=0;if(d=c.detail?c.detail*-1:c.wheelDelta/40)b.scrollmom&&b.scrollmom.y.stop(),b.doScrollBy(d*b.opt.mousescrollstep);return b.cancelEvent(c)};
+this.stop=function(){b.cancelScroll();b.scrollmon&&b.scrollmon.stop();b.cursorfreezed=false;b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y));b.noticeCursor();return b};b.ishwscroll&&b.hastransition&&b.opt.usetransition?(this.prepareTransition=function(c){var d=Math.round(b.opt.scrollspeed*10),c=Math.min(d,Math.round(c/20*b.opt.scrollspeed)),d=c>20?b.prefixstyle+"transform "+c+"ms ease-out 0s":"";if(!b.lasttransitionstyle||b.lasttransitionstyle!=d)b.lasttransitionstyle=d,b.doc.css(b.transitionstyle,
+d);return c},this.doScroll=function(c,d){var e=b.getScrollTop();if(c<0&&e<=0)return b.noticeCursor();else if(c>b.page.maxh&&e>=b.page.maxh)return b.checkContentSize(),b.noticeCursor();b.newscrolly=c;b.newscrollspeed=d||false;if(b.timer)return false;if(!b.scrollendtrapped)b.scrollendtrapped=true,b.bind(b.doc,b.transitionend,b.onScrollEnd,false);b.timer=setTimeout(function(){var c=b.getScrollTop(),c=b.newscrollspeed?b.newscrollspeed:Math.abs(c-b.newscrolly),d=b.prepareTransition(c);b.timer=setTimeout(function(){if(b.newscrolly<
+0&&!b.opt.bouncescroll)b.newscrolly=0;else if(b.newscrolly>b.page.maxh&&!b.opt.bouncescroll)b.newscrolly=b.page.maxh;if(b.newscrolly==b.getScrollTop())b.timer=0,b.onScrollEnd();else{var c=b.getScrollTop();b.timerscroll&&b.timerscroll.tm&&clearInterval(b.timerscroll.tm);if(d>0&&(b.timerscroll={ts:(new Date).getTime(),s:b.getScrollTop(),e:b.newscrolly,sp:d,bz:new BezierClass(c,b.newscrolly,d,0,1,0,1)},!b.cursorfreezed))b.timerscroll.tm=setInterval(function(){b.showCursor(b.getScrollTop())},60);b.setScrollTop(b.newscrolly);
+b.timer=0}},15)},b.opt.scrollspeed)},this.cancelScroll=function(){if(!b.scrollendtrapped)return true;var c=b.getScrollTop();b.scrollendtrapped=false;b._unbind(b.doc,b.transitionend,b.onScrollEnd);b.prepareTransition(0);b.setScrollTop(c);b.timerscroll&&b.timerscroll.tm&&clearInterval(b.timerscroll.tm);b.timerscroll=false;b.cursorfreezed=false;b.noticeCursor(false,c);return b},this.onScrollEnd=function(){b.scrollendtrapped=false;b._unbind(b.doc,b.transitionend,b.onScrollEnd);b.timerscroll&&b.timerscroll.tm&&
+clearInterval(b.timerscroll.tm);b.timerscroll=false;b.cursorfreezed=false;var c=b.getScrollTop();b.setScrollTop(c);b.noticeCursor(false,c);c<0?b.doScroll(0,60):c>b.page.maxh&&b.doScroll(b.page.maxh,60)}):(this.doScroll=function(c){function d(){if(b.cancelAnimationFrame)return true;if(h=1-h)return b.timer=m(d)||1;var c=b.getScrollTop(),e=b.bzscroll?b.bzscroll.getNow():b.newscrolly,c=e-c;if(c<0&&e<b.newscrolly||c>0&&e>b.newscrolly)e=b.newscrolly;b.setScrollTop(e);e==b.newscrolly?(b.timer=0,b.cursorfreezed=
+false,b.bzscroll=false,e<0?b.doScroll(0):e>b.page.maxh&&b.doScroll(b.page.maxh)):b.timer=m(d)||1}var e=b.getScrollTop();b.newscrolly=c;if(!b.bouncescroll)if(b.newscrolly<0){if(b.newspeedy)b.newspeedy.x=0;b.newscrolly=0}else if(b.newscrolly>b.page.maxh){if(b.newspeedy)b.newspeedy.x=b.page.maxh;b.newscrolly=b.page.maxh}var f=Math.floor(Math.abs(c-e)/40);f>0?(f=Math.min(10,f)*100,b.bzscroll=b.bzscroll?b.bzscroll.update(c,f):new BezierClass(e,c,f,0,1,0,1)):b.bzscroll=false;if(!b.timer){e==b.page.maxh&&
+c>=b.page.maxh&&b.checkContentSize();var h=1;b.cancelAnimationFrame=false;b.timer=1;d();e==b.page.maxh&&c>=e&&b.checkContentSize();b.noticeCursor()}},this.cancelScroll=function(){b.timer&&n(b.timer);b.timer=0;b.bzscroll=false;return b});this.doScrollBy=function(c,d){var e=0,e=d?Math.floor((b.scroll.y-c)*b.scrollratio.y):(b.timer?b.newscrolly:b.getScrollTop(true))-c;if(b.bouncescroll){var f=Math.round(b.view.h/2);e<-f?e=-f:e>b.page.maxh+f&&(e=b.page.maxh+f)}b.cursorfreezed=false;b.doScroll(e)};this.doScrollTo=
+function(c,d){d&&Math.round(c*b.scrollratio.y);b.cursorfreezed=false;b.doScroll(c)};this.checkContentSize=function(){var c=b.getContentSize();c.h!=b.page.h&&b.resize(false,c)};b.onscroll=function(){b.rail.drag||b.cursorfreezed||b.delayed("onscroll",function(){b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y));b.noticeCursor()},30)};b.bind(b.docscroll,"scroll",b.onscroll);this.doZoomIn=function(c){if(!b.zoomactive){b.zoomactive=true;b.zoomrestore={style:{}};var d="position,top,left,zIndex,backgroundColor,marginTop,marginBottom,marginLeft,marginRight".split(","),
+e=b.win[0].style,h;for(h in d){var i=d[h];b.zoomrestore.style[i]=typeof e[i]!="undefined"?e[i]:""}b.zoomrestore.style.width=b.win.css("width");b.zoomrestore.style.height=b.win.css("height");b.zoomrestore.padding={w:b.win.outerWidth()-b.win.width(),h:b.win.outerHeight()-b.win.height()};if(b.isios4)b.zoomrestore.scrollTop=f(window).scrollTop(),f(window).scrollTop(0);b.win.css({position:b.isios4?"absolute":"fixed",top:0,left:0,"z-index":b.opt.zindex+100,margin:"0px"});d=b.win.css("backgroundColor");
+(d==""||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(d))&&b.win.css("backgroundColor","#fff");b.rail.css({"z-index":b.opt.zindex+110});b.zoom.css({"z-index":b.opt.zindex+112});b.zoom.css("backgroundPosition","0px -18px");b.resizeZoom();return b.cancelEvent(c)}};this.doZoomOut=function(c){if(b.zoomactive)return b.zoomactive=false,b.win.css("margin",""),b.win.css(b.zoomrestore.style),b.isios4&&f(window).scrollTop(b.zoomrestore.scrollTop),b.rail.css({"z-index":b.ispage?b.opt.zindex:b.opt.zindex+
+2}),b.zoom.css({"z-index":b.opt.zindex}),b.zoomrestore=false,b.zoom.css("backgroundPosition","0px 0px"),b.onResize(),b.cancelEvent(c)};this.doZoom=function(c){return b.zoomactive?b.doZoomOut(c):b.doZoomIn(c)};this.resizeZoom=function(){if(b.zoomactive){var c=b.getScrollTop();b.win.css({width:f(window).width()-b.zoomrestore.padding.w+"px",height:f(window).height()-b.zoomrestore.padding.h+"px"});b.onResize();b.setScrollTop(Math.min(b.page.maxh,c))}};this.init()},w=function(e){var d=this;this.nc=e;this.lasttime=
+this.speedy=this.lasty=0;this.snapy=false;this.timer=this.demuly=0;this.time=function(){return(new Date).getTime()};this.reset=function(b){d.stop();d.lasttime=d.time();d.speedy=0;d.lasty=b};this.update=function(b){d.lasttime=d.time();var f=b-d.lasty,i=e.getScrollTop()+f;d.snapy=i<0||i>d.nc.page.maxh;d.speedy=f;d.lasty=b};this.stop=function(){if(d.timer)clearTimeout(d.timer),d.timer=0};this.doSnapy=function(b){b<0?d.nc.doScroll(0,60):b>d.nc.page.maxh&&d.nc.doScroll(d.nc.page.maxh,60)};this.doMomentum=
+function(){var b=d.lasttime,e=d.time();d.speedy=Math.min(60,d.speedy);if(d.speedy&&b&&e-b<=50&&d.speedy){var f=e-b,k=d.nc.page.maxh;d.demuly=0;var l=function(){var b=Math.floor(d.nc.getScrollTop()-d.speedy*(1-d.demuly));d.demuly+=b<0||b>k?0.08:0.01;d.nc.setScrollTop(b);d.nc.showCursor(b);d.demuly<1?d.timer=setTimeout(l,f):(d.timer=0,d.nc.hideCursor(),d.doSnapy(b))};l()}else d.snapy&&d.doSnapy(d.nc.getScrollTop())}},k=f.fn.scrollTop;f.cssHooks.scrollTop={get:function(e){var d=f.data(e,"__nicescroll")||
+false;return d&&d.ishwscroll?d.getScrollTop():k.call(e)},set:function(e,d){var b=f.data(e,"__nicescroll")||false;b&&b.ishwscroll?b.setScrollTop(parseInt(d)):k.call(e,d);return this}};f.fn.scrollTop=function(e){if(typeof e=="undefined"){var d=this[0]?f.data(this[0],"__nicescroll")||false:false;return d&&d.ishwscroll?d.getScrollTop():k.call(this)}else return this.each(function(){var b=f.data(this,"__nicescroll")||false;b&&b.ishwscroll?b.setScrollTop(parseInt(e)):k.call(f(this),e)})};var q=function(e){var d=
+this;this.length=0;this.name="nicescrollarray";this.each=function(b){for(var e=0;e<d.length;e++)b.call(d[e]);return d};this.push=function(b){d[d.length]=b;d.length++};this.eq=function(b){return d[b]};if(e)for(a=0;a<e.length;a++){var b=f.data(e[a],"__nicescroll")||false;b&&(this[this.length]=b,this.length++)}return this};(function(e,d,b){for(var f=0;f<d.length;f++)b(e,d[f])})(q.prototype,"show,hide,onResize,resize,remove,stop".split(","),function(e,d){e[d]=function(){return this.each(function(){this[d].call()})}});
+f.fn.getNiceScroll=function(e){return typeof e=="undefined"?new q(this):f.data(this[e],"__nicescroll")||false};f.extend(f.expr[":"],{nicescroll:function(e){return f.data(e,"__nicescroll")?true:false}});f.fn.niceScroll=function(e,d){typeof d=="undefined"&&typeof e=="object"&&!("jquery"in e)&&(d=e,e=false);var b=new q;typeof d=="undefined"&&(d={});if(e)d.doc=f(e),d.win=f(this);var h=!("doc"in d);if(!h&&!("win"in d))d.win=f(this);this.each(function(){var e=f(this).data("__nicescroll")||false;if(!e)d.doc=
+h?f(this):d.doc,e=new x(d,f(this)),f(this).data("__nicescroll",e);b.push(e)});return b.length==1?b[0]:b};window.NiceScroll={getjQuery:function(){return f}}})(jQuery);

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
     "name": "nicescroll",
-    "version": "2.9.0",
+    "version": "2.9.2",
     "title": "jQuery.NiceScroll",
     "author": {
         "name": "InuYaksa",