(function(a){a.fn.extend({mousewheel:function(b){if(!b.guid){b.guid=a.event.guid++}if(!a.event._mwCache){a.event._mwCache=[]}return this.each(function(){if(this._mwHandlers){return this._mwHandlers.push(b)}else{this._mwHandlers=[]}this._mwHandlers.push(b);var c=this;this._mwHandler=function(g){g=a.event.fix(g||window.event);a.extend(g,this._mwCursorPos||{});var h=0,f=true;if(g.wheelDelta){h=g.wheelDelta/120}if(g.detail){h=-g.detail/3}if(window.opera){h=-g.wheelDelta}for(var d=0;d<c._mwHandlers.length;d++){if(c._mwHandlers[d]){if(c._mwHandlers[d].call(c,g,h)===false){f=false;g.preventDefault();g.stopPropagation()}}}return f};if(a.browser.mozilla&&!this._mwFixCursorPos){this._mwFixCursorPos=function(d){this._mwCursorPos={pageX:d.pageX,pageY:d.pageY,clientX:d.clientX,clientY:d.clientY}};a(this).bind("mousemove",this._mwFixCursorPos)}if(this.addEventListener){if(a.browser.mozilla){this.addEventListener("DOMMouseScroll",this._mwHandler,false)}else{this.addEventListener("mousewheel",this._mwHandler,false)}}else{this.onmousewheel=this._mwHandler}a.event._mwCache.push(a(this))})},unmousewheel:function(b){return this.each(function(){if(b&&this._mwHandlers){for(var c=0;c<this._mwHandlers.length;c++){if(this._mwHandlers[c]&&this._mwHandlers[c].guid==b.guid){delete this._mwHandlers[c]}}}else{if(a.browser.mozilla&&!this._mwFixCursorPos){a(this).unbind("mousemove",this._mwFixCursorPos)}if(this.addEventListener){if(a.browser.mozilla){this.removeEventListener("DOMMouseScroll",this._mwHandler,false)}else{this.removeEventListener("mousewheel",this._mwHandler,false)}}else{this.onmousewheel=null}this._mwHandlers=this._mwHandler=this._mwFixCursorPos=this._mwCursorPos=null}})}});a(window).one("unload",function(){var c=a.event._mwCache||[];for(var b=0;b<c.length;b++){c[b].unmousewheel()}})})(jQuery);