ÿþ 
 / * E x a m p l e   m e s s a g e   a r r a y s   f o r   t h e   t w o   d e m o   s c r o l l e r s * /  
  
  
  
 / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  
 *   P a u s i n g   u p - d o w n   s c r o l l e r -   ýÿ  D y n a m i c   D r i v e   ( w w w . d y n a m i c d r i v e . c o m )  
 *   T h i s   n o t i c e   M U S T   s t a y   i n t a c t   f o r   l e g a l   u s e  
 *   V i s i t   h t t p : / / w w w . d y n a m i c d r i v e . c o m /   f o r   t h i s   s c r i p t   a n d   1 0 0 s   m o r e .  
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /  
  
 f u n c t i o n   p a u s e s c r o l l e r ( c o n t e n t ,   d i v I d ,   d i v C l a s s ,   d e l a y ) {  
 t h i s . c o n t e n t = c o n t e n t   / / m e s s a g e   a r r a y   c o n t e n t  
 t h i s . t i c k e r i d = d i v I d   / / I D   o f   t i c k e r   d i v   t o   d i s p l a y   i n f o r m a t i o n  
 t h i s . d e l a y = d e l a y   / / D e l a y   b e t w e e n   m s g   c h a n g e ,   i n   m i l i s e c o n d s .  
 t h i s . m o u s e o v e r B o l = 0   / / B o o l e a n   t o   i n d i c a t e   w h e t h e r   m o u s e   i s   c u r r e n t l y   o v e r   s c r o l l e r   ( a n d   p a u s e   i t   i f   i t   i s )  
 t h i s . h i d d e n d i v p o i n t e r = 1   / / i n d e x   o f   m e s s a g e   a r r a y   f o r   h i d d e n   d i v  
 d o c u m e n t . w r i t e ( ' < d i v   i d = " ' + d i v I d + ' "   c l a s s = " ' + d i v C l a s s + ' "   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 " > < d i v   c l a s s = " i n n e r D i v "   s t y l e = " p o s i t i o n :   a b s o l u t e ;   w i d t h :   1 0 0 % "   i d = " ' + d i v I d + ' 1 " > ' + c o n t e n t [ 0 ] + ' < / d i v > < d i v   c l a s s = " i n n e r D i v "   s t y l e = " p o s i t i o n :   a b s o l u t e ;   w i d t h :   1 0 0 % ;   v i s i b i l i t y :   h i d d e n "   i d = " ' + d i v I d + ' 2 " > ' + c o n t e n t [ 1 ] + ' < / d i v > < / d i v > ' )  
 v a r   s c r o l l e r i n s t a n c e = t h i s  
 i f   ( w i n d o w . a d d E v e n t L i s t e n e r )   / / r u n   o n l o a d   i n   D O M 2   b r o w s e r s  
 w i n d o w . a d d E v e n t L i s t e n e r ( " l o a d " ,   f u n c t i o n ( ) { s c r o l l e r i n s t a n c e . i n i t i a l i z e ( ) } ,   f a l s e )  
 e l s e   i f   ( w i n d o w . a t t a c h E v e n t )   / / r u n   o n l o a d   i n   I E 5 . 5 +  
 w i n d o w . a t t a c h E v e n t ( " o n l o a d " ,   f u n c t i o n ( ) { s c r o l l e r i n s t a n c e . i n i t i a l i z e ( ) } )  
 e l s 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 )   / / i f   l e g a c y   D O M   b r o w s e r s ,   j u s t   s t a r t   s c r o l l e r   a f t e r   0 . 5   s e c  
 s e t T i m e o u t ( f u n c t i o n ( ) { s c r o l l e r i n s t a n c e . i n i t i a l i z e ( ) } ,   5 0 0 )  
 }  
  
 / /   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 / /   i n i t i a l i z e ( ) -   I n i t i a l i z e   s c r o l l e r   m e t h o d .  
 / /   - G e t   d i v   o b j e c t s ,   s e t   i n i t i a l   p o s i t i o n s ,   s t a r t   u p   d o w n   a n i m a t i o n  
 / /   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
  
 p a u s e s c r o l l e r . p r o t o t y p e . i n i t i a l i z e = f u n c t i o n ( ) {  
 t h i s . t i c k e r d i v = d o c u m e n t . g e t E l e m e n t B y I d ( t h i s . t i c k e r i d )  
 t h i s . v i s i b l e d i v = d o c u m e n t . g e t E l e m e n t B y I d ( t h i s . t i c k e r i d + " 1 " )  
 t h i s . h i d d e n d i v = d o c u m e n t . g e t E l e m e n t B y I d ( t h i s . t i c k e r i d + " 2 " )  
 t h i s . v i s i b l e d i v t o p = p a r s e I n t ( p a u s e s c r o l l e r . g e t C S S p a d d i n g ( t h i s . t i c k e r d i v ) )  
 / / s e t   w i d t h   o f   i n n e r   D I V s   t o   o u t e r   D I V ' s   w i d t h   m i n u s   p a d d i n g   ( p a d d i n g   a s s u m e d   t o   b e   t o p   p a d d i n g   x   2 )  
 t h i s . v i s i b l e d i v . s t y l e . w i d t h = t h i s . h i d d e n d i v . s t y l e . w i d t h = t h i s . t i c k e r d i v . o f f s e t W i d t h - ( t h i s . v i s i b l e d i v t o p * 2 ) + " p x "  
 t h i s . g e t i n l i n e ( t h i s . v i s i b l e d i v ,   t h i s . h i d d e n d i v )  
 t h i s . h i d d e n d i v . s t y l e . v i s i b i l i t y = " v i s i b l e "  
 v a r   s c r o l l e r i n s t a n c e = t h i s  
 d o c u m e n t . g e t E l e m e n t B y I d ( t h i s . t i c k e r i d ) . o n m o u s e o v e r = f u n c t i o n ( ) { s c r o l l e r i n s t a n c e . m o u s e o v e r B o l = 1 }  
 d o c u m e n t . g e t E l e m e n t B y I d ( t h i s . t i c k e r i d ) . o n m o u s e o u t = f u n c t i o n ( ) { s c r o l l e r i n s t a n c e . m o u s e o v e r B o l = 0 }  
 i f   ( w i n d o w . a t t a c h E v e n t )   / / C l e a n   u p   l o o s e   r e f e r e n c e s   i n   I E  
 w i n d o w . a t t a c h E v e n t ( " o n u n l o a d " ,   f u n c t i o n ( ) { s c r o l l e r i n s t a n c e . t i c k e r d i v . o n m o u s e o v e r = s c r o l l e r i n s t a n c e . t i c k e r d i v . o n m o u s e o u t = n u l l } )  
 s e t T i m e o u t ( f u n c t i o n ( ) { s c r o l l e r i n s t a n c e . a n i m a t e u p ( ) } ,   t h i s . d e l a y )  
 }  
  
  
 / /   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 / /   a n i m a t e u p ( ) -   M o v e   t h e   t w o   i n n e r   d i v s   o f   t h e   s c r o l l e r   u p   a n d   i n   s y n c  
 / /   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
  
 p a u s e s c r o l l e r . p r o t o t y p e . a n i m a t e u p = f u n c t i o n ( ) {  
 v a r   s c r o l l e r i n s t a n c e = t h i s  
 i f   ( p a r s e I n t ( t h i s . h i d d e n d i v . s t y l e . t o p ) > ( t h i s . v i s i b l e d i v t o p + 5 ) ) {  
 t h i s . v i s i b l e d i v . s t y l e . t o p = p a r s e I n t ( t h i s . v i s i b l e d i v . s t y l e . t o p ) - 5 + " p x "  
 t h i s . h i d d e n d i v . s t y l e . t o p = p a r s e I n t ( t h i s . h i d d e n d i v . s t y l e . t o p ) - 5 + " p x "  
 s e t T i m e o u t ( f u n c t i o n ( ) { s c r o l l e r i n s t a n c e . a n i m a t e u p ( ) } ,   5 0 )  
 }  
 e l s e {  
 t h i s . g e t i n l i n e ( t h i s . h i d d e n d i v ,   t h i s . v i s i b l e d i v )  
 t h i s . s w a p d i v s ( )  
 s e t T i m e o u t ( f u n c t i o n ( ) { s c r o l l e r i n s t a n c e . s e t m e s s a g e ( ) } ,   t h i s . d e l a y )  
 }  
 }  
  
 / /   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 / /   s w a p d i v s ( ) -   S w a p   b e t w e e n   w h i c h   i s   t h e   v i s i b l e   a n d   w h i c h   i s   t h e   h i d d e n   d i v  
 / /   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
  
 p a u s e s c r o l l e r . p r o t o t y p e . s w a p d i v s = f u n c t i o n ( ) {  
 v a r   t e m p c o n t a i n e r = t h i s . v i s i b l e d i v  
 t h i s . v i s i b l e d i v = t h i s . h i d d e n d i v  
 t h i s . h i d d e n d i v = t e m p c o n t a i n e r  
 }  
  
 p a u s e s c r o l l e r . p r o t o t y p e . g e t i n l i n e = f u n c t i o n ( d i v 1 ,   d i v 2 ) {  
 d i v 1 . s t y l e . t o p = t h i s . v i s i b l e d i v t o p + " p x "  
 d i v 2 . s t y l e . t o p = M a t h . m a x ( d i v 1 . p a r e n t N o d e . o f f s e t H e i g h t ,   d i v 1 . o f f s e t H e i g h t ) + " p x "  
 }  
  
 / /   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 / /   s e t m e s s a g e ( ) -   P o p u l a t e   t h e   h i d d e n   d i v   w i t h   t h e   n e x t   m e s s a g e   b e f o r e   i t ' s   v i s i b l e  
 / /   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
  
 p a u s e s c r o l l e r . p r o t o t y p e . s e t m e s s a g e = f u n c t i o n ( ) {  
 v a r   s c r o l l e r i n s t a n c e = t h i s  
 i f   ( t h i s . m o u s e o v e r B o l = = 1 )   / / i f   m o u s e   i s   c u r r e n t l y   o v e r   s c o l l e r ,   d o   n o t h i n g   ( p a u s e   i t )  
 s e t T i m e o u t ( f u n c t i o n ( ) { s c r o l l e r i n s t a n c e . s e t m e s s a g e ( ) } ,   1 0 0 )  
 e l s e {  
 v a r   i = t h i s . h i d d e n d i v p o i n t e r  
 v a r   c e i l i n g = t h i s . c o n t e n t . l e n g t h  
 t h i s . h i d d e n d i v p o i n t e r = ( i + 1 > c e i l i n g - 1 ) ?   0   :   i + 1  
 t h i s . h i d d e n d i v . i n n e r H T M L = t h i s . c o n t e n t [ t h i s . h i d d e n d i v p o i n t e r ]  
 t h i s . a n i m a t e u p ( )  
 }  
 }  
  
 p a u s e s c r o l l e r . g e t C S S p a d d i n g = f u n c t i o n ( t i c k e r o b j ) {   / / g e t   C S S   p a d d i n g   v a l u e ,   i f   a n y  
 i f   ( t i c k e r o b j . c u r r e n t S t y l e )  
 r e t u r n   t i c k e r o b j . c u r r e n t S t y l e [ " p a d d i n g T o p " ]  
 e l s e   i f   ( w i n d o w . g e t C o m p u t e d S t y l e )   / / i f   D O M 2  
 r e t u r n   w i n d o w . g e t C o m p u t e d S t y l e ( t i c k e r o b j ,   " " ) . g e t P r o p e r t y V a l u e ( " p a d d i n g - t o p " )  
 e l s e  
 r e t u r n   0  
 }  
  
 
