ÿþf u n c t i o n   S c r o l l B a r ( h e i g h t ,   m i n i m u n ,   m a x i m u n ,   o n S c r o l l )   {  
 	 v a r   s t a g e   =   n u l l ;  
 	 v a r   u p S t a t e   =   n u l l ;  
 	 v a r   d o w n S t a t e   =   n u l l ;  
 	 v a r   h i t T e s t S t a t e   =   n u l l ;  
 	 v a r   b g   =   n u l l ;  
 	 v a r   o f f s e t X   =   0 ;  
 	 v a r   o f f s e t Y   =   0 ;  
 	 v a r   n H e i g h t   =   0 ;  
 	  
 	 i n i t ( ) ;  
 	 r e t u r n   s t a g e ;  
 	 f u n c t i o n   s c r o l l H a n d l e r ( e v )   {  
 	 	 e v   =   e v   | |   w i n d o w . e v e n t ;  
 	 	 v a r   d i r   =   0 ;  
 	 	 i f   ( e v . w h e e l D e l t a )   {  
 	 	 	 d i r   =   e v . w h e e l D e l t a   >   0   ?   1   :   - 1 ;  
 	 	 } e l s e   i f   ( e v . d e t a i l )   {  
 	 	 	 d i r   =   e v . d e t a i l   <   0   ?   1 :   - 1 ;  
 	 	 }  
 	 	 v a r   t e m p   =     9 2 / ( m a x i m u n   -   m i n i m u n )   *   ( h e i g h t   -   1 1 0 ) ;  
 	 	 t e m p     =   t e m p   <   1   ?   1   :   t e m p ;  
 	 	 t e m p   * =   d i r ;  
 	 	 s e t S t a t e (   ( p a r s e I n t ( h i t T e s t S t a t e . s t y l e . t o p )   +   - t e m p ) ) ;  
 	 }  
 	 f u n c t i o n   i n i t ( )   {  
 	 	 d o c u m e n t . o n c l i c k   =   f u n c t i o n ( )   {  
 	 	 d o c u m e n t . o n m o u s e w h e e l   =   s c r o l l H a n d l e r ;  
 	 	 / / d o c u m e n t . o n D O M M o u s e S c r o l l   =   s c r o l l H a n d l e r ;  
 	 	 i f   ( d o c u m e n t . a d d E v e n t L i s t e n e r )   {  
 	 	 	 d o c u m e n t . a d d E v e n t L i s t e n e r ( ' D O M M o u s e S c r o l l ' , s c r o l l H a n d l e r ,   f a l s e ) ;  
 	 	 }  
 	 	 }  
 	 	 s t a g e   =   d o c u m e n t . c r e a t e E l e m e n t ( " D I V " ) ;  
 	 	 s t a g e . s t y l e . w i d t h   =   " 7 p x " ;  
 	 	 s t a g e . s t y l e . h e i g h t   =   h e i g h t +   " p x " ;  
 	 	 s t a g e . s t y l e . p o s i t i o n   =   " r e l a t i v e " ;  
 	 	  
 	 	 b g   =   d o c u m e n t . c r e a t e E l e m e n t ( " D I V " ) ;  
 	 	 b g . s t y l e . w i d t h   =   " 1 p x " ;  
 	 	 b g . s t y l e . h e i g h t   =   h e i g h t   +   " p x " ;  
 	 	 b g . i n n e r H T M L   =   " "  
 	 	 b g . s t y l e . b a c k g r o u n d C o l o r   =   " # 0 0 0 " ;  
 	 	 b g . s t y l e . m a r g i n L e f t   =   " 3 p x " ;  
 	 	 b g . s t y l e . p o s i t i o n   =   " a b s o l u t e " ;  
 	 	 s t a g e . a p p e n d C h i l d ( b g ) ;  
 	 	  
 	 	 h i t T e s t S t a t e   =   d o c u m e n t . c r e a t e E l e m e n t ( " D I V " ) ;  
 	 	 h i t T e s t S t a t e . s t y l e . w i d t h   =   " 7 p x " ;  
 	 	 h i t T e s t S t a t e . s t y l e . h e i g h t   =   " 9 0 p x " ;  
 	 	 h i t T e s t S t a t e . s t y l e . b a c k g r o u n d C o l o r   =   " # C 4 8 5 0 2 "  
 	 	 h i t T e s t S t a t e . s t y l e . p o s i t i o n   =   " a b s o l u t e " ;  
 	 	 s t a g e . a p p e n d C h i l d ( h i t T e s t S t a t e ) ;  
 	 	 h i t T e s t S t a t e . s t y l e . t o p   =   " 1 0 p x " ;  
 	 	 h i t T e s t S t a t e . s t y l e . c u r s o r   =   " p o i n t e r " ;  
 	 	  
 	 	 h i t T e s t S t a t e . o n m o u s e d o w n   =   f u n c t i o n ( e v )   {  
 	 	 	 o f f s e t Y   =   g e t M o u s e ( e v ) [ 1 ]   -   t h i s . o f f s e t T o p ;  
 	 	 	 o f f s e t X   =   g e t M o u s e ( e v ) [ 0 ]   -   t h i s . o f f s e t L e f t ;  
 	 	 	 d o c u m e n t . o n m o u s e m o v e   =   m o u s e m o v e ;  
 	 	 	 d o c u m e n t . o n m o u s e u p   =   m o u s e u p ;  
 	 	 	 d o c u m e n t . o n s e l e c t s t a r t   =   f u n c t i o n ( )   { r e t u r n   f a l s e } ;  
 	 	 } 	  
 	 }  
 	  
 	 f u n c t i o n   m o u s e m o v e ( e v )   {  
 	 	 v a r   t m p   =   p a r s e I n t ( g e t M o u s e ( e v ) [ 1 ]   -   o f f s e t Y ) ;  
 	 	 s e t S t a t e ( t m p ) ;  
 	 }  
 	 f u n c t i o n   s e t S t a t e ( t m p )   {  
 	 	  
 	 	 i f   ( t m p   <   1 0 )   {  
 	 	 	 t m p   =   1 0 ;  
 	 	 }   e l s e   i f   ( t m p   >   h e i g h t   -   1 0 0 )   {  
 	 	 	 t m p   =   h e i g h t   -   1 0 0 ;  
 	 	 }  
 	 	 n H e i g h t   =   t m p ;  
 	 	 h i t T e s t S t a t e . s t y l e . t o p   =   t m p   +   " p x " ;  
 	 	 o n S c r o l l ( ( m a x i m u n   -   m i n i m u n )   *   ( t m p - 1 0 )   /   ( h e i g h t   -   1 1 0 ) ) ;  
 	 }  
 	 f u n c t i o n   m o u s e u p ( )   {  
 	 	 d o c u m e n t . o n s e l e c t s t a r t   =   n u l l ;  
 	 	 d o c u m e n t . o n m o u s e m o v e   =   n u l l ;  
 	 	 d o c u m e n t . o n m o u s e u p   =   n u l l ;  
 	 }  
 	  
 	 f u n c t i o n   g e t M o u s e ( e v )   {  
 	 	 v a r   e v   =   e v   | |   w i n d o w . e v e n t ;  
 	 	 i f   ( e v . x )   {  
 	 	 	 n x   =   e v . x ;  
 	 	 	 n y   =   e v . y ;  
 	 	 }   e l s e   {  
 	 	 	 n x   =   e v . p a g e X ;  
 	 	 	 n y   =   e v . p a g e Y ;  
 	 	 }  
 	 	 r e t u r n   [ n x , n y ] ;  
 	 }  
 } 
