(function(b){b.event.special.mousewheel={setup:function(){var a=b.event.special.mousewheel.handler;b.browser.mozilla&&b(this).bind("mousemove.mousewheel",function(c){b.data(this,"mwcursorposdata",{pageX:c.pageX,pageY:c.pageY,clientX:c.clientX,clientY:c.clientY})});if(this.addEventListener)this.addEventListener(b.browser.mozilla?"DOMMouseScroll":"mousewheel",a,false);else this.onmousewheel=a},teardown:function(){var a=b.event.special.mousewheel.handler;b(this).unbind("mousemove.mousewheel");if(this.removeEventListener)this.removeEventListener(b.browser.mozilla?
"DOMMouseScroll":"mousewheel",a,false);else this.onmousewheel=function(){};b.removeData(this,"mwcursorposdata")},handler:function(a){var c=Array.prototype.slice.call(arguments,1);a=b.event.fix(a||window.event);b.extend(a,b.data(this,"mwcursorposdata")||{});var d=0;if(a.wheelDelta)d=a.wheelDelta/120;if(a.detail)d=-a.detail/3;a.data=a.data||{};a.type="mousewheel";c.unshift(d);c.unshift(a);return b.event.handle.apply(this,c)}};b.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},
unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
