Quellcode durchsuchen

v. 2.5.0 - smooth scroll & chainable methods

getNiceScroll returns nicescrollarray
selector :nicescroll
new scroll momentum
remove method
resize method
chainable methods
better mouse wheel scrolling
smooth scrolling
zoomico.png optimized
Inuyaksa vor 13 Jahren
Ursprung
Commit
f6f4af8b6a

+ 21 - 8
README

@@ -1,5 +1,5 @@
 jquery.nicescroll
-v. 2.3.0 11-23-2011
+v. 2.5.0 12-05-2011
 copyright 2011 InuYaksa*2011
 licensed under the MIT
 http://areaaperta.com/nicescroll
@@ -9,7 +9,7 @@ https://github.com/inuyaksa/jquery.nicescroll
 Nicescroll (as nice scroll for browsers) is a jquery (since 1.5) plugin, for nice scrollbars with a very similar ios/mobile style.
 It supports DIVs, IFrames and document page (body) scrollbars.
 Compatible with Firefox 4+, Chrome 5+, Safari 4+ (win/mac), Opera 10+, IE 6+. (all A-grade browsers)
-Compatible with iOS devices as iPad. So you have scrollable divs for iPad.
+Compatible with iOS devices as iPad. So you have scrollable divs for iPad 4.x.
 
 Sexy zoom feature, you can "zoom-in" the content of any nicescroll'ed div. Nice to use and nice to see, all the content of the div in fullscreen mode. It works on desktop (double click on div) either in mobile/touch devices using pinch gesture.
 
@@ -17,7 +17,7 @@ On modern browsers hardware accelerated scrolling has implemented.
 
 Only vertical scrollbars supported in this version.
 
-Warning for IE6 users (who uses IE6 yet? Please updgrade to a more stable and modern browser), some feature can't work for limitation of the browser. Document (body) scrollbars can't appears, old (native browser) one is used. Some issues with IFrame scrolling.
+Warning for IE6 users (why do you uses IE6 yet? Please updgrade to a more stable and modern browser), some feature can't work for limitation of the browser. Document (body) scrollbars can't appears, old (native browser) one is used. Some issues with IFrame scrolling.
 
 
 * FEATURES
@@ -29,16 +29,19 @@ Warning for IE6 users (who uses IE6 yet? Please updgrade to a more stable and mo
 - scroll is smooth (as modern tablet browsing), speed is customizable
 - zoom feature
 - hardware accelerated scroll (where available)
+- dragging scroll mode with scrolling momentum (as touch device)
 - tested for all major browsers desktop and mobile versiones
 - support for touch devices
 - compatible with many other browsers, including IE6, Safari on Mac and IE10 preview!
 - very customizable aspect of bar
 - native scroll events are working yet
+- fully integrated with jQuery
+- compatibile with jQuery UI, jQuery Touch, jQuery Mobile
 
 
 * DEPENDENCIES
 It's a plugin for the jquery framework, you need to include jquery in your scripts.
-From 1.5.x version and on. (you can try with 1.4.x also)
+From 1.5.x version and on. (you can try with 1.4.2+ also)
 
 
 * INSTALLATION
@@ -61,12 +64,12 @@ $(document).ready(
   }
 );
 
-2. Style scrollbars wit object returned:
+2. Instance with object returned:
 
-var scrollbars = false;
+var nice = false;
 $(document).ready(
   function() {  
-    scrollbars = $("body").niceScroll();
+    nice = $("body").niceScroll();
   }
 );
 
@@ -79,12 +82,21 @@ $(document).ready(
 );
 
 4. DIV with "wrapper", formed by two divs, the first is the vieport, the latter is the content:
+
 $(document).ready(
   function() {
     $("#viewportdiv").niceScroll("#wrapperdiv",{cursorcolor:"#00F"});
   }
 );
 
+5. Get nicescroll object:
+
+var nice = $("#mydiv").getNiceScroll();
+
+6. Hide scrollbars:
+
+$("#mydiv").getNiceScroll().hide();
+
 
 * CONFIGURATION PARAMETERS
 
@@ -108,7 +120,8 @@ When you call "niceScroll" you can pass some parameters to custom visual aspects
 . autohidemode, how hide the scrollbar works, true=default / "cursor" = only cursor hidden / false = do not hide
 . background, change css for rail background, default is ""
 . iframeautoresize, autoresize iframe on load event (default:true)
-. autohidemode, when true the scrollbars has hidden if there is no scroll on page/div (default:true)
+. cursorminheight, set the minimum cursor height in pixel (default:20)
+
 
 * LICENSE
 

+ 0 - 35
changelog_2.3.0.txt

@@ -1,35 +0,0 @@
-Changelog nicescroll release 2.3.0
-http://areaaperta.com/nicescroll
-https://github.com/inuyaksa/jquery.nicescroll
-
-
-New features
-- show/hide scrollbar functions
-- scrollbar will hide when div has hidden
-- show scrollbar only when it needs (page/div with scroll)
-- detect orientationchange event (when available)
-- requestAnimationFrame (most of modern browsers) implementation for a smoother scrolling and CPU power saving (only native scrolling)
-- added variable with version of library
-
-New options
-- iframeautoresize, autoresize iframe on load event (default:true)
-- autohidemode, when true the scrollbars has hidden if there is no scroll on page/div (default:true)
-
-Changed features
-- more precise scrolling when key has pressed
-- more consistent iframe support
-- internal reorganization of event functions
-- added touchcancel event
-
-Fixes
-- x-position of cursor and rail width on simple div
-- prevent default for gesture event
-- Opera, keypress on iframe
-- IE7 detection routine
-- IE8 IE7, keypress on form fields
-- better event manager for IE8-
-- IE8 & older, fix iframe scrolling detection
-
-Known issues
-- chrome/safari can't detect dom attribute change, on div attr change you need to recall onResize() function
-

+ 35 - 0
changelog_2.5.0.txt

