var HoverIntent=new Class({Implements:[Options,Events],x:0,y:0,px:0,py:0,timer:false,options:{elements:[],mouseIn:$empty,mouseOut:$empty,interval:50,sensitivity:10},initialize:function(options){this.setOptions(options);window.document.addEvent("mousemove",this.track.bind(this));this.options.elements.each(function(el){el.addEvent("mouseenter",this.enter.bind(this,el));el.addEvent("mouseleave",this.out.bind(this,el));el.hover=false;}.bind(this));},track:function(e){this.x=e.client.x;this.y=e.client.y;
},enter:function(el){this.px=this.x;this.py=this.y;this.timer=this.poll.periodical(100,this,el);},out:function(el){if(el.hover){el.hover=false;this.options.mouseOut.call(el);}window.clearInterval(this.timer);},poll:function(el){diff=Math.abs(this.x-this.px)+Math.abs(this.y-this.py);if(diff<this.options.sensitivity){el.hover=true;window.clearInterval(this.timer);this.options.mouseIn.call(el);}this.px=this.x;this.py=this.y;}});
