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