@@ -0,0 +1,35 @@
+Changelog nicescroll release 2.5.0
+http://areaaperta.com/nicescroll
+https://github.com/inuyaksa/jquery.nicescroll
+
+
+New features
+- getNiceScroll returns nicescrollarray object to manage multiple scrollbars at the same time
+- new method each executes a function with all nicescroll instances returned by getNiceScroll
+- new jQuery selector :nicescroll
+- new scroll momentum implementation (only when dragging/touch scroll), more smooth and easy to use (ipad like scrolling) (inspired by the work of Kin Blas)
+- remove method, it removes nicescroll object from element (inspired by ericdc1, issue#10)
+
+New options
+- cursorminheight, set the minimum cursor height in pixel (default:20)
+- resize method, refresh position/size of the scrollbar
+
+Obsolete
+- onResize method downgraded to "obsolete", use resize method
+
+Changed features
+- show/hide/resize/stop chainable methods
+
+Warning, broken compatibilty
+- getNiceScroll manage multiple instance of nicescroll object, it returns nicescrollarray object, older version returns only the first object
+
+Fixes
+- emulate cancelAnimationFrame if browser don't implement
+- mozRequestAnimationFrame returns undefined instead of an id (returned value emulated now)
+- better mouse wheel scrolling implementation
+
+Known issues
+- Chrome 15 (Windows), -webkit-grab css style on cursor doesn't work (browser issue)
+
+Other updates
+- zoomico.png optimized (smaller size) with optipng (http://optipng.sourceforge.net/)

+ 1 - 1
demo/index.html

@@ -2,7 +2,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>jQuery NiceScroll Test 2.3.0</title>
+<title>jQuery NiceScroll Test 2.5.0</title>
 <style type="text/css">
 #boxscroll {
 	padding: 40px;

+ 0 - 15
demo/js/jquery.license.txt

@@ -1,15 +0,0 @@
-Original web page: http://jquery.org/license/
-
-The MIT License is recommended for most projects. It is simple and easy to understand and it places almost no restrictions on what you can do with a jQuery project.
-
-If the GPL suits your project better you are also free to use a jQuery project under that license.
-
-You don’t have to do anything special to choose one license or the other and you don’t have to notify anyone which license you are using. You are free to use a jQuery project in commercial projects as long as the copyright header is left intact.
-Licenses
-
-    MIT License (More Information)
-    GPL (More Information)
-
-Sizzle
-
-The Sizzle selector engine (which is included inside the jQuery library) is held by the Dojo Foundation and is licensed under the MIT, GPL, and BSD licenses. 

+ 49 - 43
demo/js/jquery.nicescroll.min.js

@@ -1,5 +1,5 @@
 /* jquery.nicescroll
--- version 2.3.0
+-- version 2.5.0
 -- copyright 2011 InuYaksa*2011
 -- licensed under the MIT
 --
@@ -7,45 +7,51 @@
 -- https://github.com/inuyaksa/jquery.nicescroll
 --
 */
-(function(g){var l=false,m=false,o=function(){var f=document.getElementsByTagName("script"),f=f[f.length-1].src.split("?")[0];return f.split("/").length>0?f.split("/").slice(0,-1).join("/")+"/":""}(),q=function(f){var b=this;this.version="2.3.0";this.name="nicescroll";this.opt={doc:g("body"),win:false,zindex:9E3,cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"5px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:60,mousescrollstep:48,touchbehavior:false,
-hwacceleration:true,usetransition:true,boxzoom:false,dblclickzoom:true,gesturezoom:true,grabcursorenabled:true,autohidemode:true,background:"",iframeautoresize:true};if(f)for(var h in b.opt)f[h]!==void 0&&(b.opt[h]=f[h]);this.id=b.opt.doc[0].id||"";this.doc=b.opt.doc;this.ispage=b.doc[0].nodeName=="BODY"||b.doc[0].nodeName=="HTML";this.haswrapper=b.opt.win!==false;this.win=b.opt.win||(this.ispage?g(window):this.doc);this.docscroll=this.ispage?g(window):this.win;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.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;do this.id="ascrail"+Math.round(Math.random()*99999);while(document.getElementById(this.id));this.hasmousefocus=this.hasfocus=this.zoomactive=this.zoom=this.cursorfreezed=this.cursor=this.rail=false;this.visibility=
-true;this.locked=false;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.cantouch="ontouchstart"in
-document.documentElement)&&/iphone|ipad|ipod/i.test(navigator.platform)?(this.isios=true,this.isios4=!("seal"in Object)):this.isios4=this.isios=false;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)&&i.style[this.trstyle]===void 0)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 f="transition,webkitTransition,MozTransition,OTransition,msTransition,KhtmlTransition".split(","),p=",-webkit-,-moz-,-o-,-ms-,-khtml-".split(","),j="transitionEnd,webkitTransitionEnd,transitionend,oTransitionEnd,msTransitionEnd,KhtmlTransitionEnd".split(",");for(h=0;h<f.length;h++)if(f[h]in i.style){this.transitionstyle=f[h];this.prefixstyle=p[h];this.transitionend=j[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(){if(!b.isie||b.isie9)for(var c=["grab","-moz-grab","-webkit-grab"],d=0;d<c.length;d++){var e=c[d];i.style.cursor=e;if(i.style.cursor==e)return e}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.scrollTop=function(c){return c===void 0?b.getScrollTop():b.setScrollTop(c)};this.ishwscroll?(b.doc.translate={x:0,y:0},this.getScrollTop=function(){return b.doc.translate.y},this.setScrollTop=this.hastranslate3d?function(c,d){b.doc.css(b.trstyle,"translate3d(0px,"+c*-1+"px,0px)");b.doc.translate.y=c;if(!d)if(document.createEvent){var e=document.createEvent("UIEvents");e.initUIEvent("scroll",false,true,window,1);b.docscroll[0].dispatchEvent(e)}else e=document.createEventObject(),
-b.docscroll[0].fireEvent("onscroll"),e.cancelBubble=true}:function(c,d){b.doc.css(b.trstyle,"translate(0px,"+c*-1+"px)");b.doc.translate.y=c;if(!d)if(document.createEvent){var e=document.createEvent("UIEvents");e.initUIEvent("scroll",false,true,window,1);b.docscroll[0].dispatchEvent(e)}else e=document.createEventObject(),b.docscroll[0].fireEvent("onscroll"),e.cancelBubble=true}):(this.getScrollTop=function(){return b.docscroll.scrollTop()},this.setScrollTop=function(c){return b.docscroll.scrollTop(c)});
-this.getTarget=function(b){return!b?false:b.target?b.target:b.srcElement?b.srcElement:false};this.hasParent=function(b,d){if(!b)return false;for(var e=b.target||b.srcElement||b||false;e&&e.id!=d;)e=e.parentNode||false;return e!==false};this.updateScrollBar=function(c){if(b.ishwscroll)b.rail.css({height:b.win.innerHeight()});else{var d=b.win.offset();d.top+=2;var e=(b.win.outerWidth()-b.win.innerWidth())/2;d.left+=b.win.innerWidth()+e-b.rail.width-1;b.rail.css({position:"absolute",top:d.top,left:d.left,
-height:c?c.h:b.win.innerHeight()});b.zoom&&b.zoom.css({position:"absolute",top:d.top+1,left:d.left-18})}};var k=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||false,n=window.cancelRequestAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||false;b.hasanimationframe=k;
-b.hascancelanimationframe=n;b.hasanimationframe||(k=function(b){return setTimeout(b,1E3/60)});b.hascancelanimationframe||(n=clearInterval);this.init=function(){if(!b.ispage||!b.cantouch&&!b.isieold){b.ispage?b.doc.css({"overflow-y":"hidden"}):b.docscroll.css({"overflow-y":"hidden"});b.ispage&&b.isie7&&g("html").css({"overflow-y":"hidden"});var c=g(document.createElement("div"));c.css({position:"relative",top:0,"float":"right",width:b.opt.cursorwidth,height:"0px","background-color":b.opt.cursorcolor,
-border:b.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":b.opt.cursorborderradius,"-moz-border-radius":b.opt.cursorborderradius,"border-radius":b.opt.cursorborderradius});c.hborder=parseFloat(c.outerHeight()-c.innerHeight());b.cursor=c;var d=g(document.createElement("div"));d.attr("id",b.id);d.width=3+Math.max(parseFloat(b.opt.cursorwidth),c.outerWidth());d.css({"padding-left":"0px","padding-right":"1px",width:d.width+"px",zIndex:b.ispage?b.opt.zindex:b.opt.zindex+2,background:b.opt.background});
-d.append(c);b.rail=d;c=false;if(b.opt.boxzoom&&!b.ispage&&!b.isieold)c=document.createElement("div"),b.bind(c,"click",b.doZoom),b.zoom=g(c),b.zoom.css({cursor:"pointer","z-index":b.opt.zindex,backgroundImage:"url("+o+"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.bind(b.win,"gestureend",function(c){c.scale>1.5&&b.doZoomIn(c);c.scale<0.8&&b.doZoomOut(c);return b.cancelEvent(c)});b.ispage?(d.css({position:"fixed",
-top:"0px",right:"0px",height:"100%"}),b.doc.append(d)):b.ishwscroll?(b.win.css("position")=="static"&&b.win.css("position","relative"),b.zoom&&(b.zoom.css({position:"absolute",top:1,right:0,"margin-right":d.width+2}),b.win.append(b.zoom)),d.css({position:"absolute",top:0,right:0}),b.win.append(d)):(b.updateScrollBar(),g("body").append(d),b.zoom&&g("body").append(b.zoom));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.bind(window,"resize",b.onResize);b.bind(window,"orientationchange",b.onResize);!b.ispage&&!b.haswrapper&&b.bind(b.win,b.isie&&!b.isie9?"propertychange":"DOMAttrModified",b.onAttributeChange);!b.ispage&&b.opt.boxzoom&&g(window).resize(b.resizeZoom);b.istextarea&&b.win.mouseup(b.onResize);b.onResize();b.cantouch||b.opt.touchbehavior?(b.onmousedown=function(c){if(b.locked)return b.cancelEvent(c);b.rail.drag={x:c.pageX,y:c.pageY,sx:b.scroll.x,sy:b.scroll.y,st:b.getScrollTop(),
-lx:c.pageX,ly:c.pageY,nx:c.pageX,ny:c.pageY,tt:(new Date).getTime(),lt:(new Date).getTime()};return b.cancelEvent(c)},b.onmouseup=function(c){if(b.rail.drag)return b.doScrollMomentum(b.rail.drag),b.rail.drag=false,b.cancelEvent(c)},b.onmousemove=function(c){if(b.rail.drag){var d=c.pageY-b.rail.drag.y;b.rail.drag.ly=b.rail.drag.ny;b.rail.drag.ny=c.pageY;b.rail.drag.lt=(new Date).getTime();b.scroll.y=Math.round((b.rail.drag.st-d)*(1/b.scrollratio.y));if(b.scroll.y<0)b.scroll.y=0;if(b.scroll.y>b.scrollvaluemax)b.scroll.y=
-b.scrollvaluemax;b.showCursor();b.doScrollTo(b.rail.drag.st-d,true);return b.cancelEvent(c)}},b.cursorgrabvalue&&b.win.css({cursor:b.cursorgrabvalue})):(b.onmousedown=function(c){if(b.locked)return b.cancelEvent(c);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)}});(b.cantouch||b.opt.touchbehavior)&&b.bind(b.win,"mousedown",b.onmousedown);b.bind(b.win,"mouseup",b.onmouseup);b.bind(b.rail,"mousedown",b.onmousedown);b.bind(b.rail,"mouseup",function(c){b.rail.drag=false;b.hideCursor();return b.cancelEvent(c)});b.bind(document,"mouseup",b.onmouseup);b.bind(document,"mousemove",b.onmousemove);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.ispage&&!b.cantouch&&(b.win.attr("tabindex")||b.win.attr({tabindex:(new Date).getTime()}),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){m=b.getTarget(c).id||true;b.hasmousefocus=true;b.noticeCursor()}),b.win.mouseleave(function(){m=false;b.hasmousefocus=false}));b.onkeypress=function(c){var c=c?c:window.e,d=b.getTarget(c);if(d&&/INPUT|TEXTAREA|SELECT/.test(d.nodeName)&&(!d.getAttribute("type")&&!d.type||!/submit|button|cancel/i.tp))return true;if(b.hasfocus||b.hasmousefocus&&!l||b.ispage&&!l&&!m){d=c.keyCode;if(b.locked&&d!=27)return b.cancelEvent(c);var e=true;switch(d){case 38:case 63233:b.doScrollBy(72,
-true);e=false;break;case 40:case 63235:b.doScrollBy(-72,true);e=false;break;case 33:case 63276:b.doScrollBy(b.view.h,true);e=false;break;case 34:case 63277:b.doScrollBy(-b.view.h,true);e=false;break;case 36:case 63273:b.doScrollTo(0,true);e=false;break;case 35:case 63275:b.doScrollTo(b.page.h,true);e=false;break;case 27:b.zoomactive&&(b.doZoom(),e=false)}if(!e)return b.cancelEvent(c)}};b.bind(document,b.isopera?"keypress":"keydown",b.onkeypress)}if(this.doc[0].nodeName=="IFRAME"){var e=function(){var c=
-"contentDocument"in this?this.contentDocument:this.contentWindow.document;if(b.isiframe)b.docscroll=g(c),b.iframe={html:b.doc.contents().find("html")[0],body:b.doc.contents().find("body")[0]};if(b.opt.iframeautoresize&&!b.isiframe){b.win.scrollTop(0);b.doc.height("");var d=b.doc.contents(),d=Math.max(d.find("html").attr("scrollHeight"),d.find("body").attr("scrollHeight"));b.doc.height(d)}b.onResize();b.isie7&&g(c).find("html").css({"overflow-y":"hidden"});g(c.body).css({"overflow-y":"hidden"});"contentWindow"in
-this?b.bind(this.contentWindow,"scroll",b.onscroll):b.bind(c,"scroll",b.onscroll);b.bind(c,"mouseup",b.onmouseup);b.bind(c,"mousewheel",b.onmousewheel);b.bind(c,b.isopera?"keypress":"keydown",b.onkeypress);if(b.cantouch||b.opt.touchbehavior)b.bind(c,"mousedown",b.onmousedown),b.cursorgrabvalue&&g(c).css({cursor:b.cursorgrabvalue});b.bind(c,"mousemove",b.onmousemove);b.zoom&&(b.opt.dblclickzoom&&b.bind(c,"dblclick",b.doZoom),b.cantouch&&b.opt.gesturezoom&&b.bind(c,"gesturechange",function(c){c.scale>
-1.5&&b.doZoomIn(c);c.scale<0.8&&b.doZoomOut(c);return b.cancelEvent(c)}))};this.doc[0].readyState&&this.doc[0].readyState=="complete"&&setTimeout(function(){e.call(b.doc[0],false)},500);this.doc.load(e)}};this.showCursor=function(){if(b.cursortimeout)clearTimeout(b.cursortimeout),b.cursortimeout=0;b.rail&&(b.autohidedom&&b.autohidedom.stop().css({opacity:b.opt.cursoropacitymax}),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||800)};this.noticeCursor=function(c){b.showCursor();b.hideCursor(c)};this.getContentSize=function(){var c=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};c.w-=1;c.h-=1;return c};this.onAttributeChange=function(c){if(c&&c.target){if(c.target!==b.win[0]&&
-c.target!==b.doc[0])return true;if((c="attrChange"in c?c.attrName:"propertyName"in c?c.propertyName:false)&&/width|height|style|block/i.test(c)){if(b.lastattributechange)b.lastattributechange=clearTimeout(b.lastattributechange);b.lastattributechange=setTimeout(function(){b.lastattributechange=0;b.onResize()},60)}}};this.onResize=function(){if(!b.haswrapper&&!b.ispage){var c=b.win.css("display")!="none";c&&!b.visibility&&b.show();!c&&b.visibility&&b.hide();if(!b.visibility)return false}b.view={w:b.ispage?
-b.win.width():b.win.innerWidth(),h:b.ispage?b.win.height():b.win.innerHeight()};b.page=b.getContentSize();if(b.view.h>=b.page.h)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.scrollvaluemax=
-b.view.h-b.cursorheight-b.cursor.hborder-2;b.scrollratio={x:0,y:(b.page.h-b.view.h)/b.scrollvaluemax};b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y));b.noticeCursor()};this.bind=function(c,d,e,f){var g=c.length?c[0]:c;g.addEventListener?(b.cantouch&&/mouseup|mousedown|mousemove/.test(d)&&g.addEventListener(d=="mousedown"?"touchstart":d=="mouseup"?"touchend":"touchmove",function(b){if(b.touches.length<2){var c=b.touches.length>0?b.touches[0]:b;c.original=b;e.call(this,c)}},f||false),g.addEventListener(d,
-e,f||false),d=="mousewheel"&&g.addEventListener("DOMMouseScroll",e,f||false),b.cantouch&&d=="mouseup"&&g.addEventListener("touchcancel",e,f||false)):g.attachEvent?g.attachEvent("on"+d,function(c){if(c&&!("pageY"in c)&&"screenY"in c)c.pageX=c.screenX,c.pageY=c.screenY;return e.call(g,c)===false||f===false?b.cancelEvent(c):true}):g["on"+d]=function(c){return e.call(g,c)===false||f===false?b.cancelEvent(c):true}};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(){b.visibility=true;b.rail.css("display","block")};this.hide=function(){b.visibility=false;b.rail.css("display","none")};this.onmousewheel=function(c){if(b.locked)return b.cancelEvent(c);c=c?c:window.event;if(b.rail.drag)return b.cancelEvent(c);var d=0;(d=c.detail?c.detail*-1:c.wheelDelta/40)&&b.doScrollBy(d*b.opt.mousescrollstep,
-true);return b.cancelEvent(c)};this.stop=function(){b.timer&&n(b.timer);b.timer=0;b.cursorfreezed=false;b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y));b.noticeCursor()};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)),c=c>20?b.prefixstyle+"transform "+c+"ms ease-out 0s":"";if(!b.lasttransitionstyle||b.lasttransitionstyle!=c)b.lasttransitionstyle=c,b.doc.css(b.transitionstyle,
-c)},this.doScroll=function(c){b.newscrolly=c;if(!b.timer)b.timer=setTimeout(function(){var c=b.getScrollTop();b.prepareTransition(c>b.newscrolly?c-b.newscrolly:b.newscrolly-c);b.setScrollTop(b.newscrolly);b.timer=0},b.opt.scrollspeed),b.noticeCursor()}):this.doScroll=function(c){function d(){g=(new Date).getTime();if(g<f)return b.timer=k(d);f=(new Date).getTime()+b.opt.scrollspeed;g=0;var c=b.newscrolly-b.getScrollTop(),c=c>0?Math.ceil(c*e):Math.floor(c*e),c=b.getScrollTop()+c;b.setScrollTop(c);c==
-b.newscrolly?(b.timer=0,b.cursorfreezed=false):b.timer=k(d)}b.newscrolly=c;if(!b.timer){var e=0.25,g=0,f=0;b.timer=k(d);b.noticeCursor()}};this.doScrollBy=function(c,d){d&&(c=Math.round(c*1/b.scrollratio.y));var e=b.scroll.y-c;e<0&&(e=0);var g=b.scrollvaluemax;e>g&&(e=g);b.cursorfreezed=false;b.doScroll(Math.floor(e*b.scrollratio.y))};this.doScrollTo=function(c,d){ny=d?Math.round(c*1/b.scrollratio.y):c;ny<0&&(c=0);var e=b.scrollvaluemax;ny>e&&(c=d?Math.round(e*b.scrollratio.y):e);b.cursorfreezed=
-false;b.doScroll(d?c:Math.round(c*b.scrollratio.y))};this.doScrollMomentum=function(c){var d=c.ly-c.ny,c=(new Date).getTime()-c.lt;(d=Math.floor(d*3/((c+1)*0.2)))&&b.doScrollBy(d,true)};b.onscroll=function(){var c=(new Date).getTime();if(!b.lastcontentcheck||b.lastcontentcheck<c)if(b.lastcontentcheck=c+500,b.getContentSize().h!=b.page.h)b.onResize();if(!b.rail.drag){if(!b.cursorfreezed)b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y));b.noticeCursor()}};b.docscroll.scroll(function(c){b.onscroll(c)});
-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,f;for(f in d){var h=d[f];b.zoomrestore.style[h]=typeof e[h]!="undefined"?e[h]:""}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=
-g(window).scrollTop(),g(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&&g(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:g(window).width()-b.zoomrestore.padding.w+
-"px",height:g(window).height()-b.zoomrestore.padding.h+"px"});b.setScrollTop(c);b.onResize()}};this.init()};g.fn.niceScroll=function(f,b){typeof f=="object"&&typeof b=="undefined"&&(b=f,f=false);var h=[];typeof b=="undefined"&&(b={});if(f)b.doc=g(f),b.win=g(this);var i=!("doc"in b);this.each(function(){var f=g(this).data("__nicescroll")||false;if(!f)b.doc=i?g(this):b.doc,f=new q(b),g(this).data("__nicescroll",f);h.push(f)});return h.length==1?h[0]:h};var j=jQuery.fn.scrollTop;g.cssHooks.scrollTop=
-{get:function(f){var b=g.data(f,"__nicescroll")||false;return b&&b.ishwscroll?b.getScrollTop():j.call(f)},set:function(f,b){var h=g.data(f,"__nicescroll")||false;h&&h.ishwscroll?h.setScrollTop(parseInt(b)):j.call(f,b);return this}};jQuery.fn.scrollTop=function(f){if(typeof f=="undefined"){var b=g.data(this,"__nicescroll")||false;return b&&b.ishwscroll?b.getScrollTop():j.call(this)}else return this.each(function(){var b=g.data(this,"__nicescroll")||false;b&&b.ishwscroll?b.setScrollTop(parseInt(f)):
-j.call(g(this),f)})};jQuery.fn.getNiceScroll=function(f){if(typeof f=="undefined"){for(a=0;a<this.length;a++)if(f=g.data(this[a],"__nicescroll")||false)return f;return false}else return f=g.data(this[f],"__nicescroll")||false}})(jQuery);
+(function(e){var l=false,n=false,q=5E3,r=2E3,s=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("/")+"/":""}(),v=function(g,d){var b=this;this.version="2.5.0";this.name="nicescroll";this.me=d;this.opt={doc:e("body"),win:false,zindex:9E3,cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"5px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:60,mousescrollstep:48,
+touchbehavior:false,hwacceleration:true,usetransition:true,boxzoom:false,dblclickzoom:true,gesturezoom:true,grabcursorenabled:true,autohidemode:true,background:"",iframeautoresize:true,cursorminheight:20};if(g)for(var i in b.opt)g[i]!==void 0&&(b.opt[i]=g[i]);this.id=b.opt.doc[0].id||"";this.doc=b.opt.doc;this.ispage=b.doc[0].nodeName=="BODY"||b.doc[0].nodeName=="HTML";this.haswrapper=b.opt.win!==false;this.win=b.opt.win||(this.ispage?e(window):this.doc);this.docscroll=this.ispage?e(window):this.win;
+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.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"+r++;while(document.getElementById(this.id));this.hasmousefocus=this.hasfocus=this.zoomactive=this.zoom=this.cursorfreezed=
+this.cursor=this.rail=false;this.visibility=true;this.locked=false;this.events=[];this.saved={};var h=document.createElement("DIV");this.isopera="opera"in window;this.isieold=(this.isie="all"in document&&"attachEvent"in h&&!this.isopera)&&!("msInterpolationMode"in h.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 h.style;(this.cantouch="ontouchstart"in document.documentElement)&&/iphone|ipad|ipod/i.test(navigator.platform)?(this.isios=true,this.isios4=!("seal"in Object)):this.isios4=this.isios=false;if(b.opt.hwacceleration){if((this.trstyle=window.opera?"OTransform":document.all?"msTransform":h.style.webkitTransform!==void 0?"webkitTransform":h.style.MozTransform!==void 0?"MozTransform":false)&&h.style[this.trstyle]===void 0)this.trstyle=false;if(this.hastransform=this.trstyle!=
+false)h.style[this.trstyle]="translate3d(1px,2px,3px)",this.hastranslate3d=/translate3d/.test(h.style[this.trstyle]);this.transitionstyle=false;this.prefixstyle="";this.transitionend=false;var o="transition,webkitTransition,MozTransition,OTransition,msTransition,KhtmlTransition".split(","),t=",-webkit-,-moz-,-o-,-ms-,-khtml-".split(","),j="transitionEnd,webkitTransitionEnd,transitionend,oTransitionEnd,msTransitionEnd,KhtmlTransitionEnd".split(",");for(i=0;i<o.length;i++)if(o[i]in h.style){this.transitionstyle=
+o[i];this.prefixstyle=t[i];this.transitionend=j[i];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(){if(!b.isie||b.isie9)for(var c=["grab","-moz-grab","-webkit-grab"],d=0;d<c.length;d++){var f=c[d];h.style.cursor=f;if(h.style.cursor==f)return f}return"url(http://www.google.com/intl/en_ALL/mapfiles/openhand.cur),n-resize"}();
+h=null;this.ishwscroll=b.hastransform&&b.opt.hwacceleration&&b.haswrapper;this.scrollTop=function(c){return c===void 0?b.getScrollTop():b.setScrollTop(c)};this.ishwscroll?(b.doc.translate={x:0,y:0},this.getScrollTop=function(){return b.doc.translate.y},this.setScrollTop=this.hastranslate3d?function(c,d){b.doc.css(b.trstyle,"translate3d(0px,"+c*-1+"px,0px)");b.doc.translate.y=c;if(!d)if(document.createEvent){var f=document.createEvent("UIEvents");f.initUIEvent("scroll",false,true,window,1);b.docscroll[0].dispatchEvent(f)}else f=
+document.createEventObject(),b.docscroll[0].fireEvent("onscroll"),f.cancelBubble=true}:function(c,d){b.doc.css(b.trstyle,"translate(0px,"+c*-1+"px)");b.doc.translate.y=c;if(!d)if(document.createEvent){var f=document.createEvent("UIEvents");f.initUIEvent("scroll",false,true,window,1);b.docscroll[0].dispatchEvent(f)}else f=document.createEventObject(),b.docscroll[0].fireEvent("onscroll"),f.cancelBubble=true}):(this.getScrollTop=function(){return b.docscroll.scrollTop()},this.setScrollTop=function(c){return b.docscroll.scrollTop(c)});
+this.getTarget=function(b){return!b?false:b.target?b.target:b.srcElement?b.srcElement:false};this.hasParent=function(b,d){if(!b)return false;for(var f=b.target||b.srcElement||b||false;f&&f.id!=d;)f=f.parentNode||false;return f!==false};this.updateScrollBar=function(c){if(b.ishwscroll)b.rail.css({height:b.win.innerHeight()});else{var d=b.win.offset();d.top+=2;var f=(b.win.outerWidth()-b.win.innerWidth())/2;d.left+=b.win.innerWidth()+f-b.rail.width-1;b.rail.css({position:"absolute",top:d.top,left:d.left,
+height:c?c.h:b.win.innerHeight()});b.zoom&&b.zoom.css({position:"absolute",top:d.top+1,left:d.left-20})}};var k=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||false,m=window.cancelRequestAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||false;b.hasanimationframe=k;
+b.hascancelanimationframe=m;b.hasanimationframe?b.hascancelanimationframe||(m=function(){b.cancelAnimationFrame=true}):(k=function(b){return setTimeout(b,1E3/60)},m=clearInterval);this.init=function(){b.saved.css=[];b.ispage&&b.saved.css.push([b.doc,"overflow-y",b.doc.css("overflow-y")]);b.ispage||b.saved.css.push([b.docscroll,"overflow-y",b.docscroll.css("overflow-y")]);b.ispage&&b.isie7&&b.saved.css.push([e("html"),"overflow-y",e("html").css("overflow-y")]);if(!b.ispage||!b.cantouch&&!b.isieold){b.ispage?
+b.doc.css({"overflow-y":"hidden"}):b.docscroll.css({"overflow-y":"hidden"});b.ispage&&b.isie7&&e("html").css({"overflow-y":"hidden"});var c=e(document.createElement("div"));c.css({position:"relative",top:0,"float":"right",width:b.opt.cursorwidth,height:"0px","background-color":b.opt.cursorcolor,border:b.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":b.opt.cursorborderradius,"-moz-border-radius":b.opt.cursorborderradius,"border-radius":b.opt.cursorborderradius});c.hborder=
+parseFloat(c.outerHeight()-c.innerHeight());b.cursor=c;var d=e(document.createElement("div"));d.attr("id",b.id);d.width=3+Math.max(parseFloat(b.opt.cursorwidth),c.outerWidth());d.css({"padding-left":"0px","padding-right":"1px",width:d.width+"px",zIndex:b.ispage?b.opt.zindex:b.opt.zindex+2,background:b.opt.background});d.append(c);b.rail=d;c=false;if(b.opt.boxzoom&&!b.ispage&&!b.isieold)c=document.createElement("div"),b.bind(c,"click",b.doZoom),b.zoom=e(c),b.zoom.css({cursor:"pointer","z-index":b.opt.zindex,
+backgroundImage:"url("+s+"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.bind(b.win,"gestureend",function(c){c.scale>1.5&&b.doZoomIn(c);c.scale<0.8&&b.doZoomOut(c);return b.cancelEvent(c)});b.ispage?(d.css({position:"fixed",top:"0px",right:"0px",height:"100%"}),b.doc.append(d)):b.ishwscroll?(b.win.css("position")=="static"&&b.win.css("position","relative"),b.zoom&&(b.zoom.css({position:"absolute",
+top:1,right:0,"margin-right":d.width+4}),b.win.append(b.zoom)),d.css({position:"absolute",top:0,right:0}),b.win.append(d)):(b.updateScrollBar(),e("body").append(d),b.zoom&&e("body").append(b.zoom));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.bind(window,"resize",b.onResize);b.bind(window,"orientationchange",b.onResize);!b.ispage&&!b.haswrapper&&b.bind(b.win,b.isie&&!b.isie9?"propertychange":
+"DOMAttrModified",b.onAttributeChange);!b.ispage&&b.opt.boxzoom&&e(window).resize(b.resizeZoom);b.istextarea&&b.win.mouseup(b.onResize);b.onResize();b.cantouch||b.opt.touchbehavior?(b.scrollmom={y:new u(b)},b.onmousedown=function(c){if(!b.locked&&(b.cancelScroll(),b.rail.drag={x:c.pageX,y:c.pageY,sx:b.scroll.x,sy:b.scroll.y,st:b.getScrollTop()},b.hasmoving=false,b.scrollmom.y.reset(c.pageY),!b.cantouch))return b.cancelEvent(c)},b.onmouseup=function(c){if(b.rail.drag&&(b.scrollmom.y.doMomentum(),b.rail.drag=
+false,b.hasmoving))return b.hasmoving=false,b.cancelEvent(c)},b.onmousemove=function(c){if(b.rail.drag){b.hasmoving=true;var d=c.pageY-b.rail.drag.y;b.scrollmom.y.update(c.pageY);b.showCursor(b.rail.drag.st-d);b.prepareTransition&&b.prepareTransition(0);b.setScrollTop(b.rail.drag.st-d);return b.cancelEvent(c)}},b.cursorgrabvalue&&(b.saved.css.push([b.win,"cursor",b.win.css("cursor")]),b.win.css({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)}});(b.cantouch||b.opt.touchbehavior)&&b.bind(b.win,
+"mousedown",b.onmousedown);b.bind(b.win,"mouseup",b.onmouseup);b.bind(b.rail,"mousedown",b.onmousedown);b.bind(b.rail,"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.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.ispage&&!b.cantouch&&(b.win.attr("tabindex")||b.win.attr({tabindex:q++}),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){n=b.getTarget(c).id||true;b.hasmousefocus=true;b.noticeCursor()}),b.win.mouseleave(function(){n=false;b.hasmousefocus=false}));b.onkeypress=function(c){var c=c?c:window.e,d=b.getTarget(c);
+if(d&&/INPUT|TEXTAREA|SELECT/.test(d.nodeName)&&(!d.getAttribute("type")&&!d.type||!/submit|button|cancel/i.tp))return true;if(b.hasfocus||b.hasmousefocus&&!l||b.ispage&&!l&&!n){d=c.keyCode;if(b.locked&&d!=27)return b.cancelEvent(c);var f=true;switch(d){case 38:case 63233:b.doScrollBy(72,true);f=false;break;case 40:case 63235:b.doScrollBy(-72,true);f=false;break;case 33:case 63276:b.doScrollBy(b.view.h,true);f=false;break;case 34:case 63277:b.doScrollBy(-b.view.h,true);f=false;break;case 36:case 63273:b.doScrollTo(0,
+true);f=false;break;case 35:case 63275:b.doScrollTo(b.page.maxh,true);f=false;break;case 27:b.zoomactive&&(b.doZoom(),f=false)}if(!f)return b.cancelEvent(c)}};b.bind(document,b.isopera?"keypress":"keydown",b.onkeypress)}if(this.doc[0].nodeName=="IFRAME"){var f=function(){var c="contentDocument"in this?this.contentDocument:this.contentWindow.document;if(b.isiframe)b.docscroll=e(c),b.iframe={html:b.doc.contents().find("html")[0],body:b.doc.contents().find("body")[0]};if(b.opt.iframeautoresize&&!b.isiframe){b.win.scrollTop(0);
+b.doc.height("");var d=b.doc.contents(),d=Math.max(d.find("html").attr("scrollHeight"),d.find("body").attr("scrollHeight"));b.doc.height(d)}b.onResize();b.isie7&&b.saved.css.push([e(c).find("html"),"overflow-y",e(c).find("html").css("overflow-y")]);b.saved.css.push([e(c.body),"overflow-y",e(c.body).css("overflow-y")]);b.isie7&&e(c).find("html").css({"overflow-y":"hidden"});e(c.body).css({"overflow-y":"hidden"});"contentWindow"in this?b.bind(this.contentWindow,"scroll",b.onscroll):b.bind(c,"scroll",
+b.onscroll);b.bind(c,"mouseup",b.onmouseup);b.bind(c,"mousewheel",b.onmousewheel);b.bind(c,b.isopera?"keypress":"keydown",b.onkeypress);if(b.cantouch||b.opt.touchbehavior)b.bind(c,"mousedown",b.onmousedown),b.cursorgrabvalue&&(b.saved.css.push([e(c),"cursor",e(c).css("cursor")]),e(c).css({cursor:b.cursorgrabvalue}));b.bind(c,"mousemove",b.onmousemove);b.zoom&&(b.opt.dblclickzoom&&b.bind(c,"dblclick",b.doZoom),b.cantouch&&b.opt.gesturezoom&&b.bind(c,"gesturechange",function(c){c.scale>1.5&&b.doZoomIn(c);
+c.scale<0.8&&b.doZoomOut(c);return b.cancelEvent(c)}))};this.doc[0].readyState&&this.doc[0].readyState=="complete"&&setTimeout(function(){f.call(b.doc[0],false)},500);this.doc.load(f)}};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||800)};this.noticeCursor=function(c){b.showCursor();b.hideCursor(c)};this.getContentSize=function(){var c=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};c.w-=1;c.h-=1;return c};this.onAttributeChange=function(c){if(c&&
+c.target){if(c.target!==b.win[0]&&c.target!==b.doc[0])return true;if((c="attrChange"in c?c.attrName:"propertyName"in c?c.propertyName:false)&&/width|height|style|block/i.test(c)){if(b.lastattributechange)b.lastattributechange=clearTimeout(b.lastattributechange);b.lastattributechange=setTimeout(function(){b.lastattributechange=0;b.onResize()},60)}}};this.resize=this.onResize=function(){if(!b.haswrapper&&!b.ispage){var c=b.win.css("display")!="none";c&&!b.visibility&&b.show();!c&&b.visibility&&b.hide();
+if(!b.visibility)return false}b.view={w:b.ispage?b.win.width():b.win.innerWidth(),h:b.ispage?b.win.height():b.win.innerHeight()};b.page=b.getContentSize();b.page.maxh=b.page.h-b.view.h;if(b.view.h>=b.page.h)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-2;b.scrollratio={x:0,y:(b.page.h-b.view.h)/b.scrollvaluemax};b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y));b.noticeCursor();return b};this._bind=function(c,d,f,e){b.events.push({e:c,n:d,f:f});c.addEventListener?c.addEventListener(d,f,e||false):c.attachEvent?c.attachEvent("on"+d,f):c["on"+d]=f};this.bind=function(c,
+d,f,e){var g=c.length?c[0]:c;g.addEventListener?(b.cantouch&&/mouseup|mousedown|mousemove/.test(d)&&b._bind(g,d=="mousedown"?"touchstart":d=="mouseup"?"touchend":"touchmove",function(b){if(b.touches.length<2){var c=b.touches.length>0?b.touches[0]:b;c.original=b;f.call(this,c)}},e||false),b._bind(g,d,f,e||false),d=="mousewheel"&&b._bind(g,"DOMMouseScroll",f,e||false),b.cantouch&&d=="mouseup"&&b._bind(g,"touchcancel",f,e||false)):b._bind(g,d,function(c){if(c&&!("pageY"in c)&&"screenY"in c)c.pageX=c.screenX,
+c.pageY=c.screenY;return f.call(g,c)===false||e===false?b.cancelEvent(c):true})};this._unbind=function(b,d,f){b.removeEventListener?b.removeEventListener(d,f,false):b.detachEvent?b.detachEvent("on"+d,f):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(){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.onmousewheel=function(c){if(b.locked)return b.cancelEvent(c);c=c?c:window.event;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,true);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)),c=c>20?b.prefixstyle+"transform "+c+"ms ease-out 0s":"";if(!b.lasttransitionstyle||b.lasttransitionstyle!=c)b.lasttransitionstyle=c,b.doc.css(b.transitionstyle,c)},this.doScroll=function(c){b.newscrolly=c;if(b.timer)return false;b.timer=setTimeout(function(){var c=b.getScrollTop(),c=Math.abs(c-b.newscrolly);b.prepareTransition(c);b.timer=setTimeout(function(){b.setScrollTop(b.newscrolly);
+b.timer=0},15)},b.opt.scrollspeed);b.noticeCursor()},this.cancelScroll=function(){var c=b.getScrollTop();b.prepareTransition(0);b.setScrollTop(c);b.noticeCursor();return b}):(this.doScroll=function(c){function d(){if(b.cancelAnimationFrame)return true;g=(new Date).getTime();if(g<h)return b.timer=k(d)||1;h=Math.floor((new Date).getTime()+b.opt.scrollspeed/2);g=0;var c=b.getScrollTop();if(b.newspeedy)if(c+=b.newspeedy.v,b.newspeedy.v>0){if(c>=b.newspeedy.x)b.newspeedy=false}else{if(c<=b.newspeedy.x)b.newspeedy=
+false}else c=b.newscrolly-b.getScrollTop(),c=c>0?Math.ceil(c*e):Math.floor(c*e),c=b.getScrollTop()+c;b.setScrollTop(c);c==b.newscrolly?(b.timer=0,b.cursorfreezed=false):b.timer=k(d)||1}b.newscrolly=c;var f=c-b.getScrollTop();b.newspeedy=f*f>100?{x:c-Math.round(f/6),v:Math.round(f/6*5/8)+1}:false;if(!b.timer){var e=0.25,g=0,h=0;b.cancelAnimationFrame=false;b.timer=k(d)||1;b.noticeCursor()}},this.cancelScroll=function(){b.timer&&m(b.timer);b.timer=0;return b});this.doScrollBy=function(c,d){var f=0,
+f=d?b.timer?b.newscrolly-c:b.getScrollTop()-c:Math.floor((b.scroll.y-c)*b.scrollratio.y);if(f<0)f=0;else if(f>b.page.maxh)f=b.page.maxh;b.cursorfreezed=false;b.doScroll(f)};this.doScrollTo=function(c,d){d||Math.round(c*b.scrollratio.y);b.cursorfreezed=false;b.doScroll(c)};b.onscroll=function(){var c=(new Date).getTime();if(!b.lastcontentcheck||b.lastcontentcheck<c)if(b.lastcontentcheck=c+500,b.getContentSize().h!=b.page.h)b.onResize();if(!b.rail.drag){if(!b.cursorfreezed)b.scroll.y=Math.round(b.getScrollTop()*
+(1/b.scrollratio.y));b.noticeCursor()}};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(","),f=b.win[0].style,g;for(g in d){var h=d[g];b.zoomrestore.style[h]=typeof f[h]!="undefined"?f[h]:""}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=e(window).scrollTop(),e(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&&e(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:e(window).width()-b.zoomrestore.padding.w+"px",height:e(window).height()-b.zoomrestore.padding.h+"px"});b.setScrollTop(c);b.onResize()}};this.init()},u=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 i=b-d.lasty,h=e.getScrollTop()+
+i;d.snapy=h<0||h>d.nc.page.maxh;d.speedy=i;d.lasty=b};this.stop=function(){if(d.timer)clearTimeout(d.timer),d.timer=0};this.doSnapy=function(b){b<0?d.nc.doScrollTo(0,true):b>d.nc.page.maxh&&d.nc.doScrollTo(d.nc.page.maxh,true)};this.doMomentum=function(){var b=d.lasttime,e=d.time();d.speedy=Math.min(200,d.speedy);if(d.speedy&&b&&e-b<=50&&d.speedy){var g=e-b;d.demuly=0;var j=function(){var b=Math.floor(d.nc.getScrollTop()-d.speedy*(1-d.demuly));d.demuly+=0.02;d.nc.setScrollTop(b);d.nc.showCursor(b);
+d.demuly<1?d.timer=setTimeout(j,g):(d.timer=0,d.nc.hideCursor(),d.doSnapy(b))};j()}else d.snapy&&d.doSnapy(d.nc.getScrollTop())}},j=jQuery.fn.scrollTop;e.cssHooks.scrollTop={get:function(g){var d=e.data(g,"__nicescroll")||false;return d&&d.ishwscroll?d.getScrollTop():j.call(g)},set:function(g,d){var b=e.data(g,"__nicescroll")||false;b&&b.ishwscroll?b.setScrollTop(parseInt(d)):j.call(g,d);return this}};jQuery.fn.scrollTop=function(g){if(typeof g=="undefined"){var d=e.data(this,"__nicescroll")||false;
+return d&&d.ishwscroll?d.getScrollTop():j.call(this)}else return this.each(function(){var b=e.data(this,"__nicescroll")||false;b&&b.ishwscroll?b.setScrollTop(parseInt(g)):j.call(e(this),g)})};var p=function(g){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.show=function(){return d.each(function(){this.show()})};this.hide=function(){return d.each(function(){this.hide()})};this.onResize=function(){return d.each(function(){this.onResize()})};
+this.resize=function(){return d.each(function(){this.resize()})};this.remove=function(){return d.each(function(){this.remove()})};this.stop=function(){return d.each(function(){this.stop()})};this.push=function(b){d[d.length]=b;d.length++};this.eq=function(b){return d[b]};if(g)for(a=0;a<g.length;a++){var b=e.data(g[a],"__nicescroll")||false;b&&(this[this.length]=b,this.length++)}return this};jQuery.fn.getNiceScroll=function(g){return typeof g=="undefined"?this.length>0?new p(this):e.data(this,"__nicescroll")||
+false:e.data(this[g],"__nicescroll")||false};jQuery.extend(jQuery.expr[":"],{nicescroll:function(g){return e.data(g,"__nicescroll")||false}});e.fn.niceScroll=function(g,d){typeof g=="object"&&typeof d=="undefined"&&(d=g,g=false);var b=new p;typeof d=="undefined"&&(d={});if(g)d.doc=e(g),d.win=e(this);var i=!("doc"in d);this.each(function(){var g=e(this).data("__nicescroll")||false;if(!g)d.doc=i?e(this):d.doc,g=new v(d,e(this)),e(this).data("__nicescroll",g);b.push(g)});return b.length==1?b[0]:b}})(jQuery);

