/* Copyright (c) 2006 Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 * 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.
 *
 * $LastChangedDate: 2007-12-20 09:02:08 -0600 (Thu, 20 Dec 2007) $
 * $Rev: 4265 $
 *
 * Version: 3.0
 * 
 * Requires: $ 1.2.2+
 */
(function(i){i.event.special.mousewheel={setup:function(){var l=this,I=i.event.special.mousewheel.handler;if(i.browser.mozilla)i(l).bind('mousemove.mousewheel',function(I){i.data(this,'mwcursorposdata',{pageX:I.pageX,pageY:I.pageY,clientX:I.clientX,clientY:I.clientY})});if(l.addEventListener)l.addEventListener((i.browser.mozilla?'DOMMouseScroll':'mousewheel'),I,false);else
l.onmousewheel=I},teardown:function(){var l=this,I=i.event.special.mousewheel.handler;i(l).unbind('mousemove.mousewheel');if(l.removeEventListener)l.removeEventListener((i.browser.mozilla?'DOMMouseScroll':'mousewheel'),I,false);else
l.onmousewheel=function(){};i.removeData(l,'mwcursorposdata')},handler:function(I){var c=this,o=Array.prototype.slice.call(arguments,1);I=i.event.fix(I||window.event);i.extend(I,i.data(c,'mwcursorposdata')||{});var l=0,O=true;if(I.wheelDelta)l=I.wheelDelta/120;if(I.detail)l=-I.detail/3;I.data=I.data||{};I.type="mousewheel";o.unshift(l);o.unshift(I);return i.event.handle.apply(c,o)}};i.fn.extend({mousewheel:function(i){var I=this;return i?I.bind("mousewheel",i):I.trigger("mousewheel")},unmousewheel:function(i){return this.unbind("mousewheel",i)}})})(jQuery);
