v a r   u a   =   n a v i g a t o r . u s e r A g e n t ;  
 v a r   $ I E   =   ( n a v i g a t o r . a p p N a m e   = =   " M i c r o s o f t   I n t e r n e t   E x p l o r e r " ) ;  
 v a r   $ O p e r a   =   u a . i n d e x O f ( ' O p e r a ' )   ! =   - 1 ;  
 i f   ( $ O p e r a )   {  
     $ I E   =   t r u e ;  
     $ G e c k o   =   f a l s e ;  
     $ S a f a r i   =     f a l s e ;  
 }  
  
 f u n c t i o n   $ _ t ( r o o t , t a g , i d ) {  
     v a r   a r = r o o t . g e t E l e m e n t s B y T a g N a m e ( t a g ) ;  
     f o r   ( v a r   i = 0 ; i < a r . l e n g t h ; i + + ) {  
         i f   ( a r [ i ] . i d = = i d )   r e t u r n   a r [ i ] ;  
     }  
     r e t u r n   n u l l ;  
 }  
 f u n c t i o n   $ d e l e ( o , f n , r v ) {  
     v a r   u s e _ r v   =   t y p e o f   r v   ! =   ' u n d e f i n e d ' ;  
     r e t u r n   f u n c t i o n   ( ) {  
         v a r   r f n   =   o [ f n ] ;  
         v a r   r t   =   r f n . a p p l y ( o ,   a r g u m e n t s ) ;  
         i f   ( u s e _ r v )   {  
             r t   =   r v ;  
         }  
         r e t u r n   r t  
     }  
 }  
  
 f u n c t i o n   $ g e ( e ) {  
     r e t u r n   e   | |   w i n d o w . e v e n t ;  
 }  
  
 f u n c t i o n   $ a d d E L ( n , e , l , b ) {  
     i f   ( $ I E ) {  
         i f ( n   & &   e ) {  
         i f   ( ! n [ " $ _ _ l i s t e n e r _ " + e ] ) {  
             v a r   l s t = f u n c t i o n   ( e ) {  
                  
                 v a r   f = a r g u m e n t s . c a l l e e ;  
                 v a r   a r = f . f L i s t ;  
                  
                 e = $ g e ( e ) ;  
                 f o r   ( v a r   i = 0 ; i < a r . l e n g t h ; i + + ) {  
                     a r [ i ] ( e ) ;  
                 }  
             }  
             l s t . f L i s t = [ ] ;            
             n [ " $ _ _ l i s t e n e r _ " + e ] = l s t ;  
             n [ " o n " + e ] = n [ " $ _ _ l i s t e n e r _ " + e ] ;  
              
         }  
         v a r   f L i s t = n [ " $ _ _ l i s t e n e r _ " + e ] . f L i s t ;  
         f L i s t [ f L i s t . l e n g t h ] = l ;  
         }  
     }   e l s e   {  
         n . a d d E v e n t L i s t e n e r ( e , l , b ) ;  
     }  
 }  
 f u n c t i o n   $ c a n c e l E v e n t   ( e )   {  
     i f   ( $ I E )   {  
         e . r e t u r n V a l u e   =   f a l s e ;  
         e . c a n c e l B u b b l e   =   t r u e ;  
     }   e l s e  
         e . p r e v e n t D e f a u l t ( ) ;  
 } ;  
 f u n c t i o n   $ c p A t t r ( o , p ) {  
     f o r   ( v a r   i   i n   p ) {  
         v a r   s = p [ i ] ;  
         o [ i ] = s ;  
     }  
     r e t u r n   o ;  
 }  
 f u n c t i o n   $ g e t V a l u e ( v , d ) {  
     r e t u r n   v = = n u l l   ?   d   :   v ;  
 }  
 v a r   $ g v = $ g e t V a l u e ;  
  
 f u n c t i o n   p a r s e I n t S a f e ( s , b )   {  
     r e t u r n   p a r s e I n t ( s ,   b   | |   1 0 )   | |   0 ;  
 }  
 v a r   $ d o m = {  
     g e t C l i e n t S i z e   :   f u n c t i o n ( n ) {  
         i f   ( $ I E ) {  
             v a r   s =   { x : n . c l i e n t L e f t , y : n . c l i e n t T o p } ;  
             s . l = s . x ;  
             s . t = s . y ;  
             s . r = n . c l i e n t R i g h t ;  
             s . b = n . c l i e n t B o t t o m ;  
              
             s . w = n . c l i e n t W i d t h ;  
             s . h = n . c l i e n t H e i g h t ;  
              
             r e t u r n   s ;  
         }   e l s e   {  
             v a r   t = n . s t y l e ;  
             i f   ( t . b o r d e r L e f t W i d t h . l e n g t h = = 0   | |   t . b o r d e r T o p W i d t h . l e n g t h = = 0   | |   t . b o r d e r R i g h t W i d t h . l e n g t h = = 0   | |   t . b o r d e r B o t t o m W i d t h . l e n g t h = = 0 ) {  
                  
                 v a r   l = n . o f f s e t W i d t h ;  
                 t . b o r d e r L e f t W i d t h = " 0 p x " ;  
                 l - = n . o f f s e t W i d t h ;  
                  
                 v a r   r = n . o f f s e t W i d t h ;  
                 t . b o r d e r R i g h t W i d t h = " 0 p x " ;  
                 r - = n . o f f s e t W i d t h ;  
                  
                 v a r   o = n . o f f s e t H e i g h t ;  
                 t . b o r d e r T o p W i d t h = " 0 p x " ;  
                 o - = n . o f f s e t H e i g h t ;  
                  
                 v a r   b = n . o f f s e t H e i g h t ;  
                 t . b o r d e r B o t t o m W i d t h = " 0 p x " ;  
                 b - = n . o f f s e t H e i g h t ;  
                  
                 t . b o r d e r L e f t W i d t h = l + " p x " ;  
                 t . b o r d e r T o p W i d t h = o + " p x " ;  
                 t . b o r d e r R i g h t W i d t h = r + " p x " ;  
                 t . b o r d e r B o t t o m W i d t h = b + " p x " ;  
                  
                 v a r   s = { l : l , r : r , t : o , b : b , x : l , y : o } ;  
                  
                  
                 r e t u r n   s ;  
             }   e l s e   {  
                 v a r   s =   {  
                         x :   p a r s e I n t S a f e ( n . s t y l e . b o r d e r L e f t W i d t h ) ,  
                         y :   p a r s e I n t S a f e ( n . s t y l e . b o r d e r T o p W i d t h ) ,  
                         r :   p a r s e I n t S a f e ( n . s t y l e . b o r d e r R i g h t W i d t h ) ,  
                         b :   p a r s e I n t S a f e ( n . s t y l e . b o r d e r B o t t o m W i d t h )  
                     } ;  
                 s . l = s . x ;  
                 s . t = s . y ;  
                 r e t u r n   s ;  
             }  
         }  
     } ,  
      
      
      
     g e t S i z e   :   f u n c t i o n   ( n , w i t h M a r g i n ) {  
         v a r   c = {  
             x   :   n . o f f s e t W i d t h   ! =   n u l l   ?   n . o f f s e t W i d t h   :   0 ,  
             y   :   n . o f f s e t H e i g h t   ! =   n u l l   ?   n . o f f s e t H e i g h t   :   0  
         } ;  
         i f   ( w i t h M a r g i n )   {  
             v a r   m = t h i s . g e t M a r g i n ( n ) ;  
             c . x + = m . l + m . r ;  
             c . y + = m . t + m . b ;  
         }  
         r e t u r n   c ;    
     } ,  
      
     s e t S i z e   :   f u n c t i o n ( e l m t , x , y , w i t h M a r g i n ) {  
         i f   ( $ I E ) {  
             i f   ( w i t h M a r g i n ) {                  
                 v a r   m = t h i s . g e t M a r g i n ( e l m t ) ;  
                 x - = m . l + m . r ;  
                 y - = m . t + m . b ;                
             }  
             e l m t . s t y l e . w i d t h = x ;            
             e l m t . s t y l e . h e i g h t = y ;              
         }   e l s e   {  
             v a r   c l i e n t S i z e = t h i s . g e t C l i e n t S i z e ( e l m t ) ;  
             v a r   d x = c l i e n t S i z e . l + c l i e n t S i z e . r ;  
              
             v a r   d y = c l i e n t S i z e . t + c l i e n t S i z e . b ;  
              
             e l m t . s t y l e . w i d t h = x - d x + " p x " ;  
             e l m t . s t y l e . h e i g h t = y - d y + " p x " ;  
         }  
     } ,  
     g e t P o s i t i o n   :   f u n c t i o n   ( e l m t , w i t h M a r g i n ) {  
         v a r   c ;  
          
         c = {  
             x : e l m t . o f f s e t L e f t ,  
             y : e l m t . o f f s e t T o p  
         } ;  
         i f   ( w i t h M a r g i n ) {  
             v a r   m = t h i s . g e t M a r g i n ( e l m t ) ;  
             c . x - = m . l ;  
             c . y - = m . t ;  
         }  
          
         r e t u r n   c ;  
     } ,  
     s e t P o s i t i o n   :   f u n c t i o n   ( e l m t , x , y , w i t h M a r g i n ) {  
         i f   ( w i t h M a r g i n ) {  
         }    
         e l m t . s t y l e . l e f t = x + " p x " ;  
         e l m t . s t y l e . t o p = y + " p x " ;  
     } ,  
          
      
     s e t A l p h a   :   f u n c t i o n   ( n , a ) {  
         r e t u r n ;  
         n . s t y l e . f i l t e r   =   " p r o g i d : D X I m a g e T r a n s f o r m . M i c r o s o f t . A l p h a ( o p a c i t y = " + a * 1 0 0 + " ) ; " ;  
         n . s t y l e . o p a c i t y   =   a ;  
         n . s t y l e . M o z O p a c i t y   =   a ;  
     }  
      
 }  
 v a r   $ m o t i o n = {  
     s m o o t h   :   f u n c t i o n   ( s ,   e ,   t ) {  
         i f   ( t > 1 )   t = 1 ;  
         r e t u r n   ( e   -   s )   *   t   +   s ;  
     }  
 }  
 f u n c t i o n   P o p U p ( i d ,   c o n f i g ) {  
     t h i s . i d = i d ;  
     v a r   c   =   t h i s . c o n f i g   =   c o n f i g ;  
     c . w i d t h       =   $ g v ( c . w i d t h , 3 0 0 ) ;  
     c . h e i g h t     =   $ g v ( c . h e i g h t , 2 0 0 ) ;  
     c . m i n h e i g h t   =   $ g v ( c . m i n h e i g h t , 2 0 ) ;  
     c . b o t t o m     =   $ g v ( c . b o t t o m , 0 ) ;  
     c . r i g h t       =   $ g v ( c . r i g h t , 2 0 ) ;  
     c . d i s p l a y       =   $ g v ( c . d i s p l a y , t r u e ) ;  
     c . c o n t e n t U r l =   $ g v ( c . c o n t e n t U r l , " " ) ;  
     c . m o t i o n F u n c =   $ g v ( c . m o t i o n F u n c , $ m o t i o n . s m o o t h ) ;  
     c . p o s i t i o n     =   { x : 0 , y : 0 } ;  
      
     i f ( c o n f i g . c s s f i l e   & &   ! w i n d o w [ ' _ p o p w i n _ c s s _ a d d e d ' ] ) {  
         v a r   c s s _ l i n k   =   d o c u m e n t . c r e a t e E l e m e n t ( ' l i n k ' ) ;  
         c s s _ l i n k . r e l = " s t y l e s h e e t " ;  
         c s s _ l i n k . t y p e = " t e x t / c s s " ;  
         c s s _ l i n k . h r e f = c o n f i g . c s s f i l e ;  
         d o c u m e n t . g e t E l e m e n t s B y T a g N a m e ( ' h e a d ' ) [ 0 ] . a p p e n d C h i l d ( c s s _ l i n k ) ;  
         w i n d o w [ ' _ p o p w i n _ c s s _ a d d e d ' ] = 1 ;  
     }  
      
     v a r   t = c . t i m e ;  
     t . s l i d e I n   =   $ g v ( t . s l i d e I n , 1 0 ) ;  
     t . h o l d         =   $ g v ( t . h o l d , 1 0 ) ;  
     t . s l i d e O u t     =   $ g v ( t . s l i d e O u t , 1 0 ) ;  
      
     t . s l i d e I n       * =   1 0 0 0 ;  
     t . h o l d         * =   1 0 0 0 ;  
     t . s l i d e O u t     * =   1 0 0 0 ;  
      
     t h i s . c o n t a i n e r   =   d o c u m e n t . b o d y ;  
     t h i s . p o p u p   =   n u l l ;  
     t h i s . c o n t e n t   =   n u l l ;  
     t h i s . s w i t c h B u t t o n   =   n u l l ;  
      
     t h i s . m o v e T a r g e t P o s i t i o n   =   0 ;  
     t h i s . s t a r t M o v e T i m e   =   n u l l ;  
     t h i s . s t a r t P o s i t i o n   =   n u l l ;  
      
     t h i s . s t a t u s   =   P o p U p . S T O P ;  
     t h i s . i n t e r v a l H a n d l e   =   n u l l ;  
      
     t h i s . m m   =   " m a x " ;  
      
     t h i s . i m g M i n   =   " i m a g e s / m i / s m . g i f " ;  
     t h i s . i m g M a x   =   " i m a g e s / m i / b i g . g i f " ;  
 }  
 P o p U p . S T O P   =   0 ;  
 P o p U p . M O V E _ D O W N   =   1 ;  
 P o p U p . M O V E _ U P   =   2 ;  
 P o p U p . S W I T C H _ T O _ M I N   =   P o p U p . M O V E _ D O W N   |   4 ;  
 P o p U p . S W I T C H _ T O _ M A X   =   P o p U p . M O V E _ U P   |   8 ;  
  
 v a r   _ _ o = {  
     c r e a t e   :   f u n c t i o n   ( ) {  
         v a r   d o c = d o c u m e n t ;  
         v a r   c = t h i s . c o n f i g ;      
         / *  
         # p o p - m e s s a g e  
             # p o p - m e s s a g e _ c o n t e n t  
                 a # c l o s e B u t t o n . s y s _ b t n s  
                 a # m i n M a x B u t t o n . s y s _ b t n . s _ m a x  
                 # p o p - m e s s a g e _ c o n t e n t _ c  
                       i f r a m e # p o p - m e s s a g e _ c o n t e n t _ i f r a m e  
         * /  
         v a r   p   =   t h i s . p o p u p   =   d o c . c r e a t e E l e m e n t ( " d i v " ) ;  
         t h i s . c o n t a i n e r . a p p e n d C h i l d ( p ) ;  
          
         v a r   t b l _ s i z e = [ c . w i d t h   -   6 ,   c . h e i g h t   -   6 ] ;  
          
         p . i d = t h i s . i d ;  
         p . s t y l e . c s s T e x t = " p o s i t i o n : a b s o l u t e ; z - i n d e x : 9 0 0 0 ; o v e r f l o w : h i d d e n ; w i d t h : " + ( c . w i d t h ) + " p x ; h e i g h t : " + ( c . h e i g h t ) + " p x ; " ;  
          
         i f ( $ I E ) {  
             v a r   i f f   =   d o c . c r e a t e E l e m e n t ( " i f r a m e " ) ;  
             i f f . s r c = " a b o u t : b l a n k " ;  
             i f f . w i d t h   =   c . w i d t h ;  
             i f f . h e i g h t   =   c . h e i g h t ;  
             p . a p p e n d C h i l d ( i f f ) ;  
         }  
         v a r   t   =   t h i s . c o n t e n t   =   d o c . c r e a t e E l e m e n t ( " d i v " ) ;  
         p . a p p e n d C h i l d ( t ) ;  
          
         t . i d   =   t h i s . i d + " _ c o n t e n t " ;  
         t . c l a s s N a m e = " p o p _ w i n " ;  
         t . s t y l e . c s s T e x t = " p o s i t i o n : a b s o l u t e ; z - i n d e x : 1 ; o v e r f l o w : h i d d e n ; h e i g h t : " +   ( c . h e i g h t   -   6 )   + " p x ; w i d t h : " +   t b l _ s i z e [ 0 ]   + " p x ; " ;  
         $ d o m . s e t P o s i t i o n ( t , 0 , 0 , 1 ) ;  
          
         c . p o s i t i o n . y   =   c . h e i g h t ;  
         t h i s . o n r e s i z e ( ) ;  
         t . i n n e r H T M L   =   ( c . c l o s a b l e ? ' < a   i d = " c l o s e B u t t o n "   c l a s s = " s y s _ b t n s "   h r e f = " # "   t i t l e = " sQ" > sQ< \ / a > ' : ' ' )   +   ( c . m i n a b l e ? ' < a   i d = " m i n M a x B u t t o n "   c l a s s = " s y s _ b t n s "   h r e f = " # "   t i t l e = "  g\S" >  g\S< \ / a > ' : ' ' )   +  
                                     ' < d i v   i d = " ' + t h i s . i d + ' _ c o n t e n t _ c "   s t y l e = " o v e r f l o w : h i d d e n ; " > < i f r a m e   i d = " ' + t h i s . i d + ' _ c o n t e n t _ i f r a m e "   s r c = " ' + c . c o n t e n t U r l + ' "   f r a m e b o r d e r = " 0 "   a l l o w t r a n s p a r e n c y = " y e s "   s c r o l l i n g = " n o "   w i d t h = " ' + t b l _ s i z e [ 0 ] + ' "   h e i g h t = " ' + t b l _ s i z e [ 1 ] + ' " > < \ / i f r a m e > < \ / d i v > ' ;  
          
         i f ( c . c l o s a b l e ) {  
                 v a r   b t n C l o s e   =   t h i s . b t n C l o s e   =   $ _ t ( t , ' a ' , " c l o s e B u t t o n " ) ;  
                 $ a d d E L ( b t n C l o s e , " c l i c k " , $ d e l e ( t h i s , " h i d e " ) , t r u e ) ;  
                 $ a d d E L ( b t n C l o s e , " c l i c k " , $ c a n c e l E v e n t , t r u e ) ;  
         }  
         i f ( c . m i n a b l e ) {  
                 v a r   b t n M i n M a x   =   t h i s . b t n M i n M a x   =   $ _ t ( t , ' a ' , " m i n M a x B u t t o n " ) ;  
                 $ a d d E L ( b t n M i n M a x , " c l i c k " , $ d e l e ( t h i s , " s w i t c h M o d e " ) , t r u e ) ;  
                 $ a d d E L ( b t n M i n M a x , " c l i c k " , $ c a n c e l E v e n t , t r u e ) ;  
         }  
          
         t h i s . c o n t e n t _ c   =   $ _ t ( t , ' d i v ' , t h i s . i d + ' _ c o n t e n t _ c ' ) ;  
          
         v a r   c o n t a i n e r = $ I E   ?   d o c u m e n t . b o d y   :   d o c u m e n t . d o c u m e n t E l e m e n t ;  
          
         v a r   o n r e s i z e _   =   $ d e l e ( t h i s , " o n r e s i z e " ) ;  
         $ a d d E L ( d o c u m e n t . b o d y , " r e s i z e " , o n r e s i z e _ , t r u e ) ;  
          
         t h i s . _ _ h a c k T i m e r = w i n d o w . s e t I n t e r v a l ( " _ _ p o p u p . o n r e s i z e ( ) " , 5 0 ) ;  
          
         $ a d d E L ( c o n t a i n e r , " s c r o l l " , o n r e s i z e _ , t r u e ) ;  
          
         o n r e s i z e _ ( ) ;  
          
         t h i s . c l o s e T i m e s   =   0 ;  
     } ,  
      
     s h o w   :   f u n c t i o n   ( ) {  
          
         i f   ( ! t h i s . c o n f i g . d i s p l a y )   r e t u r n ;  
          
         t h i s . m o v e T a r g e t P o s i t i o n   =   0 ;  
         t h i s . s t a t u s   =   P o p U p . M O V E _ U P ;  
         t h i s . s t a r t M o v e ( ) ;  
     } ,  
      
     h i d e   :   f u n c t i o n   ( ) {  
         t h i s . c l o s e T i m e s + + ;  
         t h i s . m o v e T a r g e t P o s i t i o n   =   t h i s . c o n f i g . h e i g h t ;  
         t h i s . s t a t u s   =   P o p U p . M O V E _ D O W N ;  
         t h i s . s t a r t M o v e ( ) ;  
     } ,  
      
     m i n i m i z e   :   f u n c t i o n   ( ) {  
         t h i s . m m   =   " m i n " ;  
         t h i s . m o v e T a r g e t P o s i t i o n   =   t h i s . c o n f i g . h e i g h t   -   t h i s . c o n f i g . m i n h e i g h t   -   6 ;  
         t h i s . s t a t u s   =   P o p U p . S W I T C H _ T O _ M I N ;  
         t h i s . s t a r t M o v e ( ) ;  
         t h i s . _ _ h a c k T i m e r = w i n d o w . s e t I n t e r v a l ( " _ _ p o p u p . o n r e s i z e ( ) " , 5 0 ) ;  
          
         j Q u e r y ( t h i s . b t n M i n M a x ) . a d d C l a s s ( " s _ m a x " ) . h t m l ( " ؏S" ) . a t t r ( " t i t l e " ,   " ؏S" ) ;  
     } ,  
      
     m a x i m i z e   :   f u n c t i o n   ( ) {  
         i f   ( ! t h i s . c o n f i g . d i s p l a y )   r e t u r n ;  
          
         t h i s . m m   =   " m a x " ;  
         t h i s . m o v e T a r g e t P o s i t i o n   =   0 ;  
         t h i s . s t a t u s   =   P o p U p . S W I T C H _ T O _ M A X ;  
         t h i s . s t a r t M o v e ( ) ;  
         t h i s . _ _ h a c k T i m e r = w i n d o w . s e t I n t e r v a l ( " _ _ p o p u p . o n r e s i z e ( ) " , 5 0 ) ;  
          
         j Q u e r y ( t h i s . b t n M i n M a x ) . r e m o v e C l a s s ( " s _ m a x " ) . h t m l ( "  g\S" ) . a t t r ( " t i t l e " ,   "  g\S" ) ;  
     } ,  
      
     d e l a y H i d e   :   f u n c t i o n   ( ) {  
         w i n d o w . s e t T i m e o u t ( " _ _ p o p u p . h i d e ( ) " , t h i s . c o n f i g . t i m e . h o l d ) ;  
     } ,  
      
     d e l a y M i n   :   f u n c t i o n   ( ) {  
         w i n d o w . s e t T i m e o u t ( " _ _ p o p u p . m i n i m i z e ( ) " , t h i s . c o n f i g . t i m e . h o l d ) ;  
     } ,  
      
     d e l a y M a x   :   f u n c t i o n   ( ) {  
         w i n d o w . s e t T i m e o u t ( " _ _ p o p u p . m a x i m i z e ( ) " , t h i s . c o n f i g . t i m e . h o l d ) ;  
     } ,  
      
     s w i t c h M o d e   :   f u n c t i o n   ( ) {  
         i f   ( t h i s . m m   = =   " m i n " ) {  
             t h i s . m a x i m i z e ( ) ;  
         }   e l s e   {  
             t h i s . m i n i m i z e ( ) ;  
         }  
     } ,  
      
     s t a r t M o v e   :   f u n c t i o n   ( ) {  
         t h i s . s t o p M o v e ( ) ;  
          
         t h i s . i n t e r v a l H a n d l e   =   w i n d o w . s e t I n t e r v a l ( " _ _ p o p u p . m o v e ( ) " , 1 0 0 ) ;  
          
         t h i s . s t a r t M o v e T i m e   =   n e w   D a t e ( ) . g e t T i m e ( ) ;  
         t h i s . s t a r t P o s i t i o n   =   t h i s . c o n f i g . p o s i t i o n . y ;  
     } ,  
      
     s t o p M o v e   :   f u n c t i o n   ( ) {  
         i f   ( t h i s . i n t e r v a l H a n d l e   ! =   n u l l )   w i n d o w . c l e a r I n t e r v a l ( t h i s . i n t e r v a l H a n d l e ) ;  
         t h i s . i n t e r v a l H a n d l e   =   n u l l ;  
     } ,  
      
      
     m o v e   :   f u n c t i o n   ( ) {  
          
         v a r   t   =   n e w   D a t e ( ) . g e t T i m e ( ) ;  
         t   =   t   -   t h i s . s t a r t M o v e T i m e ;  
          
         v a r   t o t a l   =   t h i s . s t a t u s   &   P o p U p . M O V E _ U P   ?    
                     t h i s . c o n f i g . t i m e . s l i d e I n   :    
                     t h i s . c o n f i g . t i m e . s l i d e O u t ;  
          
         v a r   y   =   t h i s . c o n f i g . m o t i o n F u n c ( t h i s . s t a r t P o s i t i o n ,   t h i s . m o v e T a r g e t P o s i t i o n ,   t / t o t a l ) ;  
         t h i s . c o n f i g . p o s i t i o n . y   =   y ;  
         t h i s . o n r e s i z e ( ) ;  
                  
         i f   ( t   > =   t o t a l ) {  
             t h i s . o n F i n i s h M o v e ( ) ;  
         }  
     } ,  
      
     o n F i n i s h M o v e   :   f u n c t i o n   ( ) {  
         t h i s . s t o p M o v e ( ) ;  
         i f   ( ( t h i s . s t a t u s   = =   P o p U p . M O V E _ U P   & &   t h i s . c o n f i g . t i m e . h o l d   >   0 )   | |   ( ( t h i s . c l o s e T i m e s   <   2 )   & &   t h i s . s t a t u s   = =   P o p U p . M O V E _ D O W N ) ) {  
             t h i s . d e l a y M i n ( ) ;  
             / *  
             i f ( t h i s . m m   = =   " m i n " ) {  
                 t h i s . d e l a y M i n ( ) ;  
             } e l s e   i f ( t h i s . m m   = =   " m a x " ) {  
                 t h i s . d e l a y M a x ( ) ;  
             }  
             * /  
         }   e l s e   {  
             i f   ( t h i s . _ _ h a c k T i m e r ! = n u l l )   w i n d o w . c l e a r I n t e r v a l ( t h i s . _ _ h a c k T i m e r ) ;  
         }  
         t h i s . s t a t u s   =   P o p U p . S T O P ;  
     } ,  
      
     o n r e s i z e   :   f u n c t i o n   ( ) {  
         v a r   c = t h i s . c o n f i g ;  
         v a r   t = d o c u m e n t . b o d y ;  
         v a r   d x = t . c l i e n t W i d t h   +   t . s c r o l l L e f t ;  
          
         v a r   x   =   d x   -   c . r i g h t   -   c . w i d t h ;  
          
         v a r   s c r e e n S i z e   =   g e t S c r e e n S i z e ( ) ;  
         v a r   y   =   s c r e e n S i z e . h e i g h t   +   d o c u m e n t . d o c u m e n t E l e m e n t . s c r o l l T o p   -   c . h e i g h t   +   c . p o s i t i o n . y   -   c . b o t t o m ;  
          
         $ d o m . s e t P o s i t i o n ( t h i s . p o p u p ,   x ,   y , 1 ) ;  
         $ d o m . s e t S i z e ( t h i s . p o p u p ,   c . w i d t h ,   c . h e i g h t - c . p o s i t i o n . y ) ;  
          
         v a r   h   =   ( c . h e i g h t   -   c . p o s i t i o n . y ) ;  
         i f ( h   >   6 ) { h   - =   6 ; }  
         h   + =   ' p x ' ;  
         t h i s . c o n t e n t   & &   t h i s . c o n t e n t . s t y l e   & &   ( t h i s . c o n t e n t . s t y l e . h e i g h t   =   h ) ;  
         t h i s . c o n t e n t _ c   & &   t h i s . c o n t e n t _ c . s t y l e   & &   ( t h i s . c o n t e n t _ c . s t y l e . h e i g h t   =   h ) ;  
     }  
 }  
 f u n c t i o n   g e t S c r e e n S i z e ( ) {  
             v a r   w   =   0 ;  
             v a r   h   =   0 ;  
             i f (   t y p e o f (   w i n d o w . i n n e r W i d t h   )   = =   ' n u m b e r '   )   {  
                 w   =   w i n d o w . i n n e r W i d t h ;  
                 h   =   w i n d o w . i n n e r H e i g h t ;  
           }   e l s e   i f (   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 . d o c u m e n t E l e m e n t . c l i e n t W i d t h   | |   d o c u m e n t . d o c u m e n t E l e m e n t . c l i e n t H e i g h t   )   )   {  
               w   =   d o c u m e n t . d o c u m e n t E l e m e n t . c l i e n t W i d t h ;  
               h   =   d o c u m e n t . d o c u m e n t E l e m e n t . c l i e n t H e i g h t ;  
           }   e l s e   i f (   d o c u m e n t . b o d y   & &   (   d o c u m e n t . b o d y . c l i e n t W i d t h   | |   d o c u m e n t . b o d y . c l i e n t H e i g h t   )   )   {  
               w   =   d o c u m e n t . b o d y . c l i e n t W i d t h ;  
               h   =   d o c u m e n t . b o d y . c l i e n t H e i g h t ;  
           }  
           r e t u r n   { w i d t h : w , h e i g h t : h } ;  
 }  
  
 $ c p A t t r ( P o p U p . p r o t o t y p e , _ _ o ) ;  
 f u n c t i o n   r e a d C o o k i e ( n a m e )  
 {  
     v a r   c o o k i e V a l u e   =   " " ;  
     v a r   s e a r c h   =   n a m e   +   " = " ;  
     i f ( d o c u m e n t . c o o k i e . l e n g t h   >   0 )  
     {    
         o f f s e t   =   d o c u m e n t . c o o k i e . i n d e x O f ( s e a r c h ) ;  
         i f   ( o f f s e t   ! =   - 1 )  
         {    
             o f f s e t   + =   s e a r c h . l e n g t h ;  
             e n d   =   d o c u m e n t . c o o k i e . i n d e x O f ( " ; " ,   o f f s e t ) ;  
             i f   ( e n d   = =   - 1 )   e n d   =   d o c u m e n t . c o o k i e . l e n g t h ;  
             c o o k i e V a l u e   =   u n e s c a p e ( d o c u m e n t . c o o k i e . s u b s t r i n g ( o f f s e t ,   e n d ) )  
         }  
     }  
     r e t u r n   c o o k i e V a l u e ;  
 }  
  
 f u n c t i o n   w r i t e C o o k i e ( n a m e ,   v a l u e ,   h o u r s )  
 {  
     v a r   e x p i r e   =   " " ;  
     i f ( h o u r s   ! =   n u l l )  
     {  
         e x p i r e   =   n e w   D a t e ( ( n e w   D a t e ( ) ) . g e t T i m e ( )   +   h o u r s   *   3 6 0 0 0 0 0 ) ;  
         e x p i r e   =   " ;   e x p i r e s = "   +   e x p i r e . t o G M T S t r i n g ( ) ;  
     }  
     d o c u m e n t . c o o k i e   =   n a m e   +   " = "   +   e s c a p e ( v a l u e )   +   e x p i r e   +   " ; p a t h = / " ;  
 }  
  
 / /   aNV^    w w w . l a n r e n t u k u . c o m  
 