BIN
demo/js/zoomico.png


+ 0 - 7
fastlane_2.3.1.txt

@@ -1,7 +0,0 @@
-jquery.nicescroll
-version 2.3.1 FASTLANE
-FASTLANE is a bleeding edge version, not fully tested, only for last-hours issue fix
-
-Fixing
-- compatibility with jquery.mobile and other library using touch events to create custom events
-- tabindex numbering assigned more consistent

+ 0 - 1048
jquery.nicescroll.fl.js

@@ -1,1048 +0,0 @@
-/* jquery.nicescroll
--- version 2.3.1 FASTLANE
--- FASTLANE is a bleeding edge version, not fully tested, only for last-hours issue fix
--- copyright 2011 InuYaksa*2011
--- licensed under the MIT
---
--- http://areaaperta.com/nicescroll
--- https://github.com/inuyaksa/jquery.nicescroll
---
-*/
-
-(function($){
-
-  // globals
-  var domfocus = false;
-  var mousefocus = false;
-  var zoomactive = false;  
-  var tabindexcounter = 5000;
- 
-  // http://stackoverflow.com/questions/2161159/get-script-path
-  function getScriptPath() {
-    var scripts= document.getElementsByTagName('script');
-    var path= scripts[scripts.length-1].src.split('?')[0];
-    return (path.split('/').length>0) ? path.split('/').slice(0,-1).join('/')+'/' : '';
-  }
-  var scriptpath = getScriptPath();
-
-  
-  var NiceScrollClass = function(myopt) {
-
-    var self = this;
-
-    this.version = '2.3.1-FL';
-    this.name = 'nicescroll';
-    
-    this.opt = {
-      doc:$("body"),
-      win:false,
-      zindex:9000,
-      cursoropacitymin:0,
-      cursoropacitymax:1,
-      cursorcolor:"#424242",
-      cursorwidth:"5px",
-      cursorborder:"1px solid #fff",
-      cursorborderradius:"5px",
-      scrollspeed:60,
-      mousescrollstep:8*6,
-      touchbehavior:false,
-      hwacceleration:true,
-      usetransition:true,
-      boxzoom:false,
-      dblclickzoom:true,
-      gesturezoom:true,
-      grabcursorenabled:true,
-      autohidemode:true,
-      background:"",
-      iframeautoresize:true
-    };
-    
-    if (myopt||false) {
-      for(var a in self.opt) {
-        if (myopt[a]!==undefined) self.opt[a] = myopt[a];
-      }
-    }
-    
-    this.id = self.opt.doc[0].id||'';
-    this.doc = self.opt.doc;
-    this.ispage = (self.doc[0].nodeName=='BODY'||self.doc[0].nodeName=='HTML');  
-    this.haswrapper = (self.opt.win!==false);
-    this.win = self.opt.win||(this.ispage?$(window):this.doc);
-    this.docscroll = this.ispage?$(window):this.win;
-
-    this.iframe = false;
-    this.isiframe = ((this.doc[0].nodeName == 'IFRAME') && (this.win[0].nodeName == 'IFRAME'));
-    
-    this.istextarea = (this.win[0].nodeName == 'TEXTAREA');
-
-// Events jump table    
-    this.onmousedown = false;
-    this.onmouseup = false;
-    this.onmousemove = false;
-    this.onmousewheel = false;
-    this.onkeypress = false;
-    
-    
-// Let's start!  
-    this.view = false;
-    this.page = false;
-    
-    this.scroll = {x:0,y:0};
-    this.scrollratio = {x:0,y:0};    
-    this.cursorheight = 20;
-    this.scrollvaluemax = 0;
-    
-    do {
-      this.id = "ascrail"+Math.round(Math.random() * 99999);
-    } while (document.getElementById(this.id));
-    
-    this.rail = false;
-    this.cursor = false;
-    this.cursorfreezed = false;  
-    
-    this.zoom = false;
-    this.zoomactive = false;
-    
-    this.hasfocus = false;
-    this.hasmousefocus = false;
-    
-    this.visibility = true;
-    this.locked = false;
-    
-    var domtest = document.createElement('DIV');
-    
-    this.isopera = ("opera" in window);
-    
-    this.isie = (("all" in document) && ("attachEvent" in domtest) && !this.isopera);
-    this.isieold = (this.isie && !("msInterpolationMode" in domtest.style));  // IE6 and older
-    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 domtest.style);
-    
-    this.cantouch = ("ontouchstart" in document.documentElement);
-
-    if (this.cantouch && /iphone|ipad|ipod/i.test(navigator.platform)) {
-      this.isios = true;
-      this.isios4 = !("seal" in Object);
-    } else {
-      this.isios = false;
-      this.isios4 = false;
-    }
-    
-    if (self.opt.hwacceleration) {  // if you dont need dont bother to look for
-      this.trstyle = (window.opera) ? 'OTransform' : (document.all) ? 'msTransform' : (domtest.style.webkitTransform!==undefined) ? 'webkitTransform' : (domtest.style.MozTransform!==undefined) ? 'MozTransform' : false;
-      if (this.trstyle && domtest.style[this.trstyle] === undefined) this.trstyle = false;
-      this.hastransform = (this.trstyle != false);
-      if (this.hastransform) {
-        domtest.style[this.trstyle] = "translate3d(1px,2px,3px)";
-        this.hastranslate3d = /translate3d/.test(domtest.style[this.trstyle]);
-      }
-      
-      this.transitionstyle = false;
-      this.prefixstyle = '';
-      this.transitionend = false;
-      var check = ['transition','webkitTransition','MozTransition','OTransition','msTransition','KhtmlTransition'];
-      var prefix = ['','-webkit-','-moz-','-o-','-ms-','-khtml-'];
-      var evs = ['transitionEnd','webkitTransitionEnd','transitionend','oTransitionEnd','msTransitionEnd','KhtmlTransitionEnd'];
-      for(var a=0;a<check.length;a++) {
-        if (check[a] in domtest.style) {
-          this.transitionstyle = check[a];
-          this.prefixstyle = prefix[a];
-          this.transitionend = evs[a];
-          break;
-        }
-      }
-      this.hastransition = (this.transitionstyle);
-      
-    } else {
-      this.trstyle = false;
-      this.hastransform = false;
-      this.hastranslate3d = false;
-      this.transitionstyle = false;
-      this.hastransition = false;
-      this.transitionend = false;
-    }
-    
-    this.cursorgrabvalue = '';
-    
-    if (self.opt.grabcursorenabled&&self.opt.touchbehavior) {  // check grab cursor support
-      function detectCursorGrab() {
-        if (!self.isie||self.isie9) {  // some old IE return false positive
-          var lst = ['grab','-moz-grab','-webkit-grab'];
-          for(var a=0;a<lst.length;a++) {
-            var p = lst[a];
-            domtest.style['cursor']=p;
-            if (domtest.style['cursor']==p) return p;
-          }
-        }
-        return 'url(http://www.google.com/intl/en_ALL/mapfiles/openhand.cur),n-resize';
-      }
-      this.cursorgrabvalue = detectCursorGrab();
-    }
-
-    domtest = null;
-    
-    this.ishwscroll = (self.hastransform)&&(self.opt.hwacceleration)&&(self.haswrapper);
-    
-    this.scrollTop = function(val) {
-      return (val === undefined) ? self.getScrollTop() : self.setScrollTop(val);
-    };
-    
-    if (this.ishwscroll) {
-      // hw accelerated scroll
-      self.doc.translate = {x:0,y:0};
-      this.getScrollTop = function() {
-        return self.doc.translate.y;
-      };
-      if (this.hastranslate3d) {
-        this.setScrollTop = function(val,silent) {
-          self.doc.css(self.trstyle,"translate3d(0px,"+(val*-1)+"px,0px)");
-          self.doc.translate.y = val;
-          if (!silent) {
-            if (document.createEvent) {
-              var e = document.createEvent("UIEvents");
-              e.initUIEvent("scroll", false, true, window, 1);
-              self.docscroll[0].dispatchEvent(e);
-            } else {
-              var e = document.createEventObject();
-              self.docscroll[0].fireEvent("onscroll");
-              e.cancelBubble = true; 
-            }
-          }
-        };
-      } else {
-        this.setScrollTop = function(val,silent) {
-          self.doc.css(self.trstyle,"translate(0px,"+(val*-1)+"px)");
-          self.doc.translate.y = val;
-          if (!silent) {
-            if (document.createEvent) {
-              var e = document.createEvent("UIEvents");
-              e.initUIEvent("scroll", false, true, window, 1);
-              self.docscroll[0].dispatchEvent(e);
-            } else {
-              var e = document.createEventObject();
-              self.docscroll[0].fireEvent("onscroll");
-              e.cancelBubble = true; 
-            }
-          }
-        };
-      }
-    } else {
-      // native scroll
-      this.getScrollTop = function() {
-        return self.docscroll.scrollTop();
-      };
-      this.setScrollTop = function(val) {
-        return self.docscroll.scrollTop(val);
-      };
-    }
-    
-    this.getTarget = function(e) {
-      if (!e) return false;
-      if (e.target) return e.target;
-      if (e.srcElement) return e.srcElement;
-      return false;
-    };
-    
-    this.hasParent = function(e,id) {
-      if (!e) return false;
-      var el = e.target||e.srcElement||e||false;
-      while (el && el.id != id) {
-        el = el.parentNode||false;
-      }
-      return (el!==false);
-    };
-    
-    this.updateScrollBar = function(len) {
-      if (self.ishwscroll) {
-        self.rail.css({height:self.win.innerHeight()});
-      } else {
-        var pos = self.win.offset();
-        pos.top+=2;
-        var brd = (self.win.outerWidth() - self.win.innerWidth())/2;
-        pos.left+= self.win.innerWidth() + brd - self.rail.width - 1;
-        self.rail.css({position:"absolute",top:pos.top,left:pos.left,height:(len)?len.h:self.win.innerHeight()});
-        if (self.zoom) self.zoom.css({position:"absolute",top:pos.top+1,left:pos.left-20});
-      }
-    };
-    
-// derived by http://blog.joelambert.co.uk/2011/06/01/a-better-settimeoutsetinterval/
-    var setAnimationFrame = (function(){
-      return  window.requestAnimationFrame       || 
-              window.webkitRequestAnimationFrame || 
-              window.mozRequestAnimationFrame    || 
-              window.oRequestAnimationFrame      || 
-              window.msRequestAnimationFrame     || 
-              false;
-    })();
-    var clearAnimationFrame = (function(){
-      return  window.cancelRequestAnimationFrame       || 
-              window.webkitCancelRequestAnimationFrame || 
-              window.mozCancelRequestAnimationFrame    || 
-              window.oCancelRequestAnimationFrame      || 
-              window.msCancelRequestAnimationFrame     || 
-              false;
-    })();
-    
-    self.hasanimationframe = (setAnimationFrame);
-    self.hascancelanimationframe = (clearAnimationFrame);
-    
-    if (!self.hasanimationframe) setAnimationFrame=function(fn){return setTimeout(fn,1000/60)};
-    if (!self.hascancelanimationframe) clearAnimationFrame=clearInterval;
-    
-    this.init = function() {
-    
-      if (!self.ispage || (!self.cantouch && !self.isieold)) {
-
-        (self.ispage)?self.doc.css({'overflow-y':'hidden'}):self.docscroll.css({'overflow-y':'hidden'});
-        
-        if (self.ispage&&self.isie7) $("html").css({'overflow-y':'hidden'});  //IE7 double scrollbar issue
-        
-        var cursor = $(document.createElement('div'));
-        cursor.css({
-          position:"relative",top:0,"float":"right",width:self.opt.cursorwidth,height:"0px",
-          'background-color':self.opt.cursorcolor,
-          border:self.opt.cursorborder,
-          'background-clip':'padding-box',
-          '-webkit-border-radius':self.opt.cursorborderradius,
-          '-moz-border-radius':self.opt.cursorborderradius,
-          'border-radius':self.opt.cursorborderradius
-        });        
-        cursor.hborder = parseFloat(cursor.outerHeight() - cursor.innerHeight());        
-        self.cursor = cursor;        
-        
-        var rail = $(document.createElement('div'));
-        rail.attr('id',self.id);
-        rail.width = 3+Math.max(parseFloat(self.opt.cursorwidth),cursor.outerWidth());
-        rail.css({"padding-left":"0px","padding-right":"1px",width:rail.width+"px",'zIndex':(self.ispage)?self.opt.zindex:self.opt.zindex+2,"background":self.opt.background});
-        
-        rail.append(cursor);
-        
-        self.rail = rail;
-        
-        var zoom = false;
-        if (self.opt.boxzoom&&!self.ispage&&!self.isieold) {
-          zoom = document.createElement('div');          
-          self.bind(zoom,"click",self.doZoom);
-          self.zoom = $(zoom);
-          self.zoom.css({"cursor":"pointer",'z-index':self.opt.zindex,'backgroundImage':'url('+scriptpath+'zoomico.png)','height':18,'width':18,'backgroundPosition':'0px 0px'});
-          if (self.opt.dblclickzoom) self.bind(self.win,"dblclick",self.doZoom);
-          if (self.cantouch&&self.opt.gesturezoom) {
-            self.bind(self.win,"gestureend",function(e) {
-              if (e.scale>1.5) self.doZoomIn(e);
-              if (e.scale<0.8) self.doZoomOut(e);
-              return self.cancelEvent(e);
-            });             
-          }
-        }
-        
-        if (self.ispage) {
-          rail.css({position:"fixed",top:"0px",right:"0px",height:"100%"});
-          self.doc.append(rail);
-        } else {
-          if (self.ishwscroll) {
-            if (self.win.css('position')=='static') self.win.css('position','relative');
-            if (self.zoom) {
-              self.zoom.css({position:"absolute",top:1,right:0,"margin-right":rail.width+4});
-              self.win.append(self.zoom);
-            }
-            rail.css({position:"absolute",top:0,right:0});
-            self.win.append(rail);
-          } else {
-            self.updateScrollBar();
-            $("body").append(rail);           
-            if (self.zoom) $("body").append(self.zoom);
-          }
-        }
-        
-        if (self.opt.autohidemode===false) {
-          self.autohidedom = false;
-        }
-        else if (self.opt.autohidemode===true) {
-          self.autohidedom = self.rail;
-        }
-        else if (self.opt.autohidemode=="cursor") {
-          self.autohidedom = self.cursor;
-        }        
-        
-        self.bind(window,'resize',self.onResize);
-        self.bind(window,'orientationchange',self.onResize);
-        
-        if (!self.ispage&&!self.haswrapper) {
-          self.bind(self.win,(self.isie&&!self.isie9)?"propertychange":"DOMAttrModified",self.onAttributeChange);
-        }
-
-        if (!self.ispage&&self.opt.boxzoom) $(window).resize(self.resizeZoom);
-        if (self.istextarea) self.win.mouseup(self.onResize);
-        self.onResize();
-        
-        if (self.cantouch||self.opt.touchbehavior) {
-          self.onmousedown = function(e) {
-            if (!self.locked) {
-              self.rail.drag = {x:e.pageX,y:e.pageY,sx:self.scroll.x,sy:self.scroll.y,st:self.getScrollTop(),lx:e.pageX,ly:e.pageY,nx:e.pageX,ny:e.pageY,tt:(new Date()).getTime(),lt:(new Date()).getTime()};
-              self.hasmoving = false;
-              if (!self.cantouch) return self.cancelEvent(e);
-            }
-          };
-          self.onmouseup = function(e) {
-            if (self.rail.drag) {            
-              self.doScrollMomentum(self.rail.drag);
-              self.rail.drag = false;
-              if (self.hasmoving) {
-                self.hasmoving = false;
-                return self.cancelEvent(e);
-              }
-            }
-          };
-          self.onmousemove = function(e) {
-            if (self.rail.drag) {
-              self.hasmoving = true;            
-              var my = (e.pageY-self.rail.drag.y);
-              self.rail.drag.ly = self.rail.drag.ny;
-              self.rail.drag.ny = e.pageY;
-              self.rail.drag.lt = (new Date()).getTime();
-              
-              self.scroll.y = Math.round((self.rail.drag.st-my) * (1/self.scrollratio.y));
-              if (self.scroll.y<0) self.scroll.y=0;
-              if (self.scroll.y>self.scrollvaluemax) self.scroll.y=self.scrollvaluemax;
-              self.showCursor();
-              
-              self.doScrollTo(self.rail.drag.st-my,true);
-              return self.cancelEvent(e);
-            }
-          };
-          
-          if (self.cursorgrabvalue) self.win.css({'cursor':self.cursorgrabvalue});
-        } else {
-          self.onmousedown = function(e) {
-            if (self.locked) return self.cancelEvent(e);
-            self.rail.drag = {x:e.screenX,y:e.screenY,sx:self.scroll.x,sy:self.scroll.y};
-            return self.cancelEvent(e);
-          };
-          self.onmouseup = function(e) {
-            if (self.rail.drag) {
-              self.rail.drag = false;
-              return self.cancelEvent(e);
-            }
-          };        
-          self.onmousemove = function(e) {
-            if (self.rail.drag) {
-              self.scroll.y = self.rail.drag.sy + (e.screenY-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;
-              self.showCursor();
-              self.cursorfreezed = true;
-              self.doScroll(Math.round(self.scroll.y*self.scrollratio.y));          
-              return self.cancelEvent(e);
-            }
-          };
-        }
-
-        if (self.cantouch||self.opt.touchbehavior) self.bind(self.win,"mousedown",self.onmousedown);
-        self.bind(self.win,"mouseup",self.onmouseup);
-        
-        self.bind(self.rail,"mousedown",self.onmousedown);          
-        self.bind(self.rail,"mouseup",function(e) {
-          self.rail.drag = false;
-          self.hasmoving = false;
-          self.hideCursor();
-          return self.cancelEvent(e);
-        });
-        
-        self.bind(document,"mouseup",self.onmouseup);
-        self.bind(document,"mousemove",self.onmousemove);
-        
-        if (!self.cantouch) {
-          self.rail.mouseenter(function() {
-            self.showCursor();
-            self.rail.active = true;
-          });
-          self.rail.mouseleave(function() { 
-            self.rail.active = false;
-            if (!self.rail.drag) self.hideCursor();
-          });
-        
-          if (!self.isiframe) self.bind((self.isie&&self.ispage) ? document : self.docscroll,"mousewheel",self.onmousewheel);
-          self.bind(self.rail,"mousewheel",self.onmousewheel);
-        }
-
-        if (!self.ispage&&!self.cantouch) {
-          if (!self.win.attr("tabindex")) self.win.attr({"tabindex":tabindexcounter++});
-          self.win.focus(function(e) {
-            domfocus = (self.getTarget(e)).id||true;
-            self.hasfocus = true;
-            self.noticeCursor();
-          });
-          self.win.blur(function(e) {
-            domfocus = false;
-            self.hasfocus = false;
-          });
-          self.win.mouseenter(function(e) {
-            mousefocus = (self.getTarget(e)).id||true;
-            self.hasmousefocus = true;
-            self.noticeCursor();
-          });
-          self.win.mouseleave(function() {
-            mousefocus = false;
-            self.hasmousefocus = false;
-          });
-        };
-        
-        //Thanks to http://www.quirksmode.org !!
-        self.onkeypress = function(e) {
-          e = (e) ? e : window.e;
-          var tg = self.getTarget(e);          
-          if (tg&&/INPUT|TEXTAREA|SELECT/.test(tg.nodeName)) {
-            var tp = tg.getAttribute('type')||tg.type||false;            
-            if ((!tp)||!(/submit|button|cancel/i.tp)) return true;
-          }
-          
-          if (self.hasfocus||(self.hasmousefocus&&!domfocus)||(self.ispage&&!domfocus&&!mousefocus)) {
-            var key = e.keyCode;
-            
-            if (self.locked&&key!=27) return self.cancelEvent(e);
-            
-            var ret = true;
-            switch (key) {
-              case 38:
-              case 63233: //safari
-                self.doScrollBy(24*3,true);
-                ret = false;
-                break;
-              case 40:
-              case 63235: //safari
-                self.doScrollBy(-24*3,true);
-                ret = false;
-                break;
-              case 33:
-              case 63276: // safari
-                self.doScrollBy(self.view.h,true);
-                ret = false;
-                break;
-              case 34:
-              case 63277: // safari
-                self.doScrollBy(-self.view.h,true);
-                ret = false;
-                break;
-              case 36:
-              case 63273: // safari
-                self.doScrollTo(0,true);
-                ret = false;
-                break;
-              case 35:
-              case 63275: // safari
-                self.doScrollTo(self.page.h,true);
-                ret = false;
-                break;
-              case 27: // ESC
-                if (self.zoomactive) {
-                  self.doZoom();
-                  ret = false;
-                }
-                break;
-            }
-            if (!ret) return self.cancelEvent(e);
-          }
-        };
-        
-        self.bind(document,(self.isopera)?"keypress":"keydown",self.onkeypress);
-        
-      }
-      
-      if (this.doc[0].nodeName == 'IFRAME') {
-        function oniframeload(e) {
-          var doc = 'contentDocument' in this ? this.contentDocument : this.contentWindow.document;
-          if (self.isiframe) {
-            self.docscroll = $(doc);        
-            self.iframe = {
-              html:self.doc.contents().find('html')[0],
-              body:self.doc.contents().find('body')[0]
-            };
-          }
-          if (self.opt.iframeautoresize&&!self.isiframe) {
-            self.win.scrollTop(0); // reset position
-            self.doc.height("");  //reset height to fix browser bug
-            var cc=self.doc.contents();
-            var hh=Math.max(cc.find('html').attr('scrollHeight'),cc.find('body').attr('scrollHeight'));
-            self.doc.height(hh);          
-          }
-          self.onResize();
-          if (self.isie7) $(doc).find('html').css({'overflow-y':'hidden'});
-          $(doc.body).css({'overflow-y':'hidden'});          
-          if ('contentWindow' in this) {
-            self.bind(this.contentWindow,"scroll",self.onscroll);  //IE8 & minor
-          } else {          
-            self.bind(doc,"scroll",self.onscroll);
-          }          
-          self.bind(doc,"mouseup",self.onmouseup);
-          self.bind(doc,"mousewheel",self.onmousewheel);
-          self.bind(doc,(self.isopera)?"keypress":"keydown",self.onkeypress);          
-          if (self.cantouch||self.opt.touchbehavior) {
-            self.bind(doc,"mousedown",self.onmousedown);
-            if (self.cursorgrabvalue) $(doc).css({'cursor':self.cursorgrabvalue});
-          }
-          
-          self.bind(doc,"mousemove",self.onmousemove);
-          
-          if (self.zoom) {
-            if (self.opt.dblclickzoom) self.bind(doc,'dblclick',self.doZoom);
-            if (self.cantouch&&self.opt.gesturezoom) {
-              self.bind(doc,"gesturechange",function(e) {
-                if (e.scale>1.5) self.doZoomIn(e);
-                if (e.scale<0.8) self.doZoomOut(e);
-                return self.cancelEvent(e);
-              });             
-            }          
-          }
-        };
-        
-        if (this.doc[0].readyState&&this.doc[0].readyState=="complete"){
-          setTimeout(function(){oniframeload.call(self.doc[0],false)},500);
-        }
-        this.doc.load(oniframeload);
-        
-      }
-      
-    };
-    
-    this.showCursor = function() {
-      if (self.cursortimeout) {
-        clearTimeout(self.cursortimeout);
-        self.cursortimeout = 0;
-      }
-      if (!self.rail) return;
-      if (self.autohidedom) self.autohidedom.stop().css({opacity:self.opt.cursoropacitymax});
-      self.cursor.css({height:self.cursorheight,top:self.scroll.y});
-      if (self.zoom) self.zoom.stop().css({opacity:self.opt.cursoropacitymax});
-    };
-    
-    this.hideCursor = function(tm) {
-      if (self.cursortimeout) return;
-      if (!self.rail) return;
-      if (!self.autohidedom) return;
-      self.cursortimeout = setTimeout(function() {
-         if (!self.rail.active) {
-           self.autohidedom.stop().animate({opacity:self.opt.cursoropacitymin});
-           if (self.zoom) self.zoom.stop().animate({opacity:self.opt.cursoropacitymin});
-         }
-         self.cursortimeout = 0;
-      },tm||800);
-    };
-    
-    this.noticeCursor = function(tm) {
-      self.showCursor();
-      self.hideCursor(tm);
-    };
-    
-    this.getContentSize = function() {
-      var pg = 
-        (self.ispage) ?
-        {
-          w:Math.max(document.body.scrollWidth,document.documentElement.scrollWidth),
-          h:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)
-        } 
-        : (self.haswrapper) ?
-        {
-          w:self.doc.outerWidth()+parseInt(self.win.css('paddingLeft'))+parseInt(self.win.css('paddingRight')),
-          h:self.doc.outerHeight()+parseInt(self.win.css('paddingTop'))+parseInt(self.win.css('paddingBottom'))
-        } 
-        : (self.iframe) ?
-        {
-          w:Math.max(self.iframe.html.scrollWidth,self.iframe.body.scrollWidth),
-          h:Math.max(self.iframe.html.scrollHeight,self.iframe.body.scrollHeight)
-        }        
-        :
-        {
-          w:self.docscroll[0].scrollWidth,
-          h:self.docscroll[0].scrollHeight
-        };
-        
-      pg.w-=1;
-      pg.h-=1;
-
-      return pg;
-    };
-    
-    this.onAttributeChange = function(e) {      
-      if (e&&e.target) {
-        if ((e.target !== self.win[0])&&(e.target!==self.doc[0])) return true;
-        var attr = ("attrChange" in e)?e.attrName:("propertyName" in e)?e.propertyName:false;
-        if (attr&&/width|height|style|block/i.test(attr)) {
-          if (self.lastattributechange) self.lastattributechange=clearTimeout(self.lastattributechange);
-          self.lastattributechange = setTimeout(function(){
-            self.lastattributechange = 0;
-            self.onResize();            
-          },60);
-        }
-      }
-    };
-    
-    this.onResize = function() {
-      if (!self.haswrapper&&!self.ispage) {        
-        var vis = (self.win.css('display')!='none');      
-        if (vis&&!self.visibility) self.show();
-        if (!vis&&self.visibility) self.hide();      
-        if (!self.visibility) return false;
-      }
-    
-      self.view = {
-        w:(self.ispage) ? self.win.width() : self.win.innerWidth(),
-        h:(self.ispage) ? self.win.height() : self.win.innerHeight()
-      };
-      
-      self.page = self.getContentSize();
-
-      if (self.view.h>=self.page.h) {
-        self.hide();        
-        self.scrollvaluemax = 0;
-        self.scroll.y = 0;
-        self.scrollratio = {x:0,y:0};
-        self.cursorheight = 0;
-        self.locked = true;
-        self.setScrollTop(0);
-        return false;
-      } 
-      else if (!self.visibility) self.show();     
-      
-      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);
-
-      self.cursorheight = Math.min(self.view.h,Math.round(self.view.h * (self.view.h / self.page.h)));
-      
-      self.scrollvaluemax = self.view.h-self.cursorheight-self.cursor.hborder-2;
-      
-      self.scrollratio = {
-        x:0,
-        y:((self.page.h - self.view.h)/self.scrollvaluemax)
-      };
-      
-      self.scroll.y = Math.round(self.getScrollTop() * (1/self.scrollratio.y));
-      
-      self.noticeCursor();
-    };
-   
-    this.bind = function(dom,name,fn,bubble) {  // touch-oriented & fixing jquery bind
-      var el = (dom.length) ? dom[0] : dom;
-      if (el.addEventListener) {
-        if (self.cantouch && /mouseup|mousedown|mousemove/.test(name)) {  // touch device support
-          var tt = (name=='mousedown')?'touchstart':(name=='mouseup')?'touchend':'touchmove';
-          el.addEventListener(tt,function(e){
-            if(e.touches.length<2){var ev=(e.touches.length>0)?e.touches[0]:e;ev.original=e;fn.call(this,ev);}
-          },bubble||false);
-        }
-        el.addEventListener(name,fn,bubble||false);
-        if (name=='mousewheel') el.addEventListener("DOMMouseScroll",fn,bubble||false);
-        if (self.cantouch && name=="mouseup") el.addEventListener("touchcancel",fn,bubble||false);
-      } 
-      else if (el.attachEvent) {
-        el.attachEvent("on"+name,function(e) {
-          if (e&&!("pageY" in e)&&("screenY" in e)) {
-            e.pageX = e.screenX;
-            e.pageY = e.screenY;
-          }
-          return ((fn.call(el,e)===false)||bubble===false) ? self.cancelEvent(e) : true;
-        });
-      } 
-      else {
-        el["on"+name] = function(e) {
-          var rt=fn.call(el,e);          
-          return (rt===false||bubble===false) ? self.cancelEvent(e) : true;
-        };
-      }
-    };
-    
-    // Thanks to http://www.switchonthecode.com !!
-    this.cancelEvent = function(e) {
-      if (self.cantouch) {
-        e = e.original ? e.original : e||false;
-      } else {
-        e = e ? e : window.event||false;
-      }
-      if (!e) return false;      
-      if(e.stopPropagation) e.stopPropagation();
-      if(e.preventDefault) e.preventDefault();
-      e.cancelBubble = true;
-      e.cancel = true;
-      e.returnValue = false;
-      return false;
-    };
-
-    this.show = function() {
-      self.visibility = true;
-      self.rail.css('display','block');
-    };
-
-    this.hide = function() {
-      self.visibility = false;
-      self.rail.css('display','none');
-    };
-    
-    this.onmousewheel = function(e) {
-      if (self.locked) return self.cancelEvent(e);
-      e = e ? e : window.event;
-      if (self.rail.drag) return self.cancelEvent(e);
-      var delta = 0;      
-      var delta = e.detail ? e.detail * -1 : e.wheelDelta / 40;
-      if (delta) {
-        self.doScrollBy(delta*self.opt.mousescrollstep,true);
-      }
-      return self.cancelEvent(e);
-    };
-    
-    this.stop = function() {
-      if (self.timer) clearAnimationFrame(self.timer);
-      self.timer = 0;
-      self.cursorfreezed = false;
-      self.scroll.y = Math.round(self.getScrollTop() * (1/self.scrollratio.y));      
-      self.noticeCursor();      
-    };
-    
-    if (self.ishwscroll&&self.hastransition&&self.opt.usetransition) {
-      this.prepareTransition = function(dif,trend) {
-        var sp = Math.round(self.opt.scrollspeed*10);
-        var ex = Math.min(sp,Math.round((dif / 20) * self.opt.scrollspeed));
-        var trans = (ex>20) ? self.prefixstyle+'transform '+ex+'ms ease-out 0s' : '';
-        if (!self.lasttransitionstyle||self.lasttransitionstyle!=trans) {
-          self.lasttransitionstyle = trans;
-          self.doc.css(self.transitionstyle,trans);
-        }
-      };
-      this.doScroll = function(y) {
-        self.newscrolly = y;
-        if (self.timer) return;
-        self.timer = setTimeout(function() {
-          var top = self.getScrollTop();
-          var dif = (top>self.newscrolly) ? top-self.newscrolly : self.newscrolly-top;
-          self.prepareTransition(dif)
-          self.setScrollTop(self.newscrolly);
-          self.timer = 0;
-        },self.opt.scrollspeed);
-        self.noticeCursor();
-      };
-//      self.bind(self.doc,'transitionend',function(e){console.log(e)},false); TEST!! Later or soon I use it! (I hope so)
-    } else {
-      this.doScroll = function(y) {
-        self.newscrolly = y;
-        if (self.timer) return;
-        var rt = 1/4; //*(60/self.opt.scrollspeed));        
-        var sync = 0;
-        var lastsync = 0;
-        function scrolling() {
-          sync=(new Date()).getTime();
-          if (sync<lastsync) return (self.timer = setAnimationFrame(scrolling));
-          lastsync = (new Date()).getTime()+self.opt.scrollspeed;
-          sync=0;
-          var gp = self.newscrolly - self.getScrollTop();
-          var df = (gp>0) ? Math.ceil(gp*rt) : Math.floor(gp*rt);
-          var sc = self.getScrollTop()+df;
-          self.setScrollTop(sc);     
-          if (sc == self.newscrolly) {
-//            clearAnimationFrame(self.timer);
-            self.timer = 0;        
-            self.cursorfreezed = false;
-          } else {
-            self.timer = setAnimationFrame(scrolling);
-          }
-        };        
-        self.timer = setAnimationFrame(scrolling);
-        
-        self.noticeCursor();
-      };
-    }
-    
-    this.doScrollBy = function(stp,absolute) {
-      if (absolute) stp = Math.round(stp * 1/self.scrollratio.y);
-      var ny = self.scroll.y-stp;
-      if (ny<0) ny=0;
-      var my = self.scrollvaluemax;
-      if (ny>my) ny=my;
-      self.cursorfreezed = false;
-      self.doScroll(Math.floor(ny*self.scrollratio.y));
-    };
-    
-    this.doScrollTo = function(pos,absolute) {
-      ny=(absolute)?Math.round(pos * 1/self.scrollratio.y):pos;
-      if (ny<0) pos=0;
-      var my = self.scrollvaluemax;
-      if (ny>my) pos=(absolute)?Math.round(my*self.scrollratio.y):my;
-      self.cursorfreezed = false;
-      self.doScroll((absolute)?pos:Math.round(pos*self.scrollratio.y));
-    };
-    
-    this.doScrollMomentum = function(mom) {
-      var dy = mom.ly-mom.ny;
-      var tt = ((new Date()).getTime()-mom.lt);
-      var my = Math.floor((dy*3)/((tt+1)*0.2));
-      if (my) self.doScrollBy(my,true);
-    };
-    
-    self.onscroll = function(e) {    
-      var tm = (new Date()).getTime();
-      if (!self.lastcontentcheck || self.lastcontentcheck<tm) {
-        self.lastcontentcheck=tm+500;
-        var pg = self.getContentSize();
-        if (pg.h!=self.page.h) self.onResize();        
-      }    
-      if (self.rail.drag) return;
-      if (!self.cursorfreezed) self.scroll.y = Math.round(self.getScrollTop() * (1/self.scrollratio.y));
-      self.noticeCursor();
-    };
-    self.docscroll.scroll(function(e) {
-      self.onscroll(e);
-    });
-    
-    this.doZoomIn = function(e) {
-      if (self.zoomactive) return;
-      self.zoomactive = true;
-      
-      self.zoomrestore = {
-        style:{}
-      };
-      var lst = ['position','top','left','zIndex','backgroundColor','marginTop','marginBottom','marginLeft','marginRight'];
-      var win = self.win[0].style;
-      for(var a in lst) {
-        var pp = lst[a];
-        self.zoomrestore.style[pp] = (typeof win[pp]!='undefined') ? win[pp] : '';
-      }
-      
-      self.zoomrestore.style.width = self.win.css('width');
-      self.zoomrestore.style.height = self.win.css('height');
-      
-      self.zoomrestore.padding = {
-        w:self.win.outerWidth()-self.win.width(),
-        h:self.win.outerHeight()-self.win.height()
-      };
-      
-      if (self.isios4) {
-        self.zoomrestore.scrollTop = $(window).scrollTop();
-        $(window).scrollTop(0);
-      }
-      
-      self.win.css({
-        "position":(self.isios4)?"absolute":"fixed",
-        "top":0,
-        "left":0,
-        "z-index":self.opt.zindex+100,
-        "margin":"0px"
-      });
-      var bkg = self.win.css("backgroundColor");      
-      if (bkg==""||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(bkg)) self.win.css("backgroundColor","#fff");
-      self.rail.css({"z-index":self.opt.zindex+110});
-      self.zoom.css({"z-index":self.opt.zindex+112});      
-      self.zoom.css('backgroundPosition','0px -18px');
-      self.resizeZoom();                
-      return self.cancelEvent(e);
-    };
-
-    this.doZoomOut = function(e) {
-      if (!self.zoomactive) return;
-      self.zoomactive = false;
-      
-      self.win.css("margin","");
-      self.win.css(self.zoomrestore.style);
-      
-      if (self.isios4) {
-        $(window).scrollTop(self.zoomrestore.scrollTop);
-      }
-      
-      self.rail.css({"z-index":(self.ispage)?self.opt.zindex:self.opt.zindex+2});
-      self.zoom.css({"z-index":self.opt.zindex});
-      self.zoomrestore = false;
-      self.zoom.css('backgroundPosition','0px 0px');
-      self.onResize();
-      return self.cancelEvent(e);
-    };
-    
-    this.doZoom = function(e) {
-      return (self.zoomactive) ? self.doZoomOut(e) : self.doZoomIn(e);
-    };
-    
-    this.resizeZoom = function() {
-      if (!self.zoomactive) return;
-
-      var py = self.getScrollTop(); //preserve scrolling position
-      self.win.css({
-        width:$(window).width()-self.zoomrestore.padding.w+"px",
-        height:$(window).height()-self.zoomrestore.padding.h+"px"
-      });
-      self.setScrollTop(py);
-      
-      self.onResize();
-    };
-   
-    this.init();
-
-  };
-  
-  $.fn.niceScroll = function(wrapper,opt) {    
-    if ((typeof wrapper=="object") && (typeof opt=="undefined")) {
-      opt = wrapper;
-      wrapper = false;
-    }
-    var ret = [];
-    if (typeof opt=="undefined") opt = {};
-    if (wrapper||false) {
-      opt.doc = $(wrapper);
-      opt.win = $(this);
-    }    
-    var docundef = !("doc" in opt);    
-    this.each(function() {      
-      var nice = $(this).data('__nicescroll')||false;
-      if (!nice) {
-        opt.doc = (docundef) ? $(this) : opt.doc;
-        nice = new NiceScrollClass(opt);
-        $(this).data('__nicescroll',nice);
-      }
-      ret.push(nice);
-    });
-    return (ret.length==1) ? ret[0] : ret;
-  };
-
-// override jQuery scrollTop
- 
-   var _scrollTop = jQuery.fn.scrollTop; // preserve original function
-   
-  $.cssHooks.scrollTop = {
-    get: function(elem,computed,extra) {
-      var nice = $.data(elem,'__nicescroll')||false;
-      return (nice&&nice.ishwscroll) ? nice.getScrollTop() : _scrollTop.call(elem);
-    },
-    set: function(elem,value) {
-      var nice = $.data(elem,'__nicescroll')||false;      
-      (nice&&nice.ishwscroll) ? nice.setScrollTop(parseInt(value)) : _scrollTop.call(elem,value);
-      return this;
-    }
-  };
- 
-  jQuery.fn.scrollTop = function(value) {    
-    if (typeof value == "undefined") {
-      var nice = $.data(this,'__nicescroll')||false;
-      return (nice&&nice.ishwscroll) ? nice.getScrollTop() : _scrollTop.call(this);
-    } else {
-      return this.each(function() {     
-        var nice = $.data(this,'__nicescroll')||false;
-        (nice&&nice.ishwscroll) ? nice.setScrollTop(parseInt(value)) : _scrollTop.call($(this),value);
-      });
-    }
-  }
-
-  jQuery.fn.getNiceScroll = function(index) {
-    if (typeof index == "undefined") {
-      for(a=0;a<this.length;a++) {
-        var nice = $.data(this[a],'__nicescroll')||false;
-        if (nice) return nice;
-      };
-      return false;
-    } else {
-      var nice = $.data(this[index],'__nicescroll')||false;
-      return nice;
-    }
-  }
-  
-})( jQuery );
-  

