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