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