+ 418 - 111
jquery.nicescroll.js

@@ -1,5 +1,5 @@
 /* jquery.nicescroll
--- version 2.3.0
+-- version 2.5.0
 -- copyright 2011 InuYaksa*2011
 -- licensed under the MIT
 --
@@ -14,23 +14,27 @@
   var domfocus = false;
   var mousefocus = false;
   var zoomactive = false;
+  var tabindexcounter = 5000;
+  var ascrailcounter = 2000;
  
   // http://stackoverflow.com/questions/2161159/get-script-path
   function getScriptPath() {
-    var scripts= document.getElementsByTagName('script');
-    var path= scripts[scripts.length-1].src.split('?')[0];
+    var scripts=document.getElementsByTagName('script');
+    var path=scripts[scripts.length-1].src.split('?')[0];
     return (path.split('/').length>0) ? path.split('/').slice(0,-1).join('/')+'/' : '';
   }
   var scriptpath = getScriptPath();
 
   
-  var NiceScrollClass = function(myopt) {
+  var NiceScrollClass = function(myopt,me) {
 
     var self = this;
 
-    this.version = '2.3.0';
+    this.version = '2.5.0';
     this.name = 'nicescroll';
     
+    this.me = me;
+    
     this.opt = {
       doc:$("body"),
       win:false,
@@ -52,7 +56,8 @@
       grabcursorenabled:true,
       autohidemode:true,
       background:"",
-      iframeautoresize:true
+      iframeautoresize:true,
+      cursorminheight:20
     };
     
     if (myopt||false) {
@@ -90,8 +95,10 @@
     this.cursorheight = 20;
     this.scrollvaluemax = 0;
     
+    this.scrollmom = false;
+    
     do {
-      this.id = "ascrail"+Math.round(Math.random() * 99999);
+      this.id = "ascrail"+(ascrailcounter++);
     } while (document.getElementById(this.id));
     
     this.rail = false;
@@ -107,6 +114,10 @@
     this.visibility = true;
     this.locked = false;
     
+    this.events = [];  // event list for unbind
+    
+    this.saved = {};
+    
     var domtest = document.createElement('DIV');
     
     this.isopera = ("opera" in window);
@@ -262,7 +273,7 @@
         var brd = (self.win.outerWidth() - self.win.innerWidth())/2;
         pos.left+= self.win.innerWidth() + brd - self.rail.width - 1;
         self.rail.css({position:"absolute",top:pos.top,left:pos.left,height:(len)?len.h:self.win.innerHeight()});
-        if (self.zoom) self.zoom.css({position:"absolute",top:pos.top+1,left:pos.left-18});
+        if (self.zoom) self.zoom.css({position:"absolute",top:pos.top+1,left:pos.left-20});
       }
     };
     
@@ -287,15 +298,23 @@
     self.hasanimationframe = (setAnimationFrame);
     self.hascancelanimationframe = (clearAnimationFrame);
     
-    if (!self.hasanimationframe) setAnimationFrame=function(fn){return setTimeout(fn,1000/60)};
-    if (!self.hascancelanimationframe) clearAnimationFrame=clearInterval;
+    if (!self.hasanimationframe) {
+      setAnimationFrame=function(fn){return setTimeout(fn,1000/60)};
+      clearAnimationFrame=clearInterval;
+    } 
+    else if (!self.hascancelanimationframe) clearAnimationFrame=function(){self.cancelAnimationFrame=true};
     
     this.init = function() {
-    
+
+      self.saved.css = [];
+      if (self.ispage) self.saved.css.push([self.doc,'overflow-y',self.doc.css('overflow-y')]);
+      if (!self.ispage) self.saved.css.push([self.docscroll,'overflow-y',self.docscroll.css('overflow-y')]);
+      if (self.ispage&&self.isie7) self.saved.css.push([$("html"),'overflow-y',$("html").css('overflow-y')]);
+      
       if (!self.ispage || (!self.cantouch && !self.isieold)) {
 
         (self.ispage)?self.doc.css({'overflow-y':'hidden'}):self.docscroll.css({'overflow-y':'hidden'});
-        
+      
         if (self.ispage&&self.isie7) $("html").css({'overflow-y':'hidden'});  //IE7 double scrollbar issue
         
         var cursor = $(document.createElement('div'));
@@ -307,7 +326,8 @@
           '-webkit-border-radius':self.opt.cursorborderradius,
           '-moz-border-radius':self.opt.cursorborderradius,
           'border-radius':self.opt.cursorborderradius
-        });        
+        });   
+        
         cursor.hborder = parseFloat(cursor.outerHeight() - cursor.innerHeight());        
         self.cursor = cursor;        
         
@@ -338,12 +358,12 @@
         
         if (self.ispage) {
           rail.css({position:"fixed",top:"0px",right:"0px",height:"100%"});
-          self.doc.append(rail);
+          self.doc.append(rail);          
         } else {
           if (self.ishwscroll) {
             if (self.win.css('position')=='static') self.win.css('position','relative');
             if (self.zoom) {
-              self.zoom.css({position:"absolute",top:1,right:0,"margin-right":rail.width+2});
+              self.zoom.css({position:"absolute",top:1,right:0,"margin-right":rail.width+4});
               self.win.append(self.zoom);
             }
             rail.css({position:"absolute",top:0,right:0});
@@ -377,39 +397,65 @@
         self.onResize();
         
         if (self.cantouch||self.opt.touchbehavior) {
+          self.scrollmom = {
+            y:new ScrollMomentumClass(self)
+          };
+        
           self.onmousedown = function(e) {
-            if (self.locked) return self.cancelEvent(e);
-            self.rail.drag = {x:e.pageX,y:e.pageY,sx:self.scroll.x,sy:self.scroll.y,st:self.getScrollTop(),lx:e.pageX,ly:e.pageY,nx:e.pageX,ny:e.pageY,tt:(new Date()).getTime(),lt:(new Date()).getTime()};
-            return self.cancelEvent(e);
+            if (!self.locked) {
+              self.cancelScroll();
+              self.rail.drag = {x:e.pageX,y:e.pageY,sx:self.scroll.x,sy:self.scroll.y,st:self.getScrollTop()};//,st:self.getScrollTop(),lx:e.pageX,ly:e.pageY,nx:e.pageX,ny:e.pageY,tt:(new Date()).getTime(),lt:(new Date()).getTime()};
+              self.hasmoving = false;
+              self.scrollmom.y.reset(e.pageY);
+              if (!self.cantouch) return self.cancelEvent(e);
+            }
           };
           self.onmouseup = function(e) {
-            if (self.rail.drag) {
-              self.doScrollMomentum(self.rail.drag);
+            if (self.rail.drag) {            
+//              self.doScrollMomentum(self.rail.drag);
+              self.scrollmom.y.doMomentum();
               self.rail.drag = false;
-              return self.cancelEvent(e);
+              if (self.hasmoving) {
+                self.hasmoving = false;
+                return self.cancelEvent(e);
+              }
             }
           };
           self.onmousemove = function(e) {
             if (self.rail.drag) {
+              self.hasmoving = true;            
               var my = (e.pageY-self.rail.drag.y);
+/*              
               self.rail.drag.ly = self.rail.drag.ny;
               self.rail.drag.ny = e.pageY;
               self.rail.drag.lt = (new Date()).getTime();
+*/              
               
