 / / 
 
 / /   ( c )   2 0 0 6   U l e a d   S y s t e m s ,   I n c .     A l l   r i g h t s   r e s e r v e d . 
 
 / / 
 
 
 
 / * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 
 
 	 S c r o l l   e f f e c t   c l a s s 
 
 	 
 
 	 B a s e d   o n   H D - D V D   s p e c   v 1 . 0   W i n D V D   v 7 . 5   4 1 . 4 4 
 
 
 
 	 A u t h o r   :   W i l l i a m   Y a n g ,   U l e a d   S y s t e m 
 
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * / 
 
 
 
 f u n c t i o n   C S c r o l l D a t a ( ) 
 
 { 
 
 	 t h i s . m _ B u t t o n I D   =   n u l l ; 
 
 	 t h i s . m _ T e x t I D   =   n u l l ; 
 
 	 t h i s . m _ P o p u p I D   =   n u l l ; 
 
 } ; 
 
 
 
 f u n c t i o n   C R e c t ( l e f t ,   t o p ,   r i g h t ,   b o t t o m ) 
 
 { 
 
 	 t h i s . l e f t   =   l e f t ; 
 
 	 t h i s . t o p   =   t o p ; 
 
 	 t h i s . r i g h t   =   r i g h t ; 
 
 	 t h i s . b o t t o m   =   b o t t o m ; 
 
 } ; 
 
 
 
 C R e c t . p r o t o t y p e . f n W i d t h   =   f u n c t i o n ( ) 
 
 { 
 
 	 r e t u r n   t h i s . r i g h t   -   t h i s . l e f t ; 
 
 } ; 
 
 
 
 C R e c t . p r o t o t y p e . f n H e i g h t   =   f u n c t i o n ( ) 
 
 { 
 
 	 r e t u r n   t h i s . b o t t o m   -   t h i s . t o p ; 
 
 } ; 
 
 
 
 f u n c t i o n   C S c r o l l T e m p l a t e ( ) 
 
 { 
 
 	 t h i s . m _ B u t t o n R e c t   =   n u l l ; 
 
 	 t h i s . m _ T e x t R e c t   =   n u l l ; 
 
 	 t h i s . m _ P o p u p R e c t   =   n u l l ; 
 
 } ; 
 
 
 
 f u n c t i o n   C S c r o l l E f f e c t V 2 ( ) 
 
 { 
 
 	 t h i s . m _ n O n H o l d e r B e g i n   =   0 ; 
 
 	 t h i s . m _ n O n H o l d e r E n d   =   0 ; 
 
 	 t h i s . m _ n M a x T e m p l a t e   =   0 ; 
 
 	 t h i s . m _ n M a x S c e n e   =   0 ; 
 
 	 t h i s . m _ n D u r   =   0 ; 	 	 	 / / s e c o n d 
 
 	 t h i s . m _ S c r o l l T e m p l a t e   =   n e w   A r r a y ( ) ; 
 
 	 t h i s . m _ S c r o l l D a t a   =   n e w   A r r a y ( ) ; 
 
 	 t h i s . m _ B t n N e x t   =   n u l l ; 
 
 	 t h i s . m _ B t n N e x t S h i f t   =   n u l l ; 
 
 	 t h i s . m _ B t n P r e v i o u s   =   n u l l ; 
 
 	 t h i s . m _ B t n P r e v i o u s S h i f t   =   n u l l ; 
 
 	 t h i s . m _ b E n a b l e K e y S c r o l l   =   f a l s e ; 
 
 	 t h i s . m _ V K _ N e x t   =   n u l l ; 
 
 	 t h i s . m _ V K _ N e x t S h i f t   =   n u l l ; 
 
 	 t h i s . m _ V K _ P r e v i o u s   =   n u l l ; 
 
 	 t h i s . m _ V K _ P r e v i o u s S h i f t   =   n u l l ; 
 
 	 t h i s . m _ n A l w a y s F o c u s   =   - 1 ; 
 
 } ; 
 
 
 
 C S c r o l l E f f e c t V 2 . p r o t o t y p e . f n I n i t S c r o l l   =   f u n c t i o n ( s t r E v e n t P r e f i x ,   n M a x T e m p l a t e ,   n M a x S c e n e ,   n D u r ,   b E n a b l e K e y S c r o l l ,   n A l w a y s F o c u s ) 
 
 { 
 
 	 t h i s . m _ n M a x S c e n e   =   n M a x S c e n e ; 	 
 
 	 t h i s . m _ n M a x T e m p l a t e   =   n M a x T e m p l a t e ; 	 
 
 	 t h i s . m _ n O n H o l d e r B e g i n   =   0 ; 
 
 	 t h i s . m _ n O n H o l d e r E n d   =   n M a x T e m p l a t e   -   3 ; 
 
 	 t h i s . m _ n D u r   =   n D u r ; 
 
 	 t h i s . m _ b E n a b l e K e y S C r o l l   =   b E n a b l e K e y S c r o l l ; 
 
 	 t h i s . m _ n A l w a y s F o c u s   =   n A l w a y s F o c u s ; 
 
 	 v a r   _ t h i s   =   t h i s ; 	 
 
 	 v a r   s t r E v e n t N a m e   =   s t r E v e n t P r e f i x   +   " O n B t n N e x t S h i f t C l i c k " ; 
 
 	 a d d E v e n t L i s t e n e r ( s t r E v e n t N a m e   , f u n c t i o n   B t n N e x t S h i f t ( ) { _ t h i s . f n O n N e x t S h i f t ( _ t h i s . m _ n D u r , 1 ) ;   } , t r u e ) ; 
 
 	 s t r E v e n t N a m e   =   s t r E v e n t P r e f i x   +   " O n B t n N e x t C l i c k " ; 
 
 	 a d d E v e n t L i s t e n e r ( s t r E v e n t N a m e   , f u n c t i o n   B t n N e x t ( ) { _ t h i s . f n O n N e x t ( ) ;   } , t r u e ) ; 
 
 	 s t r E v e n t N a m e   =   s t r E v e n t P r e f i x   +   " O n B t n P r e v i o u s S h i f t C l i c k " ; 
 
 	 a d d E v e n t L i s t e n e r ( s t r E v e n t N a m e   , f u n c t i o n   B t n P r e v i o u s S h i f t ( ) { _ t h i s . f n O n P r e v i o u s S h i f t ( _ t h i s . m _ n D u r ,   1 ) ;   } , t r u e ) ; 
 
 	 s t r E v e n t N a m e   =   s t r E v e n t P r e f i x   +   " O n B t n P r e v i o u s C l i c k " ; 
 
 	 a d d E v e n t L i s t e n e r ( s t r E v e n t N a m e   , f u n c t i o n   B t n P r e v i o u s ( ) { _ t h i s . f n O n P r e v i o u s ( ) ;   } , t r u e ) ; 	 
 
 	 i f ( t h i s . m _ b E n a b l e K e y S C r o l l ) 
 
 	 { 
 
 	 	 a d d E v e n t L i s t e n e r ( " c o n t r o l l e r _ k e y _ d o w n " ,   f u n c t i o n   K e y D o w n ( e v t )   { _ t h i s . f n H a n d l e K e y D o w n ( e v t ) ;   } ,   t r u e ) ; 
 
 	 } 
 
 } ; 
 
 
 
 C S c r o l l E f f e c t V 2 . p r o t o t y p e . f n A d d S c r o l l T e m p l a t e   =   f u n c t i o n ( r c B u t t o n ,   r c T e x t ,   r c P o p u p ) 
 
 { 
 
 	 S c r T m p l   =   n e w   C S c r o l l T e m p l a t e ( ) ; 
 
 	 S c r T m p l . m _ B u t t o n R e c t   =   r c B u t t o n ; 
 
 	 S c r T m p l . m _ T e x t R e c t   =   r c T e x t ; 
 
 	 S c r T m p l . m _ P o p u p R e c t   =   r c P o p u p ; 
 
 	 t h i s . m _ S c r o l l T e m p l a t e . p u s h ( S c r T m p l ) ; 
 
 } ; 
 
 
 
 C S c r o l l E f f e c t V 2 . p r o t o t y p e . f n A d d S c r o l l D a t a   =   f u n c t i o n ( B u t t o n I D ,   T e x t I D ,   P o p u p I D ) 
 
 { 
 
 	 S c r D a t a   =   n e w   C S c r o l l D a t a ( ) ; 
 
 	 S c r D a t a . m _ B u t t o n I D   =   B u t t o n I D ; 
 
 	 S c r D a t a . m _ T e x t I D   =   T e x t I D ; 
 
 	 S c r D a t a . m _ P o p u p I D   =   P o p u p I D ; 
 
 	 t h i s . m _ S c r o l l D a t a . p u s h ( S c r D a t a ) ; 
 
 } ; 
 
 
 
 C S c r o l l E f f e c t V 2 . p r o t o t y p e . f n A d d N a v i g a t i o n B t n   =   f u n c t i o n ( B t n N e x t ,   B t n N e x t S h i f t ,   B t n P r e v i o u s ,   B t n P r e v i o u s S h i f t ) 
 
 { 
 
 	 t h i s . m _ B t n N e x t   =   B t n N e x t ; 
 
 	 t h i s . m _ B t n N e x t S h i f t   =   B t n N e x t S h i f t ; 
 
 	 t h i s . m _ B t n P r e v i o u s   =   B t n P r e v i o u s ; 
 
 	 t h i s . m _ B t n P r e v i o u s S h i f t   =   B t n P r e v i o u s S h i f t ; 
 
 } ; 
 
 
 
 C S c r o l l E f f e c t V 2 . p r o t o t y p e . f n A d d V K 4 S c r o l l   =   f u n c t i o n ( V K _ N e x t ,   V K _ N e x t S h i f t ,   V K _ P r e v i o u s ,   V K _ P r e v i o u s S h i f t ) 
 
 { 
 
 	 t h i s . m _ V K _ N e x t   =   t h i s . f n M a p V K 2 V a l u e ( V K _ N e x t ) ; 
 
 	 t h i s . m _ V K _ N e x t S h i f t   =   t h i s . f n M a p V K 2 V a l u e ( V K _ N e x t S h i f t ) ; 
 
 	 t h i s . m _ V K _ P r e v i o u s   =   t h i s . f n M a p V K 2 V a l u e ( V K _ P r e v i o u s ) ; 
 
 	 t h i s . m _ V K _ P r e v i o u s S h i f t   =   t h i s . f n M a p V K 2 V a l u e ( V K _ P r e v i o u s S h i f t ) ; 
 
 } ; 
 
 
 
 C S c r o l l E f f e c t V 2 . p r o t o t y p e . f n M a p V K 2 V a l u e   =   f u n c t i o n ( V i r t u a l K e y ) 
 
 { 
 
 	 r e t u r n   V i r t u a l K e y ; 
 
 } ; 
 
 
 
 C S c r o l l E f f e c t V 2 . p r o t o t y p e . f n R e s e t   =   f u n c t i o n ( ) 
 
 { 
 
 	 t h i s . m _ n O n H o l d e r B e g i n   =   0 ; 
 
 	 t h i s . m _ n O n H o l d e r E n d   =   t h i s . m _ n M a x T e m p l a t e   -   3 ; 
 
 	 t h i s . f n I n i t S h o w ( ) ; 
 
 } 
 
 
 
 C S c r o l l E f f e c t V 2 . p r o t o t y p e . f n I n i t S h o w   =   f u n c t i o n ( ) 
 
 { 
 
 	 f o r ( i = 0 ;   i   <   t h i s . m _ n M a x S c e n e ;   i   =   i   +   1 ) 
 
 	 { 
 
 	 	 v a r   s t r B t n I D   =   t h i s . m _ S c r o l l D a t a [ i ] . m _ B u t t o n I D ; 
 
 	 	 v a r   s t r T e x t I D   =   t h i s . m _ S c r o l l D a t a [ i ] . m _ T e x t I D ; 
 
 	 	 v a r   s t r P o p u p I D   =   t h i s . m _ S c r o l l D a t a [ i ] . m _ P o p u p I D ; 
 
 	 	 i f ( i   > =   t h i s . m _ n O n H o l d e r B e g i n   & &   i   < =   t h i s . m _ n O n H o l d e r E n d ) 
 
 	 	 { 
 
 	 	 	 / / B u t t o n 
 
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r B t n I D ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " a u t o " ) ; 
 
 	 	 	 v a r   s t r P r o p   =   t h i s . m _ S c r o l l T e m p l a t e [ i   +   1 ] . m _ B u t t o n R e c t . l e f t   +   " p x " ; 
 
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r B t n I D ) . s t y l e . s e t P r o p e r t y ( " x " ,   s t r P r o p ) ; 
 
 	 	 	 s t r P r o p   =   t h i s . m _ S c r o l l T e m p l a t e [ i   +   1 ] . m _ B u t t o n R e c t . t o p   +   " p x " ; 
 
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r B t n I D ) . s t y l e . s e t P r o p e r t y ( " y " ,   s t r P r o p ) ; 
 
 	 	 	 s t r P r o p   =   t h i s . m _ S c r o l l T e m p l a t e [ i   +   1 ] . m _ B u t t o n R e c t . f n W i d t h ( )   +   " p x " ; 
 
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r B t n I D ) . s t y l e . s e t P r o p e r t y ( " w i d t h " ,   s t r P r o p ) ; 
 
 	 	 	 s t r P r o p   =   t h i s . m _ S c r o l l T e m p l a t e [ i   +   1 ] . m _ B u t t o n R e c t . f n H e i g h t ( )   +   " p x " ; 
 
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r B t n I D ) . s t y l e . s e t P r o p e r t y ( " h e i g h t " ,   s t r P r o p ) ; 
 
 	 	 	 / / T e x t 
 
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r T e x t I D ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " a u t o " ) ; 
 
 	 	 	 v a r   s t r P r o p   =   t h i s . m _ S c r o l l T e m p l a t e [ i   +   1 ] . m _ T e x t R e c t . l e f t   +   " p x " ; 
 
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r T e x t I D ) . s t y l e . s e t P r o p e r t y ( " x " ,   s t r P r o p ) ; 
 
 	 	 	 s t r P r o p   =   t h i s . m _ S c r o l l T e m p l a t e [ i   +   1 ] . m _ T e x t R e c t . t o p   +   " p x " ; 
 
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r T e x t I D ) . s t y l e . s e t P r o p e r t y ( " y " ,   s t r P r o p ) ; 
 
 	 	 	 s t r P r o p   =   t h i s . m _ S c r o l l T e m p l a t e [ i   +   1 ] . m _ T e x t R e c t . f n W i d t h ( )   +   " p x " ; 
 
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r T e x t I D ) . s t y l e . s e t P r o p e r t y ( " w i d t h " ,   s t r P r o p ) ; 
 
 	 	 	 s t r P r o p   =   t h i s . m _ S c r o l l T e m p l a t e [ i   +   1 ] . m _ T e x t R e c t . f n H e i g h t ( )   +   " p x " ; 
 
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r T e x t I D ) . s t y l e . s e t P r o p e r t y ( " h e i g h t " ,   s t r P r o p ) ; 
 
 	 	 	 / / P o p u p 
 
 	 	 	 i f ( s t r P o p u p I D   ! =   n u l l ) 
 
 	 	 	 { 
 
 	 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r P o p u p I D ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " a u t o " ) ; 
 
 	 	 	 	 v a r   s t r P r o p   =   t h i s . m _ S c r o l l T e m p l a t e [ i   +   1 ] . m _ P o p u p R e c t . l e f t   +   " p x " ; 
 
 	 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r P o p u p I D ) . s t y l e . s e t P r o p e r t y ( " x " ,   s t r P r o p ) ; 
 
 	 	 	 	 s t r P r o p   =   t h i s . m _ S c r o l l T e m p l a t e [ i   +   1 ] . m _ P o p u p R e c t . t o p   +   " p x " ; 
 
 	 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r P o p u p I D ) . s t y l e . s e t P r o p e r t y ( " y " ,   s t r P r o p ) ; 
 
 	 	 	 	 s t r P r o p   =   t h i s . m _ S c r o l l T e m p l a t e [ i   +   1 ] . m _ P o p u p R e c t . f n W i d t h ( )   +   " p x " ; 
 
 	 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r P o p u p I D ) . s t y l e . s e t P r o p e r t y ( " w i d t h " ,   s t r P r o p ) ; 
 
 	 	 	 	 s t r P r o p   =   t h i s . m _ S c r o l l T e m p l a t e [ i   +   1 ] . m _ P o p u p R e c t . f n H e i g h t ( )   +   " p x " ; 
 
 	 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r P o p u p I D ) . s t y l e . s e t P r o p e r t y ( " h e i g h t " ,   s t r P r o p ) ; 	 	 	 	 	 	 
 
 	 	 	 } 
 
 	 	 } e l s e 
 
 	 	 { 
 
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r B t n I D ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " n o n e " ) ; 
 
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r T e x t I D ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " n o n e " ) ; 
 
 	 	 	 i f ( s t r P o p u p I D   ! =   n u l l ) 
 
 	 	 	 { 
 
 	 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r P o p u p I D ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " n o n e " ) ; 
 
 	 	 	 } 
 
 	 	 } 
 
 	 } 
 
 	 i f ( t h i s . m _ B t n N e x t   ! =   n u l l ) 
 
 	 	 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 . m _ B t n N e x t ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " n o n e " ) ; 
 
 	 i f ( t h i s . m _ B t n N e x t S h i f t   ! =   n u l l ) 
 
 	 	 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 . m _ B t n N e x t S h i f t ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " n o n e " ) ; 
 
 	 i f ( t h i s . m _ B t n P r e v i o u s   ! =   n u l l ) 	 	 
 
 	 	 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 . m _ B t n P r e v i o u s ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " a u t o " ) ; 
 
 	 i f ( t h i s . m _ B t n P r e v i o u s S h i f t   ! =   n u l l ) 
 
 	 	 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 . m _ B t n P r e v i o u s S h i f t ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " a u t o " ) ; 	 
 
 	 
 
 	 / /   S e t   a l w a y s   f o c u s   e l e m e n t 
 
 	 i f ( t h i s . m _ n A l w a y s F o c u s   >   0 ) 
 
 	 { 
 
 	 	 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 . m _ S c r o l l D a t a [ t h i s . m _ n A l w a y s F o c u s ] . m _ B u t t o n I D ) . s t a t e . s e t P r o p e r t y ( " f o c u s e d " ,   " t r u e " ) ; 
 
 	 	 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 . m _ S c r o l l D a t a [ t h i s . m _ n A l w a y s F o c u s ] . m _ B u t t o n I D ) . s t a t e . u n s e t P r o p e r t y ( " f o c u s e d " ) ; 
 
 	 } e l s e 
 
 	 { 
 
 	 	 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 . m _ S c r o l l D a t a [ 0 ] . m _ B u t t o n I D ) . s t a t e . s e t P r o p e r t y ( " f o c u s e d " ,   " t r u e " ) ; 
 
 	 	 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 . m _ S c r o l l D a t a [ 0 ] . m _ B u t t o n I D ) . s t a t e . u n s e t P r o p e r t y ( " f o c u s e d " ) ; 
 
 	 } 
 
 } ; 
 
 
 
 
 
 / /   r e t u r n   c o d e   0 :   e r r o r ; 
 
 / /   r e t u r n   c o d e   1 :   s u c c e e d   a n d   c o n t i n u e   e v e n t   r o u n t i n g . 
 
 / /   r e t u r n   c o d e   2 :   s u c c e e d   a n d   e a t   e v e n t . 
 
 C S c r o l l E f f e c t V 2 . p r o t o t y p e . f n H a n d l e K e y D o w n   =   f u n c t i o n ( e v t ) 
 
 { 
 
         v a r   N o d e L i s t ; 
 
 	 / /   f i n d   c u r r e n t   f o c u s e d   e l e m e n t 
 
 	 t r y 
 
 	 { 
 
 	 	 N o d e L i s t   =   d o c u m e n t . e v a l u a t e X P a t h ( " / / b u t t o n [ s t a t e : f o c u s e d ( ) = t r u e ( ) ] " ,   d o c u m e n t . d o c u m e n t E l e m e n t ) ; 
 
 	 } c a t c h ( e x p ) 
 
 	 { 
 
 	 	 r e t u r n   0 ; 
 
 	 } 
 
 	 v a r   F o c u s e d N o d e   =   N o d e L i s t . i t e m ( 0 ) ; 
 
 	 i f ( F o c u s e d N o d e   = =   n u l l ) 
 
 	 	 r e t u r n   1 ; 
 
         v a r   s t r B e g i n B t n I D   =   t h i s . m _ S c r o l l D a t a [ t h i s . m _ n O n H o l d e r B e g i n ] . m _ B u t t o n I D ; 
 
         i f ( t h i s . m _ n O n H o l d e r E n d   <   t h i s . m _ n M a x S c e n e ) 
 
                 v a r   s t r E n d B t n I D   =   t h i s . m _ S c r o l l D a t a [ t h i s . m _ n O n H o l d e r E n d ] . m _ B u t t o n I D ; 
 
         e l s e 
 
                 v a r   s t r E n d B t n I D   =   t h i s . m _ S c r o l l D a t a [ t h i s . m _ n M a x S c e n e   -   1 ] . m _ B u t t o n I D ; 
 
         v a r   s t r F o c u s e d I D   =   F o c u s e d N o d e . g e t A t t r i b u t e ( " i d " ) ; 
 
 	 i f ( s t r B e g i n B t n I D   = =   s t r F o c u s e d I D   & &   e v t . k e y   = =   t h i s . m _ V K _ N e x t   & &   t h i s . m _ n O n H o l d e r B e g i n   >   0 ) 
 
 	 { 
 
 	         t h i s . f n O n N e x t ( ) ; 
 
 	 	 i f ( t h i s . m _ n O n H o l d e r E n d   > =   0 ) 
 
 	 	 { 
 
 	 	         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 . m _ S c r o l l D a t a [ t h i s . m _ n O n H o l d e r E n d ] . m _ B u t t o n I D ) . s t a t e . s e t P r o p e r t y ( " f o c u s e d " ,   " t r u e " ) ; 
 
 	 	         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 . m _ S c r o l l D a t a [ t h i s . m _ n O n H o l d e r E n d ] . m _ B u t t o n I D ) . s t a t e . u n s e t P r o p e r t y ( " f o c u s e d " ) ; 
 
 	 	 } 
 
 	 	 r e t u r n   2 ; 	 	 
 
 	 } 
 
 	 i f ( s t r E n d B t n I D   = =   s t r F o c u s e d I D   & &   e v t . k e y   = =   t h i s . m _ V K _ P r e v i o u s   & &   t h i s . m _ n O n H o l d e r E n d   <   t h i s . m _ n M a x S c e n e   -   1 ) 
 
 	 { 
 
 	 	 t h i s . f n O n P r e v i o u s ( ) ; 
 
 	 	 i f ( t h i s . m _ n O n H o l d e r B e g i n   <   t h i s . m _ n M a x S c e n e ) 
 
 	 	 { 
 
 	 	         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 . m _ S c r o l l D a t a [ t h i s . m _ n O n H o l d e r B e g i n ] . m _ B u t t o n I D ) . s t a t e . s e t P r o p e r t y ( " f o c u s e d " ,   " t r u e " ) ; 
 
 	 	         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 . m _ S c r o l l D a t a [ t h i s . m _ n O n H o l d e r B e g i n ] . m _ B u t t o n I D ) . s t a t e . u n s e t P r o p e r t y ( " f o c u s e d " ) ; 
 
 	 	 } 
 
 	 	 r e t u r n   2 ; 
 
 	 } 
 
 	 r e t u r n   1 ; 
 
 } ; 
 
 
 
 C S c r o l l E f f e c t V 2 . p r o t o t y p e . f n O n N e x t S h i f t   =   f u n c t i o n ( n D u r ,   n S h i f t ) 
 
 { 
 
 	 / /   c h e c k   c u r r e n t   s t a t u s .   I f   o n   t h e   f i r s t   p o s i t i o n .   D o n ' t   s c r o l l . 
 
 	 i f ( t h i s . m _ n O n H o l d e r B e g i n   < =   0 ) 
 
 	 	 r e t u r n ; 	 
 
 	 / /   T h e   f i r s t   p a g e   s h o u l d   b e   f u l l . 
 
 	 i f ( t h i s . m _ n O n H o l d e r B e g i n   -   n S h i f t   <   0 ) 	 
 
 	         n S h i f t   =   t h i s . m _ n O n H o l d e r B e g i n ; 
 
 	 f o r ( i = - n S h i f t ;   i < t h i s . m _ n M a x T e m p l a t e - 2 ; i = i + 1 ) 
 
 	 { 
 
 	 	 i f ( i   +   t h i s . m _ n O n H o l d e r B e g i n < 0   | |   i   +   t h i s . m _ n O n H o l d e r B e g i n   > =   t h i s . m _ n M a x S c e n e ) 
 
 	 	         c o n t i n u e ; 
 
 	 	 / / S o u r c e   a n d   T a r g e t   i n d e x 
 
 	 	 v a r   n S c r o l l I t e m   =   i + t h i s . m _ n O n H o l d e r B e g i n ; 
 
 	 	 v a r   n S r c T m p l I n d e x = i + 1 ; 
 
 	 	 i f ( n S r c T m p l I n d e x < 0 ) 
 
 	 	         n S r c T m p l I n d e x = 0 ; 
 
 
 
                 v a r   b H i d e   =   f a l s e ; 
 
                 v a r   n T a r T m p l I n d e x = i + 1 + n S h i f t ; 
 
 	 	 i f ( n T a r T m p l I n d e x > = t h i s . m _ n M a x T e m p l a t e - 1 ) 
 
 	 	 { 
 
 	 	         n T a r T m p l I n d e x   =   t h i s . m _ n M a x T e m p l a t e - 1 ; 
 
 	 	         b H i d e = t r u e ; 
 
 	 	 } 
 
 	 	 / /   b u t t o n 
 
 	 	 v a r   s t r B t n I D   =   t h i s . m _ S c r o l l D a t a [ n S c r o l l I t e m ] . m _ B u t t o n I D ; 
 
 	 	 v a r   s t r X   =   t h i s . m _ S c r o l l T e m p l a t e [ n S r c T m p l I n d e x ] . m _ B u t t o n R e c t . l e f t     +   " p x ; "   +   t h i s . m _ S c r o l l T e m p l a t e [ n T a r T m p l I n d e x ] . m _ B u t t o n R e c t . l e f t   +   " p x " ; 
 
 	 	 v a r   s t r Y   =   t h i s . m _ S c r o l l T e m p l a t e [ n S r c T m p l I n d e x ] . m _ B u t t o n R e c t . t o p     +   " p x ; "   +   t h i s . m _ S c r o l l T e m p l a t e [ n T a r T m p l I n d e x ] . m _ B u t t o n R e c t . t o p   +   " p x " ; 
 
 	 	 v a r   s t r W i d t h   =   t h i s . m _ S c r o l l T e m p l a t e [ n S r c T m p l I n d e x ] . m _ B u t t o n R e c t . f n W i d t h ( )     +   " p x ; "   +   t h i s . m _ S c r o l l T e m p l a t e [ n T a r T m p l I n d e x ] . m _ B u t t o n R e c t . f n W i d t h ( )   +   " p x " ; 
 
 	 	 v a r   s t r H e i g h t   =   t h i s . m _ S c r o l l T e m p l a t e [ n S r c T m p l I n d e x ] . m _ B u t t o n R e c t . f n H e i g h t ( )   +   " p x ; "   +   t h i s . m _ S c r o l l T e m p l a t e [ n T a r T m p l I n d e x ] . m _ B u t t o n R e c t . f n H e i g h t ( )   +   " p x " ; 
 
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r B t n I D ) . s t y l e . a n i m a t e P r o p e r t y ( " x " ,   s t r X ,   t h i s . m _ n D u r ) ; 
 
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r B t n I D ) . s t y l e . a n i m a t e P r o p e r t y ( " y " ,   s t r Y ,   t h i s . m _ n D u r ) ; 
 
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r B t n I D ) . s t y l e . a n i m a t e P r o p e r t y ( " w i d t h " ,   s t r W i d t h ,   t h i s . m _ n D u r ) ; 
 
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r B t n I D ) . s t y l e . a n i m a t e P r o p e r t y ( " h e i g h t " ,   s t r H e i g h t ,   t h i s . m _ n D u r ) ; 
 
 	 	 i f ( b H i d e ) 
 
 	 	         d o c u m e n t . g e t E l e m e n t B y I d ( s t r B t n I D ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " n o n e " ) ; 
 
 	 	 e l s e 
 
 	 	         d o c u m e n t . g e t E l e m e n t B y I d ( s t r B t n I D ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " a u t o " ) ; 
 
 	 	 / / t e x t 
 
 	 	 s t r T e x t I D   =   t h i s . m _ S c r o l l D a t a [ n S c r o l l I t e m ] . m _ T e x t I D ; 
 
 	 	 s t r X   =   t h i s . m _ S c r o l l T e m p l a t e [ n S r c T m p l I n d e x ] . m _ T e x t R e c t . l e f t     +   " p x ; "   +   t h i s . m _ S c r o l l T e m p l a t e [ n T a r T m p l I n d e x ] . m _ T e x t R e c t . l e f t   +   " p x " ; 
 
 	 	 s t r Y   =   t h i s . m _ S c r o l l T e m p l a t e [ n S r c T m p l I n d e x ] . m _ T e x t R e c t . t o p     +   " p x ; "   +   t h i s . m _ S c r o l l T e m p l a t e [ n T a r T m p l I n d e x ] . m _ T e x t R e c t . t o p   +   " p x " ; 
 
 	 	 s t r W i d t h   =   t h i s . m _ S c r o l l T e m p l a t e [ n S r c T m p l I n d e x ] . m _ T e x t R e c t . f n W i d t h ( )     +   " p x ; "   +   t h i s . m _ S c r o l l T e m p l a t e [ n T a r T m p l I n d e x ] . m _ T e x t R e c t . f n W i d t h ( )   +   " p x " ; 
 
 	 	 s t r H e i g h t   =   t h i s . m _ S c r o l l T e m p l a t e [ n S r c T m p l I n d e x ] . m _ T e x t R e c t . f n H e i g h t ( )   +   " p x ; "   +   t h i s . m _ S c r o l l T e m p l a t e [ n T a r T m p l I n d e x ] . m _ T e x t R e c t . f n H e i g h t ( )   +   " p x " ; 	 	 
 
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r T e x t I D ) . s t y l e . a n i m a t e P r o p e r t y ( " x " ,   s t r X ,   t h i s . m _ n D u r ) ; 
 
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r T e x t I D ) . s t y l e . a n i m a t e P r o p e r t y ( " y " ,   s t r Y ,   t h i s . m _ n D u r ) ; 
 
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r T e x t I D ) . s t y l e . a n i m a t e P r o p e r t y ( " w i d t h " ,   s t r W i d t h ,   t h i s . m _ n D u r ) ; 
 
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r T e x t I D ) . s t y l e . a n i m a t e P r o p e r t y ( " h e i g h t " ,   s t r H e i g h t ,   t h i s . m _ n D u r ) ; 
 
 	 	 i f ( b H i d e ) 
 
 	 	         d o c u m e n t . g e t E l e m e n t B y I d ( s t r T e x t I D ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " n o n e " ) ; 
 
 	 	 e l s e 
 
 	 	         d o c u m e n t . g e t E l e m e n t B y I d ( s t r T e x t I D ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " a u t o " ) ; 	 	 
 
 	 	 / / p o p u p 
 
 	 	 s t r P o p u p I D   =   t h i s . m _ S c r o l l D a t a [ n S c r o l l I t e m ] . m _ P o p u p I D ; 
 
 	 	 i f ( s t r P o p u p I D   ! =   n u l l ) 
 
 	 	 { 
 
 	 	 	 s t r X   =   t h i s . m _ S c r o l l T e m p l a t e [ n S r c T m p l I n d e x ] . m _ P o p u p R e c t . l e f t     +   " p x ; "   +   t h i s . m _ S c r o l l T e m p l a t e [ n T a r T m p l I n d e x ] . m _ P o p u p R e c t . l e f t   +   " p x " ; 
 
 	 	 	 s t r Y   =   t h i s . m _ S c r o l l T e m p l a t e [ n S r c T m p l I n d e x ] . m _ P o p u p R e c t . t o p     +   " p x ; "   +   t h i s . m _ S c r o l l T e m p l a t e [ n T a r T m p l I n d e x ] . m _ P o p u p R e c t . t o p   +   " p x " ; 
 
 	 	 	 s t r W i d t h   =   t h i s . m _ S c r o l l T e m p l a t e [ n S r c T m p l I n d e x ] . m _ P o p u p R e c t . f n W i d t h ( )     +   " p x ; "   +   t h i s . m _ S c r o l l T e m p l a t e [ n T a r T m p l I n d e x ] . m _ P o p u p R e c t . f n W i d t h ( )   +   " p x " ; 
 
 	 	 	 s t r H e i g h t   =   t h i s . m _ S c r o l l T e m p l a t e [ n S r c T m p l I n d e x ] . m _ P o p u p R e c t . f n H e i g h t ( )   +   " p x ; "   +   t h i s . m _ S c r o l l T e m p l a t e [ n T a r T m p l I n d e x ] . m _ P o p u p R e c t . f n H e i g h t ( )   +   " p x " ; 	 	 
 
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r P o p u p I D ) . s t y l e . a n i m a t e P r o p e r t y ( " x " ,   s t r X ,   t h i s . m _ n D u r ) ; 
 
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r P o p u p I D ) . s t y l e . a n i m a t e P r o p e r t y ( " y " ,   s t r Y ,   t h i s . m _ n D u r ) ; 
 
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r P o p u p I D ) . s t y l e . a n i m a t e P r o p e r t y ( " w i d t h " ,   s t r W i d t h ,   t h i s . m _ n D u r ) ; 
 
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r P o p u p I D ) . s t y l e . a n i m a t e P r o p e r t y ( " h e i g h t " ,   s t r H e i g h t ,   t h i s . m _ n D u r ) ; 	 	 	 	 
 
 	 	         i f ( b H i d e ) 
 
 	 	                 d o c u m e n t . g e t E l e m e n t B y I d ( s t r P o p u p I D ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " n o n e " ) ; 
 
 	 	         e l s e 
 
 	 	                 d o c u m e n t . g e t E l e m e n t B y I d ( s t r P o p u p I D ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " a u t o " ) ; 	 	 	 
 
 	 	 } 
 
 	 } 
 
 	 
 
 	 / /   u p d a t e   c u r r e n t   s t a t u s . 
 
 	 t h i s . m _ n O n H o l d e r B e g i n   =   t h i s . m _ n O n H o l d e r B e g i n   -   n S h i f t ; 
 
 	 t h i s . m _ n O n H o l d e r E n d   =   t h i s . m _ n O n H o l d e r E n d   -   n S h i f t ; 
 
 	 
 
 	 / /   S e t   a l w a y s   f o c u s   e l e m e n t 
 
 	 i f ( t h i s . m _ n A l w a y s F o c u s   >   0 ) 
 
 	 { 
 
 	 	 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 . m _ S c r o l l D a t a [ t h i s . m _ n A l w a y s F o c u s   +   t h i s . m _ n O n H o l d e r B e g i n ] . m _ B u t t o n I D ) . s t a t e . s e t P r o p e r t y ( " f o c u s e d " ,   " t r u e " ) ; 
 
 	 	 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 . m _ S c r o l l D a t a [ t h i s . m _ n A l w a y s F o c u s   +   t h i s . m _ n O n H o l d e r B e g i n ] . m _ B u t t o n I D ) . s t a t e . u n s e t P r o p e r t y ( " f o c u s e d " ) ; 
 
 	 } 
 
 
 
 	 / /   s h o w / h i d e   n a v i g a t i o n   b u t t o n . 
 
 	 i f ( t h i s . m _ n O n H o l d e r B e g i n   < =   0 ) 
 
 	 { 
 
 	 	 i f ( t h i s . m _ B t n N e x t   ! =   n u l l ) 
 
 	 	 { 
 
 	 	 	 v a r   f o c u s e d   =   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 . m _ B t n N e x t ) . s t a t e . g e t P r o p e r t y ( " f o c u s e d " ) ; 
 
 	 	 	 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 . m _ B t n N e x t ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " n o n e " ) ; 
 
 	 	 	 i f ( f o c u s e d   = =   " t r u e " ) 
 
 	 	 	 { 
 
 	 	 	 	 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 . m _ B t n P r e v i o u s ) . s t a t e . s e t P r o p e r t y ( " f o c u s e d " ,   " t r u e " ) ; 
 
 	 	 	 	 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 . m _ B t n P r e v i o u s ) . s t a t e . u n s e t P r o p e r t y ( " f o c u s e d " ) ; 
 
 	 	 	 } 
 
 	 	 } 
 
 	 	 i f ( t h i s . m _ B t n N e x t S h i f t   ! =   n u l l ) 
 
 	 	 { 
 
 	 	 	 v a r   f o c u s e d   =   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 . m _ B t n N e x t S h i f t ) . s t a t e . g e t P r o p e r t y ( " f o c u s e d " ) ; 
 
 	 	 	 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 . m _ B t n N e x t S h i f t ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " n o n e " ) ; 
 
 	 	 	 i f ( f o c u s e d   = =   " t r u e " ) 
 
 	 	 	 { 
 
 	 	 	 	 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 . m _ B t n P r e v i o u s S h i f t ) . s t a t e . s e t P r o p e r t y ( " f o c u s e d " ,   " t r u e " ) ; 
 
 	 	 	 	 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 . m _ B t n P r e v i o u s S h i f t ) . s t a t e . u n s e t P r o p e r t y ( " f o c u s e d " ) ; 
 
 	 	 	 } 
 
 	 	 } 
 
 	 } 
 
 	 i f ( t h i s . m _ n O n H o l d e r E n d   < =   t h i s . m _ n M a x S c e n e   -   2 ) 
 
 	 { 
 
 	 	 i f ( t h i s . m _ B t n P r e v i o u s   ! =   n u l l ) 
 
 	 	 	 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 . m _ B t n P r e v i o u s ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " a u t o " ) ; 
 
 	 	 i f ( t h i s . m _ B t n P r e v i o u s S h i f t   ! =   n u l l ) 
 
 	 	 	 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 . m _ B t n P r e v i o u s S h i f t ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " a u t o " ) ; 	 
 
 	 } 
 
 } ; 
 
 
 
 C S c r o l l E f f e c t V 2 . p r o t o t y p e . f n O n N e x t   =   f u n c t i o n ( ) 
 
 { 
 
 	 v a r   n C o u n t   =   t h i s . m _ n M a x T e m p l a t e   -   2 ; 
 
 	 t h i s . f n O n N e x t S h i f t ( t h i s . m _ n D u r * n C o u n t ,   n C o u n t ) ; 
 
 
 
 } ; 
 
 
 
 C S c r o l l E f f e c t V 2 . p r o t o t y p e . f n O n P r e v i o u s S h i f t   =   f u n c t i o n ( n D u r ,   n S h i f t ) 
 
 { 
 
 	 / /   c h e c k   c u r r e n t   s t a t u s .   I f   o n   t h e   l a s t   p o s i t i o n .   D o n ' t   s c r o l l . 
 
 	 i f ( t h i s . m _ n O n H o l d e r B e g i n   +   n S h i f t   >   t h i s . m _ n M a x S c e n e ) 
 
 	         r e t u r n ; 	 
 
 
 
 	 f o r ( i = 0 ;   i   <   t h i s . m _ n M a x T e m p l a t e + n S h i f t - 2 ; i = i + 1 ) 
 
 	 { 
 
 	 	 i f ( i   +   t h i s . m _ n O n H o l d e r B e g i n < 0   | |   i   +   t h i s . m _ n O n H o l d e r B e g i n   > =   t h i s . m _ n M a x S c e n e ) 
 
 	 	         c o n t i n u e ; 
 
 	 	 / / S o u r c e   a n d   T a r g e t   i n d e x 
 
 	 	 v a r   n S c r o l l I t e m   =   i + t h i s . m _ n O n H o l d e r B e g i n ; 
 
 	 	 v a r   n S r c T m p l I n d e x = i + 1 ; 
 
 	 	 i f ( n S r c T m p l I n d e x > = t h i s . m _ n M a x T e m p l a t e ) 
 
 	 	         n S r c T m p l I n d e x   =   t h i s . m _ n M a x T e m p l a t e - 1 ; 
 
 	 	 v a r   n T a r T m p l I n d e x = i + 1 - n S h i f t ; 
 
 	 	 v a r   b H i d e   =   f a l s e ; 
 
 	 	 i f ( n T a r T m p l I n d e x < = 0 ) 
 
 	 	 { 
 
 	 	         n T a r T m p l I n d e x = 0 ; 
 
 	 	         b H i d e = t r u e ; 
 
 	 	 } 
 
                 / / B u t t o n 
 
                 v a r 	 s t r B t n I D   =   t h i s . m _ S c r o l l D a t a [ n S c r o l l I t e m ] . m _ B u t t o n I D ; 
 
 	 	 v a r   s t r X   =   t h i s . m _ S c r o l l T e m p l a t e [ n S r c T m p l I n d e x ] . m _ B u t t o n R e c t . l e f t     +   " p x ; "   +   t h i s . m _ S c r o l l T e m p l a t e [ n T a r T m p l I n d e x ] . m _ B u t t o n R e c t . l e f t   +   " p x " ; 
 
 	 	 v a r   s t r Y   =   t h i s . m _ S c r o l l T e m p l a t e [ n S r c T m p l I n d e x ] . m _ B u t t o n R e c t . t o p     +   " p x ; "   +   t h i s . m _ S c r o l l T e m p l a t e [ n T a r T m p l I n d e x ] . m _ B u t t o n R e c t . t o p   +   " p x " ; 
 
 	 	 v a r   s t r W i d t h   =   t h i s . m _ S c r o l l T e m p l a t e [ n S r c T m p l I n d e x ] . m _ B u t t o n R e c t . f n W i d t h ( )     +   " p x ; "   +   t h i s . m _ S c r o l l T e m p l a t e [ n T a r T m p l I n d e x ] . m _ B u t t o n R e c t . f n W i d t h ( )   +   " p x " ; 
 
 	 	 v a r   s t r H e i g h t   =   t h i s . m _ S c r o l l T e m p l a t e [ n S r c T m p l I n d e x ] . m _ B u t t o n R e c t . f n H e i g h t ( )   +   " p x ; "   +   t h i s . m _ S c r o l l T e m p l a t e [ n T a r T m p l I n d e x ] . m _ B u t t o n R e c t . f n H e i g h t ( )   +   " p x " ; 	 	 	 	 
 
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r B t n I D ) . s t y l e . a n i m a t e P r o p e r t y ( " x " ,   s t r X ,   t h i s . m _ n D u r ) ; 
 
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r B t n I D ) . s t y l e . a n i m a t e P r o p e r t y ( " y " ,   s t r Y ,   t h i s . m _ n D u r ) ; 
 
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r B t n I D ) . s t y l e . a n i m a t e P r o p e r t y ( " w i d t h " ,   s t r W i d t h ,   t h i s . m _ n D u r ) ; 
 
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r B t n I D ) . s t y l e . a n i m a t e P r o p e r t y ( " h e i g h t " ,   s t r H e i g h t ,   t h i s . m _ n D u r ) ; 
 
 	 	 i f ( b H i d e ) 
 
 	 	         d o c u m e n t . g e t E l e m e n t B y I d ( s t r B t n I D ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " n o n e " ) ; 
 
 	 	 e l s e 
 
 	 	       d o c u m e n t . g e t E l e m e n t B y I d ( s t r B t n I D ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " a u t o " ) ; 
 
 	 	 / / T e x t 
 
 	 	 s t r T e x t I D   =   t h i s . m _ S c r o l l D a t a [ n S c r o l l I t e m ] . m _ T e x t I D ; 
 
 	 	 s t r X   =   t h i s . m _ S c r o l l T e m p l a t e [ n S r c T m p l I n d e x ] . m _ T e x t R e c t . l e f t     +   " p x ; "   +   t h i s . m _ S c r o l l T e m p l a t e [ n T a r T m p l I n d e x ] . m _ T e x t R e c t . l e f t   +   " p x " ; 
 
 	 	 s t r Y   =   t h i s . m _ S c r o l l T e m p l a t e [ n S r c T m p l I n d e x ] . m _ T e x t R e c t . t o p     +   " p x ; "   +   t h i s . m _ S c r o l l T e m p l a t e [ n T a r T m p l I n d e x ] . m _ T e x t R e c t . t o p   +   " p x " ; 
 
 	 	 s t r W i d t h   =   t h i s . m _ S c r o l l T e m p l a t e [ n S r c T m p l I n d e x ] . m _ T e x t R e c t . f n W i d t h ( )     +   " p x ; "   +   t h i s . m _ S c r o l l T e m p l a t e [ n T a r T m p l I n d e x ] . m _ T e x t R e c t . f n W i d t h ( )   +   " p x " ; 
 
 	 	 s t r H e i g h t   =   t h i s . m _ S c r o l l T e m p l a t e [ n S r c T m p l I n d e x ] . m _ T e x t R e c t . f n H e i g h t ( )   +   " p x ; "   +   t h i s . m _ S c r o l l T e m p l a t e [ n T a r T m p l I n d e x ] . m _ T e x t R e c t . f n H e i g h t ( )   +   " p x " ; 	 	 	 	 
 
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r T e x t I D ) . s t y l e . a n i m a t e P r o p e r t y ( " x " ,   s t r X ,   t h i s . m _ n D u r ) ; 
 
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r T e x t I D ) . s t y l e . a n i m a t e P r o p e r t y ( " y " ,   s t r Y ,   t h i s . m _ n D u r ) ; 
 
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r T e x t I D ) . s t y l e . a n i m a t e P r o p e r t y ( " w i d t h " ,   s t r W i d t h ,   t h i s . m _ n D u r ) ; 
 
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r T e x t I D ) . s t y l e . a n i m a t e P r o p e r t y ( " h e i g h t " ,   s t r H e i g h t ,   t h i s . m _ n D u r ) ; 
 
 	 	 i f ( b H i d e ) 
 
 	 	         d o c u m e n t . g e t E l e m e n t B y I d ( s t r T e x t I D ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " n o n e " ) ; 
 
 	 	 e l s e 
 
 	 	         d o c u m e n t . g e t E l e m e n t B y I d ( s t r T e x t I D ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " a u t o " ) ; 
 
 	 	 / / P o p u p 
 
 	 	 s t r P o p u p I D   =   t h i s . m _ S c r o l l D a t a [ n S c r o l l I t e m ] . m _ P o p u p I D ; 
 
 	 	 i f ( s t r P o p u p I D   ! =   n u l l ) 
 
 	 	 { 
 
 	 	 	 s t r X   =   t h i s . m _ S c r o l l T e m p l a t e [ n S r c T m p l I n d e x ] . m _ P o p u p R e c t . l e f t     +   " p x ; "   +   t h i s . m _ S c r o l l T e m p l a t e [ n T a r T m p l I n d e x ] . m _ P o p u p R e c t . l e f t   +   " p x " ; 
 
 	 	 	 s t r Y   =   t h i s . m _ S c r o l l T e m p l a t e [ n S r c T m p l I n d e x ] . m _ P o p u p R e c t . t o p     +   " p x ; "   +   t h i s . m _ S c r o l l T e m p l a t e [ n T a r T m p l I n d e x ] . m _ P o p u p R e c t . t o p   +   " p x " ; 
 
 	 	 	 s t r W i d t h   =   t h i s . m _ S c r o l l T e m p l a t e [ n S r c T m p l I n d e x ] . m _ P o p u p R e c t . f n W i d t h ( )     +   " p x ; "   +   t h i s . m _ S c r o l l T e m p l a t e [ n T a r T m p l I n d e x ] . m _ P o p u p R e c t . f n W i d t h ( )   +   " p x " ; 
 
 	 	 	 s t r H e i g h t   =   t h i s . m _ S c r o l l T e m p l a t e [ n S r c T m p l I n d e x ] . m _ P o p u p R e c t . f n H e i g h t ( )   +   " p x ; "   +   t h i s . m _ S c r o l l T e m p l a t e [ n T a r T m p l I n d e x ] . m _ P o p u p R e c t . f n H e i g h t ( )   +   " p x " ; 	 	 	 	 
 
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r P o p u p I D ) . s t y l e . a n i m a t e P r o p e r t y ( " x " ,   s t r X ,   t h i s . m _ n D u r ) ; 
 
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r P o p u p I D ) . s t y l e . a n i m a t e P r o p e r t y ( " y " ,   s t r Y ,   t h i s . m _ n D u r ) ; 
 
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r P o p u p I D ) . s t y l e . a n i m a t e P r o p e r t y ( " w i d t h " ,   s t r W i d t h ,   t h i s . m _ n D u r ) ; 
 
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t r P o p u p I D ) . s t y l e . a n i m a t e P r o p e r t y ( " h e i g h t " ,   s t r H e i g h t ,   t h i s . m _ n D u r ) ; 
 
 	 	         i f ( b H i d e ) 
 
 	 	                 d o c u m e n t . g e t E l e m e n t B y I d ( s t r P o p u p I D ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " n o n e " ) ; 
 
 	 	         e l s e 
 
 	 	                 d o c u m e n t . g e t E l e m e n t B y I d ( s t r P o p u p I D ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " a u t o " ) ; 
 
 	 	 } 
 
 	 } 
 
 	 / /   u p d a t e   c u r r e n t   s t a t u s . 
 
 	 t h i s . m _ n O n H o l d e r B e g i n   =   t h i s . m _ n O n H o l d e r B e g i n   +   n S h i f t ; 
 
         t h i s . m _ n O n H o l d e r E n d   =   t h i s . m _ n O n H o l d e r E n d   +   n S h i f t ; 
 
 	 
 
 	 / /   S e t   a l w a y s   f o c u s   e l e m e n t 
 
 	 i f ( t h i s . m _ n A l w a y s F o c u s   >   0 ) 
 
 	 { 
 
 	 	 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 . m _ S c r o l l D a t a [ t h i s . m _ n A l w a y s F o c u s   +   t h i s . m _ n O n H o l d e r B e g i n ] . m _ B u t t o n I D ) . s t a t e . s e t P r o p e r t y ( " f o c u s e d " ,   " t r u e " ) ; 
 
 	 	 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 . m _ S c r o l l D a t a [ t h i s . m _ n A l w a y s F o c u s   +   t h i s . m _ n O n H o l d e r B e g i n ] . m _ B u t t o n I D ) . s t a t e . u n s e t P r o p e r t y ( " f o c u s e d " ) ; 
 
 	 } 
 
 	 / /   s h o w / h i d e   n a v i g a t i o n   b u t t o n . 
 
 	 i f ( t h i s . m _ n O n H o l d e r B e g i n   >   0 ) 
 
 	 { 
 
 	 	 i f ( t h i s . m _ B t n N e x t   ! =   n u l l ) 
 
 	 	 	 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 . m _ B t n N e x t ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " a u t o " ) ; 
 
 	 	 i f ( t h i s . m _ B t n N e x t S h i f t   ! =   n u l l ) 
 
 	 	 	 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 . m _ B t n N e x t S h i f t ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " a u t o " ) ; 
 
 	 } 	 
 
 	 i f ( t h i s . m _ n O n H o l d e r E n d   > =   t h i s . m _ n M a x S c e n e   -   1 ) 
 
 	 { 
 
 	 	 i f ( t h i s . m _ B t n P r e v i o u s   ! =   n u l l ) 
 
 	 	 { 
 
 	 	 	 v a r   f o c u s e d   =   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 . m _ B t n P r e v i o u s ) . s t a t e . g e t P r o p e r t y ( " f o c u s e d " ) ; 
 
 	 	 	 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 . m _ B t n P r e v i o u s ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " n o n e " ) ; 
 
 	 	 	 i f ( f o c u s e d   = =   " t r u e " ) 
 
 	 	 	 { 
 
 	 	 	 	 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 . m _ B t n N e x t ) . s t a t e . s e t P r o p e r t y ( " f o c u s e d " ,   " t r u e " ) ; 
 
 	 	 	 	 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 . m _ B t n N e x t ) . s t a t e . u n s e t P r o p e r t y ( " f o c u s e d " ) ; 
 
 	 	 	 } 
 
 	 	 } 
 
 	 	 i f ( t h i s . m _ B t n P r e v i o u s S h i f t   ! =   n u l l ) 
 
 	 	 { 
 
 	 	 	 v a r   f o c u s e d   =   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 . m _ B t n P r e v i o u s S h i f t ) . s t a t e . g e t P r o p e r t y ( " f o c u s e d " ) ; 
 
 	 	 	 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 . m _ B t n P r e v i o u s S h i f t ) . s t y l e . s e t P r o p e r t y ( " d i s p l a y " ,   " n o n e " ) ; 
 
 	 	 	 i f ( f o c u s e d   = =   " t r u e " ) 
 
 	 	 	 { 
 
 	 	 	 	 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 . m _ B t n N e x t S h i f t ) . s t a t e . s e t P r o p e r t y ( " f o c u s e d " ,   " t r u e " ) ; 
 
 	 	 	 	 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 . m _ B t n N e x t S h i f t ) . s t a t e . u n s e t P r o p e r t y ( " f o c u s e d " ) ; 
 
 	 	 	 } 
 
 	 	 } 
 
 	 } 
 
 } ; 
 
 
 
 C S c r o l l E f f e c t V 2 . p r o t o t y p e . f n O n P r e v i o u s   =   f u n c t i o n ( ) 
 
 { 
 
 	 v a r   n C o u n t   =   t h i s . m _ n M a x T e m p l a t e   -   2 ; 
 
 	 t h i s . f n O n P r e v i o u s S h i f t ( t h i s . m _ n D u r * n C o u n t ,   n C o u n t ) ; 
 
 } ; 
 
