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