+              self.scrollmom.y.update(e.pageY);
+              
+/*              
               self.scroll.y = Math.round((self.rail.drag.st-my) * (1/self.scrollratio.y));
               if (self.scroll.y<0) self.scroll.y=0;
               if (self.scroll.y>self.scrollvaluemax) self.scroll.y=self.scrollvaluemax;
-              self.showCursor();
+*/
+              
+              self.showCursor(self.rail.drag.st-my);
+              
+              if (self.prepareTransition) self.prepareTransition(0);
+              self.setScrollTop(self.rail.drag.st-my);
               
-              self.doScrollTo(self.rail.drag.st-my,true);
               return self.cancelEvent(e);
             }
           };
           
-          if (self.cursorgrabvalue) self.win.css({'cursor':self.cursorgrabvalue});
+          if (self.cursorgrabvalue) {
+            self.saved.css.push([self.win,'cursor',self.win.css('cursor')]);
+            self.win.css({'cursor':self.cursorgrabvalue});
+          }
         } else {
           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};
             return self.cancelEvent(e);
           };
@@ -439,6 +485,7 @@
         self.bind(self.rail,"mousedown",self.onmousedown);          
         self.bind(self.rail,"mouseup",function(e) {
           self.rail.drag = false;
+          self.hasmoving = false;
           self.hideCursor();
           return self.cancelEvent(e);
         });
