/*! copyright (c) 2010 brandon aaron (http://brandonaaron.net) * licensed under the mit license (license.txt). * * thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. * thanks to: mathias bank(http://www.mathias-bank.de) for a scope bug fix. * thanks to: seamus leahy for adding deltax and deltay * * version: 3.0.4 * * requires: 1.2.2+ */ (function(d){function g(a){var b=a||window.event,i=[].slice.call(arguments,1),c=0,h=0,e=0;a=d.event.fix(b);a.type="mousewheel";if(a.wheeldelta)c=a.wheeldelta/120;if(a.detail)c=-a.detail/3;e=c;if(b.axis!==undefined&&b.axis===b.horizontal_axis){e=0;h=-1*c}if(b.wheeldeltay!==undefined)e=b.wheeldeltay/120;if(b.wheeldeltax!==undefined)h=-1*b.wheeldeltax/120;i.unshift(a,c,h,e);return d.event.handle.apply(this,i)}var f=["dommousescroll","mousewheel"];d.event.special.mousewheel={setup:function(){if(this.addeventlistener)for(var a= f.length;a;)this.addeventlistener(f[--a],g,false);else this.onmousewheel=g},teardown:function(){if(this.removeeventlistener)for(var a=f.length;a;)this.removeeventlistener(f[--a],g,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jquery);