f u n c t i o n   M a r q u e e ( )  
 {  
 	 t h i s . I D   =   d o c u m e n t . g e t E l e m e n t B y I d ( a r g u m e n t s [ 0 ] ) ;  
 	 i f ( ! t h i s . I D )  
 	 {  
 	 	 a l e r t ( " `nv\ " "   +   a r g u m e n t s [ 0 ]   +   " \ " RYS\ r \ n hgh~{I D n/f&Tcknx! " ) ;  
 	 	 t h i s . I D   =   - 1 ;  
 	 	 r e t u r n ;  
 	 }  
 	 t h i s . D i r e c t i o n   =   t h i s . W i d t h   =   t h i s . H e i g h t   =   t h i s . D e l a y T i m e   =   t h i s . W a i t T i m e   =   t h i s . C o r r e c t   =   t h i s . C T L   =   t h i s . S t a r t I D   =   t h i s . S t o p   =   t h i s . M o u s e O v e r   =   0 ;  
 	 t h i s . S t e p   =   1 ;  
 	 t h i s . T i m e r   =   3 0 ;  
 	 t h i s . D i r e c t i o n A r r a y   =   { " t o p " : 0   ,   " b o t t o m " : 1   ,   " l e f t " : 2   ,   " r i g h t " : 3 } ;  
 	 i f ( t y p e o f   a r g u m e n t s [ 1 ]   = =   " n u m b e r "   | |   t y p e o f   a r g u m e n t s [ 1 ]   = =   " s t r i n g " ) t h i s . D i r e c t i o n   =   a r g u m e n t s [ 1 ] ;  
 	 i f ( t y p e o f   a r g u m e n t s [ 2 ]   = =   " n u m b e r " ) t h i s . S t e p   =   a r g u m e n t s [ 2 ] ;  
 	 i f ( t y p e o f   a r g u m e n t s [ 3 ]   = =   " n u m b e r " ) t h i s . W i d t h   =   a r g u m e n t s [ 3 ] ;  
 	 i f ( t y p e o f   a r g u m e n t s [ 4 ]   = =   " n u m b e r " ) t h i s . H e i g h t   =   a r g u m e n t s [ 4 ] ;  
 	 i f ( t y p e o f   a r g u m e n t s [ 5 ]   = =   " n u m b e r " ) t h i s . T i m e r   =   a r g u m e n t s [ 5 ] ;  
 	 i f ( t y p e o f   a r g u m e n t s [ 6 ]   = =   " n u m b e r " ) t h i s . D e l a y T i m e   =   a r g u m e n t s [ 6 ] ;  
 	 i f ( t y p e o f   a r g u m e n t s [ 7 ]   = =   " n u m b e r " ) t h i s . W a i t T i m e   =   a r g u m e n t s [ 7 ] ;  
 	 i f ( t y p e o f   a r g u m e n t s [ 8 ]   = =   " n u m b e r " ) t h i s . S c r o l l S t e p   =   a r g u m e n t s [ 8 ]  
 	 t h i s . I D . s t y l e . o v e r f l o w   =   t h i s . I D . s t y l e . o v e r f l o w X   =   t h i s . I D . s t y l e . o v e r f l o w Y   =   " h i d d e n " ;  
 	 t h i s . I D . n o W r a p   =   t r u e ;  
 	 t h i s . I s N o t O p e r a   =   ( n a v i g a t o r . u s e r A g e n t . t o L o w e r C a s e ( ) . i n d e x O f ( " o p e r a " )   = =   - 1 ) ;  
 	 i f ( a r g u m e n t s . l e n g t h   > =   7 ) t h i s . S t a r t ( ) ;  
 }  
  
  
 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 ( )  
 {  
 	 i f ( t h i s . I D   = =   - 1 ) r e t u r n ;  
 	 i f ( t h i s . W a i t T i m e   <   8 0 0 ) t h i s . W a i t T i m e   =   8 0 0 ;  
 	 i f ( t h i s . T i m e r   <   2 0 ) t h i s . T i m e r   =   2 0 ;  
 	 i f ( t h i s . W i d t h   = =   0 ) t h i s . W i d t h   =   p a r s e I n t ( t h i s . I D . s t y l e . w i d t h ) ;  
 	 i f ( t h i s . H e i g h t   = =   0 ) t h i s . H e i g h t   =   p a r s e I n t ( t h i s . I D . s t y l e . h e i g h t ) ;  
 	 i f ( t y p e o f   t h i s . D i r e c t i o n   = =   " s t r i n g " ) t h i s . D i r e c t i o n   =   t h i s . D i r e c t i o n A r r a y [ t h i s . D i r e c t i o n . t o S t r i n g ( ) . t o L o w e r C a s e ( ) ] ;  
 	 t h i s . H a l f W i d t h   =   M a t h . r o u n d ( t h i s . W i d t h   /   2 ) ;  
 	 t h i s . H a l f H e i g h t   =   M a t h . r o u n d ( t h i s . H e i g h t   /   2 ) ;  
 	 t h i s . B a k S t e p   =   t h i s . S t e p ;  
 	 t h i s . I D . s t y l e . w i d t h   =   t h i s . W i d t h   +   " p x " ;  
 	 t h i s . I D . s t y l e . h e i g h t   =   t h i s . H e i g h t   +   " p x " ;  
 	 i f ( t y p e o f   t h i s . S c r o l l S t e p   ! =   " n u m b e r " ) t h i s . S c r o l l S t e p   =   t h i s . D i r e c t i o n   >   1   ?   t h i s . W i d t h   :   t h i s . H e i g h t ;  
 	 v a r   m s o b j   =   t h i s ;  
 	 v a r   t i m e r   =   t h i s . T i m e r ;  
 	 v a r   d e l a y t i m e   =   t h i s . D e l a y T i m e ;  
 	 v a r   w a i t t i m e   =   t h i s . W a i t T i m e ;  
 	 m s o b j . S t a r t I D   =   f u n c t i o n ( ) { m s o b j . S c r o l l ( ) }  
 	 m s o b j . C o n t i n u e   =   f u n c t i o n ( )  
 	 	 	 	 {  
 	 	 	 	 	 i f ( m s o b j . M o u s e O v e r   = =   1 )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 s e t T i m e o u t ( m s o b j . C o n t i n u e , d e l a y t i m e ) ;  
 	 	 	 	 	 }  
 	 	 	 	 	 e l s e  
 	 	 	 	 	 { 	 c l e a r I n t e r v a l ( m s o b j . T i m e r I D ) ;  
 	 	 	 	 	 	 m s o b j . C T L   =   m s o b j . S t o p   =   0 ;  
 	 	 	 	 	 	 m s o b j . T i m e r I D   =   s e t I n t e r v a l ( m s o b j . S t a r t I D , t i m e r ) ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
  
 	 m s o b j . P a u s e   =   f u n c t i o n ( )  
 	 	 	 {  
 	 	 	 	 m s o b j . S t o p   =   1 ;  
 	 	 	 	 c l e a r I n t e r v a l ( m s o b j . T i m e r I D ) ;  
 	 	 	 	 s e t T i m e o u t ( m s o b j . C o n t i n u e , d e l a y t i m e ) ;  
 	 	 	 }  
  
 	 m s o b j . B e g i n   =   f u n c t i o n ( )  
 	 	 {  
 	 	 	 m s o b j . C l i e n t S c r o l l   =   m s o b j . D i r e c t i o n   >   1   ?   m s o b j . I D . s c r o l l W i d t h   :   m s o b j . I D . s c r o l l H e i g h t ;  
 	 	 	 i f ( ( m s o b j . D i r e c t i o n   < =   1   & &   m s o b j . C l i e n t S c r o l l   < =   m s o b j . H e i g h t   +   m s o b j . S t e p )   | |   ( m s o b j . D i r e c t i o n   >   1   & &   m s o b j . C l i e n t S c r o l l   < =   m s o b j . W i d t h   +   m s o b j . S t e p ) ) r e t u r n ;  
 	 	 	 m s o b j . I D . i n n e r H T M L   + =   m s o b j . I D . i n n e r H T M L ;  
 	 	 	 m s o b j . T i m e r I D   =   s e t I n t e r v a l ( m s o b j . S t a r t I D , t i m e r ) ;  
 	 	 	 i f ( m s o b j . S c r o l l S t e p   <   0 ) r e t u r n ;  
 	 	 	 m s o b j . I D . o n m o u s e m o v e   =   f u n c t i o n ( e v e n t )  
 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 i f ( m s o b j . S c r o l l S t e p   = =   0   & &   m s o b j . D i r e c t i o n   >   1 )  
 	 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 	 v a r   e v e n t   =   e v e n t   | |   w i n d o w . e v e n t ;  
 	 	 	 	 	 	 	 	 i f ( w i n d o w . e v e n t )  
 	 	 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 	 	 i f ( m s o b j . I s N o t O p e r a )  
 	 	 	 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 	 	 	 m s o b j . E v e n t L e f t   =   e v e n t . s r c E l e m e n t . i d   = =   m s o b j . I D . i d   ?   e v e n t . o f f s e t X   -   m s o b j . I D . s c r o l l L e f t   :   e v e n t . s r c E l e m e n t . o f f s e t L e f t   -   m s o b j . I D . s c r o l l L e f t   +   e v e n t . o f f s e t X ;  
 	 	 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 	 	 	 m s o b j . S c r o l l S t e p   =   n u l l ;  
 	 	 	 	 	 	 	 	 	 	 r e t u r n ;  
 	 	 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 	 	 m s o b j . E v e n t L e f t   =   e v e n t . l a y e r X   -   m s o b j . I D . s c r o l l L e f t ;  
 	 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	 	 m s o b j . D i r e c t i o n   =   m s o b j . E v e n t L e f t   >   m s o b j . H a l f W i d t h   ?   3   :   2 ;  
 	 	 	 	 	 	 	 	 m s o b j . A b s C e n t e r   =   M a t h . a b s ( m s o b j . H a l f W i d t h   -   m s o b j . E v e n t L e f t ) ;  
 	 	 	 	 	 	 	 	 m s o b j . S t e p   =   M a t h . r o u n d ( m s o b j . A b s C e n t e r   *   ( m s o b j . B a k S t e p * 2 )   /   m s o b j . H a l f W i d t h ) ;  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 }  
 	 	 	 m s o b j . I D . o n m o u s e o v e r   =   f u n c t i o n ( )  
 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 i f ( m s o b j . S c r o l l S t e p   = =   0 ) r e t u r n ;  
 	 	 	 	 	 	 	 m s o b j . M o u s e O v e r   =   1 ;  
 	 	 	 	 	 	 	 c l e a r I n t e r v a l ( m s o b j . T i m e r I D ) ;  
 	 	 	 	 	 	 }  
 	 	 	 m s o b j . I D . o n m o u s e o u t   =   f u n c t i o n ( )  
 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 i f ( m s o b j . S c r o l l S t e p   = =   0 )  
 	 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 	 i f ( m s o b j . S t e p   = =   0 ) m s o b j . S t e p   =   1 ;  
 	 	 	 	 	 	 	 	 r e t u r n ;  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	 m s o b j . M o u s e O v e r   =   0 ;  
 	 	 	 	 	 	 	 i f ( m s o b j . S t o p   = =   0 )  
 	 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 	 c l e a r I n t e r v a l ( m s o b j . T i m e r I D ) ;  
 	 	 	 	 	 	 	 	 m s o b j . T i m e r I D   =   s e t I n t e r v a l ( m s o b j . S t a r t I D , t i m e r ) ;  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 }  
 	 	 }  
 	 s e t T i m e o u t ( m s o b j . B e g i n , w a i t t i m e ) ;  
 }  
  
 M a r q u e e . p r o t o t y p e . S c r o l l   =   f u n c t i o n ( )  
 {  
 	 s w i t c h ( t h i s . D i r e c t i o n )  
 	 {  
 	 	 c a s e   0 :  
 	 	 	 t h i s . C T L   + =   t h i s . S t e p ;  
 	 	 	 i f ( t h i s . C T L   > =   t h i s . S c r o l l S t e p   & &   t h i s . D e l a y T i m e   >   0 )  
 	 	 	 {  
 	 	 	 	 t h i s . I D . s c r o l l T o p   + =   t h i s . S c r o l l S t e p   +   t h i s . S t e p   -   t h i s . C T L ;  
 	 	 	 	 t h i s . P a u s e ( ) ;  
 	 	 	 	 r e t u r n ;  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 i f ( t h i s . I D . s c r o l l T o p   > =   t h i s . C l i e n t S c r o l l )  
 	 	 	 	 {  
 	 	 	 	 	 t h i s . I D . s c r o l l T o p   - =   t h i s . C l i e n t S c r o l l ;  
 	 	 	 	 }  
 	 	 	 	 t h i s . I D . s c r o l l T o p   + =   t h i s . S t e p ;  
 	 	 	 }  
 	 	 b r e a k ;  
  
 	 	 c a s e   1 :  
 	 	 	 t h i s . C T L   + =   t h i s . S t e p ;  
 	 	 	 i f ( t h i s . C T L   > =   t h i s . S c r o l l S t e p   & &   t h i s . D e l a y T i m e   >   0 )  
 	 	 	 {  
 	 	 	 	 t h i s . I D . s c r o l l T o p   - =   t h i s . S c r o l l S t e p   +   t h i s . S t e p   -   t h i s . C T L ;  
 	 	 	 	 t h i s . P a u s e ( ) ;  
 	 	 	 	 r e t u r n ;  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 i f ( t h i s . I D . s c r o l l T o p   < =   0 )  
 	 	 	 	 {  
 	 	 	 	 	 t h i s . I D . s c r o l l T o p   + =   t h i s . C l i e n t S c r o l l ;  
 	 	 	 	 }  
 	 	 	 	 t h i s . I D . s c r o l l T o p   - =   t h i s . S t e p ;  
 	 	 	 }  
 	 	 b r e a k ;  
  
 	 	 c a s e   2 :  
 	 	 	 t h i s . C T L   + =   t h i s . S t e p ;  
 	 	 	 i f ( t h i s . C T L   > =   t h i s . S c r o l l S t e p   & &   t h i s . D e l a y T i m e   >   0 )  
 	 	 	 {  
 	 	 	 	 t h i s . I D . s c r o l l L e f t   + =   t h i s . S c r o l l S t e p   +   t h i s . S t e p   -   t h i s . C T L ;  
 	 	 	 	 t h i s . P a u s e ( ) ;  
 	 	 	 	 r e t u r n ;  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 i f ( t h i s . I D . s c r o l l L e f t   > =   t h i s . C l i e n t S c r o l l )  
 	 	 	 	 {  
 	 	 	 	 	 t h i s . I D . s c r o l l L e f t   - =   t h i s . C l i e n t S c r o l l ;  
 	 	 	 	 }  
 	 	 	 	 t h i s . I D . s c r o l l L e f t   + =   t h i s . S t e p ;  
 	 	 	 }  
 	 	 b r e a k ;  
  
 	 	 c a s e   3 :  
 	 	 	 t h i s . C T L   + =   t h i s . S t e p ;  
 	 	 	 i f ( t h i s . C T L   > =   t h i s . S c r o l l S t e p   & &   t h i s . D e l a y T i m e   >   0 )  
 	 	 	 {  
 	 	 	 	 t h i s . I D . s c r o l l L e f t   - =   t h i s . S c r o l l S t e p   +   t h i s . S t e p   -   t h i s . C T L ;  
 	 	 	 	 t h i s . P a u s e ( ) ;  
 	 	 	 	 r e t u r n ;  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 i f ( t h i s . I D . s c r o l l L e f t   < =   0 )  
 	 	 	 	 {  
 	 	 	 	 	 t h i s . I D . s c r o l l L e f t   + =   t h i s . C l i e n t S c r o l l ;  
 	 	 	 	 }  
 	 	 	 	 t h i s . I D . s c r o l l L e f t   - =   t h i s . S t e p ;  
 	 	 	 }  
 	 	 b r e a k ;  
 	 }  
 }  
 / / - - > 