@@ -450,7 +497,7 @@
           self.rail.mouseenter(function() {
             self.showCursor();
             self.rail.active = true;
-          });
+          });          
           self.rail.mouseleave(function() { 
             self.rail.active = false;
             if (!self.rail.drag) self.hideCursor();
@@ -461,7 +508,7 @@
         }
 
         if (!self.ispage&&!self.cantouch) {
-          if (!self.win.attr("tabindex")) self.win.attr({"tabindex":(new Date()).getTime()});
+          if (!self.win.attr("tabindex")) self.win.attr({"tabindex":tabindexcounter++});
           self.win.focus(function(e) {
             domfocus = (self.getTarget(e)).id||true;
             self.hasfocus = true;
@@ -525,7 +572,7 @@
                 break;
               case 35:
               case 63275: // safari
-                self.doScrollTo(self.page.h,true);
+                self.doScrollTo(self.page.maxh,true);
                 ret = false;
                 break;
               case 27: // ESC
@@ -561,8 +608,12 @@
             self.doc.height(hh);          
           }
           self.onResize();
+          
+          if (self.isie7) self.saved.css.push([$(doc).find('html'),'overflow-y',$(doc).find('html').css('overflow-y')]);
+          self.saved.css.push([$(doc.body),'overflow-y',$(doc.body).css('overflow-y')]);
+          
           if (self.isie7) $(doc).find('html').css({'overflow-y':'hidden'});
-          $(doc.body).css({'overflow-y':'hidden'});          
+          $(doc.body).css({'overflow-y':'hidden'});
           if ('contentWindow' in this) {
             self.bind(this.contentWindow,"scroll",self.onscroll);  //IE8 & minor
           } else {          
@@ -573,7 +624,10 @@
           self.bind(doc,(self.isopera)?"keypress":"keydown",self.onkeypress);          
           if (self.cantouch||self.opt.touchbehavior) {
             self.bind(doc,"mousedown",self.onmousedown);
-            if (self.cursorgrabvalue) $(doc).css({'cursor':self.cursorgrabvalue});
+            if (self.cursorgrabvalue) {
+              self.saved.css.push([$(doc),'cursor',$(doc).css('cursor')]);
+              $(doc).css({'cursor':self.cursorgrabvalue});
+            }
           }
           
           self.bind(doc,"mousemove",self.onmousemove);
@@ -599,13 +653,18 @@
       
     };
     
-    this.showCursor = function() {
+    this.showCursor = function(py) {
       if (self.cursortimeout) {
         clearTimeout(self.cursortimeout);
         self.cursortimeout = 0;
       }
       if (!self.rail) return;
       if (self.autohidedom) self.autohidedom.stop().css({opacity:self.opt.cursoropacitymax});
+      
+      if (typeof py != "undefined") {
+        self.scroll.y = Math.round(py * 1/self.scrollratio.y);
+      }
+      
       self.cursor.css({height:self.cursorheight,top:self.scroll.y});
       if (self.zoom) self.zoom.stop().css({opacity:self.opt.cursoropacitymax});
     };
@@ -685,7 +744,9 @@
       };
       
       self.page = self.getContentSize();
-
+      
+      self.page.maxh = self.page.h - self.view.h;
+      
       if (self.view.h>=self.page.h) {
         self.hide();        
         self.scrollvaluemax = 0;
@@ -704,6 +765,7 @@
       if (!self.ispage) self.updateScrollBar(self.view);
 
       self.cursorheight = Math.min(self.view.h,Math.round(self.view.h * (self.view.h / self.page.h)));
+      self.cursorheight = Math.max(self.opt.cursorminheight,self.cursorheight);
       
       self.scrollvaluemax = self.view.h-self.cursorheight-self.cursor.hborder-2;
       
@@ -711,10 +773,27 @@
         x:0,
         y:((self.page.h - self.view.h)/self.scrollvaluemax)
       };
-      
+     
       self.scroll.y = Math.round(self.getScrollTop() * (1/self.scrollratio.y));
       
       self.noticeCursor();
+      
+      return self;
+    };
+    
+    this.resize = this.onResize;  // mask internal method -- in future name can change
+   
+    this._bind = function(el,name,fn,bubble) {  // primitive bind
+      self.events.push({e:el,n:name,f:fn});
+      if (el.addEventListener) {
+        el.addEventListener(name,fn,bubble||false);
+      }
+      else if (el.attachEvent) {
+        el.attachEvent("on"+name,fn);
+      }
+      else {
+        el["on"+name] = fn;        
+      }        
     };
    
     this.bind = function(dom,name,fn,bubble) {  // touch-oriented & fixing jquery bind
@@ -722,16 +801,16 @@
       if (el.addEventListener) {
         if (self.cantouch && /mouseup|mousedown|mousemove/.test(name)) {  // touch device support
           var tt = (name=='mousedown')?'touchstart':(name=='mouseup')?'touchend':'touchmove';
-          el.addEventListener(tt,function(e){
+          self._bind(el,tt,function(e){
             if(e.touches.length<2){var ev=(e.touches.length>0)?e.touches[0]:e;ev.original=e;fn.call(this,ev);}
           },bubble||false);
         }
-        el.addEventListener(name,fn,bubble||false);
-        if (name=='mousewheel') el.addEventListener("DOMMouseScroll",fn,bubble||false);
-        if (self.cantouch && name=="mouseup") el.addEventListener("touchcancel",fn,bubble||false);
-      } 
-      else if (el.attachEvent) {
-        el.attachEvent("on"+name,function(e) {
+        self._bind(el,name,fn,bubble||false);
+        if (name=='mousewheel') self._bind(el,"DOMMouseScroll",fn,bubble||false);
+        if (self.cantouch && name=="mouseup") self._bind(el,"touchcancel",fn,bubble||false);
+      }
+      else {
+        self._bind(el,name,function(e) {
           if (e&&!("pageY" in e)&&("screenY" in e)) {
             e.pageX = e.screenX;
             e.pageY = e.screenY;
@@ -739,11 +818,23 @@
           return ((fn.call(el,e)===false)||bubble===false) ? self.cancelEvent(e) : true;
         });
       } 
-      else {
-        el["on"+name] = function(e) {
-          var rt=fn.call(el,e);          
-          return (rt===false||bubble===false) ? self.cancelEvent(e) : true;
-        };
+    };
+    
+    this._unbind = function(el,name,fn) {  // primitive unbind
+      if (el.removeEventListener) {
+        el.removeEventListener(name,fn,false);
+      }
+      else if (el.detachEvent) {
+        el.detachEvent('on'+name,fn);
+      } else {
+        el['on'+name] = false;
+      }
+    };
+    
+    this.unbindAll = function() {
+      for(var a=0;a<self.events.length;a++) {
+        var r = self.events[a];        
+        self._unbind(r.e,r.n,r.f);
       }
     };
     
@@ -766,11 +857,31 @@
     this.show = function() {
       self.visibility = true;
       self.rail.css('display','block');
+      return self;
     };
 
     this.hide = function() {
       self.visibility = false;
       self.rail.css('display','none');
+      return self;
+    };
+    
+    this.remove = function() {
+      self.doZoomOut();
+      self.unbindAll();
+      self.events = [];
+      self.rail.remove();
+      if (self.zoom) self.zoom.remove();
+      self.cursor = false;
+      self.rail = false;
+      self.zoom = false;
+      for(var a=0;a<self.saved.css.length;a++) {
+        var d=self.saved.css[a];
+        d[0].css(d[1],(typeof d[2]=="undefined") ? '' : d[2]);
+      }
+      self.saved = false;      
+      self.me.data('__nicescroll',''); //erase all traces
+      return self;
     };
     
     this.onmousewheel = function(e) {
@@ -780,17 +891,19 @@
       var delta = 0;      
       var delta = e.detail ? e.detail * -1 : e.wheelDelta / 40;
       if (delta) {
+        if (self.scrollmom) self.scrollmom.y.stop();
         self.doScrollBy(delta*self.opt.mousescrollstep,true);
       }
       return self.cancelEvent(e);
     };
     
     this.stop = function() {
-      if (self.timer) clearAnimationFrame(self.timer);
-      self.timer = 0;
+      self.cancelScroll();
+      if (self.scrollmon) self.scrollmon.stop();
       self.cursorfreezed = false;
       self.scroll.y = Math.round(self.getScrollTop() * (1/self.scrollratio.y));      
-      self.noticeCursor();      
+      self.noticeCursor();
+      return self;
     };
     
     if (self.ishwscroll&&self.hastransition&&self.opt.usetransition) {
@@ -805,71 +918,108 @@
       };
       this.doScroll = function(y) {
         self.newscrolly = y;
-        if (self.timer) return;
-        self.timer = setTimeout(function() {
+        if (self.timer) return false;
+        
+        self.timer = setTimeout(function(){        
           var top = self.getScrollTop();
-          var dif = (top>self.newscrolly) ? top-self.newscrolly : self.newscrolly-top;
+          var dif = Math.abs(top-self.newscrolly);
           self.prepareTransition(dif)
-          self.setScrollTop(self.newscrolly);
-          self.timer = 0;
+          self.timer = setTimeout(function(){
+            self.setScrollTop(self.newscrolly);
+            self.timer = 0;
+          },15);
         },self.opt.scrollspeed);
         self.noticeCursor();
       };
+      this.cancelScroll = function() {
+        var py = self.getScrollTop();
+        self.prepareTransition(0);
+        self.setScrollTop(py);
+        self.noticeCursor();
+        return self;
+      };
+      
 //      self.bind(self.doc,'transitionend',function(e){console.log(e)},false); TEST!! Later or soon I use it! (I hope so)
     } else {
       this.doScroll = function(y) {
         self.newscrolly = y;
+        var df = y-self.getScrollTop();
+        if ((df*df)>100) {
+          self.newspeedy = {
+            x:y-Math.round(df/6),
+            v:Math.round(df/6*5/8)+1
+          };
+        } else {
+          self.newspeedy = false;
+        }
         if (self.timer) return;
-        var rt = 1/4; //*(60/self.opt.scrollspeed));        
+        var rt = 1/4;      
         var sync = 0;
         var lastsync = 0;
         function scrolling() {
+          if (self.cancelAnimationFrame) return true;
           sync=(new Date()).getTime();
-          if (sync<lastsync) return (self.timer = setAnimationFrame(scrolling));
-          lastsync = (new Date()).getTime()+self.opt.scrollspeed;
+          if (sync<lastsync) return (self.timer = setAnimationFrame(scrolling)||1);
+          lastsync = Math.floor((new Date()).getTime()+self.opt.scrollspeed/2);
           sync=0;
-          var gp = self.newscrolly - self.getScrollTop();
-          var df = (gp>0) ? Math.ceil(gp*rt) : Math.floor(gp*rt);
-          var sc = self.getScrollTop()+df;
-          self.setScrollTop(sc);     
+          var sy = self.getScrollTop();
+          if (self.newspeedy) {
+            var sc = sy + self.newspeedy.v;
+            if (self.newspeedy.v>0) {
+              if (sc>=self.newspeedy.x) self.newspeedy = false;
+            } else {
+              if (sc<=self.newspeedy.x) self.newspeedy = false;
+            }
+          } else {
+            var gp = self.newscrolly - self.getScrollTop();
+            var df = (gp>0) ? Math.ceil(gp*rt) : Math.floor(gp*rt);
+            var sc = self.getScrollTop()+df;
+          }
+          self.setScrollTop(sc);
+//          if (!self.cursorfreezed) self.showCursor(sc);
           if (sc == self.newscrolly) {
 //            clearAnimationFrame(self.timer);
             self.timer = 0;        
             self.cursorfreezed = false;
           } else {
-            self.timer = setAnimationFrame(scrolling);
+            self.timer = setAnimationFrame(scrolling)||1;
           }
-        };        
-        self.timer = setAnimationFrame(scrolling);
+        };
+        self.cancelAnimationFrame=false;
+        self.timer = setAnimationFrame(scrolling)||1;
         
         self.noticeCursor();
       };
+      this.cancelScroll = function() {
+        if (self.timer) clearAnimationFrame(self.timer);
+        self.timer = 0;
+        return self;
+      };
     }
     
     this.doScrollBy = function(stp,absolute) {
-      if (absolute) stp = Math.round(stp * 1/self.scrollratio.y);
-      var ny = self.scroll.y-stp;
-      if (ny<0) ny=0;
-      var my = self.scrollvaluemax;
-      if (ny>my) ny=my;
+      var ny = 0;
+      if (absolute) {
+        if (self.timer) {
+          ny = self.newscrolly-stp;
+        } else {
+          ny = self.getScrollTop()-stp;  
+        }          
+      } else {
+        ny = Math.floor((self.scroll.y-stp)*self.scrollratio.y)
+      }
+      if (ny<0) ny=0
+      else if (ny>self.page.maxh) ny = self.page.maxh;
       self.cursorfreezed = false;
-      self.doScroll(Math.floor(ny*self.scrollratio.y));
+      self.doScroll(ny);
     };
     
     this.doScrollTo = function(pos,absolute) {
-      ny=(absolute)?Math.round(pos * 1/self.scrollratio.y):pos;
-      if (ny<0) pos=0;
-      var my = self.scrollvaluemax;
-      if (ny>my) pos=(absolute)?Math.round(my*self.scrollratio.y):my;
+      var ny = (absolute) ? pos : Math.round(pos*self.scrollratio.y);
+      if (ny<0) ny=0
+      else if (ny>self.page.maxh) ny = self.page.maxh;
       self.cursorfreezed = false;
-      self.doScroll((absolute)?pos:Math.round(pos*self.scrollratio.y));
-    };
-    
-    this.doScrollMomentum = function(mom) {
-      var dy = mom.ly-mom.ny;
-      var tt = ((new Date()).getTime()-mom.lt);
-      var my = Math.floor((dy*3)/((tt+1)*0.2));
-      if (my) self.doScrollBy(my,true);
+      self.doScroll(pos);
     };
     
     self.onscroll = function(e) {    
@@ -883,9 +1033,7 @@
       if (!self.cursorfreezed) self.scroll.y = Math.round(self.getScrollTop() * (1/self.scrollratio.y));
       self.noticeCursor();
     };
-    self.docscroll.scroll(function(e) {
-      self.onscroll(e);
-    });
+    self.bind(self.docscroll,"scroll",self.onscroll);
     
     this.doZoomIn = function(e) {
       if (self.zoomactive) return;
@@ -970,33 +1118,97 @@
 
   };
   
-  $.fn.niceScroll = function(wrapper,opt) {    
-    if ((typeof wrapper=="object") && (typeof opt=="undefined")) {
-      opt = wrapper;
-      wrapper = false;
-    }
-    var ret = [];
-    if (typeof opt=="undefined") opt = {};
-    if (wrapper||false) {
-      opt.doc = $(wrapper);
-      opt.win = $(this);
-    }    
-    var docundef = !("doc" in opt);    
-    this.each(function() {      
-      var nice = $(this).data('__nicescroll')||false;
-      if (!nice) {
-        opt.doc = (docundef) ? $(this) : opt.doc;
-        nice = new NiceScrollClass(opt);
-        $(this).data('__nicescroll',nice);
+// Inspired by the work of Kin Blas
+// http://webpro.host.adobe.com/people/jblas/momentum/includes/jquery.momentum.0.7.js  
+  
+  var ScrollMomentumClass = function(nc) {
+    var self = this;
+    this.nc = nc;
+    
+    this.lasty = 0;
+    this.speedy = 0;
+    this.lasttime = 0;    
+    this.snapy = false;
+    this.demuly = 0;
+    
+    this.timer = 0;
+    
+    this.time = function() {
+      return (new Date()).getTime();
+    };
+    
+    this.reset = function(py) {
+      self.stop();
+      self.lasttime = self.time();
+      self.speedy = 0;
+      self.lasty = py;      
+    };
+    
+    this.update = function(py) {
+      self.lasttime = self.time();
+      var dy = py - self.lasty;
+      var sy = nc.getScrollTop();
+      var newy = sy + dy;
+      self.snapy = (newy<0)||(newy>self.nc.page.maxh);
+      self.speedy = dy;
+      self.lasty = py;
+    };
+    
+    this.stop = function() {
+      if (self.timer) {
+        clearTimeout(self.timer);
+        self.timer = 0;
+      }    
+    };
+    
+    this.doSnapy = function(ny) {
+      if (ny<0) {
+        self.nc.doScrollTo(0,true);
       }
-      ret.push(nice);
-    });
-    return (ret.length==1) ? ret[0] : ret;
+      else if (ny>self.nc.page.maxh) {
+        self.nc.doScrollTo(self.nc.page.maxh,true);
+      }
+    };
+    
+    this.doMomentum = function() {
+      var l = self.lasttime;
+      var t = self.time();
+      
+      self.speedy = Math.min(200,self.speedy);
+      
+      var chk = l && (t - l) <= 50;
+      var sy = (self.speedy && chk) ? self.speedy : false;
+      
+      if (sy) {
+        var tm = t-l;
+        self.demuly = 0;
+        var onscroll = function(){          
+          var ny = Math.floor(self.nc.getScrollTop() - (self.speedy*(1-self.demuly)));
+          self.demuly+=0.02;
+          self.nc.setScrollTop(ny);
+          self.nc.showCursor(ny);
+          if(self.demuly<1) {
+            self.timer = setTimeout(onscroll,tm);
+          } else {
+            self.timer = 0;
+            self.nc.hideCursor();
+            self.doSnapy(ny);
+          }
+        };
+        onscroll();
+      } else {
+        if (self.snapy) {
+          self.doSnapy(self.nc.getScrollTop());
+        }
+      }      
+      
+    }
+    
   };
 
 // override jQuery scrollTop
  
-   var _scrollTop = jQuery.fn.scrollTop; // preserve original function
+  var _scrollTop = jQuery.fn.scrollTop; // preserve original function
    
   $.cssHooks.scrollTop = {
     get: function(elem,computed,extra) {
@@ -1022,18 +1234,113 @@
     }
   }
 
+  var NiceScrollArray = function(doms) {
+    var self = this;
+    this.length = 0;
+    this.name = "nicescrollarray";
+  
+    this.each = function(fn) {
+      for(var a=0;a<self.length;a++) fn.call(self[a]);
+      return self;
+    };
+  
+    this.show = function() {
+      return self.each(function(){
+        this.show();
+      });
+    };
+
+    this.hide = function() {
+      return self.each(function(){
+        this.hide();
+      });
+    };
+
+    this.onResize = function() {  // OBSOLETE - for compatibilty
+      return self.each(function(){
+        this.onResize();
+      });
+    };
+
+    this.resize = function() {
+      return self.each(function(){
+        this.resize();
+      });
+    };
+    
+    this.remove = function() {
+      return self.each(function(){
+        this.remove();
+      });
+    };
+    
+    this.stop = function() {
+      return self.each(function(){
+        this.stop();
+      });
+    };
+    
+    this.push = function(nice) {
+      self[self.length]=nice;
+      self.length++;
+    };
+    
+    this.eq = function(idx) {
+      return self[idx];
+    };
+    
+    if (doms) {
+      for(a=0;a<doms.length;a++) {
+        var nice = $.data(doms[a],'__nicescroll')||false;
+        if (nice) {
+          this[this.length]=nice;
+          this.length++;
+        }
+      };
+    }
+    
+    return this;
+  };
+  
   jQuery.fn.getNiceScroll = function(index) {
     if (typeof index == "undefined") {
-      for(a=0;a<this.length;a++) {
-        var nice = $.data(this[a],'__nicescroll')||false;
-        if (nice) return nice;
-      };
-      return false;
+      return (this.length>0) ? new NiceScrollArray(this) : $.data(this,'__nicescroll')||false;
     } else {
       var nice = $.data(this[index],'__nicescroll')||false;
       return nice;
     }
-  }
+  };
+  
+  jQuery.extend(jQuery.expr[':'], {
+    nicescroll: function(a) { 
+      return ($.data(a,'__nicescroll')||false);
+    }
+  });  
+  
+  $.fn.niceScroll = function(wrapper,opt) {        
+    if ((typeof wrapper=="object") && (typeof opt=="undefined")) {
+      opt = wrapper;
+      wrapper = false;
+    }
+    var ret = new NiceScrollArray();
+    if (typeof opt=="undefined") opt = {};
+    if (wrapper||false) {
+      opt.doc = $(wrapper);
+      opt.win = $(this);
+    }    
+    var docundef = !("doc" in opt);   
+    
+    this.each(function() {
+      var nice = $(this).data('__nicescroll')||false;
+      if (!nice) {
+        opt.doc = (docundef) ? $(this) : opt.doc;
+        nice = new NiceScrollClass(opt,$(this));        
+        $(this).data('__nicescroll',nice);
+      }
+      ret.push(nice);
+    });
+    return (ret.length==1) ? ret[0] : ret;
+  };
   
 })( jQuery );
   

+ 49 - 43
jquery.nicescroll.min.js

@@ -1,5 +1,5 @@
 /* jquery.nicescroll
--- version 2.3.0
+-- version 2.5.0
 -- copyright 2011 InuYaksa*2011
 -- licensed under the MIT
 --
@@ -7,45 +7,51 @@
 -- https://github.com/inuyaksa/jquery.nicescroll
 --
 */
-(function(g){var l=false,m=false,o=function(){var f=document.getElementsByTagName("script"),f=f[f.length-1].src.split("?")[0];return f.split("/").length>0?f.split("/").slice(0,-1).join("/")+"/":""}(),q=function(f){var b=this;this.version="2.3.0";this.name="nicescroll";this.opt={doc:g("body"),win:false,zindex:9E3,cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"5px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:60,mousescrollstep:48,touchbehavior:false,
-hwacceleration:true,usetransition:true,boxzoom:false,dblclickzoom:true,gesturezoom:true,grabcursorenabled:true,autohidemode:true,background:"",iframeautoresize:true};if(f)for(var h in b.opt)f[h]!==void 0&&(b.opt[h]=f[h]);this.id=b.opt.doc[0].id||"";this.doc=b.opt.doc;this.ispage=b.doc[0].nodeName=="BODY"||b.doc[0].nodeName=="HTML";this.haswrapper=b.opt.win!==false;this.win=b.opt.win||(this.ispage?g(window):this.doc);this.docscroll=this.ispage?g(window):this.win;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.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;do this.id="ascrail"+Math.round(Math.random()*99999);while(document.getElementById(this.id));this.hasmousefocus=this.hasfocus=this.zoomactive=this.zoom=this.cursorfreezed=this.cursor=this.rail=false;this.visibility=
-true;this.locked=false;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.cantouch="ontouchstart"in
-document.documentElement)&&/iphone|ipad|ipod/i.test(navigator.platform)?(this.isios=true,this.isios4=!("seal"in Object)):this.isios4=this.isios=false;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)&&i.style[this.trstyle]===void 0)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 f="transition,webkitTransition,MozTransition,OTransition,msTransition,KhtmlTransition".split(","),p=",-webkit-,-moz-,-o-,-ms-,-khtml-".split(","),j="transitionEnd,webkitTransitionEnd,transitionend,oTransitionEnd,msTransitionEnd,KhtmlTransitionEnd".split(",");for(h=0;h<f.length;h++)if(f[h]in i.style){this.transitionstyle=f[h];this.prefixstyle=p[h];this.transitionend=j[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(){if(!b.isie||b.isie9)for(var c=["grab","-moz-grab","-webkit-grab"],d=0;d<c.length;d++){var e=c[d];i.style.cursor=e;if(i.style.cursor==e)return e}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.scrollTop=function(c){return c===void 0?b.getScrollTop():b.setScrollTop(c)};this.ishwscroll?(b.doc.translate={x:0,y:0},this.getScrollTop=function(){return b.doc.translate.y},this.setScrollTop=this.hastranslate3d?function(c,d){b.doc.css(b.trstyle,"translate3d(0px,"+c*-1+"px,0px)");b.doc.translate.y=c;if(!d)if(document.createEvent){var e=document.createEvent("UIEvents");e.initUIEvent("scroll",false,true,window,1);b.docscroll[0].dispatchEvent(e)}else e=document.createEventObject(),
-b.docscroll[0].fireEvent("onscroll"),e.cancelBubble=true}:function(c,d){b.doc.css(b.trstyle,"translate(0px,"+c*-1+"px)");b.doc.translate.y=c;if(!d)if(document.createEvent){var e=document.createEvent("UIEvents");e.initUIEvent("scroll",false,true,window,1);b.docscroll[0].dispatchEvent(e)}else e=document.createEventObject(),b.docscroll[0].fireEvent("onscroll"),e.cancelBubble=true}):(this.getScrollTop=function(){return b.docscroll.scrollTop()},this.setScrollTop=function(c){return b.docscroll.scrollTop(c)});
-this.getTarget=function(b){return!b?false:b.target?b.target:b.srcElement?b.srcElement:false};this.hasParent=function(b,d){if(!b)return false;for(var e=b.target||b.srcElement||b||false;e&&e.id!=d;)e=e.parentNode||false;return e!==false};this.updateScrollBar=function(c){if(b.ishwscroll)b.rail.css({height:b.win.innerHeight()});else{var d=b.win.offset();d.top+=2;var e=(b.win.outerWidth()-b.win.innerWidth())/2;d.left+=b.win.innerWidth()+e-b.rail.width-1;b.rail.css({position:"absolute",top:d.top,left:d.left,
-height:c?c.h:b.win.innerHeight()});b.zoom&&b.zoom.css({position:"absolute",top:d.top+1,left:d.left-18})}};var k=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||false,n=window.cancelRequestAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||false;b.hasanimationframe=k;
-b.hascancelanimationframe=n;b.hasanimationframe||(k=function(b){return setTimeout(b,1E3/60)});b.hascancelanimationframe||(n=clearInterval);this.init=function(){if(!b.ispage||!b.cantouch&&!b.isieold){b.ispage?b.doc.css({"overflow-y":"hidden"}):b.docscroll.css({"overflow-y":"hidden"});b.ispage&&b.isie7&&g("html").css({"overflow-y":"hidden"});var c=g(document.createElement("div"));c.css({position:"relative",top:0,"float":"right",width:b.opt.cursorwidth,height:"0px","background-color":b.opt.cursorcolor,
-border:b.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":b.opt.cursorborderradius,"-moz-border-radius":b.opt.cursorborderradius,"border-radius":b.opt.cursorborderradius});c.hborder=parseFloat(c.outerHeight()-c.innerHeight());b.cursor=c;var d=g(document.createElement("div"));d.attr("id",b.id);d.width=3+Math.max(parseFloat(b.opt.cursorwidth),c.outerWidth());d.css({"padding-left":"0px","padding-right":"1px",width:d.width+"px",zIndex:b.ispage?b.opt.zindex:b.opt.zindex+2,background:b.opt.background});
-d.append(c);b.rail=d;c=false;if(b.opt.boxzoom&&!b.ispage&&!b.isieold)c=document.createElement("div"),b.bind(c,"click",b.doZoom),b.zoom=g(c),b.zoom.css({cursor:"pointer","z-index":b.opt.zindex,backgroundImage:"url("+o+"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.bind(b.win,"gestureend",function(c){c.scale>1.5&&b.doZoomIn(c);c.scale<0.8&&b.doZoomOut(c);return b.cancelEvent(c)});b.ispage?(d.css({position:"fixed",
-top:"0px",right:"0px",height:"100%"}),b.doc.append(d)):b.ishwscroll?(b.win.css("position")=="static"&&b.win.css("position","relative"),b.zoom&&(b.zoom.css({position:"absolute",top:1,right:0,"margin-right":d.width+2}),b.win.append(b.zoom)),d.css({position:"absolute",top:0,right:0}),b.win.append(d)):(b.updateScrollBar(),g("body").append(d),b.zoom&&g("body").append(b.zoom));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.bind(window,"resize",b.onResize);b.bind(window,"orientationchange",b.onResize);!b.ispage&&!b.haswrapper&&b.bind(b.win,b.isie&&!b.isie9?"propertychange":"DOMAttrModified",b.onAttributeChange);!b.ispage&&b.opt.boxzoom&&g(window).resize(b.resizeZoom);b.istextarea&&b.win.mouseup(b.onResize);b.onResize();b.cantouch||b.opt.touchbehavior?(b.onmousedown=function(c){if(b.locked)return b.cancelEvent(c);b.rail.drag={x:c.pageX,y:c.pageY,sx:b.scroll.x,sy:b.scroll.y,st:b.getScrollTop(),
-lx:c.pageX,ly:c.pageY,nx:c.pageX,ny:c.pageY,tt:(new Date).getTime(),lt:(new Date).getTime()};return b.cancelEvent(c)},b.onmouseup=function(c){if(b.rail.drag)return b.doScrollMomentum(b.rail.drag),b.rail.drag=false,b.cancelEvent(c)},b.onmousemove=function(c){if(b.rail.drag){var d=c.pageY-b.rail.drag.y;b.rail.drag.ly=b.rail.drag.ny;b.rail.drag.ny=c.pageY;b.rail.drag.lt=(new Date).getTime();b.scroll.y=Math.round((b.rail.drag.st-d)*(1/b.scrollratio.y));if(b.scroll.y<0)b.scroll.y=0;if(b.scroll.y>b.scrollvaluemax)b.scroll.y=
-b.scrollvaluemax;b.showCursor();b.doScrollTo(b.rail.drag.st-d,true);return b.cancelEvent(c)}},b.cursorgrabvalue&&b.win.css({cursor:b.cursorgrabvalue})):(b.onmousedown=function(c){if(b.locked)return b.cancelEvent(c);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)}});(b.cantouch||b.opt.touchbehavior)&&b.bind(b.win,"mousedown",b.onmousedown);b.bind(b.win,"mouseup",b.onmouseup);b.bind(b.rail,"mousedown",b.onmousedown);b.bind(b.rail,"mouseup",function(c){b.rail.drag=false;b.hideCursor();return b.cancelEvent(c)});b.bind(document,"mouseup",b.onmouseup);b.bind(document,"mousemove",b.onmousemove);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.ispage&&!b.cantouch&&(b.win.attr("tabindex")||b.win.attr({tabindex:(new Date).getTime()}),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){m=b.getTarget(c).id||true;b.hasmousefocus=true;b.noticeCursor()}),b.win.mouseleave(function(){m=false;b.hasmousefocus=false}));b.onkeypress=function(c){var c=c?c:window.e,d=b.getTarget(c);if(d&&/INPUT|TEXTAREA|SELECT/.test(d.nodeName)&&(!d.getAttribute("type")&&!d.type||!/submit|button|cancel/i.tp))return true;if(b.hasfocus||b.hasmousefocus&&!l||b.ispage&&!l&&!m){d=c.keyCode;if(b.locked&&d!=27)return b.cancelEvent(c);var e=true;switch(d){case 38:case 63233:b.doScrollBy(72,
-true);e=false;break;case 40:case 63235:b.doScrollBy(-72,true);e=false;break;case 33:case 63276:b.doScrollBy(b.view.h,true);e=false;break;case 34:case 63277:b.doScrollBy(-b.view.h,true);e=false;break;case 36:case 63273:b.doScrollTo(0,true);e=false;break;case 35:case 63275:b.doScrollTo(b.page.h,true);e=false;break;case 27:b.zoomactive&&(b.doZoom(),e=false)}if(!e)return b.cancelEvent(c)}};b.bind(document,b.isopera?"keypress":"keydown",b.onkeypress)}if(this.doc[0].nodeName=="IFRAME"){var e=function(){var c=
-"contentDocument"in this?this.contentDocument:this.contentWindow.document;if(b.isiframe)b.docscroll=g(c),b.iframe={html:b.doc.contents().find("html")[0],body:b.doc.contents().find("body")[0]};if(b.opt.iframeautoresize&&!b.isiframe){b.win.scrollTop(0);b.doc.height("");var d=b.doc.contents(),d=Math.max(d.find("html").attr("scrollHeight"),d.find("body").attr("scrollHeight"));b.doc.height(d)}b.onResize();b.isie7&&g(c).find("html").css({"overflow-y":"hidden"});g(c.body).css({"overflow-y":"hidden"});"contentWindow"in
-this?b.bind(this.contentWindow,"scroll",b.onscroll):b.bind(c,"scroll",b.onscroll);b.bind(c,"mouseup",b.onmouseup);b.bind(c,"mousewheel",b.onmousewheel);b.bind(c,b.isopera?"keypress":"keydown",b.onkeypress);if(b.cantouch||b.opt.touchbehavior)b.bind(c,"mousedown",b.onmousedown),b.cursorgrabvalue&&g(c).css({cursor:b.cursorgrabvalue});b.bind(c,"mousemove",b.onmousemove);b.zoom&&(b.opt.dblclickzoom&&b.bind(c,"dblclick",b.doZoom),b.cantouch&&b.opt.gesturezoom&&b.bind(c,"gesturechange",function(c){c.scale>
-1.5&&b.doZoomIn(c);c.scale<0.8&&b.doZoomOut(c);return b.cancelEvent(c)}))};this.doc[0].readyState&&this.doc[0].readyState=="complete"&&setTimeout(function(){e.call(b.doc[0],false)},500);this.doc.load(e)}};this.showCursor=function(){if(b.cursortimeout)clearTimeout(b.cursortimeout),b.cursortimeout=0;b.rail&&(b.autohidedom&&b.autohidedom.stop().css({opacity:b.opt.cursoropacitymax}),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||800)};this.noticeCursor=function(c){b.showCursor();b.hideCursor(c)};this.getContentSize=function(){var c=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};c.w-=1;c.h-=1;return c};this.onAttributeChange=function(c){if(c&&c.target){if(c.target!==b.win[0]&&
-c.target!==b.doc[0])return true;if((c="attrChange"in c?c.attrName:"propertyName"in c?c.propertyName:false)&&/width|height|style|block/i.test(c)){if(b.lastattributechange)b.lastattributechange=clearTimeout(b.lastattributechange);b.lastattributechange=setTimeout(function(){b.lastattributechange=0;b.onResize()},60)}}};this.onResize=function(){if(!b.haswrapper&&!b.ispage){var c=b.win.css("display")!="none";c&&!b.visibility&&b.show();!c&&b.visibility&&b.hide();if(!b.visibility)return false}b.view={w:b.ispage?
-b.win.width():b.win.innerWidth(),h:b.ispage?b.win.height():b.win.innerHeight()};b.page=b.getContentSize();if(b.view.h>=b.page.h)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.scrollvaluemax=
-b.view.h-b.cursorheight-b.cursor.hborder-2;b.scrollratio={x:0,y:(b.page.h-b.view.h)/b.scrollvaluemax};b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y));b.noticeCursor()};this.bind=function(c,d,e,f){var g=c.length?c[0]:c;g.addEventListener?(b.cantouch&&/mouseup|mousedown|mousemove/.test(d)&&g.addEventListener(d=="mousedown"?"touchstart":d=="mouseup"?"touchend":"touchmove",function(b){if(b.touches.length<2){var c=b.touches.length>0?b.touches[0]:b;c.original=b;e.call(this,c)}},f||false),g.addEventListener(d,
-e,f||false),d=="mousewheel"&&g.addEventListener("DOMMouseScroll",e,f||false),b.cantouch&&d=="mouseup"&&g.addEventListener("touchcancel",e,f||false)):g.attachEvent?g.attachEvent("on"+d,function(c){if(c&&!("pageY"in c)&&"screenY"in c)c.pageX=c.screenX,c.pageY=c.screenY;return e.call(g,c)===false||f===false?b.cancelEvent(c):true}):g["on"+d]=function(c){return e.call(g,c)===false||f===false?b.cancelEvent(c):true}};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(){b.visibility=true;b.rail.css("display","block")};this.hide=function(){b.visibility=false;b.rail.css("display","none")};this.onmousewheel=function(c){if(b.locked)return b.cancelEvent(c);c=c?c:window.event;if(b.rail.drag)return b.cancelEvent(c);var d=0;(d=c.detail?c.detail*-1:c.wheelDelta/40)&&b.doScrollBy(d*b.opt.mousescrollstep,
-true);return b.cancelEvent(c)};this.stop=function(){b.timer&&n(b.timer);b.timer=0;b.cursorfreezed=false;b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y));b.noticeCursor()};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)),c=c>20?b.prefixstyle+"transform "+c+"ms ease-out 0s":"";if(!b.lasttransitionstyle||b.lasttransitionstyle!=c)b.lasttransitionstyle=c,b.doc.css(b.transitionstyle,
-c)},this.doScroll=function(c){b.newscrolly=c;if(!b.timer)b.timer=setTimeout(function(){var c=b.getScrollTop();b.prepareTransition(c>b.newscrolly?c-b.newscrolly:b.newscrolly-c);b.setScrollTop(b.newscrolly);b.timer=0},b.opt.scrollspeed),b.noticeCursor()}):this.doScroll=function(c){function d(){g=(new Date).getTime();if(g<f)return b.timer=k(d);f=(new Date).getTime()+b.opt.scrollspeed;g=0;var c=b.newscrolly-b.getScrollTop(),c=c>0?Math.ceil(c*e):Math.floor(c*e),c=b.getScrollTop()+c;b.setScrollTop(c);c==
-b.newscrolly?(b.timer=0,b.cursorfreezed=false):b.timer=k(d)}b.newscrolly=c;if(!b.timer){var e=0.25,g=0,f=0;b.timer=k(d);b.noticeCursor()}};this.doScrollBy=function(c,d){d&&(c=Math.round(c*1/b.scrollratio.y));var e=b.scroll.y-c;e<0&&(e=0);var g=b.scrollvaluemax;e>g&&(e=g);b.cursorfreezed=false;b.doScroll(Math.floor(e*b.scrollratio.y))};this.doScrollTo=function(c,d){ny=d?Math.round(c*1/b.scrollratio.y):c;ny<0&&(c=0);var e=b.scrollvaluemax;ny>e&&(c=d?Math.round(e*b.scrollratio.y):e);b.cursorfreezed=
-false;b.doScroll(d?c:Math.round(c*b.scrollratio.y))};this.doScrollMomentum=function(c){var d=c.ly-c.ny,c=(new Date).getTime()-c.lt;(d=Math.floor(d*3/((c+1)*0.2)))&&b.doScrollBy(d,true)};b.onscroll=function(){var c=(new Date).getTime();if(!b.lastcontentcheck||b.lastcontentcheck<c)if(b.lastcontentcheck=c+500,b.getContentSize().h!=b.page.h)b.onResize();if(!b.rail.drag){if(!b.cursorfreezed)b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y));b.noticeCursor()}};b.docscroll.scroll(function(c){b.onscroll(c)});
-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,f;for(f in d){var h=d[f];b.zoomrestore.style[h]=typeof e[h]!="undefined"?e[h]:""}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=
-g(window).scrollTop(),g(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&&g(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:g(window).width()-b.zoomrestore.padding.w+
-"px",height:g(window).height()-b.zoomrestore.padding.h+"px"});b.setScrollTop(c);b.onResize()}};this.init()};g.fn.niceScroll=function(f,b){typeof f=="object"&&typeof b=="undefined"&&(b=f,f=false);var h=[];typeof b=="undefined"&&(b={});if(f)b.doc=g(f),b.win=g(this);var i=!("doc"in b);this.each(function(){var f=g(this).data("__nicescroll")||false;if(!f)b.doc=i?g(this):b.doc,f=new q(b),g(this).data("__nicescroll",f);h.push(f)});return h.length==1?h[0]:h};var j=jQuery.fn.scrollTop;g.cssHooks.scrollTop=
-{get:function(f){var b=g.data(f,"__nicescroll")||false;return b&&b.ishwscroll?b.getScrollTop():j.call(f)},set:function(f,b){var h=g.data(f,"__nicescroll")||false;h&&h.ishwscroll?h.setScrollTop(parseInt(b)):j.call(f,b);return this}};jQuery.fn.scrollTop=function(f){if(typeof f=="undefined"){var b=g.data(this,"__nicescroll")||false;return b&&b.ishwscroll?b.getScrollTop():j.call(this)}else return this.each(function(){var b=g.data(this,"__nicescroll")||false;b&&b.ishwscroll?b.setScrollTop(parseInt(f)):
-j.call(g(this),f)})};jQuery.fn.getNiceScroll=function(f){if(typeof f=="undefined"){for(a=0;a<this.length;a++)if(f=g.data(this[a],"__nicescroll")||false)return f;return false}else return f=g.data(this[f],"__nicescroll")||false}})(jQuery);
+(function(e){var l=false,n=false,q=5E3,r=2E3,s=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("/")+"/":""}(),v=function(g,d){var b=this;this.version="2.5.0";this.name="nicescroll";this.me=d;this.opt={doc:e("body"),win:false,zindex:9E3,cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"5px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:60,mousescrollstep:48,
+touchbehavior:false,hwacceleration:true,usetransition:true,boxzoom:false,dblclickzoom:true,gesturezoom:true,grabcursorenabled:true,autohidemode:true,background:"",iframeautoresize:true,cursorminheight:20};if(g)for(var i in b.opt)g[i]!==void 0&&(b.opt[i]=g[i]);this.id=b.opt.doc[0].id||"";this.doc=b.opt.doc;this.ispage=b.doc[0].nodeName=="BODY"||b.doc[0].nodeName=="HTML";this.haswrapper=b.opt.win!==false;this.win=b.opt.win||(this.ispage?e(window):this.doc);this.docscroll=this.ispage?e(window):this.win;
+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.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"+r++;while(document.getElementById(this.id));this.hasmousefocus=this.hasfocus=this.zoomactive=this.zoom=this.cursorfreezed=
+this.cursor=this.rail=false;this.visibility=true;this.locked=false;this.events=[];this.saved={};var h=document.createElement("DIV");this.isopera="opera"in window;this.isieold=(this.isie="all"in document&&"attachEvent"in h&&!this.isopera)&&!("msInterpolationMode"in h.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 h.style;(this.cantouch="ontouchstart"in document.documentElement)&&/iphone|ipad|ipod/i.test(navigator.platform)?(this.isios=true,this.isios4=!("seal"in Object)):this.isios4=this.isios=false;if(b.opt.hwacceleration){if((this.trstyle=window.opera?"OTransform":document.all?"msTransform":h.style.webkitTransform!==void 0?"webkitTransform":h.style.MozTransform!==void 0?"MozTransform":false)&&h.style[this.trstyle]===void 0)this.trstyle=false;if(this.hastransform=this.trstyle!=
+false)h.style[this.trstyle]="translate3d(1px,2px,3px)",this.hastranslate3d=/translate3d/.test(h.style[this.trstyle]);this.transitionstyle=false;this.prefixstyle="";this.transitionend=false;var o="transition,webkitTransition,MozTransition,OTransition,msTransition,KhtmlTransition".split(","),t=",-webkit-,-moz-,-o-,-ms-,-khtml-".split(","),j="transitionEnd,webkitTransitionEnd,transitionend,oTransitionEnd,msTransitionEnd,KhtmlTransitionEnd".split(",");for(i=0;i<o.length;i++)if(o[i]in h.style){this.transitionstyle=
+o[i];this.prefixstyle=t[i];this.transitionend=j[i];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(){if(!b.isie||b.isie9)for(var c=["grab","-moz-grab","-webkit-grab"],d=0;d<c.length;d++){var f=c[d];h.style.cursor=f;if(h.style.cursor==f)return f}return"url(http://www.google.com/intl/en_ALL/mapfiles/openhand.cur),n-resize"}();
+h=null;this.ishwscroll=b.hastransform&&b.opt.hwacceleration&&b.haswrapper;this.scrollTop=function(c){return c===void 0?b.getScrollTop():b.setScrollTop(c)};this.ishwscroll?(b.doc.translate={x:0,y:0},this.getScrollTop=function(){return b.doc.translate.y},this.setScrollTop=this.hastranslate3d?function(c,d){b.doc.css(b.trstyle,"translate3d(0px,"+c*-1+"px,0px)");b.doc.translate.y=c;if(!d)if(document.createEvent){var f=document.createEvent("UIEvents");f.initUIEvent("scroll",false,true,window,1);b.docscroll[0].dispatchEvent(f)}else f=
+document.createEventObject(),b.docscroll[0].fireEvent("onscroll"),f.cancelBubble=true}:function(c,d){b.doc.css(b.trstyle,"translate(0px,"+c*-1+"px)");b.doc.translate.y=c;if(!d)if(document.createEvent){var f=document.createEvent("UIEvents");f.initUIEvent("scroll",false,true,window,1);b.docscroll[0].dispatchEvent(f)}else f=document.createEventObject(),b.docscroll[0].fireEvent("onscroll"),f.cancelBubble=true}):(this.getScrollTop=function(){return b.docscroll.scrollTop()},this.setScrollTop=function(c){return b.docscroll.scrollTop(c)});
+this.getTarget=function(b){return!b?false:b.target?b.target:b.srcElement?b.srcElement:false};this.hasParent=function(b,d){if(!b)return false;for(var f=b.target||b.srcElement||b||false;f&&f.id!=d;)f=f.parentNode||false;return f!==false};this.updateScrollBar=function(c){if(b.ishwscroll)b.rail.css({height:b.win.innerHeight()});else{var d=b.win.offset();d.top+=2;var f=(b.win.outerWidth()-b.win.innerWidth())/2;d.left+=b.win.innerWidth()+f-b.rail.width-1;b.rail.css({position:"absolute",top:d.top,left:d.left,
+height:c?c.h:b.win.innerHeight()});b.zoom&&b.zoom.css({position:"absolute",top:d.top+1,left:d.left-20})}};var k=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||false,m=window.cancelRequestAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||false;b.hasanimationframe=k;
+b.hascancelanimationframe=m;b.hasanimationframe?b.hascancelanimationframe||(m=function(){b.cancelAnimationFrame=true}):(k=function(b){return setTimeout(b,1E3/60)},m=clearInterval);this.init=function(){b.saved.css=[];b.ispage&&b.saved.css.push([b.doc,"overflow-y",b.doc.css("overflow-y")]);b.ispage||b.saved.css.push([b.docscroll,"overflow-y",b.docscroll.css("overflow-y")]);b.ispage&&b.isie7&&b.saved.css.push([e("html"),"overflow-y",e("html").css("overflow-y")]);if(!b.ispage||!b.cantouch&&!b.isieold){b.ispage?
+b.doc.css({"overflow-y":"hidden"}):b.docscroll.css({"overflow-y":"hidden"});b.ispage&&b.isie7&&e("html").css({"overflow-y":"hidden"});var c=e(document.createElement("div"));c.css({position:"relative",top:0,"float":"right",width:b.opt.cursorwidth,height:"0px","background-color":b.opt.cursorcolor,border:b.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":b.opt.cursorborderradius,"-moz-border-radius":b.opt.cursorborderradius,"border-radius":b.opt.cursorborderradius});c.hborder=
+parseFloat(c.outerHeight()-c.innerHeight());b.cursor=c;var d=e(document.createElement("div"));d.attr("id",b.id);d.width=3+Math.max(parseFloat(b.opt.cursorwidth),c.outerWidth());d.css({"padding-left":"0px","padding-right":"1px",width:d.width+"px",zIndex:b.ispage?b.opt.zindex:b.opt.zindex+2,background:b.opt.background});d.append(c);b.rail=d;c=false;if(b.opt.boxzoom&&!b.ispage&&!b.isieold)c=document.createElement("div"),b.bind(c,"click",b.doZoom),b.zoom=e(c),b.zoom.css({cursor:"pointer","z-index":b.opt.zindex,
+backgroundImage:"url("+s+"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.bind(b.win,"gestureend",function(c){c.scale>1.5&&b.doZoomIn(c);c.scale<0.8&&b.doZoomOut(c);return b.cancelEvent(c)});b.ispage?(d.css({position:"fixed",top:"0px",right:"0px",height:"100%"}),b.doc.append(d)):b.ishwscroll?(b.win.css("position")=="static"&&b.win.css("position","relative"),b.zoom&&(b.zoom.css({position:"absolute",
+top:1,right:0,"margin-right":d.width+4}),b.win.append(b.zoom)),d.css({position:"absolute",top:0,right:0}),b.win.append(d)):(b.updateScrollBar(),e("body").append(d),b.zoom&&e("body").append(b.zoom));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.bind(window,"resize",b.onResize);b.bind(window,"orientationchange",b.onResize);!b.ispage&&!b.haswrapper&&b.bind(b.win,b.isie&&!b.isie9?"propertychange":
+"DOMAttrModified",b.onAttributeChange);!b.ispage&&b.opt.boxzoom&&e(window).resize(b.resizeZoom);b.istextarea&&b.win.mouseup(b.onResize);b.onResize();b.cantouch||b.opt.touchbehavior?(b.scrollmom={y:new u(b)},b.onmousedown=function(c){if(!b.locked&&(b.cancelScroll(),b.rail.drag={x:c.pageX,y:c.pageY,sx:b.scroll.x,sy:b.scroll.y,st:b.getScrollTop()},b.hasmoving=false,b.scrollmom.y.reset(c.pageY),!b.cantouch))return b.cancelEvent(c)},b.onmouseup=function(c){if(b.rail.drag&&(b.scrollmom.y.doMomentum(),b.rail.drag=
+false,b.hasmoving))return b.hasmoving=false,b.cancelEvent(c)},b.onmousemove=function(c){if(b.rail.drag){b.hasmoving=true;var d=c.pageY-b.rail.drag.y;b.scrollmom.y.update(c.pageY);b.showCursor(b.rail.drag.st-d);b.prepareTransition&&b.prepareTransition(0);b.setScrollTop(b.rail.drag.st-d);return b.cancelEvent(c)}},b.cursorgrabvalue&&(b.saved.css.push([b.win,"cursor",b.win.css("cursor")]),b.win.css({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)}});(b.cantouch||b.opt.touchbehavior)&&b.bind(b.win,
+"mousedown",b.onmousedown);b.bind(b.win,"mouseup",b.onmouseup);b.bind(b.rail,"mousedown",b.onmousedown);b.bind(b.rail,"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.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.ispage&&!b.cantouch&&(b.win.attr("tabindex")||b.win.attr({tabindex:q++}),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){n=b.getTarget(c).id||true;b.hasmousefocus=true;b.noticeCursor()}),b.win.mouseleave(function(){n=false;b.hasmousefocus=false}));b.onkeypress=function(c){var c=c?c:window.e,d=b.getTarget(c);
+if(d&&/INPUT|TEXTAREA|SELECT/.test(d.nodeName)&&(!d.getAttribute("type")&&!d.type||!/submit|button|cancel/i.tp))return true;if(b.hasfocus||b.hasmousefocus&&!l||b.ispage&&!l&&!n){d=c.keyCode;if(b.locked&&d!=27)return b.cancelEvent(c);var f=true;switch(d){case 38:case 63233:b.doScrollBy(72,true);f=false;break;case 40:case 63235:b.doScrollBy(-72,true);f=false;break;case 33:case 63276:b.doScrollBy(b.view.h,true);f=false;break;case 34:case 63277:b.doScrollBy(-b.view.h,true);f=false;break;case 36:case 63273:b.doScrollTo(0,
+true);f=false;break;case 35:case 63275:b.doScrollTo(b.page.maxh,true);f=false;break;case 27:b.zoomactive&&(b.doZoom(),f=false)}if(!f)return b.cancelEvent(c)}};b.bind(document,b.isopera?"keypress":"keydown",b.onkeypress)}if(this.doc[0].nodeName=="IFRAME"){var f=function(){var c="contentDocument"in this?this.contentDocument:this.contentWindow.document;if(b.isiframe)b.docscroll=e(c),b.iframe={html:b.doc.contents().find("html")[0],body:b.doc.contents().find("body")[0]};if(b.opt.iframeautoresize&&!b.isiframe){b.win.scrollTop(0);
+b.doc.height("");var d=b.doc.contents(),d=Math.max(d.find("html").attr("scrollHeight"),d.find("body").attr("scrollHeight"));b.doc.height(d)}b.onResize();b.isie7&&b.saved.css.push([e(c).find("html"),"overflow-y",e(c).find("html").css("overflow-y")]);b.saved.css.push([e(c.body),"overflow-y",e(c.body).css("overflow-y")]);b.isie7&&e(c).find("html").css({"overflow-y":"hidden"});e(c.body).css({"overflow-y":"hidden"});"contentWindow"in this?b.bind(this.contentWindow,"scroll",b.onscroll):b.bind(c,"scroll",
+b.onscroll);b.bind(c,"mouseup",b.onmouseup);b.bind(c,"mousewheel",b.onmousewheel);b.bind(c,b.isopera?"keypress":"keydown",b.onkeypress);if(b.cantouch||b.opt.touchbehavior)b.bind(c,"mousedown",b.onmousedown),b.cursorgrabvalue&&(b.saved.css.push([e(c),"cursor",e(c).css("cursor")]),e(c).css({cursor:b.cursorgrabvalue}));b.bind(c,"mousemove",b.onmousemove);b.zoom&&(b.opt.dblclickzoom&&b.bind(c,"dblclick",b.doZoom),b.cantouch&&b.opt.gesturezoom&&b.bind(c,"gesturechange",function(c){c.scale>1.5&&b.doZoomIn(c);
+c.scale<0.8&&b.doZoomOut(c);return b.cancelEvent(c)}))};this.doc[0].readyState&&this.doc[0].readyState=="complete"&&setTimeout(function(){f.call(b.doc[0],false)},500);this.doc.load(f)}};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||800)};this.noticeCursor=function(c){b.showCursor();b.hideCursor(c)};this.getContentSize=function(){var c=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};c.w-=1;c.h-=1;return c};this.onAttributeChange=function(c){if(c&&
+c.target){if(c.target!==b.win[0]&&c.target!==b.doc[0])return true;if((c="attrChange"in c?c.attrName:"propertyName"in c?c.propertyName:false)&&/width|height|style|block/i.test(c)){if(b.lastattributechange)b.lastattributechange=clearTimeout(b.lastattributechange);b.lastattributechange=setTimeout(function(){b.lastattributechange=0;b.onResize()},60)}}};this.resize=this.onResize=function(){if(!b.haswrapper&&!b.ispage){var c=b.win.css("display")!="none";c&&!b.visibility&&b.show();!c&&b.visibility&&b.hide();
+if(!b.visibility)return false}b.view={w:b.ispage?b.win.width():b.win.innerWidth(),h:b.ispage?b.win.height():b.win.innerHeight()};b.page=b.getContentSize();b.page.maxh=b.page.h-b.view.h;if(b.view.h>=b.page.h)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-2;b.scrollratio={x:0,y:(b.page.h-b.view.h)/b.scrollvaluemax};b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y));b.noticeCursor();return b};this._bind=function(c,d,f,e){b.events.push({e:c,n:d,f:f});c.addEventListener?c.addEventListener(d,f,e||false):c.attachEvent?c.attachEvent("on"+d,f):c["on"+d]=f};this.bind=function(c,
+d,f,e){var g=c.length?c[0]:c;g.addEventListener?(b.cantouch&&/mouseup|mousedown|mousemove/.test(d)&&b._bind(g,d=="mousedown"?"touchstart":d=="mouseup"?"touchend":"touchmove",function(b){if(b.touches.length<2){var c=b.touches.length>0?b.touches[0]:b;c.original=b;f.call(this,c)}},e||false),b._bind(g,d,f,e||false),d=="mousewheel"&&b._bind(g,"DOMMouseScroll",f,e||false),b.cantouch&&d=="mouseup"&&b._bind(g,"touchcancel",f,e||false)):b._bind(g,d,function(c){if(c&&!("pageY"in c)&&"screenY"in c)c.pageX=c.screenX,
+c.pageY=c.screenY;return f.call(g,c)===false||e===false?b.cancelEvent(c):true})};this._unbind=function(b,d,f){b.removeEventListener?b.removeEventListener(d,f,false):b.detachEvent?b.detachEvent("on"+d,f):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(){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.onmousewheel=function(c){if(b.locked)return b.cancelEvent(c);c=c?c:window.event;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,true);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)),c=c>20?b.prefixstyle+"transform "+c+"ms ease-out 0s":"";if(!b.lasttransitionstyle||b.lasttransitionstyle!=c)b.lasttransitionstyle=c,b.doc.css(b.transitionstyle,c)},this.doScroll=function(c){b.newscrolly=c;if(b.timer)return false;b.timer=setTimeout(function(){var c=b.getScrollTop(),c=Math.abs(c-b.newscrolly);b.prepareTransition(c);b.timer=setTimeout(function(){b.setScrollTop(b.newscrolly);
+b.timer=0},15)},b.opt.scrollspeed);b.noticeCursor()},this.cancelScroll=function(){var c=b.getScrollTop();b.prepareTransition(0);b.setScrollTop(c);b.noticeCursor();return b}):(this.doScroll=function(c){function d(){if(b.cancelAnimationFrame)return true;g=(new Date).getTime();if(g<h)return b.timer=k(d)||1;h=Math.floor((new Date).getTime()+b.opt.scrollspeed/2);g=0;var c=b.getScrollTop();if(b.newspeedy)if(c+=b.newspeedy.v,b.newspeedy.v>0){if(c>=b.newspeedy.x)b.newspeedy=false}else{if(c<=b.newspeedy.x)b.newspeedy=
+false}else c=b.newscrolly-b.getScrollTop(),c=c>0?Math.ceil(c*e):Math.floor(c*e),c=b.getScrollTop()+c;b.setScrollTop(c);c==b.newscrolly?(b.timer=0,b.cursorfreezed=false):b.timer=k(d)||1}b.newscrolly=c;var f=c-b.getScrollTop();b.newspeedy=f*f>100?{x:c-Math.round(f/6),v:Math.round(f/6*5/8)+1}:false;if(!b.timer){var e=0.25,g=0,h=0;b.cancelAnimationFrame=false;b.timer=k(d)||1;b.noticeCursor()}},this.cancelScroll=function(){b.timer&&m(b.timer);b.timer=0;return b});this.doScrollBy=function(c,d){var f=0,
+f=d?b.timer?b.newscrolly-c:b.getScrollTop()-c:Math.floor((b.scroll.y-c)*b.scrollratio.y);if(f<0)f=0;else if(f>b.page.maxh)f=b.page.maxh;b.cursorfreezed=false;b.doScroll(f)};this.doScrollTo=function(c,d){d||Math.round(c*b.scrollratio.y);b.cursorfreezed=false;b.doScroll(c)};b.onscroll=function(){var c=(new Date).getTime();if(!b.lastcontentcheck||b.lastcontentcheck<c)if(b.lastcontentcheck=c+500,b.getContentSize().h!=b.page.h)b.onResize();if(!b.rail.drag){if(!b.cursorfreezed)b.scroll.y=Math.round(b.getScrollTop()*
+(1/b.scrollratio.y));b.noticeCursor()}};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(","),f=b.win[0].style,g;for(g in d){var h=d[g];b.zoomrestore.style[h]=typeof f[h]!="undefined"?f[h]:""}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=e(window).scrollTop(),e(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&&e(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:e(window).width()-b.zoomrestore.padding.w+"px",height:e(window).height()-b.zoomrestore.padding.h+"px"});b.setScrollTop(c);b.onResize()}};this.init()},u=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 i=b-d.lasty,h=e.getScrollTop()+
+i;d.snapy=h<0||h>d.nc.page.maxh;d.speedy=i;d.lasty=b};this.stop=function(){if(d.timer)clearTimeout(d.timer),d.timer=0};this.doSnapy=function(b){b<0?d.nc.doScrollTo(0,true):b>d.nc.page.maxh&&d.nc.doScrollTo(d.nc.page.maxh,true)};this.doMomentum=function(){var b=d.lasttime,e=d.time();d.speedy=Math.min(200,d.speedy);if(d.speedy&&b&&e-b<=50&&d.speedy){var g=e-b;d.demuly=0;var j=function(){var b=Math.floor(d.nc.getScrollTop()-d.speedy*(1-d.demuly));d.demuly+=0.02;d.nc.setScrollTop(b);d.nc.showCursor(b);
+d.demuly<1?d.timer=setTimeout(j,g):(d.timer=0,d.nc.hideCursor(),d.doSnapy(b))};j()}else d.snapy&&d.doSnapy(d.nc.getScrollTop())}},j=jQuery.fn.scrollTop;e.cssHooks.scrollTop={get:function(g){var d=e.data(g,"__nicescroll")||false;return d&&d.ishwscroll?d.getScrollTop():j.call(g)},set:function(g,d){var b=e.data(g,"__nicescroll")||false;b&&b.ishwscroll?b.setScrollTop(parseInt(d)):j.call(g,d);return this}};jQuery.fn.scrollTop=function(g){if(typeof g=="undefined"){var d=e.data(this,"__nicescroll")||false;
+return d&&d.ishwscroll?d.getScrollTop():j.call(this)}else return this.each(function(){var b=e.data(this,"__nicescroll")||false;b&&b.ishwscroll?b.setScrollTop(parseInt(g)):j.call(e(this),g)})};var p=function(g){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.show=function(){return d.each(function(){this.show()})};this.hide=function(){return d.each(function(){this.hide()})};this.onResize=function(){return d.each(function(){this.onResize()})};
+this.resize=function(){return d.each(function(){this.resize()})};this.remove=function(){return d.each(function(){this.remove()})};this.stop=function(){return d.each(function(){this.stop()})};this.push=function(b){d[d.length]=b;d.length++};this.eq=function(b){return d[b]};if(g)for(a=0;a<g.length;a++){var b=e.data(g[a],"__nicescroll")||false;b&&(this[this.length]=b,this.length++)}return this};jQuery.fn.getNiceScroll=function(g){return typeof g=="undefined"?this.length>0?new p(this):e.data(this,"__nicescroll")||
+false:e.data(this[g],"__nicescroll")||false};jQuery.extend(jQuery.expr[":"],{nicescroll:function(g){return e.data(g,"__nicescroll")||false}});e.fn.niceScroll=function(g,d){typeof g=="object"&&typeof d=="undefined"&&(d=g,g=false);var b=new p;typeof d=="undefined"&&(d={});if(g)d.doc=e(g),d.win=e(this);var i=!("doc"in d);this.each(function(){var g=e(this).data("__nicescroll")||false;if(!g)d.doc=i?e(this):d.doc,g=new v(d,e(this)),e(this).data("__nicescroll",g);b.push(g)});return b.length==1?b[0]:b}})(jQuery);

BIN
zoomico.png