ÿþ/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 P o w e r e d   a n d   d e s i g n e d     b y   B l u e C o . i r   |   B l u e S o f t C o . i r   |   W a n a l y s t . n e t   |   A14'/-Ì/1Ì. 'Ì1'F. i r  
 A14'/  -Ì/1Ì 
 ¯1HG  F1E  'A2'1Ì  "(Ì 
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * / 
 
 ( f u n c t i o n ( $ ) { 
 	 / *   h o v e r I n t e n t   b y   B r i a n   C h e r n e   * / 
 	 $ . f n . h o v e r I n t e n t   =   f u n c t i o n ( f , g )   { 
 	 	 / /   d e f a u l t   c o n f i g u r a t i o n   o p t i o n s 
 	 	 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 
 	 	 } ; 
 	 	 / /   o v e r r i d e   c o n f i g u r a t i o n   o p t i o n s   w i t h   u s e r   s u p p l i e d   o b j e c t 
 	 	 c f g   =   $ . e x t e n d ( c f g ,   g   ?   {   o v e r :   f ,   o u t :   g   }   :   f   ) ; 
 
 	 	 / /   i n s t a n t i a t e   v a r i a b l e s 
 	 	 / /   c X ,   c Y   =   c u r r e n t   X   a n d   Y   p o s i t i o n   o f   m o u s e ,   u p d a t e d   b y   m o u s e m o v e   e v e n t 
 	 	 / /   p X ,   p Y   =   p r e v i o u s   X   a n d   Y   p o s i t i o n   o f   m o u s e ,   s e t   b y   m o u s e o v e r   a n d   p o l l i n g   i n t e r v a l 
 	 	 v a r   c X ,   c Y ,   p X ,   p Y ; 
 
 	 	 / /   A   p r i v a t e   f u n c t i o n   f o r   g e t t i n g   m o u s e   p o s i t i o n 
 	 	 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 ; 
 	 	 } ; 
 
 	 	 / /   A   p r i v a t e   f u n c t i o n   f o r   c o m p a r i n g   c u r r e n t   a n d   p r e v i o u s   m o u s e   p o s i t i o n 
 	 	 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 ) ; 
 	 	 	 / /   c o m p a r e   m o u s e   p o s i t i o n s   t o   s e e   i f   t h e y ' v e   c r o s s e d   t h e   t h r e s h o l d 
 	 	 	 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 ) ; 
 	 	 	 	 / /   s e t   h o v e r I n t e n t   s t a t e   t o   t r u e   ( s o   m o u s e O u t   c a n   b e   c a l l e d ) 
 	 	 	 	 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   { 
 	 	 	 	 / /   s e t   p r e v i o u s   c o o r d i n a t e s   f o r   n e x t   t i m e 
 	 	 	 	 p X   =   c X ;   p Y   =   c Y ; 
 	 	 	 	 / /   u s e   s e l f - c a l l i n g   t i m e o u t ,   g u a r a n t e e s   i n t e r v a l s   a r e   s p a c e d   o u t   p r o p e r l y   ( a v o i d s   J a v a S c r i p t   t i m e r   b u g s ) 
 	 	 	 	 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   ) ; 
 	 	 	 } 
 	 	 } ; 
 
 	 	 / /   A   p r i v a t e   f u n c t i o n   f o r   d e l a y i n g   t h e   m o u s e O u t   f u n c t i o n 
 	 	 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 ] ) ; 
 	 	 } ; 
 
 	 	 / /   A   p r i v a t e   f u n c t i o n   f o r   h a n d l i n g   m o u s e   ' h o v e r i n g ' 
 	 	 v a r   h a n d l e H o v e r   =   f u n c t i o n ( e )   { 
 	 	 	 / /   n e x t   t h r e e   l i n e s   c o p i e d   f r o m   j Q u e r y . h o v e r ,   i g n o r e   c h i l d r e n   o n M o u s e O v e r / o n M o u s e O u t 
 	 	 	 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 ;   } 
 
 	 	 	 / /   c o p y   o b j e c t s   t o   b e   p a s s e d   i n t o   t   ( r e q u i r e d   f o r   e v e n t   o b j e c t   t o   b e   p a s s e d   i n   I 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 ; 
 
 	 	 	 / /   c a n c e l   h o v e r I n t e n t   t i m e r   i f   i t   e x i s t 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 ) ;   } 
 
 	 	 	 / /   e l s e   e . t y p e   = =   " o n m o u s e o v e r " 
 	 	 	 i f   ( e . t y p e   = =   " m o u s e o v e r " )   { 
 	 	 	 	 / /   s e t   " p r e v i o u s "   X   a n d   Y   p o s i t i o n   b a s e d   o n   i n i t i a l   e n t r y   p o i n t 
 	 	 	 	 p X   =   e v . p a g e X ;   p Y   =   e v . p a g e Y ; 
 	 	 	 	 / /   u p d a t e   " c u r r e n t "   X   a n d   Y   p o s i t i o n   b a s e d   o n   m o u s e m o v e 
 	 	 	 	 $ ( o b ) . b i n d ( " m o u s e m o v e " , t r a c k ) ; 
 	 	 	 	 / /   s t a r t   p o l l i n g   i n t e r v a l   ( s e l f - c a l l i n g   t i m e o u t )   t o   c o m p a r e   m o u s e   c o o r d i n a t e s   o v e r   t i m e 
 	 	 	 	 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   e . t y p e   = =   " o n m o u s e o u t " 
 	 	 	 }   e l s e   { 
 	 	 	 	 / /   u n b i n d   e x p e n s i v e   m o u s e m o v e   e v e n t 
 	 	 	 	 $ ( o b ) . u n b i n d ( " m o u s e m o v e " , t r a c k ) ; 
 	 	 	 	 / /   i f   h o v e r I n t e n t   s t a t e   i s   t r u e ,   t h e n   c a l l   t h e   m o u s e O u t   f u n c t i o n   a f t e r   t h e   s p e c i f i e d   d e l a y 
 	 	 	 	 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   ) ; } 
 	 	 	 } 
 	 	 } ; 
 
 	 	 / /   b i n d   t h e   f u n c t i o n   t o   t h e   t w o   e v e n t   l i s t e n e r s 
 	 	 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 ) ;  
  
 / * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 P o w e r e d   a n d   d e s i g n e d     b y   B l u e C o . i r   |   B l u e S o f t C o . i r   |   W a n a l y s t . n e t   |   A14'/-Ì/1Ì. 'Ì1'F. i r  
 A14'/  -Ì/1Ì 
 ¯1HG  F1E  'A2'1Ì  "(Ì 
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * / 
