ÿþv a r   o f f s e t x p o i n t = - 6 0   / / C u s t o m i z e   x   o f f s e t   o f   t o o l t i p  
 v a r   o f f s e t y p o i n t = 2 0   / / C u s t o m i z e   y   o f f s e t   o f   t o o l t i p  
 v a r   i e = d o c u m e n t . a l l  
 v a r   n s 6 = d o c u m e n t . g e t E l e m e n t B y I d   & &   ! d o c u m e n t . a l l  
 v a r   e n a b l e t i p = f a l s e  
 i f   ( i e | | n s 6 )  
 v a r   t i p o b j = d o c u m e n t . a l l ?   d o c u m e n t . a l l [ " d h t m l t o o l t i p " ]   :   d o c u m e n t . g e t E l e m e n t B y I d ?   d o c u m e n t . g e t E l e m e n t B y I d ( " d h t m l t o o l t i p " )   :   " "  
  
 f u n c t i o n   i e t r u e b o d y ( ) {  
 r e t u r n   ( d o c u m e n t . c o m p a t M o d e   & &   d o c u m e n t . c o m p a t M o d e ! = " B a c k C o m p a t " ) ?   d o c u m e n t . d o c u m e n t E l e m e n t   :   d o c u m e n t . b o d y  
 }  
  
 f u n c t i o n   P r i k a z i T o o l t i p ( t h e t e x t ,   t h e c o l o r ,   t h e w i d t h ) {  
 i f   ( n s 6 | | i e ) {  
 i f   ( t y p e o f   t h e w i d t h ! = " u n d e f i n e d " )   t i p o b j . s t y l e . w i d t h = t h e w i d t h + " p x "  
 i f   ( t y p e o f   t h e c o l o r ! = " u n d e f i n e d "   & &   t h e c o l o r ! = " " )   t i p o b j . s t y l e . b a c k g r o u n d C o l o r = t h e c o l o r  
 t i p o b j . i n n e r H T M L = d o c u m e n t . g e t E l e m e n t B y I d ( t h e t e x t ) . i n n e r H T M L ;  
 e n a b l e t i p = t r u e  
 r e t u r n   f a l s e  
 }  
 }  
  
 f u n c t i o n   P r i k a z i T o o l t i p 2 ( t h e t e x t ) {  
 i f   ( n s 6 | | i e ) {  
 t i p o b j . i n n e r H T M L = d o c u m e n t . g e t E l e m e n t B y I d ( t h e t e x t ) . i n n e r H T M L ;  
 e n a b l e t i p = t r u e  
 r e t u r n   f a l s e  
 }  
 }  
  
 f u n c t i o n   p o s i t i o n t i p ( e ) {  
 i f   ( e n a b l e t i p ) {  
 v a r   c u r X = ( n s 6 ) ? e . p a g e X   :   e v e n t . c l i e n t X + i e t r u e b o d y ( ) . s c r o l l L e f t ;  
 v a r   c u r Y = ( n s 6 ) ? e . p a g e Y   :   e v e n t . c l i e n t Y + i e t r u e b o d y ( ) . s c r o l l T o p ;  
 / / F i n d   o u t   h o w   c l o s e   t h e   m o u s e   i s   t o   t h e   c o r n e r   o f   t h e   w i n d o w  
 v a r   r i g h t e d g e = i e & & ! w i n d o w . o p e r a ?   i e t r u e b o d y ( ) . c l i e n t W i d t h - e v e n t . c l i e n t X - o f f s e t x p o i n t   :   w i n d o w . i n n e r W i d t h - e . c l i e n t X - o f f s e t x p o i n t - 2 0  
 v a r   b o t t o m e d g e = i e & & ! w i n d o w . o p e r a ?   i e t r u e b o d y ( ) . c l i e n t H e i g h t - e v e n t . c l i e n t Y - o f f s e t y p o i n t   :   w i n d o w . i n n e r H e i g h t - e . c l i e n t Y - o f f s e t y p o i n t - 2 0  
  
 v a r   l e f t e d g e = ( o f f s e t x p o i n t < 0 ) ?   o f f s e t x p o i n t * ( - 1 )   :   - 1 0 0 0  
  
 / / i f   t h e   h o r i z o n t a l   d i s t a n c e   i s n ' t   e n o u g h   t o   a c c o m o d a t e   t h e   w i d t h   o f   t h e   c o n t e x t   m e n u  
 i f   ( r i g h t e d g e < t i p o b j . o f f s e t W i d t h )  
 / / m o v e   t h e   h o r i z o n t a l   p o s i t i o n   o f   t h e   m e n u   t o   t h e   l e f t   b y   i t ' s   w i d t h  
 t i p o b j . s t y l e . l e f t = i e ?   i e t r u e b o d y ( ) . s c r o l l L e f t + e v e n t . c l i e n t X - t i p o b j . o f f s e t W i d t h + " p x "   :   w i n d o w . p a g e X O f f s e t + e . c l i e n t X - t i p o b j . o f f s e t W i d t h + " p x "  
 e l s e   i f   ( c u r X < l e f t e d g e )  
 t i p o b j . s t y l e . l e f t = " 5 p x "  
 e l s e  
 / / p o s i t i o n   t h e   h o r i z o n t a l   p o s i t i o n   o f   t h e   m e n u   w h e r e   t h e   m o u s e   i s   p o s i t i o n e d  
 t i p o b j . s t y l e . l e f t = c u r X + o f f s e t x p o i n t + " p x "  
  
 / / s a m e   c o n c e p t   w i t h   t h e   v e r t i c a l   p o s i t i o n  
 i f   ( b o t t o m e d g e < t i p o b j . o f f s e t H e i g h t )  
 t i p o b j . s t y l e . t o p = i e ?   i e t r u e b o d y ( ) . s c r o l l T o p + e v e n t . c l i e n t Y - t i p o b j . o f f s e t H e i g h t - o f f s e t y p o i n t + " p x "   :   w i n d o w . p a g e Y O f f s e t + e . c l i e n t Y - t i p o b j . o f f s e t H e i g h t - o f f s e t y p o i n t + " p x "  
 e l s e  
 t i p o b j . s t y l e . t o p = c u r Y + o f f s e t y p o i n t + " p x "  
 t i p o b j . s t y l e . d i s p l a y = " b l o c k "  
 }  
 }  
  
 f u n c t i o n   S k r i j T o o l t i p ( ) {  
 i f   ( n s 6 | | i e ) {  
 e n a b l e t i p = f a l s e  
 t i p o b j . s t y l e . d i s p l a y = " n o n e "  
 t i p o b j . s t y l e . l e f t = " - 1 0 0 0 p x "  
 t i p o b j . s t y l e . b a c k g r o u n d C o l o r = ' '  
 t i p o b j . s t y l e . w i d t h = ' '  
 }  
 }  
  
 d o c u m e n t . o n m o u s e m o v e = p o s i t i o n t i p 
