(function(a){a.fn.hoverIntent=function(i,j){var b={sensitivity:7,interval:100,timeout:0};b=a.extend(b,j?{over:i,out:j}:i);var d,e,l,m;var n=function(f){d=f.pageX;e=f.pageY};var c=function(f,g){g.hoverIntent_t=clearTimeout(g.hoverIntent_t);if((Math.abs(l-d)+Math.abs(m-e))<b.sensitivity){a(g).unbind("mousemove",n);g.hoverIntent_s=1;return b.over.apply(g,[f])}else{l=d;m=e;g.hoverIntent_t=setTimeout(function(){c(f,g)},b.interval)}};var h=function(f,g){g.hoverIntent_t=clearTimeout(g.hoverIntent_t);g.hoverIntent_s=0;return b.out.apply(g,[f])};var k=function(f){var q=(f.type=="mouseover"?f.fromElement:f.toElement)||f.relatedTarget;while(q&&q!=this){try{q=q.parentNode}catch(f){q=this}}if(q==this){return false}var g=jQuery.extend({},f);var o=this;if(o.hoverIntent_t){o.hoverIntent_t=clearTimeout(o.hoverIntent_t)}if(f.type=="mouseover"){l=g.pageX;m=g.pageY;a(o).bind("mousemove",n);if(o.hoverIntent_s!=1){o.hoverIntent_t=setTimeout(function(){c(g,o)},b.interval)}}else{a(o).unbind("mousemove",n);if(o.hoverIntent_s==1){o.hoverIntent_t=setTimeout(function(){h(g,o)},b.timeout)}}};return this.mouseover(k).mouseout(k)}})(jQuery);
