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