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