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