ÿþv a r   c l i p T o p   =   0 ;  
 v a r   c l i p W i d t h   =   6 6 0 ;  
 v a r   c l i p B o t t o m   =   2 2 0 ;  
 v a r   t o p p e r   =   0 ;  
 v a r   l y r h e i g h t   =   0 ;  
 v a r   t i m e , a m o u n t , t h e T i m e , t h e H e i g h t , D H T M L ;  
  
 f u n c t i o n   i n i t ( )  
 {  
 	 D H T M L   =   ( d o c u m e n t . g e t E l e m e n t B y I d   | |   d o c u m e n t . a l l   | |   d o c u m e n t . l a y e r s )  
 	 i f   ( ! D H T M L )   r e t u r n ;  
 	 v a r   x   =   n e w   g e t O b j ( ' e x a m p l e ' ) ;  
 	 i f   ( d o c u m e n t . l a y e r s )  
 	 {  
 	 	 l y r h e i g h t   =   x . s t y l e . c l i p . b o t t o m ;  
 	 	 l y r h e i g h t   + =   2 0 ;  
 	 	 x . s t y l e . c l i p . t o p   =   c l i p T o p ;  
 	 	 x . s t y l e . c l i p . l e f t   =   0 ;  
 	 	 x . s t y l e . c l i p . r i g h t   =   c l i p W i d t h ;  
 	 	 x . s t y l e . c l i p . b o t t o m   =   c l i p B o t t o m ;  
 	 }  
 	 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   | |   d o c u m e n t . a l l )  
 	 {  
 	 	 l y r h e i g h t   =   x . o b j . o f f s e t H e i g h t ;  
 	 	 x . s t y l e . c l i p   =   ' r e c t ( ' + c l i p T o p + ' p x , ' + c l i p W i d t h + ' p x , ' + c l i p B o t t o m + ' p x , 0 ) ' ;  
 	 }  
 }  
  
 f u n c t i o n   s c r o l l a y e r ( l a y e r n a m e , a m t , t i m )  
 {  
 	 i f   ( ! D H T M L )   r e t u r n ;  
 	 t h e l a y e r   =   n e w   g e t O b j ( l a y e r n a m e ) ;  
 	 i f   ( ! t h e l a y e r )   r e t u r n ;  
 	 a m o u n t   =   a m t ;  
 	 t h e T i m e   =   t i m ;  
 	 r e a l s c r o l l ( ) ;  
 }  
  
 f u n c t i o n   r e a l s c r o l l ( )  
 {  
 	 i f   ( ! D H T M L )   r e t u r n ;  
 	 c l i p T o p   + =   a m o u n t ;  
 	 c l i p B o t t o m   + =   a m o u n t ;  
 	 t o p p e r   - =   a m o u n t ;  
 	 i f   ( c l i p T o p   <   0   | |   c l i p B o t t o m   >   ( l y r h e i g h t + 2 0 ) )  
 	 {  
 	 	 c l i p T o p   - =   a m o u n t ;  
 	 	 c l i p B o t t o m   - =   a m o u n t ;  
 	 	 t o p p e r   + =   a m o u n t ;  
 	 	 r e t u r n ;  
 	 }  
 	 i f   ( d o c u m e n t . g e t E l e m e n t B y I d   | |   d o c u m e n t . a l l )  
 	 {  
 	 	 c l i p s t r i n g   =   ' r e c t ( ' + c l i p T o p + ' p x , ' + c l i p W i d t h + ' p x , ' + c l i p B o t t o m + ' p x , 0 ) ' ;  
 	 	 t h e l a y e r . s t y l e . c l i p   =   c l i p s t r i n g ;  
 	 	 t h e l a y e r . s t y l e . t o p   =   t o p p e r   +   ' p x ' ;  
 	 }  
 	 e l s e   i f   ( d o c u m e n t . l a y e r s )  
 	 {  
 	 	 t h e l a y e r . s t y l e . c l i p . t o p   =   c l i p T o p ;  
 	 	 t h e l a y e r . s t y l e . c l i p . b o t t o m   =   c l i p B o t t o m ;  
 	 	 t h e l a y e r . s t y l e . t o p   =   t o p p e r ;  
 	 }  
 	 t i m e   =   s e t T i m e o u t ( ' r e a l s c r o l l ( ) ' , t h e T i m e ) ;  
 }  
  
 f u n c t i o n   s t o p S c r o l l ( )  
 {  
 	 i f   ( t i m e )   c l e a r T i m e o u t ( t i m e ) ;  
 }  
  
 f u n c t i o n   g e t O b j ( n a m 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 )  
     {  
     	 t h i s . o b j   =   d o c u m e n t . g e t E l e m e n t B y I d ( n a m e ) ;  
 	 t h i s . s t y l e   =   d o c u m e n t . g e t E l e m e n t B y I d ( n a m e ) . s t y l e ;  
     }  
     e l s e   i f   ( d o c u m e n t . a l l )  
     {  
 	 t h i s . o b j   =   d o c u m e n t . a l l [ n a m e ] ;  
 	 t h i s . s t y l e   =   d o c u m e n t . a l l [ n a m e ] . 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 . o b j   =   g e t O b j N N 4 ( d o c u m e n t , n a m e ) ;  
 	 t h i s . s t y l e   =   t h i s . o b j ;  
     }  
 }  
  
 f u n c t i o n   g e t O b j N N 4 ( o b j , n a m e )  
 {  
 	 v a r   x   =   o b j . l a y e r s ;  
 	 v a r   f o u n d L a y e r ;  
 	 f o r   ( v a r   i = 0 ; i < x . l e n g t h ; i + + )  
 	 {  
 	 	 i f   ( x [ i ] . i d   = =   n a m e )  
 	 	   	 f o u n d L a y e r   =   x [ i ] ;  
 	 	 e l s e   i f   ( x [ i ] . l a y e r s . l e n g t h )  
 	 	 	 v a r   t m p   =   g e t O b j N N 4 ( x [ i ] , n a m e ) ;  
 	 	 i f   ( t m p )   f o u n d L a y e r   =   t m p ;  
 	 }  
 	 r e t u r n   f o u n d L a y e r ;  
 } 
