ÿþ/ * *  
 *   h o v e r I n t e n t   r 5   / /   2 0 0 7 . 0 3 . 2 7   / /   j Q u e r y   1 . 1 . 2 +  
 *   < h t t p : / / c h e r n e . n e t / b r i a n / r e s o u r c e s / j q u e r y . h o v e r I n t e n t . h t m l >  
 *    
 *   @ p a r a m     f     o n M o u s e O v e r   f u n c t i o n   | |   A n   o b j e c t   w i t h   c o n f i g u r a t i o n   o p t i o n s  
 *   @ p a r a m     g     o n M o u s e O u t   f u n c t i o n     | |   N o t h i n g   ( u s e   c o n f i g u r a t i o n   o p t i o n s   o b j e c t )  
 *   @ a u t h o r         B r i a n   C h e r n e   < b r i a n @ c h e r n e . n e t >  
 * /  
 ( f u n c t i o n ( $ ) { $ . f n . h o v e r I n t e n t = f u n c t i o n ( f , g ) { v a r   c f g = { s e n s i t i v i t y : 7 , i n t e r v a l : 1 0 0 , t i m e o u t : 0 } ; c f g = $ . e x t e n d ( c f g , g ? { o v e r : f , o u t : g } : f ) ; v a r   c X , c Y , p X , p Y ; v a r   t r a c k = f u n c t i o n ( e v ) { c X = e v . p a g e X ; c Y = e v . p a g e Y ; } ; v a r   c o m p a r e = f u n c t i o n ( e v , o b ) { o b . h o v e r I n t e n t _ t = c l e a r T i m e o u t ( o b . h o v e r I n t e n t _ t ) ; i f ( ( M a t h . a b s ( p X - c X ) + M a t h . a b s ( p Y - c Y ) ) < c f g . s e n s i t i v i t y ) { $ ( o b ) . u n b i n d ( " m o u s e m o v e " , t r a c k ) ; o b . h o v e r I n t e n t _ s = 1 ; r e t u r n   c f g . o v e r . a p p l y ( o b , [ e v ] ) ; } e l s e { p X = c X ; p Y = c Y ; o b . h o v e r I n t e n t _ t = s e t T i m e o u t ( f u n c t i o n ( ) { c o m p a r e ( e v , o b ) ; } , c f g . i n t e r v a l ) ; } } ; v a r   d e l a y = f u n c t i o n ( e v , o b ) { o b . h o v e r I n t e n t _ t = c l e a r T i m e o u t ( o b . h o v e r I n t e n t _ t ) ; o b . h o v e r I n t e n t _ s = 0 ; r e t u r n   c f g . o u t . a p p l y ( o b , [ e v ] ) ; } ; v a r   h a n d l e H o v e r = f u n c t i o n ( e ) { v a r   p = ( e . t y p e = = " m o u s e o v e r " ? e . f r o m E l e m e n t : e . t o E l e m e n t ) | | e . r e l a t e d T a r g e t ; w h i l e ( p & & p ! = t h i s ) { t r y { p = p . p a r e n t N o d e ; } c a t c h ( e ) { p = t h i s ; } } i f ( p = = t h i s ) { r e t u r n   f a l s e ; } v a r   e v = j Q u e r y . e x t e n d ( { } , e ) ; v a r   o b = t h i s ; i f ( o b . h o v e r I n t e n t _ t ) { o b . h o v e r I n t e n t _ t = c l e a r T i m e o u t ( o b . h o v e r I n t e n t _ t ) ; } i f ( e . t y p e = = " m o u s e o v e r " ) { p X = e v . p a g e X ; p Y = e v . p a g e Y ; $ ( o b ) . b i n d ( " m o u s e m o v e " , t r a c k ) ; i f ( o b . h o v e r I n t e n t _ s ! = 1 ) { o b . h o v e r I n t e n t _ t = s e t T i m e o u t ( f u n c t i o n ( ) { c o m p a r e ( e v , o b ) ; } , c f g . i n t e r v a l ) ; } } e l s e { $ ( o b ) . u n b i n d ( " m o u s e m o v e " , t r a c k ) ; i f ( o b . h o v e r I n t e n t _ s = = 1 ) { o b . h o v e r I n t e n t _ t = s e t T i m e o u t ( f u n c t i o n ( ) { d e l a y ( e v , o b ) ; } , c f g . t i m e o u t ) ; } } } ; r e t u r n   t h i s . m o u s e o v e r ( h a n d l e H o v e r ) . m o u s e o u t ( h a n d l e H o v e r ) ; } ; } ) ( j Q u e r y ) ; 
