ÿþf u n c t i o n   l o g ( m s g )   {  
 	 w i n d o w . c o n s o l e   & &   w i n d o w . c o n s o l e . l o g ( m s g ) ;  
 }  
  
  
  
  
 / *   S W F   E l e m e n t   n e e d s   t h e   f o l l o w i n g   M a r k u p   S t r u c t u r e :  
 < a   h r e f = " h t t p : / / y o u r . l i n k / h e r e "   d a t a - s w f = " h t t p : / / p a t h . t o / s w f "   c l a s s = " s w f " >  
     < ! - -   d i v   w i l l   b e   r e p l a c e d   b y   f l a s h   - - >    
     ( < d i v > )  
         f l a s h   f a l l b a c k   c o n t e n t   ( i . e .   i m a g e )  
     ( < / d i v > )  
 < / a >  
 a l s o   p o s s i b l e   t o   u s e   < d i v >   i n s t e a d   o f   < a >    
 * /  
 ( f u n c t i o n (   $   ) {  
 	 v a r   m e t h o d s   =   {  
 	         i n i t   :   f u n c t i o n (   o   )   {  
 	 	 	 r e t u r n   t h i s . e a c h ( f u n c t i o n ( ) {  
 	 	 	 	 v a r   $ t h i s   =   $ ( t h i s ) ;  
 	 	 	 	 v a r   u n i q u e _ i d   =   g e t U n i q u e I d ( ) ;  
 	 	 	 	  
 	 	 	 	 v a r   f l a s h v a r s   =   $ . u n s e r i a l i z e ( $ t h i s . a t t r ( ' d a t a - f l a s h v a r s ' ) ) ;  
 	 	 	 	 v a r   p a r a m s   =   $ . u n s e r i a l i z e ( $ t h i s . a t t r ( ' d a t a - p a r a m s ' ) ) ;  
 	 	 	 	 v a r   a t t r i b u t e s   =   $ . u n s e r i a l i z e ( $ t h i s . a t t r ( ' d a t a - a t t r i b u t e s ' ) ) ;  
 	 	 	 	  
 	 	 	 	 v a r   d e f a u l t _ f l a s h v a r s   =   {  
 	 	 	 	 	 c l i c k t a g :   $ t h i s . a t t r ( ' h r e f ' )  
 	 	 	 	 } ;  
 	 	 	 	 v a r   d e f a u l t _ p a r a m s   =   {  
 	 	 	 	 	 a l l o w F u l l s c r e e n :   t r u e ,  
 	 	 	 	 	 a l l o w S c r i p t A c c e s s :   ' a l w a y s ' ,  
 	 	 	 	 	 w m o d e :   ' t r a n s p a r e n t '  
 	 	 	 	 } ;  
 	 	 	 	 v a r   d e f a u l t _ a t t r i b u t e s   =   {  
 	 	 	 	 	 i d :   u n i q u e _ i d ,  
 	 	 	 	 	 n a m e :   u n i q u e _ i d  
 	 	 	 	 } ;  
 	 	 	 	  
 	 	 	 	 f l a s h v a r s   =   $ . e x t e n d ( f a l s e ,   d e f a u l t _ f l a s h v a r s ,   f l a s h v a r s ) ;  
 	 	 	 	 p a r a m s   =   $ . e x t e n d ( f a l s e ,   d e f a u l t _ p a r a m s ,   p a r a m s ) ;  
 	 	 	 	 a t t r i b u t e s   =   $ . e x t e n d ( f a l s e ,   d e f a u l t _ a t t r i b u t e s ,   a t t r i b u t e s ) ;  
 	 	 	 	  
 	 	 	 	 v a r   d e f a u l t s   =   {  
 	 	 	 	 	 s w f U r l :   $ t h i s . a t t r ( ' d a t a - s w f ' ) ,  
 	 	 	 	 	 w i d t h :   " 1 0 0 % " ,  
 	 	 	 	 	 h e i g h t :   " 1 0 0 % " ,  
 	 	 	 	 	 f l a s h v a r s :   f l a s h v a r s ,  
 	 	 	 	 	 p a r a m s :   p a r a m s ,  
 	 	 	 	 	 a t t r i b u t e s :   a t t r i b u t e s ,  
 	 	 	 	 	 c a l l b a c k :   n u l l  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 v a r   o p t i o n s   =   $ . e x t e n d ( t r u e ,   d e f a u l t s ,   o ) ; 	 	  
 	 	 	 	 $ t h i s . w i d t h ( $ t h i s . w i d t h ( ) ) ;  
 	 	 	 	 $ t h i s . h e i g h t ( $ t h i s . h e i g h t ( ) ) ;  
 	 	 	 	 v a r   $ c o n t a i n e r   =   $ ( ' < d i v   / > ' ) . a p p e n d T o ( $ t h i s ) ;  
 	 	 	 	 $ c o n t a i n e r . a t t r ( ' i d ' ,   o p t i o n s . a t t r i b u t e s . i d ) ;  
 	 	 	 	 v a r   w i d t h   =   " 1 0 0 % " ;  
 	 	 	 	 v a r   h e i g h t   =   " 1 0 0 % " ;  
 	 	 	 	 s w f o b j e c t . e m b e d S W F ( o p t i o n s . s w f U r l ,   o p t i o n s . a t t r i b u t e s . i d ,   o p t i o n s . w i d t h ,   o p t i o n s . h e i g h t ,   " 9 . 0 . 0 " , f a l s e ,   o p t i o n s . f l a s h v a r s ,   o p t i o n s . p a r a m s ,   o p t i o n s . a t t r i b u t e s ,   s w f E m b e d C a l l b a c k ) ;  
 	 	 	 	 f u n c t i o n   s w f E m b e d C a l l b a c k ( e ) {  
 	 	 	 	 	 i f   ( e . s u c c e s s )   {  
 	 	 	 	 	 	 $ t h i s . c h i l d r e n ( ) . n o t ( e . r e f ) . r e m o v e ( ) ;  
 	 	 	 	 	 	 $ t h i s . r e m o v e A t t r ( ' h r e f ' ) ;  
 	 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 	 $ c o n t a i n e r . r e m o v e ( ) ;  
 	 	 	 	 	 }  
 	 	 	 	 	 i f   ( o p t i o n s . c a l l b a c k )    
 	 	 	 	 	 	 o p t i o n s . c a l l b a c k . c a l l ( $ t h i s ,   e ) ;  
 	 	 	 	 }  
 	 	 	 } ) ;  
 	 	 }  
 	 } ;  
 	 f u n c t i o n   g e t U n i q u e I d ( )   {  
 	 	 v a r   j e t z t   =   n e w   D a t e ( ) ;  
 	 	 r e t u r n   " i d _ " + j e t z t . g e t T i m e ( ) ;  
 	 }  
 	 $ . f n . s w f E l e m e n t   =   f u n c t i o n (   m e t h o d   )   {  
 	         / /   M e t h o d   c a l l i n g   l o g i c  
 	         i f   (   m e t h o d s [ m e t h o d ]   )   {  
 	             r e t u r n   m e t h o d s [   m e t h o d   ] . a p p l y (   t h i s ,   A r r a y . p r o t o t y p e . s l i c e . c a l l (   a r g u m e n t s ,   1   ) ) ;  
 	         }   e l s e   i f   (   t y p e o f   m e t h o d   = = =   ' o b j e c t '   | |   !   m e t h o d   )   {  
 	             r e t u r n   m e t h o d s . i n i t . a p p l y (   t h i s ,   a r g u m e n t s   ) ;  
 	         }   e l s e   {  
 	             $ . e r r o r (   ' M e t h o d   '   +     m e t h o d   +   '   d o e s   n o t   e x i s t   o n   j Q u e r y . s w f E l e m e n t '   ) ;  
 	         }      
 	 } ;  
 } ) (   j Q u e r y   ) ;  
  
  
 / *   u n s e r i a l i z e   d e c o d e s   s t r i n g s   o f   k i n d   a = 1 & b = 2 & c = 3 . . .   t o   a n   o b j e c t   * /  
 ( f u n c t i o n ( $ )   {  
 	 	 $ . u n s e r i a l i z e   =   f u n c t i o n ( s t r )   {  
 	 	 	 i f   ( s t r )   {  
 	 	 	 	 v a r   i t e m _ p a i r s   =   s t r . s p l i t ( ' & ' ) ;  
 	 	 	 	 v a r   o b j   =   n e w   O b j e c t ( ) ;  
 	 	 	 	 $ . e a c h ( i t e m _ p a i r s ,   f u n c t i o n ( i n d e x ,   v a l ) {  
 	 	 	 	 	 v a r   i t e m _ s p l i t t e d   =   v a l . s p l i t ( ' = ' ) ;  
 	 	 	 	 	 o b j [ i t e m _ s p l i t t e d [ 0 ] ]   =   i t e m _ s p l i t t e d [ 1 ] ;  
 	 	 	 	 } ) ;  
 	 	 	 	 r e t u r n   o b j ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 }  
 	 	 } ;  
 } ) ( j Q u e r y ) ;  
  
  
  
 / *   j Q u e r y   S i t e m a p   n e e d   s t a n d a r d   c s c - s i t e m a p   f r o m   t y p o 3   * /  
  
 ( f u n c t i o n ( $ )   {  
 	 $ . f n . j Q u e r y S i t e m a p   =   f u n c t i o n ( p r e s e n t a t i o n ,   t y p e )   {  
 	  
 	 	 v a r   r o o t E l e m e n t   =   t h i s ;  
 	  
 	 	 i f ( r o o t E l e m e n t . l e n g t h   >   0 ) {  
 	 	 	  
 	 	 	 	 	  
 	 	 	 / /   a s s i g n   t h e   l a y o u t   d e p e n d i n g   o n   t h e   g i v e n   p a r a m e t e r   ' t y p e '  
 	 	 	 / /   b y   d e f a u l t   ' v e r t i c a l '   i s   a s s i g n e d  
 	 	 	 	 v a r   t y p e   =   ( t y p e   = =   n u l l )   ?   " v e r t i c a l "   :   t y p e ;  
 	 	 	 	 $ ( r o o t E l e m e n t ) . a d d C l a s s ( t y p e ) ;  
 	 	 	  
 	 	 	  
 	 	 	 / /   h i d e / s h o w   s u b l e v e l s   d e p e n d i n g   o n   t h e   p a r a m e t e r   ' p r e s e n t a t i o n ' 	 	 	  
 	 	 	 	 v a r   p r e s e n t a t i o n   =   ( p r e s e n t a t i o n   = =   n u l l )   ?   " o p e n "   :   p r e s e n t a t i o n ;  
 	 	 	  
 	 	 	 	 i f   ( p r e s e n t a t i o n   = =   ' c l o s e d ' )   {  
 	 	 	 	 	 $ ( r o o t E l e m e n t   +   '   u l ' ) . h i d e ( ) ;  
 	 	 	 	 	 s p a n C l a s s   =   ' c o l l a p s e d ' ;  
 	 	 	 	 }  
 	 	 	 	 e l s e   {  
 	 	 	 	 	 s p a n C l a s s   =   ' e x p a n d e d ' ;  
 	 	 	 	 }  
 	 	 	  
 	 	 	  
 	 	 	 / /   a p p e n d   t h e   n a v i g a t i o n   f o r   t o g g l i n g  
 	 	 	 	 $ ( ' l i ' ,   r o o t E l e m e n t ) . f i n d ( ' u l ' ) . e a c h ( f u n c t i o n ( ) {  
 	 	 	 	 	 $ ( t h i s ) . a f t e r ( ' < s p a n   c l a s s = " ' +   s p a n C l a s s   + ' "   / > ' ) ;  
 	 	 	 	 } ) 	 	 	 	  
 	 	 	  
 	 	 	 / /   T o g g l e   t h e   I c o n s   o n c l i c k  
 	 	 	 	 $ ( ' . e x p a n d e d ' ) . l i v e ( ' c l i c k ' ,   f u n c t i o n ( ) {  
 	 	 	 	 	 $ ( t h i s ) . p r e v A l l ( ' u l ' ) . s l i d e T o g g l e ( ) ;  
 	 	 	 	 	 $ ( t h i s ) . a t t r ( ' c l a s s ' ,   ' c o l l a p s e d ' ) ;  
 	 	 	 	 } )  
 	 	 	 	 $ ( ' . c o l l a p s e d ' ) . l i v e ( ' c l i c k ' ,   f u n c t i o n ( ) {  
 	 	 	 	 	 $ ( t h i s ) . p r e v A l l ( ' u l ' ) . s l i d e T o g g l e ( ) ;  
 	 	 	 	 	 $ ( t h i s ) . a t t r ( ' c l a s s ' ,   ' e x p a n d e d ' ) ;  
 	 	 	 	 } ) 	  
 	 	 	 	  
 	 	 	 	 $ ( ' . e x p a n d e d ,   . c o l l a p s e d ' ) . h o v e r ( f u n c t i o n ( ) {  
 	 	 	 	 	 $ ( t h i s ) . c s s ( ' c u r s o r ' ,   ' p o i n t e r ' ) ;  
 	 	 	 	 } ) 	 	 	  
 	 	 } ;  
 	 	  
 	  
 	 } ;  
 } ) ( j Q u e r y ) ;  
  
  
  
 / *   m m c F o r m D e f a u l t s   i s   a   H T M L 5   F a l l b a c k   f o r   o l d   B r o w s e r s   a n d   I E    
       f i l l s   t e x t - i n p u t s   a n d   t e x t a r e a s   w i t h   t h e i r   p l a c e h o l d e r   t e x t   a n d   t o g g l e s   o n   f o c u s   * /  
 ( f u n c t i o n ( $ )   {  
 	 	 $ . f n . m m c F o r m D e f a u l t s   =   f u n c t i o n ( )   {  
 	 	 	 f u n c t i o n   s u p p o r t s _ i n p u t _ p l a c e h o l d e r ( )   {  
 	 	 	     v a r   i   =   d o c u m e n t . c r e a t e E l e m e n t ( ' i n p u t ' ) ;  
 	 	 	     r e t u r n   ' p l a c e h o l d e r '   i n   i ;  
 	 	 	 }  
 	 	 	 i f   ( ! s u p p o r t s _ i n p u t _ p l a c e h o l d e r ( ) )   {  
 	 	 	 	 t h i s . e a c h ( f u n c t i o n ( ) {  
 	 	 	 	 	 v a r   $ t h i s   =   $ ( t h i s ) ;  
 	 	 	 	 	 v a r   i n p u t   =   $ t h i s . i s ( ' i n p u t ' )   ?   t r u e   :   f a l s e ;  
 	 	 	 	 	 i f   ( $ t h i s . v a l ( )   = =   ' '   & &   $ t h i s . t e x t ( )   = =   ' ' )   {  
 	 	 	 	 	 	 i f   ( i n p u t )   {  
 	 	 	 	 	 	 	 $ t h i s . v a l ( $ t h i s . a t t r ( ' p l a c e h o l d e r ' ) ) . a d d C l a s s ( ' e m p t y ' ) ;  
 	 	 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 	 	 $ t h i s . t e x t ( $ t h i s . a t t r ( ' p l a c e h o l d e r ' ) ) . a d d C l a s s ( ' e m p t y ' ) ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 }  
 	 	 	 	 	 $ t h i s . b i n d ( ' f o c u s ' ,   f u n c t i o n ( ) {  
 	 	 	 	 	 	 i f   ( $ t h i s . v a l ( )   = =   $ t h i s . a t t r ( ' p l a c e h o l d e r ' )   | |   $ t h i s . t e x t ( )   = =   $ t h i s . a t t r ( ' p l a c e h o l d e r ' ) )   {  
 	 	 	 	 	 	 	 i f   ( i n p u t )   {  
 	 	 	 	 	 	 	 	 $ t h i s . v a l ( ' ' ) . r e m o v e C l a s s ( ' e m p t y ' ) ;  
 	 	 	 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 	 	 	 $ t h i s . t e x t ( ' ' ) . r e m o v e C l a s s ( ' e m p t y ' ) ;  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 }  
 	 	 	 	 	 } ) ;  
 	 	 	 	 	 $ t h i s . b i n d ( ' b l u r ' ,   f u n c t i o n ( ) {  
 	 	 	 	 	 	 i f   ( $ t h i s . v a l ( )   = =   ' '   & &   $ t h i s . t e x t ( )   = =   ' ' )   {  
 	 	 	 	 	 	 	 i f   ( i n p u t )   {  
 	 	 	 	 	 	 	 	 $ t h i s . v a l ( $ t h i s . a t t r ( ' p l a c e h o l d e r ' ) ) . a d d C l a s s ( ' e m p t y ' ) ;  
 	 	 	 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 	 	 	 $ t h i s . t e x t ( $ t h i s . a t t r ( ' p l a c e h o l d e r ' ) ) . a d d C l a s s ( ' e m p t y ' ) ;  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 }  
 	 	 	 	 	 } ) ;  
 	 	 	 	 } ) ;  
 	 	 	 }  
 	 	 	 r e t u r n   t h i s ;  
 	 	 } ;  
 } ) ( j Q u e r y ) ;  
  
  
  
  
  
  
  
  
 / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /  
 / *   M M C   C a r o u s e l   ( c )   2 0 1 0 - 2 0 1 1   D a v i d   R e r y c h   m m c : a g e n t u r   * /  
  
  
 ( f u n c t i o n (   $   ) {  
  
     v a r   m e t h o d s   =   {  
 	 i n i t   :   f u n c t i o n (   o p t i o n s   )   {  
 	 	 r e t u r n   $ ( t h i s ) . e a c h ( f u n c t i o n ( ) {  
 	 	  
 	 	 i f   ( t y p e o f   t h i s . o   = =   ' u n d e f i n e d ' )   {  
 	 	 	 	  
 	 	 	 	 l o g ( ' i n i t i a l i z i n g   '   +   $ ( t h i s ) . a t t r ( ' i d ' ) ) ;  
 	 	 	 	  
 	 	 	 	 v a r   $ t h i s   =   $ ( t h i s ) ;  
 	 	 	 	 v a r   T h i s   =   t h i s ;  
  
 	 	 	 	 / / t h i s . o r i g i n a l M a r k u p   =   $ ( $ ( ' < d i v > < / d i v > ' ) . h t m l ( $ t h i s . c l o n e ( ) ) ) . h t m l ( ) ;  
 	 	 	 	  
 	 	 	 	 $ t h i s . a d d C l a s s ( ' m m c - c a r o u s e l ' ) ;  
  
 	 	 	 	 v a r   o   =   $ . e x t e n d ( {  
 	 	 	 	 	 b t n P r e v :   n u l l ,  
 	 	 	 	 	 b t n N e x t :   n u l l ,  
 	 	 	 	 	 b t n G o :   n u l l ,  
 	 	 	 	 	 b t n P a g e :   n u l l ,  
 	 	 	 	 	 b u i l d P a g e r :   n u l l ,  
 	 	 	 	 	 m o u s e W h e e l :   f a l s e ,  
 	 	 	 	 	 a u t o :   n u l l ,  
 	 	 	 	 	 j u m p T o O t h e r E n d :   f a l s e ,  
 	 	 	 	 	  
 	 	 	 	 	 s p e e d :   2 0 0 ,  
 	 	 	 	 	 e a s i n g :   n u l l ,  
 	 	 	 	 	  
 	 	 	 	 	 v e r t i c a l :   f a l s e ,  
 	 	 	 	 	 c i r c u l a r :   t r u e ,  
 	 	 	 	 	 v i s i b l e :   3 ,  
 	 	 	 	 	 s t a r t :   0 ,  
 	 	 	 	 	 s c r o l l :   1 ,  
 	 	 	 	 	  
 	 	 	 	 	 b e f o r e S t a r t :   n u l l ,  
 	 	 	 	 	 a f t e r E n d :   n u l l ,  
 	 	 	 	 	 o n R e I n i t :   n u l l  
 	 	 	 	 } ,   o p t i o n s ) ;  
 	 	 	 	  
 	 	 	 	 t h i s . o   =   o ;  
 	 	 	 	  
 	 	 	 	 i f   ( o . s c r o l l   >   o . v i s i b l e )   {  
 	 	 	 	 	 l o g ( ' s c r o l l   m o r e   e l e m e n t s   t h a n   v i s i b l e   i s   n o t   a l l o w e d !   t e r m i n a t i n g   . . . ' ) ;  
 	 	 	 	 	 r e t u r n   $ t h i s ;  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 t h i s . r u n n i n g   =   f a l s e ;  
 	 	 	 	  
 	 	 	 	 t h i s . c u r r   =   0 ;  
 	 	 	 	  
 	 	 	 	 t h i s . a n i m C s s   =   t h i s . o . v e r t i c a l   ?   " t o p "   :   " l e f t " ;  
 	 	 	 	 t h i s . s i z e C s s   =   t h i s . o . v e r t i c a l   ?   " h e i g h t "   :   " w i d t h " ;  
 	 	 	 	 t h i s . d i v   =   $ t h i s ;  
 	 	 	 	 t h i s . u l   =   t h i s . d i v . c h i l d r e n ( ' u l ' ) ;  
 	 	 	 	 t h i s . v   =   t h i s . o . v i s i b l e ;  
 	 	 	  
 	 	 	 	 t h i s . c i r c _ o f f s e t   =   0 ;  
  
 	 	 	 	 t h i s . i n t e r v a l I D   =   n u l l ;  
 	 	 	 	  
 	 	 	 	 t h i s . c u r r   =   t h i s . o . s t a r t ;  
 	 	 	 	 t h i s . c u r r p a g e   =   n u l l ;  
 	 	 	 	  
 	 	 	 	 m e t h o d s . r e I n i t . c a l l ( $ t h i s ) ;  
  
 	 	 	 	  
 	 	 	 	 t h i s . l i . c s s ( {  
 	 	 	 	 	 ' o v e r f l o w ' :   ' h i d d e n ' ,  
 	 	 	 	 	 ' f l o a t ' :   t h i s . o . v e r t i c a l   ?   " n o n e "   :   " l e f t "  
 	 	 	 	 } ) ;  
 	 	 	 	 t h i s . u l . c s s ( {  
 	 	 	 	 	 m a r g i n :   " 0 " ,  
 	 	 	 	 	 p a d d i n g :   " 0 " ,  
 	 	 	 	 	 p o s i t i o n :   " r e l a t i v e " ,  
 	 	 	 	 	 " l i s t - s t y l e - t y p e " :   " n o n e "  
 	 	 	 	 } ) ;  
 	 	 	 	 t h i s . d i v . c s s ( {  
 	 	 	 	 	 o v e r f l o w :   " h i d d e n " ,  
 	 	 	 	 	 p o s i t i o n :   " r e l a t i v e " ,  
 	 	 	 	 	 l e f t :   " 0 p x "  
 	 	 	 	 } ) ;  
  
 	 	 	 	  
 	 	 	 	 i f   ( t h i s . o . b t n G o )   {  
 	 	 	 	 	 $ . e a c h ( t h i s . o . b t n G o ,   f u n c t i o n ( i ,   v a l ) {  
 	 	 	 	 	 	 $ ( v a l ) . c l i c k ( f u n c t i o n ( ) {  
 	 	 	 	 	 	 	 i f   ( ! $ ( t h i s ) . h a s C l a s s ( ' a c t i v e ' ) )   {  
 	 	 	 	 	 	 	 	 m e t h o d s . g o . c a l l ( $ t h i s ,   i ) ;  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 	 	 	 } ) ;  
 	 	 	 	 	 } ) ;  
 	 	 	 	 } 	 	 	 	  
  
  
 	 	 	 	 i f   ( t h i s . o . b t n P r e v )   {  
 	 	 	 	 	 $ ( t h i s . o . b t n P r e v ) . c l i c k ( f u n c t i o n ( ) {  
 	 	 	 	 	 	 i f   ( ! $ ( t h i s ) . h a s C l a s s ( ' d i s a b l e d ' ) )   {  
 	 	 	 	 	 	 	 m e t h o d s . a d v a n c e . c a l l ( $ t h i s ,   - T h i s . o . s c r o l l ) ;  
 	 	 	 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 	 e l s e   {  
 	 	 	 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 } ) ;  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 i f   ( t h i s . o . b t n N e x t )   {  
 	 	 	 	 	 $ ( t h i s . o . b t n N e x t ) . c l i c k ( f u n c t i o n ( ) {  
 	 	 	 	 	 	 i f   ( ! $ ( t h i s ) . h a s C l a s s ( ' d i s a b l e d ' ) )   {  
 	 	 	 	 	 	 	 m e t h o d s . a d v a n c e . c a l l ( $ t h i s ,   T h i s . o . s c r o l l ) ;  
 	 	 	 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 } ) ;  
 	 	 	 	 }  
 	 	 	 	  
  
 	 	 	 	 	  
 	 	 	 	 i f   ( t h i s . o . m o u s e W h e e l   & &   t h i s . d i v . m o u s e w h e e l )    
 	 	 	 	 	 t h i s . d i v . m o u s e w h e e l ( f u n c t i o n ( e ,   d ) {  
 	 	 	 	 	 	 d   >   0   ?   m e t h o d s . a d v a n c e . c a l l ( $ t h i s ,     - T h i s . o . s c r o l l )   :   m e t h o d s . a d v a n c e . c a l l ( $ t h i s ,   T h i s . o . s c r o l l ) ;  
 	 	 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 	 	 } ) ;  
  
 	 	 	 	 i f   ( t h i s . o . a u t o )   {  
 	 	 	 	 	 m e t h o d s . s t a r t A u t o . c a l l ( $ t h i s ) ;  
 	 	 	 	 	 $ ( t h i s . o . b t n P r e v ) . a d d ( t h i s . o . b t n N e x t )  
 	 	 	 	 	 	 . m o u s e e n t e r ( f u n c t i o n ( ) {  
 	 	 	 	 	 	 	 m e t h o d s . s t o p A u t o . c a l l ( $ t h i s ) ;  
 	 	 	 	 	 	 } )  
 	 	 	 	 	 	 . m o u s e l e a v e ( f u n c t i o n ( ) {  
 	 	 	 	 	 	 	 i f   ( t h i s . o . a u t o )   {  
 	 	 	 	 	 	 	 	 m e t h o d s . s t a r t A u t o . c a l l ( $ t h i s ) ;  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 } ) ; 	  
 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 d i s E n A b l e B u t t o n s ( t h i s ) ;  
 	 	 	 	  
                                 i f ( t h i s . o . a f t e r I n i t )  
                                         t h i s . o . a f t e r I n i t . c a l l ( t h i s ,   t h i s . o ) ;  
 	 	 	 	  
 	 	       }  
 	 	 } ) ;  
 	 	  
 	 	  
 	 } ,  
 	 r e I n i t   :   f u n c t i o n   ( )   {  
 	 	 r e t u r n   t h i s . e a c h ( f u n c t i o n ( ) {  
 	 	 	 l o g ( ' r e i n i t i a l i z i n g ' ) ;  
 	 	 	  
 	 	 	 v a r   $ t h i s   =   $ ( t h i s ) ;  
 	 	 	  
 	 	 	 t h i s . u l . f i n d ( ' . m m c C a r o u s e l C l o n e ' ) . r e m o v e ( ) ;  
 	 	 	  
 	 	 	 t h i s . t L i   =   t h i s . u l . c h i l d r e n ( ' l i ' ) ;  
 	 	 	 t h i s . t l   =   t h i s . t L i . s i z e ( ) ;  
 	 	 	  
 	 	 	 t h i s . t L i . e a c h ( f u n c t i o n ( ) {  
 	 	 	 	 $ ( t h i s ) . a t t r ( ' d a t a - i n d e x ' , $ ( t h i s ) . i n d e x ( ) ) ;  
 	 	 	 } ) ;  
 	 	 	 t h i s . p a g e l e n g t h   =   M a t h . c e i l ( ( t h i s . t l   -   t h i s . o . v i s i b l e ) / t h i s . o . s c r o l l ) + 1 ;  
 	 	 	 t h i s . l i S i z e   =   t h i s . o . v e r t i c a l   ?   t h i s . t L i . o u t e r H e i g h t ( t r u e )   :   t h i s . t L i . o u t e r W i d t h ( t r u e ) ;   / /   F u l l   l i   s i z e ( i n c l   m a r g i n ) - U s e d   f o r   a n i m a t i o n  
 	 	 	 i f   ( t h i s . o . c i r c u l a r   & &   ( t h i s . t l   >   t h i s . o . v i s i b l e ) )   {  
 	 	 	 	 t h i s . u l . p r e p e n d ( t h i s . t L i . s l i c e ( t h i s . t l   -   t h i s . o . v i s i b l e ,   t h i s . t l ) . c l o n e ( t r u e ) . a d d C l a s s ( ' m m c C a r o u s e l C l o n e ' ) ) ;  
 	 	 	 	 t h i s . u l . a p p e n d ( t h i s . t L i . s l i c e ( 0 ,   t h i s . o . v i s i b l e ) . c l o n e ( t r u e ) . a d d C l a s s ( ' m m c C a r o u s e l C l o n e ' ) ) ;  
 	 	 	 	 t h i s . c i r c _ o f f s e t   =   t h i s . v   *   t h i s . l i S i z e ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 t h i s . c i r c _ o f f s e t   =   0 ;  
 	 	 	 }  
 	 	 	 t h i s . l i   =   t h i s . u l . c h i l d r e n ( ' l i ' ) ;  
 	 	 	 t h i s . t o t a l L i L e n g t h   =   t h i s . l i . s i z e ( ) + 3 0 ;  
 	 	 	 t h i s . u l S i z e   =   t h i s . l i S i z e   *   t h i s . t o t a l L i L e n g t h ;   / /   s i z e   o f   f u l l   u l ( t o t a l   l e n g t h ,   n o t   j u s t   f o r   t h e   v i s i b l e   i t e m s )  
 	  
 	  
 	 	 	 t h i s . u l . c s s ( t h i s . s i z e C s s ,   t h i s . u l S i z e   +   " p x " ) ;  
  
 	 	  
 	 	 	 / / . c s s ( t h i s . a n i m C s s ,   - ( t h i s . c u r r * t h i s . l i S i z e   +   t h i s . c i r c _ o f f s e t ) ) ;  
 	 	 	  
 	 	 	  
 	 	 	  
 	 	 	 i f   ( t h i s . o . b u i l d P a g e r )   {  
 	 	 	 	 v a r   p a g e r L i n k s   =   ' ' ;  
 	 	 	 	 f o r   ( v a r   i = 0 ;   i < t h i s . p a g e l e n g t h ;   i + + )   {  
 	 	 	 	 	 p a g e r L i n k s   + =   ' < a   h r e f = " # "   > ' + ( i + 1 ) + ' < / a > ' ;  
 	 	 	 	 } ;  
 	 	 	 	 $ ( t h i s . o . b u i l d P a g e r ) . h t m l ( p a g e r L i n k s ) ;  
 	 	 	 	 t h i s . o . b t n P a g e   =   $ ( ' a ' ,   t h i s . o . b u i l d P a g e r ) ;  
 	 	 	 }  
 	 	 	  
 	 	 	 i f   ( t h i s . o . b t n P a g e )   {  
 	 	 	 	 i f   ( t h i s . o . b t n P a g e . l e n g t h   <   t h i s . p a g e l e n g t h )   {  
 	 	 	 	 	 l o g ( ' N o t   e n o u g h   b t n P a g e   O b j e c t s ,   p l e a s e   u p d a t e   o r   u s e   $ ( " # y o u r C a r o u s e l I D " ) . m m c C a r o u s e l ( " g o P a g e " ,   n ) . ' ) ;  
 	 	 	 	 	 t h i s . o . b t n P a g e   =   n u l l ;  
 	 	 	 	 }  
 	 	 	 	 e l s e   {  
 	 	 	 	 	 $ . e a c h ( t h i s . o . b t n P a g e ,   f u n c t i o n ( i ,   v a l ) {  
 	 	 	 	 	 	 $ ( v a l ) . c l i c k ( f u n c t i o n ( ) {  
 	 	 	 	 	 	 	 i f   ( ! $ ( t h i s ) . h a s C l a s s ( ' a c t i v e ' ) )   {  
 	 	 	 	 	 	 	 	 m e t h o d s . g o P a g e . c a l l ( $ t h i s ,   i ) ;  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 	 	 	 } ) ;  
 	 	 	 	 	 } ) ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	  
 	 	 	 i f   ( ( ! t h i s . o . c i r c u l a r ) )   {  
 	 	 	 	 m e t h o d s . j u m p . c a l l ( $ t h i s ,   t h i s . c u r r ) ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 m e t h o d s . j u m p . c a l l ( $ t h i s ,   t h i s . c u r r ) ;  
 	 	 	 	 i f   ( t h i s . t l   < =   t h i s . o . v i s i b l e )   {  
 	 	 	 	 	 t h i s . o . c i r c u l a r   =   f a l s e ;  
 	 	 	 	 	 m e t h o d s . g o . c a l l ( $ t h i s ,   0 ) ;  
 	 	 	 	 }  
 	 	 	 } 	 	 	  
 	 	 	  
 	 	 	 i f   ( t h i s . o . o n R e I n i t )   {  
 	 	 	 	 t h i s . o . o n R e I n i t . c a l l ( $ t h i s ,   m e t h o d s . v i s . c a l l ( $ t h i s ) ,   t h i s . c u r r p a g e ) ;  
 	 	 	 }  
  
 	 	 } ) ;  
 	 } ,  
 	 r e m o v e I t e m   :   f u n c t i o n   ( i t e m ,   s p e e d )   {  
 	 	 v a r   T h i s   =   t h i s [ 0 ] ;  
 	 	 v a r   $ t h i s   =   $ ( T h i s ) ;  
 	 	 i f   ( t y p e o f   T h i s . o   = =   ' u n d e f i n e d ' )   {  
 	 	 	 l o g ( $ t h i s . c o n t e x t + '   ' + $ t h i s . c o n t e x t . c l a s s N a m e + '   ' + $ t h i s . c o n t e x t . i d + '   i s   n o   m m c C a r o u s e l ' ) ;  
 	 	 	 r e t u r n   f a l s e ;  
 	 	 }  
 	 	 i f   ( T h i s . r u n n i n g )   {  
 	 	 	 r e t u r n   $ ( T h i s ) ;  
 	 	 }  
 	 	 s p e e d   =   s p e e d   | |   2 0 0 ;  
 	 	 l o g ( ' r e m o v e I t e m   C a l l e d ' ) ;  
 	 	 i f   ( t y p e o f   i t e m   = =   ' n u m b e r ' )   {  
 	 	 	 v a r   $ t h i s _ l i   =   T h i s . l i . f i l t e r ( ' [ d a t a - i n d e x = ' + i t e m + ' ] ' ) ;  
 	 	 	 i f   ( $ t h i s _ l i . l e n g t h   < =   0 )   {  
 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 }  
 	 	 }   e l s e   {  
 	 	 	 v a r   $ t h i s _ l i   =   $ ( i t e m ) ;  
 	 	 }  
 	 	  
 	 	 v a r   i n d e x   =   $ t h i s _ l i . a t t r ( ' d a t a - i n d e x ' ) ;  
 	 	 / / l o g ( t h i s . l i . f i l t e r ( ' [ d a t a - i n d e x = ' + i n d e x + ' ] ' ) ) ;  
 	 	  
 	 	 i f   ( i n d e x   <   T h i s . c u r r )   {  
 	 	 	 T h i s . c u r r - - ;  
 	 	 }  
 	 	  
 	 	 i f   ( ( i n d e x   >   T h i s . t l   -   T h i s . o . v i s i b l e   -   1 )   & &   ( ! T h i s . o . c i r c u l a r ) )   {  
 	 	 	 l o g ( ' r e m o v e   i n d e x   =   '   +   i n d e x ) ;  
 	 	 	 l o g ( ' r e m o v e   c u r r   =   '   +   T h i s . c u r r ) ;  
 	 	 	 m e t h o d s . g o . c a l l ( $ t h i s ,   T h i s . c u r r   -   1 ,   s p e e d ) ;  
 	 	 }  
 	 	  
 	 	  
 	 	  
 	 	 i f   ( m e t h o d s . v i s . c a l l ( $ t h i s ,   $ t h i s _ l i ) )   {  
 	 	  
 	 	 	 T h i s . r u n n i n g   =   t r u e ;  
 	 	 	  
 	 	 	 $ t h i s _ l i . a n i m a t e ( T h i s . a n i m C s s   = =   " l e f t "   ?   {  
 	 	 	 	 ' w i d t h ' :   ' 0 p x ' ,  
 	 	 	 	 ' m a r g i n - l e f t ' :   ' 0 p x ' ,  
 	 	 	 	 ' m a r g i n - r i g h t ' :   ' 0 p x ' ,  
 	 	 	 	 ' p a d d i n g - l e f t ' :   ' 0 p x ' ,  
 	 	 	 	 ' p a d d i n g - r i g h t ' :   ' 0 p x '  
 	 	 	 }   :   {  
 	 	 	 	 ' h e i g h t ' :   ' 0 p x ' ,  
 	 	 	 	 ' m a r g i n - t o p ' :   ' 0 p x ' ,  
 	 	 	 	 ' m a r g i n - b o t t o m ' :   ' 0 p x ' ,  
 	 	 	 	 ' p a d d i n g - t o p ' :   ' 0 p x ' ,  
 	 	 	 	 ' p a d d i n g - b o t t o m ' :   ' 0 p x '  
 	 	 	 } ,   s p e e d ,   f u n c t i o n ( ) {  
 	 	 	 	 T h i s . r u n n i n g   =   f a l s e ;  
 	 	 	 	 f i n a l l y R e m o v e I t e m ( ) ;  
 	 	 	 } ) ;  
 	 	  
 	 	 }   e l s e   {  
 	 	 	 f i n a l l y R e m o v e I t e m ( ) ;  
 	 	 }  
 	 	  
  
 	 	 f u n c t i o n   f i n a l l y R e m o v e I t e m ( )   {  
 	 	 	 T h i s . l i . f i l t e r ( ' [ d a t a - i n d e x = '   +   i n d e x   +   ' ] ' ) . r e m o v e ( ) ;  
 	 	 	 m e t h o d s . r e I n i t . c a l l ( $ t h i s ) ;  
 	 	 }  
 	 } ,  
 	 g o   :   f u n c t i o n (   t o ,   s p e e d   )   {  
 	 	 r e t u r n   t h i s . e a c h ( f u n c t i o n ( ) {  
 	 	 	 i f   ( t y p e o f   t h i s . o   ! =   ' u n d e f i n e d ' )   {  
  
 	 	 	 	 s p e e d   =   t y p e o f   s p e e d   ! =   ' u n d e f i n e d '   ?   s p e e d   :   t h i s . o . s p e e d ; 	 	  
 	 	 	  
 	 	 	 	 l o g ( ' g o   t o = ' + t o   +   '   ' ) ;  
 	 	 	 	  
 	 	 	 	 v a r   $ t h i s   =   $ ( t h i s ) ;  
 	 	 	 	 v a r   T h i s   =   t h i s ;  
 	 	 	 	 v a r   v   =   t h i s . o . v i s i b l e ;  
 	 	 	 	  
 	 	                 i f ( ! t h i s . r u n n i n g )   {  
 	 	 	 	 	  
 	 	                         i f ( t h i s . o . c i r c u l a r )   {                         / /   I f   c i r c u l a r   w e   a r e   i n   f i r s t   o r   l a s t ,   t h e n   g o t o   t h e   o t h e r   e n d  
 	 	                                 i f ( t o < - t h i s . o . v i s i b l e )   {                       / /   I f   f i r s t ,   t h e n   g o t o   l a s t  
 	 	                                         / /   I f   " s c r o l l "   >   1 ,   t h e n   t h e   " t o "   m i g h t   n o t   b e   e q u a l   t o   t h e   c o n d i t i o n ;   i t   c a n   b e   l e s s e r   d e p e n d i n g   o n   t h e   n u m b e r   o f   e l e m e n t s .  
 	 	                                         t h i s . c u r r   =   t o + t h i s . t l ;  
 	 	 	 	 	 	 	 m e t h o d s . j u m p . c a l l ( $ t h i s ,   t h i s . c u r r + t h i s . t l ) ;  
 	 	                                 }   e l s e   i f ( t o   >   t h i s . t l )   {   / /   I f   l a s t ,   t h e n   g o t o   f i r s t  
 	 	                                         m e t h o d s . j u m p . c a l l ( $ t h i s ,   t h i s . c u r r - t h i s . t l ) ;  
 	 	 	 	 	 	 	 t h i s . c u r r   =   t o   -   t h i s . t l ;  
 	 	                                 }   e l s e   t h i s . c u r r   =   t o ;  
 	 	                         }   e l s e   {                                         / /   I f   n o n - c i r c u l a r   a n d   t o   p o i n t s   t o   f i r s t   o r   l a s t ,   w e   j u s t   r e t u r n .  
 	 	                                 i f   ( t h i s . o . a u t o   | |   t h i s . o . j u m p T o O t h e r E n d )   {  
 	 	 	 	 	 	 	 i f   ( t o   <   0 )  
 	 	 	 	 	 	 	 	 t h i s . c u r r   =   t h i s . t l   -   v ;  
 	 	 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 	 	 i f   ( t o   >   t h i s . t l   -   v )   { 	 	 	 	 / /   t r u e   i f   " t o "   i s   g r e a t e r   t h a n   t h e   l a s t   v a l i d   e l e m e n t   ( a l l   e l e m e n t s   m i n u s   v i s i b l e   e l e m e n t s ) .  
 	 	 	 	 	 	 	 	 	 i f   ( t h i s . c u r r   = =   ( t h i s . t l   -   v ) ) 	 / /   i f   w e   h a v e   b e e n   h e r e   b e f o r e ,  
 	 	 	 	 	 	 	 	 	 	 t h i s . c u r r   =   0 ; 	 	 	 	 / /   . . .   g o   t o   f i r s t   e l e m e n t  
 	 	 	 	 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 	 	 	 	 t h i s . c u r r   =   t h i s . t l   -   v ; 	 / /   s e t   " c u r r "   t o   t h e   l a s t   v a l i d   e l e m e n t    
 	 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	 	 e l s e    
 	 	 	 	 	 	 	 	 	 t h i s . c u r r   =   t o ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 	 e l s e   {  
 	 	 	 	 	 	 	 i f   ( t o   <   0 )    
 	 	 	 	 	 	 	 	 t h i s . c u r r   =   0 ;  
 	 	 	 	 	 	 	 e l s e    
 	 	 	 	 	 	 	 	 i f   ( t o   >   t h i s . t l   -   v )    
 	 	 	 	 	 	 	 	 	 t h i s . c u r r   =   t h i s . t l   -   v ;  
 	 	 	 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 	 	 	 t h i s . c u r r   =   t o ;  
 	 	 	 	 	 	 	 i f   ( t h i s . c u r r   <   0 )    
 	 	 	 	 	 	 	 	 t h i s . c u r r   =   0 ;  
 	 	 	 	 	 	 }  
 	 	                         }                                                       / /   I f   n e i t h e r   o v e r r i d e s   i t ,   t h e   c u r r   w i l l   s t i l l   b e   " t o "   a n d   w e   c a n   p r o c e e d .  
 	  
 	 	 	 	 	 t h i s . c u r r p a g e   =   M a t h . c e i l ( t h i s . c u r r / t h i s . o . s c r o l l )   %   t h i s . p a g e l e n g t h ;  
 	 	 	 	 	  
 	 	 	 	 	  
 	  
 	 	 	 	 	 i f ( t h i s . o . b e f o r e S t a r t )  
 	 	                                 t h i s . o . b e f o r e S t a r t . c a l l ( T h i s ,   m e t h o d s . v i s . c a l l ( $ t h i s ) ,   T h i s . c u r r ,   T h i s . c u r r p a g e ) ;  
 	 	  
 	 	 	 	 	 / / l o g ( ' c u r r = ' + t h i s . c u r r + '     c u r r p a g e = ' + t h i s . c u r r p a g e ) ;  
 	 	  
 	 	                         t h i s . r u n n i n g   =   t r u e ;  
 	 	  
 	 	 	 	 	 / / l o g ( t h i s . c u r r * t h i s . l i S i z e + t h i s . c i r c _ o f f s e t ) ;  
 	  
 	 	                         t h i s . u l . a n i m a t e (  
 	  
 	 	                                 t h i s . a n i m C s s   = =   " l e f t "   ?   {   l e f t :   - ( t h i s . c u r r * t h i s . l i S i z e + t h i s . c i r c _ o f f s e t )   }   :   {   t o p :   - ( t h i s . c u r r * t h i s . l i S i z e + t h i s . c i r c _ o f f s e t )   } ,   s p e e d ,   t h i s . o . e a s i n g ,  
 	 	 	 	 	 	  
 	 	 	 	 	 	 f u n c t i o n ( )   {  
 	 	 	 	 	 	 	 i f ( T h i s . o . c i r c u l a r )   {  
 	 	 	 	 	 	 	 	 i f ( T h i s . c u r r   <   0 )   {  
 	 	 	 	 	 	 	 	 	 T h i s . c u r r   + =   T h i s . t l ;  
 	 	 	 	 	 	 	 	 }   e l s e   i f ( T h i s . c u r r   > =   T h i s . t l )   {  
 	 	 	 	 	 	 	 	 	 T h i s . c u r r   - =   T h i s . t l ;  
 	 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	 	 T h i s . c u r r p a g e   =   M a t h . c e i l ( T h i s . c u r r / T h i s . o . s c r o l l )   %   T h i s . p a g e l e n g t h ;  
 	 	 	 	 	 	 	 	 m e t h o d s . j u m p . c a l l ( $ t h i s ,   T h i s . c u r r ) ;  
 	 	 	 	 	 	 	 }  
 	 	                                         i f ( T h i s . o . a f t e r E n d )  
 	 	                                                 T h i s . o . a f t e r E n d . c a l l ( T h i s ,   m e t h o d s . v i s . c a l l ( $ t h i s ) ,   T h i s . c u r r ,   T h i s . c u r r p a g e ) ;  
 	 	 	 	 	 	 	  
 	 	                                         / / l o g ( ' c u r r   =   ' + T h i s . c u r r ) ;  
 	 	 	 	 	 	 	 T h i s . r u n n i n g   =   f a l s e ;  
 	 	                                 }  
 	 	                         ) ;  
 	 	 	 	 	  
 	 	 	 	 	  
 	 	 	 	 	 d i s E n A b l e B u t t o n s ( t h i s ) ;  
 	 	                 }  
 	 	 	 }   e l s e   {  
 	 	 	 	 l o g ( $ ( t h i s ) . a t t r ( ' i d ' ) + '   i s   n o   m m c C a r o u s e l ' ) ;  
 	 	 	 } 	 	 	  
 	 	 } ) ;  
  
 	   } ,  
 	   a d v a n c e   :   f u n c t i o n   ( h o w m u c h )   {  
 	   	 r e t u r n   t h i s . e a c h ( f u n c t i o n ( ) {  
 	 	 	 v a r   $ t h i s   =   $ ( t h i s ) ;  
 	 	 	 v a r   T h i s   =   t h i s ;  
 	 	 	 v a r   c u r r   =   T h i s . c u r r ;  
 	 	 	 i f   ( T h i s . o . b t n P a g e )    
 	 	 	 	 r e t u r n   m e t h o d s . g o P a g e . c a l l ( $ t h i s ,   T h i s . c u r r p a g e   +   s g n ( h o w m u c h ) ) ;  
 	 	 	 e l s e 	 	 	  
 	 	 	 	 r e t u r n   m e t h o d s . g o . c a l l ( $ t h i s ,   ( c u r r + h o w m u c h ) ) ;  
 	 	 } ) ;  
 	   } ,  
 	   g e t R u n n i n g   :   f u n c t i o n ( )   {  
 	   	 r e t u r n   t h i s . r u n n i n g ;  
 	   } ,  
 	   j u m p :   f u n c t i o n (   t o ,   c a l l C a l l b a c k F n s   )   {  
 	   	 c a l l C a l l b a c k F n s   =   c a l l C a l l b a c k F n s   | |   f a l s e ;  
 	   	 r e t u r n   t h i s . e a c h ( f u n c t i o n ( ) {  
 	 	 	 / / l o g ( ' j u m p   c a l l e d ' ) ;  
 	 	 	 v a r   $ t h i s   =   $ ( t h i s ) ;  
 	 	 	 v a r   T h i s   =   t h i s ;  
 	 	 	 T h i s . u l . c s s ( T h i s . a n i m C s s ,   - ( T h i s . l i S i z e   *   t o   +   T h i s . c i r c _ o f f s e t ) ) ;  
 	 	 	 T h i s . c u r r   =   t o ;  
 	 	 	 d i s E n A b l e B u t t o n s ( t h i s ) ;  
 	 	 	 i f ( t h i s . o . b e f o r e S t a r t   & &   c a l l C a l l b a c k F n s )  
 	 	             t h i s . o . b e f o r e S t a r t . c a l l ( t h i s ,   m e t h o d s . v i s . c a l l ( $ t h i s ) ,   t h i s . c u r r p a g e ) ;  
 	 	 	 i f ( T h i s . o . a f t e r E n d   & &   c a l l C a l l b a c k F n s )  
 	 	             T h i s . o . a f t e r E n d . c a l l ( t h i s ,   m e t h o d s . v i s . c a l l ( $ t h i s ) ,   T h i s . c u r r ,   T h i s . c u r r p a g e ) ;  
  
 	 	 } ) ;  
 	   } ,  
 	   g o P a g e   :   f u n c t i o n (   t o P g   )   {  
 	   	 r e t u r n   t h i s . e a c h ( f u n c t i o n ( )   {  
 	 	 	 i f   ( t y p e o f   t h i s . o   ! =   ' u n d e f i n e d ' )   {  
 	 	 	 	 v a r   $ t h i s   =   $ ( t h i s ) ;  
 	 	 	 	 v a r   T h i s   =   t h i s ;  
 	 	 	 	 v a r   t o   =   t o P g   *   T h i s . o . s c r o l l ;  
 	 	 	 	 i f   ( t o   >   T h i s . t l )   {  
 	 	 	 	 	 t o   =   T h i s . t l ;  
 	 	 	 	 }   e l s e   i f   ( t o   <   0 )   {  
 	 	 	 	 	 t o   =   - ( T h i s . t l   %   T h i s . o . s c r o l l ) ;  
 	 	 	 	 	 l o g   ( t o ) ;  
 	 	 	 	 }  
 	 	 	 	 r e t u r n   m e t h o d s . g o . c a l l ( $ t h i s ,   t o ) ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 l o g ( $ ( t h i s ) . a t t r ( ' i d ' ) + '   i s   n o   m m c C a r o u s e l ' ) ;  
 	 	 	 }  
 	 	 } ) ;  
 	   } ,  
 	   s t o p A u t o   :   f u n c t i o n ( )   {  
 	   	 r e t u r n   t h i s . e a c h ( f u n c t i o n ( ) {  
 	 	 	 i f   ( t y p e o f   t h i s . o   ! =   ' u n d e f i n e d ' )   {  
 	 	 	 	 v a r   $ t h i s   =   $ ( t h i s ) ;  
 	 	 	 	 c l e a r I n t e r v a l ( T h i s . i n t e r v a l I D ) ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 l o g ( $ ( t h i s ) . a t t r ( ' i d ' ) + '   i s   n o   m m c C a r o u s e l ' ) ;  
 	 	 	 }  
 	 	 } ) ;  
 	   } ,  
 	   s t a r t A u t o   :   f u n c t i o n ( )   {  
 	   	 r e t u r n   t h i s . e a c h ( f u n c t i o n ( ) {  
 	 	 	 i f   ( t y p e o f   t h i s . o   ! =   ' u n d e f i n e d ' )   {  
 	 	 	 	 v a r   $ t h i s   =   $ ( t h i s ) ;  
 	 	 	 	 v a r   T h i s   =   t h i s ;  
 	 	 	 	 i f   ( ! T h i s . o . a u t o )    
 	 	 	 	 	 T h i s . o . a u t o   =   t r u e ;  
 	 	 	 	 i f   ( T h i s . o . a u t o   = = =   t r u e )    
 	 	 	 	 	 T h i s . o . a u t o   =   T h i s . o . s p e e d ;  
 	 	 	 	 T h i s . i n t e r v a l I D   =   s e t I n t e r v a l ( f u n c t i o n ( ) {  
 	 	 	 	 	 m e t h o d s . a d v a n c e . c a l l ( $ t h i s ,   T h i s . o . s c r o l l ) ;  
 	 	 	 	 } ,   p a r s e I n t ( T h i s . o . a u t o   +   T h i s . o . s p e e d ) ) ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 l o g ( $ ( t h i s ) . a t t r ( ' i d ' ) + '   i s   n o   m m c C a r o u s e l ' ) ;  
 	 	 	 }  
 	 	 } ) ;  
 	   } ,  
 	   d e s t r o y   :   f u n c t i o n ( )   {  
 	   	 t h i s . e a c h ( f u n c t i o n ( ) {  
 	 	 	 i f   ( t y p e o f   t h i s . o   ! =   ' u n d e f i n e d ' )   {  
 	 	 	 	 v a r   $ t h i s   =   $ ( t h i s ) ;  
 	 	 	 	 T h i s   =   t h i s ;  
 	 	 	 	 t h i s . u l . f i n d ( ' . m m c C a r o u s e l C l o n e ' ) . r e m o v e ( ) ;  
 	 	 	 	 t h i s . u l . r e m o v e A t t r ( ' s t y l e ' ) ;  
 	 	 	 	 t h i s . c i r c _ o f f s e t   =   0 ;  
 	 	 	 	 T h i s . u l . c s s ( T h i s . a n i m C s s ,   0 ) ;  
 	 	 	 	 t h i s . o . c i r c u l a r   =   f a l s e ;  
 	 	 	 	 t h i s . l i . r e m o v e A t t r ( ' d a t a - i n d e x ' ) ;  
 	 	 	 	 $ ( t h i s . o . b t n P r e v ) . u n b i n d ( ' c l i c k ' ) ;  
 	 	 	 	 $ ( t h i s . o . b t n N e x t ) . u n b i n d ( ' c l i c k ' ) ;  
 	 	 	 	 $ ( t h i s . o . b u i l d P a g e r ) . h t m l ( ' ' ) ;  
 	 	 	 	  
 	 	 	 	 m e t h o d s . s t o p A u t o . c a l l ( $ t h i s ) ;  
 	 	 	 	 t h i s . o . a u t o   =   f a l s e ;  
 	 	 	 	  
 	 	 	 	 d e l e t e   t h i s . o ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 l o g ( $ ( t h i s ) . a t t r ( ' i d ' ) + '   i s   n o   m m c C a r o u s e l ' ) ;  
 	 	 	 }  
 	 	 	  
 	 	 } ) ;  
 	 	  
 	   } ,  
 	    
 	   v i s   :   f u n c t i o n (   a r g u m e n t   )   {  
 	 	 v a r   $ t h i s   =   $ ( t h i s ) [ 0 ] ;  
 	 	 v a r   T h i s   =   t h i s [ 0 ] ;  
 	 	 i f   ( t y p e o f   a r g u m e n t   = =   ' n u m b e r ' )   {  
 	 	 	 i f   ( ( a r g u m e n t   > =   T h i s . c u r r )   & &   ( a r g u m e n t   <   T h i s . c u r r   +   T h i s . o . v i s i b l e ) )   {  
 	 	 	 	 r e t u r n   t r u e ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 }  
 	 	 }   e l s e   i f (   a r g u m e n t   i n s t a n c e o f   j Q u e r y )   {  
 	 	 	 i f ( T h i s . l i . s l i c e ( T h i s . c u r r ) . s l i c e ( 0 ,   T h i s . o . v i s i b l e ) . f i l t e r ( a r g u m e n t ) . l e n g t h   >   0 )   {  
 	 	 	 	 r e t u r n   t r u e ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 }  
 	 	 }   e l s e   {  
 	 	 	 r e t u r n   T h i s . l i . s l i c e ( T h i s . c u r r ) . s l i c e ( 0 ,   T h i s . o . v i s i b l e ) ;  
 	 	 }  
 	   }  
  
     } ;  
  
 	  
 	 f u n c t i o n   d i s E n A b l e B u t t o n s ( i n s t a n c e ) {  
 	 	 / /   D i s a b l e   b u t t o n s   w h e n   t h e   c a r o u s e l   r e a c h e s   t h e   l a s t / f i r s t ,   a n d   e n a b l e   w h e n   n o t  
 	 	 v a r   T h i s   =   i n s t a n c e ;  
 	 	 i f   ( ! T h i s . o . c i r c u l a r   & &   ! T h i s . o . j u m p T o O t h e r E n d )   {  
 	 	 	 $ ( T h i s . o . b t n P r e v ) . a d d ( T h i s . o . b t n N e x t ) . r e m o v e C l a s s ( " d i s a b l e d " ) ;  
 	 	 	  
 	 	 	 $ ( ( T h i s . c u r r   = =   0   & &   T h i s . o . b t n P r e v )   | |  
 	 	 	 ( T h i s . c u r r   = =   ( T h i s . t l   -   T h i s . o . v i s i b l e )   & &   T h i s . o . b t n N e x t )   | |  
 	 	 	 [ ] ) . a d d C l a s s ( " d i s a b l e d " ) ;  
 	 	 	  
 	 	 	 i f   ( T h i s . t l   < =   T h i s . o . v i s i b l e )   $ ( T h i s . o . b t n N e x t ) . a d d C l a s s ( " d i s a b l e d " ) ;  
 	 	 	  
 	 	 }  
 	 	  
 	 	 i f   ( T h i s . t l   < =   T h i s . o . v i s i b l e )   {  
 	 	 	 $ ( T h i s . o . b t n P r e v ) . a d d C l a s s ( ' d i s a b l e d ' ) ;  
 	 	 	 $ ( T h i s . o . b t n N e x t ) . a d d C l a s s ( ' d i s a b l e d ' ) ;  
 	 	 }  
  
 	 	 i f ( T h i s . o . b t n G o )   {  
 	 	 	 $ ( T h i s . o . b t n G o ) . r e m o v e C l a s s ( ' a c t i v e ' ) ;  
 	 	 	 $ ( T h i s . o . b t n G o ) . e q ( T h i s . c u r r ) . a d d C l a s s ( ' a c t i v e ' ) ;  
 	 	 }  
 	 	 i f ( T h i s . o . b t n P a g e )   {  
 	 	 	 $ ( T h i s . o . b t n P a g e ) . r e m o v e C l a s s ( ' a c t i v e ' ) ;  
 	 	 	 $ ( T h i s . o . b t n P a g e ) . e q ( T h i s . c u r r p a g e ) . a d d C l a s s ( ' a c t i v e ' ) ;  
 	 	 } 	 	  
 	 	  
 	 }  
 	  
 	 f u n c t i o n   l o g ( m s g )   {  
 	 	 i f   ( w i n d o w . c o n s o l e   & &   w i n d o w . c o n s o l e . l o g )  
 	 	 	 w i n d o w . c o n s o l e . l o g ( m s g ) ;  
 	 } ; 	  
 	  
 	 f u n c t i o n   s g n ( n u m )   {  
 	 	 i f   ( n u m   <   0 )   {  
 	 	 	 r e t u r n   - 1 ;  
 	 	 }  
 	 	 e l s e   i f   ( n u m   >   0 )   {  
 	 	 	 r e t u r n   1 ;  
 	 	 }  
 	 	 e l s e   {  
 	 	 	 r e t u r n   0 ;  
 	 	 }  
 	 }  
  
  
  
     $ . f n . m m c C a r o u s e l   =   f u n c t i o n (   m e t h o d   )   {  
          
         / /   M e t h o d   c a l l i n g   l o g i c  
         i f   (   m e t h o d s [ m e t h o d ]   )   {  
             r e t u r n   m e t h o d s [   m e t h o d   ] . a p p l y (   t h i s ,   A r r a y . p r o t o t y p e . s l i c e . c a l l (   a r g u m e n t s ,   1   ) ) ;  
         }   e l s e   i f   (   t y p e o f   m e t h o d   = = =   ' o b j e c t '   | |   !   m e t h o d   )   {  
             r e t u r n   m e t h o d s . i n i t . a p p l y (   t h i s ,   a r g u m e n t s   ) ;  
         }   e l s e   {  
             $ . e r r o r (   ' M e t h o d   '   +     m e t h o d   +   '   d o e s   n o t   e x i s t   o n   j Q u e r y . m m c C a r o u s e l '   ) ;  
         }          
      
     } ;  
  
 } ) (   j Q u e r y   ) ;  
  
  
  
  
 / *  
   *   j Q u e r y   C y c l e   P l u g i n   ( c o r e   e n g i n e )  
   *   E x a m p l e s   a n d   d o c u m e n t a t i o n   a t :   h t t p : / / j q u e r y . m a l s u p . c o m / c y c l e /  
   *   C o p y r i g h t   ( c )   2 0 0 7 - 2 0 1 0   M .   A l s u p  
   *   V e r s i o n :   2 . 8 8   ( 0 8 - J U N - 2 0 1 0 )  
   *   D u a l   l i c e n s e d   u n d e r   t h e   M I T   a n d   G P L   l i c e n s e s .  
   *   h t t p : / / j q u e r y . m a l s u p . c o m / l i c e n s e . h t m l  
   *   R e q u i r e s :   j Q u e r y   v 1 . 2 . 6   o r   l a t e r  
   * /  
 ( f u n c t i o n ( $ ) { v a r   v e r = " 2 . 8 8 " ; i f ( $ . s u p p o r t = = u n d e f i n e d ) { $ . s u p p o r t = { o p a c i t y : ! ( $ . b r o w s e r . m s i e ) } ; } f u n c t i o n   d e b u g ( s ) { i f ( $ . f n . c y c l e . d e b u g ) { l o g ( s ) ; } } f u n c t i o n   l o g ( ) { i f ( w i n d o w . c o n s o l e & & w i n d o w . c o n s o l e . l o g ) { w i n d o w . c o n s o l e . l o g ( " [ c y c l e ]   " + A r r a y . p r o t o t y p e . j o i n . c a l l ( a r g u m e n t s , "   " ) ) ; } } $ . f n . c y c l e = f u n c t i o n ( o p t i o n s , a r g 2 ) { v a r   o = { s : t h i s . s e l e c t o r , c : t h i s . c o n t e x t } ; i f ( t h i s . l e n g t h = = = 0 & & o p t i o n s ! = " s t o p " ) { i f ( ! $ . i s R e a d y & & o . s ) { l o g ( " D O M   n o t   r e a d y ,   q u e u i n g   s l i d e s h o w " ) ; $ ( f u n c t i o n ( ) { $ ( o . s , o . c ) . c y c l e ( o p t i o n s , a r g 2 ) ; } ) ; r e t u r n   t h i s ; } l o g ( " t e r m i n a t i n g ;   z e r o   e l e m e n t s   f o u n d   b y   s e l e c t o r " + ( $ . i s R e a d y ? " " : "   ( D O M   n o t   r e a d y ) " ) ) ; r e t u r n   t h i s ; } r e t u r n   t h i s . e a c h ( f u n c t i o n ( ) { v a r   o p t s = h a n d l e A r g u m e n t s ( t h i s , o p t i o n s , a r g 2 ) ; i f ( o p t s = = = f a l s e ) { r e t u r n ; } o p t s . u p d a t e A c t i v e P a g e r L i n k = o p t s . u p d a t e A c t i v e P a g e r L i n k | | $ . f n . c y c l e . u p d a t e A c t i v e P a g e r L i n k ; i f ( t h i s . c y c l e T i m e o u t ) { c l e a r T i m e o u t ( t h i s . c y c l e T i m e o u t ) ; } t h i s . c y c l e T i m e o u t = t h i s . c y c l e P a u s e = 0 ; v a r   $ c o n t = $ ( t h i s ) ; v a r   $ s l i d e s = o p t s . s l i d e E x p r ? $ ( o p t s . s l i d e E x p r , t h i s ) : $ c o n t . c h i l d r e n ( ) ; v a r   e l s = $ s l i d e s . g e t ( ) ; i f ( e l s . l e n g t h < 2 ) { l o g ( " t e r m i n a t i n g ;   t o o   f e w   s l i d e s :   " + e l s . l e n g t h ) ; r e t u r n ; } v a r   o p t s 2 = b u i l d O p t i o n s ( $ c o n t , $ s l i d e s , e l s , o p t s , o ) ; i f ( o p t s 2 = = = f a l s e ) { r e t u r n ; } v a r   s t a r t T i m e = o p t s 2 . c o n t i n u o u s ? 1 0 : g e t T i m e o u t ( e l s [ o p t s 2 . c u r r S l i d e ] , e l s [ o p t s 2 . n e x t S l i d e ] , o p t s 2 , ! o p t s 2 . r e v ) ; i f ( s t a r t T i m e ) { s t a r t T i m e + = ( o p t s 2 . d e l a y | | 0 ) ; i f ( s t a r t T i m e < 1 0 ) { s t a r t T i m e = 1 0 ; } d e b u g ( " f i r s t   t i m e o u t :   " + s t a r t T i m e ) ; t h i s . c y c l e T i m e o u t = s e t T i m e o u t ( f u n c t i o n ( ) { g o ( e l s , o p t s 2 , 0 , ( ! o p t s 2 . r e v & & ! o p t s . b a c k w a r d s ) ) ; } , s t a r t T i m e ) ; } } ) ; } ; f u n c t i o n   h a n d l e A r g u m e n t s ( c o n t , o p t i o n s , a r g 2 ) { i f ( c o n t . c y c l e S t o p = = u n d e f i n e d ) { c o n t . c y c l e S t o p = 0 ; } i f ( o p t i o n s = = = u n d e f i n e d | | o p t i o n s = = = n u l l ) { o p t i o n s = { } ; } i f ( o p t i o n s . c o n s t r u c t o r = = S t r i n g ) { s w i t c h ( o p t i o n s ) { c a s e " d e s t r o y " : c a s e " s t o p " : v a r   o p t s = $ ( c o n t ) . d a t a ( " c y c l e . o p t s " ) ; i f ( ! o p t s ) { r e t u r n   f a l s e ; } c o n t . c y c l e S t o p + + ; i f ( c o n t . c y c l e T i m e o u t ) { c l e a r T i m e o u t ( c o n t . c y c l e T i m e o u t ) ; } c o n t . c y c l e T i m e o u t = 0 ; $ ( c o n t ) . r e m o v e D a t a ( " c y c l e . o p t s " ) ; i f ( o p t i o n s = = " d e s t r o y " ) { d e s t r o y ( o p t s ) ; } r e t u r n   f a l s e ; c a s e " t o g g l e " : c o n t . c y c l e P a u s e = ( c o n t . c y c l e P a u s e = = = 1 ) ? 0 : 1 ; c h e c k I n s t a n t R e s u m e ( c o n t . c y c l e P a u s e , a r g 2 , c o n t ) ; r e t u r n   f a l s e ; c a s e " p a u s e " : c o n t . c y c l e P a u s e = 1 ; r e t u r n   f a l s e ; c a s e " r e s u m e " : c o n t . c y c l e P a u s e = 0 ; c h e c k I n s t a n t R e s u m e ( f a l s e , a r g 2 , c o n t ) ; r e t u r n   f a l s e ; c a s e " p r e v " : c a s e " n e x t " : v a r   o p t s = $ ( c o n t ) . d a t a ( " c y c l e . o p t s " ) ; i f ( ! o p t s ) { l o g ( ' o p t i o n s   n o t   f o u n d ,   " p r e v / n e x t "   i g n o r e d ' ) ; r e t u r n   f a l s e ; } $ . f n . c y c l e [ o p t i o n s ] ( o p t s ) ; r e t u r n   f a l s e ; d e f a u l t : o p t i o n s = { f x : o p t i o n s } ; } r e t u r n   o p t i o n s ; } e l s e { i f ( o p t i o n s . c o n s t r u c t o r = = N u m b e r ) { v a r   n u m = o p t i o n s ; o p t i o n s = $ ( c o n t ) . d a t a ( " c y c l e . o p t s " ) ; i f ( ! o p t i o n s ) { l o g ( " o p t i o n s   n o t   f o u n d ,   c a n   n o t   a d v a n c e   s l i d e " ) ; r e t u r n   f a l s e ; } i f ( n u m < 0 | | n u m > = o p t i o n s . e l e m e n t s . l e n g t h ) { l o g ( " i n v a l i d   s l i d e   i n d e x :   " + n u m ) ; r e t u r n   f a l s e ; } o p t i o n s . n e x t S l i d e = n u m ; i f ( c o n t . c y c l e T i m e o u t ) { c l e a r T i m e o u t ( c o n t . c y c l e T i m e o u t ) ; c o n t . c y c l e T i m e o u t = 0 ; } i f ( t y p e o f   a r g 2 = = " s t r i n g " ) { o p t i o n s . o n e T i m e F x = a r g 2 ; } g o ( o p t i o n s . e l e m e n t s , o p t i o n s , 1 , n u m > = o p t i o n s . c u r r S l i d e ) ; r e t u r n   f a l s e ; } } r e t u r n   o p t i o n s ; f u n c t i o n   c h e c k I n s t a n t R e s u m e ( i s P a u s e d , a r g 2 , c o n t ) { i f ( ! i s P a u s e d & & a r g 2 = = = t r u e ) { v a r   o p t i o n s = $ ( c o n t ) . d a t a ( " c y c l e . o p t s " ) ; i f ( ! o p t i o n s ) { l o g ( " o p t i o n s   n o t   f o u n d ,   c a n   n o t   r e s u m e " ) ; r e t u r n   f a l s e ; } i f ( c o n t . c y c l e T i m e o u t ) { c l e a r T i m e o u t ( c o n t . c y c l e T i m e o u t ) ; c o n t . c y c l e T i m e o u t = 0 ; } g o ( o p t i o n s . e l e m e n t s , o p t i o n s , 1 , ( ! o p t s . r e v & & ! o p t s . b a c k w a r d s ) ) ; } } } f u n c t i o n   r e m o v e F i l t e r ( e l , o p t s ) { i f ( ! $ . s u p p o r t . o p a c i t y & & o p t s . c l e a r t y p e & & e l . s t y l e . f i l t e r ) { t r y { e l . s t y l e . r e m o v e A t t r i b u t e ( " f i l t e r " ) ; } c a t c h ( s m o t h e r ) { } } } f u n c t i o n   d e s t r o y ( o p t s ) { i f ( o p t s . n e x t ) { $ ( o p t s . n e x t ) . u n b i n d ( o p t s . p r e v N e x t E v e n t ) ; } i f ( o p t s . p r e v ) { $ ( o p t s . p r e v ) . u n b i n d ( o p t s . p r e v N e x t E v e n t ) ; } i f ( o p t s . p a g e r | | o p t s . p a g e r A n c h o r B u i l d e r ) { $ . e a c h ( o p t s . p a g e r A n c h o r s | | [ ] , f u n c t i o n ( ) { t h i s . u n b i n d ( ) . r e m o v e ( ) ; } ) ; } o p t s . p a g e r A n c h o r s = n u l l ; i f ( o p t s . d e s t r o y ) { o p t s . d e s t r o y ( o p t s ) ; } } f u n c t i o n   b u i l d O p t i o n s ( $ c o n t , $ s l i d e s , e l s , o p t i o n s , o ) { v a r   o p t s = $ . e x t e n d ( { } , $ . f n . c y c l e . d e f a u l t s , o p t i o n s | | { } , $ . m e t a d a t a ? $ c o n t . m e t a d a t a ( ) : $ . m e t a ? $ c o n t . d a t a ( ) : { } ) ; i f ( o p t s . a u t o s t o p ) { o p t s . c o u n t d o w n = o p t s . a u t o s t o p C o u n t | | e l s . l e n g t h ; } v a r   c o n t = $ c o n t [ 0 ] ; $ c o n t . d a t a ( " c y c l e . o p t s " , o p t s ) ; o p t s . $ c o n t = $ c o n t ; o p t s . s t o p C o u n t = c o n t . c y c l e S t o p ; o p t s . e l e m e n t s = e l s ; o p t s . b e f o r e = o p t s . b e f o r e ? [ o p t s . b e f o r e ] : [ ] ; o p t s . a f t e r = o p t s . a f t e r ? [ o p t s . a f t e r ] : [ ] ; o p t s . a f t e r . u n s h i f t ( f u n c t i o n ( ) { o p t s . b u s y = 0 ; } ) ; i f ( ! $ . s u p p o r t . o p a c i t y & & o p t s . c l e a r t y p e ) { o p t s . a f t e r . p u s h ( f u n c t i o n ( ) { r e m o v e F i l t e r ( t h i s , o p t s ) ; } ) ; } i f ( o p t s . c o n t i n u o u s ) { o p t s . a f t e r . p u s h ( f u n c t i o n ( ) { g o ( e l s , o p t s , 0 , ( ! o p t s . r e v & & ! o p t s . b a c k w a r d s ) ) ; } ) ; } s a v e O r i g i n a l O p t s ( o p t s ) ; i f ( ! $ . s u p p o r t . o p a c i t y & & o p t s . c l e a r t y p e & & ! o p t s . c l e a r t y p e N o B g ) { c l e a r T y p e F i x ( $ s l i d e s ) ; } i f ( $ c o n t . c s s ( " p o s i t i o n " ) = = " s t a t i c " ) { $ c o n t . c s s ( " p o s i t i o n " , " r e l a t i v e " ) ; } i f ( o p t s . w i d t h ) { $ c o n t . w i d t h ( o p t s . w i d t h ) ; } i f ( o p t s . h e i g h t & & o p t s . h e i g h t ! = " a u t o " ) { $ c o n t . h e i g h t ( o p t s . h e i g h t ) ; } i f ( o p t s . s t a r t i n g S l i d e ) { o p t s . s t a r t i n g S l i d e = p a r s e I n t ( o p t s . s t a r t i n g S l i d e ) ; } e l s e { i f ( o p t s . b a c k w a r d s ) { o p t s . s t a r t i n g S l i d e = e l s . l e n g t h - 1 ; } } i f ( o p t s . r a n d o m ) { o p t s . r a n d o m M a p = [ ] ; f o r ( v a r   i = 0 ; i < e l s . l e n g t h ; i + + ) { o p t s . r a n d o m M a p . p u s h ( i ) ; } o p t s . r a n d o m M a p . s o r t ( f u n c t i o n ( a , b ) { r e t u r n   M a t h . r a n d o m ( ) - 0 . 5 ; } ) ; o p t s . r a n d o m I n d e x = 1 ; o p t s . s t a r t i n g S l i d e = o p t s . r a n d o m M a p [ 1 ] ; } e l s e { i f ( o p t s . s t a r t i n g S l i d e > = e l s . l e n g t h ) { o p t s . s t a r t i n g S l i d e = 0 ; } } o p t s . c u r r S l i d e = o p t s . s t a r t i n g S l i d e | | 0 ; v a r   f i r s t = o p t s . s t a r t i n g S l i d e ; $ s l i d e s . c s s ( { p o s i t i o n : " a b s o l u t e " , t o p : 0 , l e f t : 0 } ) . h i d e ( ) . e a c h ( f u n c t i o n ( i ) { v a r   z ; i f ( o p t s . b a c k w a r d s ) { z = f i r s t ? i < = f i r s t ? e l s . l e n g t h + ( i - f i r s t ) : f i r s t - i : e l s . l e n g t h - i ; } e l s e { z = f i r s t ? i > = f i r s t ? e l s . l e n g t h - ( i - f i r s t ) : f i r s t - i : e l s . l e n g t h - i ; } $ ( t h i s ) . c s s ( " z - i n d e x " , z ) ; } ) ; $ ( e l s [ f i r s t ] ) . c s s ( " o p a c i t y " , 1 ) . s h o w ( ) ; r e m o v e F i l t e r ( e l s [ f i r s t ] , o p t s ) ; i f ( o p t s . f i t & & o p t s . w i d t h ) { $ s l i d e s . w i d t h ( o p t s . w i d t h ) ; } i f ( o p t s . f i t & & o p t s . h e i g h t & & o p t s . h e i g h t ! = " a u t o " ) { $ s l i d e s . h e i g h t ( o p t s . h e i g h t ) ; } v a r   r e s h a p e = o p t s . c o n t a i n e r R e s i z e & & ! $ c o n t . i n n e r H e i g h t ( ) ; i f ( r e s h a p e ) { v a r   m a x w = 0 , m a x h = 0 ; f o r ( v a r   j = 0 ; j < e l s . l e n g t h ; j + + ) { v a r   $ e = $ ( e l s [ j ] ) , e = $ e [ 0 ] , w = $ e . o u t e r W i d t h ( ) , h = $ e . o u t e r H e i g h t ( ) ; i f ( ! w ) { w = e . o f f s e t W i d t h | | e . w i d t h | | $ e . a t t r ( " w i d t h " ) ; } i f ( ! h ) { h = e . o f f s e t H e i g h t | | e . h e i g h t | | $ e . a t t r ( " h e i g h t " ) ; } m a x w = w > m a x w ? w : m a x w ; m a x h = h > m a x h ? h : m a x h ; } i f ( m a x w > 0 & & m a x h > 0 ) { $ c o n t . c s s ( { w i d t h : m a x w + " p x " , h e i g h t : m a x h + " p x " } ) ; } } i f ( o p t s . p a u s e ) { $ c o n t . h o v e r ( f u n c t i o n ( ) { t h i s . c y c l e P a u s e + + ; } , f u n c t i o n ( ) { t h i s . c y c l e P a u s e - - ; } ) ; } i f ( s u p p o r t M u l t i T r a n s i t i o n s ( o p t s ) = = = f a l s e ) { r e t u r n   f a l s e ; } v a r   r e q u e u e = f a l s e ; o p t i o n s . r e q u e u e A t t e m p t s = o p t i o n s . r e q u e u e A t t e m p t s | | 0 ; $ s l i d e s . e a c h ( f u n c t i o n ( ) { v a r   $ e l = $ ( t h i s ) ; t h i s . c y c l e H = ( o p t s . f i t & & o p t s . h e i g h t ) ? o p t s . h e i g h t : ( $ e l . h e i g h t ( ) | | t h i s . o f f s e t H e i g h t | | t h i s . h e i g h t | | $ e l . a t t r ( " h e i g h t " ) | | 0 ) ; t h i s . c y c l e W = ( o p t s . f i t & & o p t s . w i d t h ) ? o p t s . w i d t h : ( $ e l . w i d t h ( ) | | t h i s . o f f s e t W i d t h | | t h i s . w i d t h | | $ e l . a t t r ( " w i d t h " ) | | 0 ) ; i f ( $ e l . i s ( " i m g " ) ) { v a r   l o a d i n g I E = ( $ . b r o w s e r . m s i e & & t h i s . c y c l e W = = 2 8 & & t h i s . c y c l e H = = 3 0 & & ! t h i s . c o m p l e t e ) ; v a r   l o a d i n g F F = ( $ . b r o w s e r . m o z i l l a & & t h i s . c y c l e W = = 3 4 & & t h i s . c y c l e H = = 1 9 & & ! t h i s . c o m p l e t e ) ; v a r   l o a d i n g O p = ( $ . b r o w s e r . o p e r a & & ( ( t h i s . c y c l e W = = 4 2 & & t h i s . c y c l e H = = 1 9 ) | | ( t h i s . c y c l e W = = 3 7 & & t h i s . c y c l e H = = 1 7 ) ) & & ! t h i s . c o m p l e t e ) ; v a r   l o a d i n g O t h e r = ( t h i s . c y c l e H = = 0 & & t h i s . c y c l e W = = 0 & & ! t h i s . c o m p l e t e ) ; i f ( l o a d i n g I E | | l o a d i n g F F | | l o a d i n g O p | | l o a d i n g O t h e r ) { i f ( o . s & & o p t s . r e q u e u e O n I m a g e N o t L o a d e d & & + + o p t i o n s . r e q u e u e A t t e m p t s < 1 0 0 ) { l o g ( o p t i o n s . r e q u e u e A t t e m p t s , "   -   i m g   s l i d e   n o t   l o a d e d ,   r e q u e u i n g   s l i d e s h o w :   " , t h i s . s r c , t h i s . c y c l e W , t h i s . c y c l e H ) ; s e t T i m e o u t ( f u n c t i o n ( ) { $ ( o . s , o . c ) . c y c l e ( o p t i o n s ) ; } , o p t s . r e q u e u e T i m e o u t ) ; r e q u e u e = t r u e ; r e t u r n   f a l s e ; } e l s e { l o g ( " c o u l d   n o t   d e t e r m i n e   s i z e   o f   i m a g e :   " + t h i s . s r c , t h i s . c y c l e W , t h i s . c y c l e H ) ; } } } r e t u r n   t r u e ; } ) ; i f ( r e q u e u e ) { r e t u r n   f a l s e ; } o p t s . c s s B e f o r e = o p t s . c s s B e f o r e | | { } ; o p t s . a n i m I n = o p t s . a n i m I n | | { } ; o p t s . a n i m O u t = o p t s . a n i m O u t | | { } ; $ s l i d e s . n o t ( " : e q ( " + f i r s t + " ) " ) . c s s ( o p t s . c s s B e f o r e ) ; i f ( o p t s . c s s F i r s t ) { $ ( $ s l i d e s [ f i r s t ] ) . c s s ( o p t s . c s s F i r s t ) ; } i f ( o p t s . t i m e o u t ) { o p t s . t i m e o u t = p a r s e I n t ( o p t s . t i m e o u t ) ; i f ( o p t s . s p e e d . c o n s t r u c t o r = = S t r i n g ) { o p t s . s p e e d = $ . f x . s p e e d s [ o p t s . s p e e d ] | | p a r s e I n t ( o p t s . s p e e d ) ; } i f ( ! o p t s . s y n c ) { o p t s . s p e e d = o p t s . s p e e d / 2 ; } v a r   b u f f e r = o p t s . f x = = " s h u f f l e " ? 5 0 0 : 2 5 0 ; w h i l e ( ( o p t s . t i m e o u t - o p t s . s p e e d ) < b u f f e r ) { o p t s . t i m e o u t + = o p t s . s p e e d ; } } i f ( o p t s . e a s i n g ) { o p t s . e a s e I n = o p t s . e a s e O u t = o p t s . e a s i n g ; } i f ( ! o p t s . s p e e d I n ) { o p t s . s p e e d I n = o p t s . s p e e d ; } i f ( ! o p t s . s p e e d O u t ) { o p t s . s p e e d O u t = o p t s . s p e e d ; } o p t s . s l i d e C o u n t = e l s . l e n g t h ; o p t s . c u r r S l i d e = o p t s . l a s t S l i d e = f i r s t ; i f ( o p t s . r a n d o m ) { i f ( + + o p t s . r a n d o m I n d e x = = e l s . l e n g t h ) { o p t s . r a n d o m I n d e x = 0 ; } o p t s . n e x t S l i d e = o p t s . r a n d o m M a p [ o p t s . r a n d o m I n d e x ] ; } e l s e { i f ( o p t s . b a c k w a r d s ) { o p t s . n e x t S l i d e = o p t s . s t a r t i n g S l i d e = = 0 ? ( e l s . l e n g t h - 1 ) : o p t s . s t a r t i n g S l i d e - 1 ; } e l s e { o p t s . n e x t S l i d e = o p t s . s t a r t i n g S l i d e > = ( e l s . l e n g t h - 1 ) ? 0 : o p t s . s t a r t i n g S l i d e + 1 ; } } i f ( ! o p t s . m u l t i F x ) { v a r   i n i t = $ . f n . c y c l e . t r a n s i t i o n s [ o p t s . f x ] ; i f ( $ . i s F u n c t i o n ( i n i t ) ) { i n i t ( $ c o n t , $ s l i d e s , o p t s ) ; } e l s e { i f ( o p t s . f x ! = " c u s t o m " & & ! o p t s . m u l t i F x ) { l o g ( " u n k n o w n   t r a n s i t i o n :   " + o p t s . f x , " ;   s l i d e s h o w   t e r m i n a t i n g " ) ; r e t u r n   f a l s e ; } } } v a r   e 0 = $ s l i d e s [ f i r s t ] ; i f ( o p t s . b e f o r e . l e n g t h ) { o p t s . b e f o r e [ 0 ] . a p p l y ( e 0 , [ e 0 , e 0 , o p t s , t r u e ] ) ; } i f ( o p t s . a f t e r . l e n g t h > 1 ) { o p t s . a f t e r [ 1 ] . a p p l y ( e 0 , [ e 0 , e 0 , o p t s , t r u e ] ) ; } i f ( o p t s . n e x t ) { $ ( o p t s . n e x t ) . b i n d ( o p t s . p r e v N e x t E v e n t , f u n c t i o n ( ) { r e t u r n   a d v a n c e ( o p t s , o p t s . r e v ? - 1 : 1 ) ; } ) ; } i f ( o p t s . p r e v ) { $ ( o p t s . p r e v ) . b i n d ( o p t s . p r e v N e x t E v e n t , f u n c t i o n ( ) { r e t u r n   a d v a n c e ( o p t s , o p t s . r e v ? 1 : - 1 ) ; } ) ; } i f ( o p t s . p a g e r | | o p t s . p a g e r A n c h o r B u i l d e r ) { b u i l d P a g e r ( e l s , o p t s ) ; } e x p o s e A d d S l i d e ( o p t s , e l s ) ; r e t u r n   o p t s ; } f u n c t i o n   s a v e O r i g i n a l O p t s ( o p t s ) { o p t s . o r i g i n a l = { b e f o r e : [ ] , a f t e r : [ ] } ; o p t s . o r i g i n a l . c s s B e f o r e = $ . e x t e n d ( { } , o p t s . c s s B e f o r e ) ; o p t s . o r i g i n a l . c s s A f t e r = $ . e x t e n d ( { } , o p t s . c s s A f t e r ) ; o p t s . o r i g i n a l . a n i m I n = $ . e x t e n d ( { } , o p t s . a n i m I n ) ; o p t s . o r i g i n a l . a n i m O u t = $ . e x t e n d ( { } , o p t s . a n i m O u t ) ; $ . e a c h ( o p t s . b e f o r e , f u n c t i o n ( ) { o p t s . o r i g i n a l . b e f o r e . p u s h ( t h i s ) ; } ) ; $ . e a c h ( o p t s . a f t e r , f u n c t i o n ( ) { o p t s . o r i g i n a l . a f t e r . p u s h ( t h i s ) ; } ) ; } f u n c t i o n   s u p p o r t M u l t i T r a n s i t i o n s ( o p t s ) { v a r   i , t x , t x s = $ . f n . c y c l e . t r a n s i t i o n s ; i f ( o p t s . f x . i n d e x O f ( " , " ) > 0 ) { o p t s . m u l t i F x = t r u e ; o p t s . f x s = o p t s . f x . r e p l a c e ( / \ s * / g , " " ) . s p l i t ( " , " ) ; f o r ( i = 0 ; i < o p t s . f x s . l e n g t h ; i + + ) { v a r   f x = o p t s . f x s [ i ] ; t x = t x s [ f x ] ; i f ( ! t x | | ! t x s . h a s O w n P r o p e r t y ( f x ) | | ! $ . i s F u n c t i o n ( t x ) ) { l o g ( " d i s c a r d i n g   u n k n o w n   t r a n s i t i o n :   " , f x ) ; o p t s . f x s . s p l i c e ( i , 1 ) ; i - - ; } } i f ( ! o p t s . f x s . l e n g t h ) { l o g ( " N o   v a l i d   t r a n s i t i o n s   n a m e d ;   s l i d e s h o w   t e r m i n a t i n g . " ) ; r e t u r n   f a l s e ; } } e l s e { i f ( o p t s . f x = = " a l l " ) { o p t s . m u l t i F x = t r u e ; o p t s . f x s = [ ] ; f o r ( p   i n   t x s ) { t x = t x s [ p ] ; i f ( t x s . h a s O w n P r o p e r t y ( p ) & & $ . i s F u n c t i o n ( t x ) ) { o p t s . f x s . p u s h ( p ) ; } } } } i f ( o p t s . m u l t i F x & & o p t s . r a n d o m i z e E f f e c t s ) { v a r   r 1 = M a t h . f l o o r ( M a t h . r a n d o m ( ) * 2 0 ) + 3 0 ; f o r ( i = 0 ; i < r 1 ; i + + ) { v a r   r 2 = M a t h . f l o o r ( M a t h . r a n d o m ( ) * o p t s . f x s . l e n g t h ) ; o p t s . f x s . p u s h ( o p t s . f x s . s p l i c e ( r 2 , 1 ) [ 0 ] ) ; } d e b u g ( " r a n d o m i z e d   f x   s e q u e n c e :   " , o p t s . f x s ) ; } r e t u r n   t r u e ; } f u n c t i o n   e x p o s e A d d S l i d e ( o p t s , e l s ) { o p t s . a d d S l i d e = f u n c t i o n ( n e w S l i d e , p r e p e n d ) { v a r   $ s = $ ( n e w S l i d e ) , s = $ s [ 0 ] ; i f ( ! o p t s . a u t o s t o p C o u n t ) { o p t s . c o u n t d o w n + + ; } e l s [ p r e p e n d ? " u n s h i f t " : " p u s h " ] ( s ) ; i f ( o p t s . e l s ) { o p t s . e l s [ p r e p e n d ? " u n s h i f t " : " p u s h " ] ( s ) ; } o p t s . s l i d e C o u n t = e l s . l e n g t h ; $ s . c s s ( " p o s i t i o n " , " a b s o l u t e " ) ; $ s [ p r e p e n d ? " p r e p e n d T o " : " a p p e n d T o " ] ( o p t s . $ c o n t ) ; i f ( p r e p e n d ) { o p t s . c u r r S l i d e + + ; o p t s . n e x t S l i d e + + ; } i f ( ! $ . s u p p o r t . o p a c i t y & & o p t s . c l e a r t y p e & & ! o p t s . c l e a r t y p e N o B g ) { c l e a r T y p e F i x ( $ s ) ; } i f ( o p t s . f i t & & o p t s . w i d t h ) { $ s . w i d t h ( o p t s . w i d t h ) ; } i f ( o p t s . f i t & & o p t s . h e i g h t & & o p t s . h e i g h t ! = " a u t o " ) { $ s l i d e s . h e i g h t ( o p t s . h e i g h t ) ; } s . c y c l e H = ( o p t s . f i t & & o p t s . h e i g h t ) ? o p t s . h e i g h t : $ s . h e i g h t ( ) ; s . c y c l e W = ( o p t s . f i t & & o p t s . w i d t h ) ? o p t s . w i d t h : $ s . w i d t h ( ) ; $ s . c s s ( o p t s . c s s B e f o r e ) ; i f ( o p t s . p a g e r | | o p t s . p a g e r A n c h o r B u i l d e r ) { $ . f n . c y c l e . c r e a t e P a g e r A n c h o r ( e l s . l e n g t h - 1 , s , $ ( o p t s . p a g e r ) , e l s , o p t s ) ; } i f ( $ . i s F u n c t i o n ( o p t s . o n A d d S l i d e ) ) { o p t s . o n A d d S l i d e ( $ s ) ; } e l s e { $ s . h i d e ( ) ; } } ; } $ . f n . c y c l e . r e s e t S t a t e = f u n c t i o n ( o p t s , f x ) { f x = f x | | o p t s . f x ; o p t s . b e f o r e = [ ] ; o p t s . a f t e r = [ ] ; o p t s . c s s B e f o r e = $ . e x t e n d ( { } , o p t s . o r i g i n a l . c s s B e f o r e ) ; o p t s . c s s A f t e r = $ . e x t e n d ( { } , o p t s . o r i g i n a l . c s s A f t e r ) ; o p t s . a n i m I n = $ . e x t e n d ( { } , o p t s . o r i g i n a l . a n i m I n ) ; o p t s . a n i m O u t = $ . e x t e n d ( { } , o p t s . o r i g i n a l . a n i m O u t ) ; o p t s . f x F n = n u l l ; $ . e a c h ( o p t s . o r i g i n a l . b e f o r e , f u n c t i o n ( ) { o p t s . b e f o r e . p u s h ( t h i s ) ; } ) ; $ . e a c h ( o p t s . o r i g i n a l . a f t e r , f u n c t i o n ( ) { o p t s . a f t e r . p u s h ( t h i s ) ; } ) ; v a r   i n i t = $ . f n . c y c l e . t r a n s i t i o n s [ f x ] ; i f ( $ . i s F u n c t i o n ( i n i t ) ) { i n i t ( o p t s . $ c o n t , $ ( o p t s . e l e m e n t s ) , o p t s ) ; } } ; f u n c t i o n   g o ( e l s , o p t s , m a n u a l , f w d ) { i f ( m a n u a l & & o p t s . b u s y & & o p t s . m a n u a l T r u m p ) { d e b u g ( " m a n u a l T r u m p   i n   g o ( ) ,   s t o p p i n g   a c t i v e   t r a n s i t i o n " ) ; $ ( e l s ) . s t o p ( t r u e , t r u e ) ; o p t s . b u s y = f a l s e ; } i f ( o p t s . b u s y ) { d e b u g ( " t r a n s i t i o n   a c t i v e ,   i g n o r i n g   n e w   t x   r e q u e s t " ) ; r e t u r n ; } v a r   p = o p t s . $ c o n t [ 0 ] , c u r r = e l s [ o p t s . c u r r S l i d e ] , n e x t = e l s [ o p t s . n e x t S l i d e ] ; i f ( p . c y c l e S t o p ! = o p t s . s t o p C o u n t | | p . c y c l e T i m e o u t = = = 0 & & ! m a n u a l ) { r e t u r n ; } i f ( ! m a n u a l & & ! p . c y c l e P a u s e & & ! o p t s . b o u n c e & & ( ( o p t s . a u t o s t o p & & ( - - o p t s . c o u n t d o w n < = 0 ) ) | | ( o p t s . n o w r a p & & ! o p t s . r a n d o m & & o p t s . n e x t S l i d e < o p t s . c u r r S l i d e ) ) ) { i f ( o p t s . e n d ) { o p t s . e n d ( o p t s ) ; } r e t u r n ; } v a r   c h a n g e d = f a l s e ; i f ( ( m a n u a l | | ! p . c y c l e P a u s e ) & & ( o p t s . n e x t S l i d e ! = o p t s . c u r r S l i d e ) ) { c h a n g e d = t r u e ; v a r   f x = o p t s . f x ; c u r r . c y c l e H = c u r r . c y c l e H | | $ ( c u r r ) . h e i g h t ( ) ; c u r r . c y c l e W = c u r r . c y c l e W | | $ ( c u r r ) . w i d t h ( ) ; n e x t . c y c l e H = n e x t . c y c l e H | | $ ( n e x t ) . h e i g h t ( ) ; n e x t . c y c l e W = n e x t . c y c l e W | | $ ( n e x t ) . w i d t h ( ) ; i f ( o p t s . m u l t i F x ) { i f ( o p t s . l a s t F x = = u n d e f i n e d | | + + o p t s . l a s t F x > = o p t s . f x s . l e n g t h ) { o p t s . l a s t F x = 0 ; } f x = o p t s . f x s [ o p t s . l a s t F x ] ; o p t s . c u r r F x = f x ; } i f ( o p t s . o n e T i m e F x ) { f x = o p t s . o n e T i m e F x ; o p t s . o n e T i m e F x = n u l l ; } $ . f n . c y c l e . r e s e t S t a t e ( o p t s , f x ) ; i f ( o p t s . b e f o r e . l e n g t h ) { $ . e a c h ( o p t s . b e f o r e , f u n c t i o n ( i , o ) { i f ( p . c y c l e S t o p ! = o p t s . s t o p C o u n t ) { r e t u r n ; } o . a p p l y ( n e x t , [ c u r r , n e x t , o p t s , f w d ] ) ; } ) ; } v a r   a f t e r = f u n c t i o n ( ) { $ . e a c h ( o p t s . a f t e r , f u n c t i o n ( i , o ) { i f ( p . c y c l e S t o p ! = o p t s . s t o p C o u n t ) { r e t u r n ; } o . a p p l y ( n e x t , [ c u r r , n e x t , o p t s , f w d ] ) ; } ) ; } ; d e b u g ( " t x   f i r i n g ;   c u r r S l i d e :   " + o p t s . c u r r S l i d e + " ;   n e x t S l i d e :   " + o p t s . n e x t S l i d e ) ; o p t s . b u s y = 1 ; i f ( o p t s . f x F n ) { o p t s . f x F n ( c u r r , n e x t , o p t s , a f t e r , f w d , m a n u a l & & o p t s . f a s t O n E v e n t ) ; } e l s e { i f ( $ . i s F u n c t i o n ( $ . f n . c y c l e [ o p t s . f x ] ) ) { $ . f n . c y c l e [ o p t s . f x ] ( c u r r , n e x t , o p t s , a f t e r , f w d , m a n u a l & & o p t s . f a s t O n E v e n t ) ; } e l s e { $ . f n . c y c l e . c u s t o m ( c u r r , n e x t , o p t s , a f t e r , f w d , m a n u a l & & o p t s . f a s t O n E v e n t ) ; } } } i f ( c h a n g e d | | o p t s . n e x t S l i d e = = o p t s . c u r r S l i d e ) { o p t s . l a s t S l i d e = o p t s . c u r r S l i d e ; i f ( o p t s . r a n d o m ) { o p t s . c u r r S l i d e = o p t s . n e x t S l i d e ; i f ( + + o p t s . r a n d o m I n d e x = = e l s . l e n g t h ) { o p t s . r a n d o m I n d e x = 0 ; } o p t s . n e x t S l i d e = o p t s . r a n d o m M a p [ o p t s . r a n d o m I n d e x ] ; i f ( o p t s . n e x t S l i d e = = o p t s . c u r r S l i d e ) { o p t s . n e x t S l i d e = ( o p t s . c u r r S l i d e = = o p t s . s l i d e C o u n t - 1 ) ? 0 : o p t s . c u r r S l i d e + 1 ; } } e l s e { i f ( o p t s . b a c k w a r d s ) { v a r   r o l l = ( o p t s . n e x t S l i d e - 1 ) < 0 ; i f ( r o l l & & o p t s . b o u n c e ) { o p t s . b a c k w a r d s = ! o p t s . b a c k w a r d s ; o p t s . n e x t S l i d e = 1 ; o p t s . c u r r S l i d e = 0 ; } e l s e { o p t s . n e x t S l i d e = r o l l ? ( e l s . l e n g t h - 1 ) : o p t s . n e x t S l i d e - 1 ; o p t s . c u r r S l i d e = r o l l ? 0 : o p t s . n e x t S l i d e + 1 ; } } e l s e { v a r   r o l l = ( o p t s . n e x t S l i d e + 1 ) = = e l s . l e n g t h ; i f ( r o l l & & o p t s . b o u n c e ) { o p t s . b a c k w a r d s = ! o p t s . b a c k w a r d s ; o p t s . n e x t S l i d e = e l s . l e n g t h - 2 ; o p t s . c u r r S l i d e = e l s . l e n g t h - 1 ; } e l s e { o p t s . n e x t S l i d e = r o l l ? 0 : o p t s . n e x t S l i d e + 1 ; o p t s . c u r r S l i d e = r o l l ? e l s . l e n g t h - 1 : o p t s . n e x t S l i d e - 1 ; } } } } i f ( c h a n g e d & & o p t s . p a g e r ) { o p t s . u p d a t e A c t i v e P a g e r L i n k ( o p t s . p a g e r , o p t s . c u r r S l i d e , o p t s . a c t i v e P a g e r C l a s s ) ; } v a r   m s = 0 ; i f ( o p t s . t i m e o u t & & ! o p t s . c o n t i n u o u s ) { m s = g e t T i m e o u t ( e l s [ o p t s . c u r r S l i d e ] , e l s [ o p t s . n e x t S l i d e ] , o p t s , f w d ) ; } e l s e { i f ( o p t s . c o n t i n u o u s & & p . c y c l e P a u s e ) { m s = 1 0 ; } } i f ( m s > 0 ) { p . c y c l e T i m e o u t = s e t T i m e o u t ( f u n c t i o n ( ) { g o ( e l s , o p t s , 0 , ( ! o p t s . r e v & & ! o p t s . b a c k w a r d s ) ) ; } , m s ) ; } } $ . f n . c y c l e . u p d a t e A c t i v e P a g e r L i n k = f u n c t i o n ( p a g e r , c u r r S l i d e , c l s N a m e ) { $ ( p a g e r ) . e a c h ( f u n c t i o n ( ) { $ ( t h i s ) . c h i l d r e n ( ) . r e m o v e C l a s s ( c l s N a m e ) . e q ( c u r r S l i d e ) . a d d C l a s s ( c l s N a m e ) ; } ) ; } ; f u n c t i o n   g e t T i m e o u t ( c u r r , n e x t , o p t s , f w d ) { i f ( o p t s . t i m e o u t F n ) { v a r   t = o p t s . t i m e o u t F n . c a l l ( c u r r , c u r r , n e x t , o p t s , f w d ) ; w h i l e ( ( t - o p t s . s p e e d ) < 2 5 0 ) { t + = o p t s . s p e e d ; } d e b u g ( " c a l c u l a t e d   t i m e o u t :   " + t + " ;   s p e e d :   " + o p t s . s p e e d ) ; i f ( t ! = = f a l s e ) { r e t u r n   t ; } } r e t u r n   o p t s . t i m e o u t ; } $ . f n . c y c l e . n e x t = f u n c t i o n ( o p t s ) { a d v a n c e ( o p t s , o p t s . r e v ? - 1 : 1 ) ; } ; $ . f n . c y c l e . p r e v = f u n c t i o n ( o p t s ) { a d v a n c e ( o p t s , o p t s . r e v ? 1 : - 1 ) ; } ; f u n c t i o n   a d v a n c e ( o p t s , v a l ) { v a r   e l s = o p t s . e l e m e n t s ; v a r   p = o p t s . $ c o n t [ 0 ] , t i m e o u t = p . c y c l e T i m e o u t ; i f ( t i m e o u t ) { c l e a r T i m e o u t ( t i m e o u t ) ; p . c y c l e T i m e o u t = 0 ; } i f ( o p t s . r a n d o m & & v a l < 0 ) { o p t s . r a n d o m I n d e x - - ; i f ( - - o p t s . r a n d o m I n d e x = = - 2 ) { o p t s . r a n d o m I n d e x = e l s . l e n g t h - 2 ; } e l s e { i f ( o p t s . r a n d o m I n d e x = = - 1 ) { o p t s . r a n d o m I n d e x = e l s . l e n g t h - 1 ; } } o p t s . n e x t S l i d e = o p t s . r a n d o m M a p [ o p t s . r a n d o m I n d e x ] ; } e l s e { i f ( o p t s . r a n d o m ) { o p t s . n e x t S l i d e = o p t s . r a n d o m M a p [ o p t s . r a n d o m I n d e x ] ; } e l s e { o p t s . n e x t S l i d e = o p t s . c u r r S l i d e + v a l ; i f ( o p t s . n e x t S l i d e < 0 ) { i f ( o p t s . n o w r a p ) { r e t u r n   f a l s e ; } o p t s . n e x t S l i d e = e l s . l e n g t h - 1 ; } e l s e { i f ( o p t s . n e x t S l i d e > = e l s . l e n g t h ) { i f ( o p t s . n o w r a p ) { r e t u r n   f a l s e ; } o p t s . n e x t S l i d e = 0 ; } } } } v a r   c b = o p t s . o n P r e v N e x t E v e n t | | o p t s . p r e v N e x t C l i c k ; i f ( $ . i s F u n c t i o n ( c b ) ) { c b ( v a l > 0 , o p t s . n e x t S l i d e , e l s [ o p t s . n e x t S l i d e ] ) ; } g o ( e l s , o p t s , 1 , v a l > = 0 ) ; r e t u r n   f a l s e ; } f u n c t i o n   b u i l d P a g e r ( e l s , o p t s ) { v a r   $ p = $ ( o p t s . p a g e r ) ; $ . e a c h ( e l s , f u n c t i o n ( i , o ) { $ . f n . c y c l e . c r e a t e P a g e r A n c h o r ( i , o , $ p , e l s , o p t s ) ; } ) ; o p t s . u p d a t e A c t i v e P a g e r L i n k ( o p t s . p a g e r , o p t s . s t a r t i n g S l i d e , o p t s . a c t i v e P a g e r C l a s s ) ; } $ . f n . c y c l e . c r e a t e P a g e r A n c h o r = f u n c t i o n ( i , e l , $ p , e l s , o p t s ) { v a r   a ; i f ( $ . i s F u n c t i o n ( o p t s . p a g e r A n c h o r B u i l d e r ) ) { a = o p t s . p a g e r A n c h o r B u i l d e r ( i , e l ) ; d e b u g ( " p a g e r A n c h o r B u i l d e r ( " + i + " ,   e l )   r e t u r n e d :   " + a ) ; } e l s e { a = ' < a   h r e f = " # " > ' + ( i + 1 ) + " < / a > " ; } i f ( ! a ) { r e t u r n ; } v a r   $ a = $ ( a ) ; i f ( $ a . p a r e n t s ( " b o d y " ) . l e n g t h = = = 0 ) { v a r   a r r = [ ] ; i f ( $ p . l e n g t h > 1 ) { $ p . e a c h ( f u n c t i o n ( ) { v a r   $ c l o n e = $ a . c l o n e ( t r u e ) ; $ ( t h i s ) . a p p e n d ( $ c l o n e ) ; a r r . p u s h ( $ c l o n e [ 0 ] ) ; } ) ; $ a = $ ( a r r ) ; } e l s e { $ a . a p p e n d T o ( $ p ) ; } } o p t s . p a g e r A n c h o r s = o p t s . p a g e r A n c h o r s | | [ ] ; o p t s . p a g e r A n c h o r s . p u s h ( $ a ) ; $ a . b i n d ( o p t s . p a g e r E v e n t , f u n c t i o n ( e ) { e . p r e v e n t D e f a u l t ( ) ; o p t s . n e x t S l i d e = i ; v a r   p = o p t s . $ c o n t [ 0 ] , t i m e o u t = p . c y c l e T i m e o u t ; i f ( t i m e o u t ) { c l e a r T i m e o u t ( t i m e o u t ) ; p . c y c l e T i m e o u t = 0 ; } v a r   c b = o p t s . o n P a g e r E v e n t | | o p t s . p a g e r C l i c k ; i f ( $ . i s F u n c t i o n ( c b ) ) { c b ( o p t s . n e x t S l i d e , e l s [ o p t s . n e x t S l i d e ] ) ; } g o ( e l s , o p t s , 1 , o p t s . c u r r S l i d e < i ) ; } ) ; i f ( ! / ^ c l i c k / . t e s t ( o p t s . p a g e r E v e n t ) & & ! o p t s . a l l o w P a g e r C l i c k B u b b l e ) { $ a . b i n d ( " c l i c k . c y c l e " , f u n c t i o n ( ) { r e t u r n   f a l s e ; } ) ; } i f ( o p t s . p a u s e O n P a g e r H o v e r ) { $ a . h o v e r ( f u n c t i o n ( ) { o p t s . $ c o n t [ 0 ] . c y c l e P a u s e + + ; } , f u n c t i o n ( ) { o p t s . $ c o n t [ 0 ] . c y c l e P a u s e - - ; } ) ; } } ; $ . f n . c y c l e . h o p s F r o m L a s t = f u n c t i o n ( o p t s , f w d ) { v a r   h o p s , l = o p t s . l a s t S l i d e , c = o p t s . c u r r S l i d e ; i f ( f w d ) { h o p s = c > l ? c - l : o p t s . s l i d e C o u n t - l ; } e l s e { h o p s = c < l ? l - c : l + o p t s . s l i d e C o u n t - c ; } r e t u r n   h o p s ; } ; f u n c t i o n   c l e a r T y p e F i x ( $ s l i d e s ) { d e b u g ( " a p p l y i n g   c l e a r T y p e   b a c k g r o u n d - c o l o r   h a c k " ) ; f u n c t i o n   h e x ( s ) { s = p a r s e I n t ( s ) . t o S t r i n g ( 1 6 ) ; r e t u r n   s . l e n g t h < 2 ? " 0 " + s : s ; } f u n c t i o n   g e t B g ( e ) { f o r ( ; e & & e . n o d e N a m e . t o L o w e r C a s e ( ) ! = " h t m l " ; e = e . p a r e n t N o d e ) { v a r   v = $ . c s s ( e , " b a c k g r o u n d - c o l o r " ) ; i f ( v . i n d e x O f ( " r g b " ) > = 0 ) { v a r   r g b = v . m a t c h ( / \ d + / g ) ; r e t u r n " # " + h e x ( r g b [ 0 ] ) + h e x ( r g b [ 1 ] ) + h e x ( r g b [ 2 ] ) ; } i f ( v & & v ! = " t r a n s p a r e n t " ) { r e t u r n   v ; } } r e t u r n " # f f f f f f " ; } $ s l i d e s . e a c h ( f u n c t i o n ( ) { $ ( t h i s ) . c s s ( " b a c k g r o u n d - c o l o r " , g e t B g ( t h i s ) ) ; } ) ; } $ . f n . c y c l e . c o m m o n R e s e t = f u n c t i o n ( c u r r , n e x t , o p t s , w , h , r e v ) { $ ( o p t s . e l e m e n t s ) . n o t ( c u r r ) . h i d e ( ) ; o p t s . c s s B e f o r e . o p a c i t y = 1 ; o p t s . c s s B e f o r e . d i s p l a y = " b l o c k " ; i f ( w ! = = f a l s e & & n e x t . c y c l e W > 0 ) { o p t s . c s s B e f o r e . w i d t h = n e x t . c y c l e W ; } i f ( h ! = = f a l s e & & n e x t . c y c l e H > 0 ) { o p t s . c s s B e f o r e . h e i g h t = n e x t . c y c l e H ; } o p t s . c s s A f t e r = o p t s . c s s A f t e r | | { } ; o p t s . c s s A f t e r . d i s p l a y = " n o n e " ; $ ( c u r r ) . c s s ( " z I n d e x " , o p t s . s l i d e C o u n t + ( r e v = = = t r u e ? 1 : 0 ) ) ; $ ( n e x t ) . c s s ( " z I n d e x " , o p t s . s l i d e C o u n t + ( r e v = = = t r u e ? 0 : 1 ) ) ; } ; $ . f n . c y c l e . c u s t o m = f u n c t i o n ( c u r r , n e x t , o p t s , c b , f w d , s p e e d O v e r r i d e ) { v a r   $ l = $ ( c u r r ) , $ n = $ ( n e x t ) ; v a r   s p e e d I n = o p t s . s p e e d I n , s p e e d O u t = o p t s . s p e e d O u t , e a s e I n = o p t s . e a s e I n , e a s e O u t = o p t s . e a s e O u t ; $ n . c s s ( o p t s . c s s B e f o r e ) ; i f ( s p e e d O v e r r i d e ) { i f ( t y p e o f   s p e e d O v e r r i d e = = " n u m b e r " ) { s p e e d I n = s p e e d O u t = s p e e d O v e r r i d e ; } e l s e { s p e e d I n = s p e e d O u t = 1 ; } e a s e I n = e a s e O u t = n u l l ; } v a r   f n = f u n c t i o n ( ) { $ n . a n i m a t e ( o p t s . a n i m I n , s p e e d I n , e a s e I n , c b ) ; } ; $ l . a n i m a t e ( o p t s . a n i m O u t , s p e e d O u t , e a s e O u t , f u n c t i o n ( ) { i f ( o p t s . c s s A f t e r ) { $ l . c s s ( o p t s . c s s A f t e r ) ; } i f ( ! o p t s . s y n c ) { f n ( ) ; } } ) ; i f ( o p t s . s y n c ) { f n ( ) ; } } ; $ . f n . c y c l e . t r a n s i t i o n s = { f a d e : f u n c t i o n ( $ c o n t , $ s l i d e s , o p t s ) { $ s l i d e s . n o t ( " : e q ( " + o p t s . c u r r S l i d e + " ) " ) . c s s ( " o p a c i t y " , 0 ) ; o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r , n e x t , o p t s ) { $ . f n . c y c l e . c o m m o n R e s e t ( c u r r , n e x t , o p t s ) ; o p t s . c s s B e f o r e . o p a c i t y = 0 ; } ) ; o p t s . a n i m I n = { o p a c i t y : 1 } ; o p t s . a n i m O u t = { o p a c i t y : 0 } ; o p t s . c s s B e f o r e = { t o p : 0 , l e f t : 0 } ; } } ; $ . f n . c y c l e . v e r = f u n c t i o n ( ) { r e t u r n   v e r ; } ; $ . f n . c y c l e . d e f a u l t s = { f x : " f a d e " , t i m e o u t : 4 0 0 0 , t i m e o u t F n : n u l l , c o n t i n u o u s : 0 , s p e e d : 1 0 0 0 , s p e e d I n : n u l l , s p e e d O u t : n u l l , n e x t : n u l l , p r e v : n u l l , o n P r e v N e x t E v e n t : n u l l , p r e v N e x t E v e n t : " c l i c k . c y c l e " , p a g e r : n u l l , o n P a g e r E v e n t : n u l l , p a g e r E v e n t : " c l i c k . c y c l e " , a l l o w P a g e r C l i c k B u b b l e : f a l s e , p a g e r A n c h o r B u i l d e r : n u l l , b e f o r e : n u l l , a f t e r : n u l l , e n d : n u l l , e a s i n g : n u l l , e a s e I n : n u l l , e a s e O u t : n u l l , s h u f f l e : n u l l , a n i m I n : n u l l , a n i m O u t : n u l l , c s s B e f o r e : n u l l , c s s A f t e r : n u l l , f x F n : n u l l , h e i g h t : " a u t o " , s t a r t i n g S l i d e : 0 , s y n c : 1 , r a n d o m : 0 , f i t : 0 , c o n t a i n e r R e s i z e : 1 , p a u s e : 0 , p a u s e O n P a g e r H o v e r : 0 , a u t o s t o p : 0 , a u t o s t o p C o u n t : 0 , d e l a y : 0 , s l i d e E x p r : n u l l , c l e a r t y p e : ! $ . s u p p o r t . o p a c i t y , c l e a r t y p e N o B g : f a l s e , n o w r a p : 0 , f a s t O n E v e n t : 0 , r a n d o m i z e E f f e c t s : 1 , r e v : 0 , m a n u a l T r u m p : t r u e , r e q u e u e O n I m a g e N o t L o a d e d : t r u e , r e q u e u e T i m e o u t : 2 5 0 , a c t i v e P a g e r C l a s s : " a c t i v e S l i d e " , u p d a t e A c t i v e P a g e r L i n k : n u l l , b a c k w a r d s : f a l s e } ; } ) ( j Q u e r y ) ;  
  
  
  
  
  
 ( f u n c t i o n ( a ) { a . u n i f o r m = { o p t i o n s : { s e l e c t C l a s s : " s e l e c t o r " , r a d i o C l a s s : " r a d i o " , c h e c k b o x C l a s s : " c h e c k e r " , f i l e C l a s s : " u p l o a d e r " , f i l e n a m e C l a s s : " f i l e n a m e " , f i l e B t n C l a s s : " a c t i o n " , f i l e D e f a u l t T e x t : " N o   f i l e   s e l e c t e d " , f i l e B t n T e x t : " C h o o s e   F i l e " , c h e c k e d C l a s s : " c h e c k e d " , f o c u s C l a s s : " f o c u s " , d i s a b l e d C l a s s : " d i s a b l e d " , b u t t o n C l a s s : " b u t t o n " , a c t i v e C l a s s : " a c t i v e " , h o v e r C l a s s : " h o v e r " , u s e I D : t r u e , i d P r e f i x : " u n i f o r m " , r e s e t S e l e c t o r : f a l s e , a u t o H i d e : t r u e } , e l e m e n t s : [ ] } ; i f ( a . b r o w s e r . m s i e & & a . b r o w s e r . v e r s i o n < 7 ) { a . s u p p o r t . s e l e c t O p a c i t y = f a l s e } e l s e { a . s u p p o r t . s e l e c t O p a c i t y = t r u e } a . f n . u n i f o r m = f u n c t i o n ( k ) { k = a . e x t e n d ( a . u n i f o r m . o p t i o n s , k ) ; v a r   d = t h i s ; i f ( k . r e s e t S e l e c t o r ! = f a l s e ) { a ( k . r e s e t S e l e c t o r ) . m o u s e u p ( f u n c t i o n ( ) { f u n c t i o n   l ( ) { a . u n i f o r m . u p d a t e ( d ) } s e t T i m e o u t ( l , 1 0 ) } ) } f u n c t i o n   j ( l ) { $ e l = a ( l ) ; $ e l . a d d C l a s s ( $ e l . a t t r ( " t y p e " ) ) ; b ( l ) } f u n c t i o n   g ( l ) { a ( l ) . a d d C l a s s ( " u n i f o r m " ) ; b ( l ) } f u n c t i o n   i ( o ) { v a r   m = a ( o ) ; v a r   p = a ( " < d i v > " ) , l = a ( " < s p a n > " ) ; p . a d d C l a s s ( k . b u t t o n C l a s s ) ; i f ( k . u s e I D & & m . a t t r ( " i d " ) ! = " " ) { p . a t t r ( " i d " , k . i d P r e f i x + " - " + m . a t t r ( " i d " ) ) } v a r   n ; i f ( m . i s ( " a " ) | | m . i s ( " b u t t o n " ) ) { n = m . t e x t ( ) } e l s e { i f ( m . i s ( " : s u b m i t " ) | | m . i s ( " : r e s e t " ) | | m . i s ( " i n p u t [ t y p e = b u t t o n ] " ) ) { n = m . a t t r ( " v a l u e " ) } } n = n = = " " ? m . i s ( " : r e s e t " ) ? " R e s e t " : " S u b m i t " : n ; l . h t m l ( n ) ; m . c s s ( " o p a c i t y " , 0 ) ; m . w r a p ( p ) ; m . w r a p ( l ) ; p = m . c l o s e s t ( " d i v " ) ; l = m . c l o s e s t ( " s p a n " ) ; i f ( m . i s ( " : d i s a b l e d " ) ) { p . a d d C l a s s ( k . d i s a b l e d C l a s s ) } p . b i n d ( { " m o u s e e n t e r . u n i f o r m " : f u n c t i o n ( ) { p . a d d C l a s s ( k . h o v e r C l a s s ) } , " m o u s e l e a v e . u n i f o r m " : f u n c t i o n ( ) { p . r e m o v e C l a s s ( k . h o v e r C l a s s ) ; p . r e m o v e C l a s s ( k . a c t i v e C l a s s ) } , " m o u s e d o w n . u n i f o r m   t o u c h b e g i n . u n i f o r m " : f u n c t i o n ( ) { p . a d d C l a s s ( k . a c t i v e C l a s s ) } , " m o u s e u p . u n i f o r m   t o u c h e n d . u n i f o r m " : f u n c t i o n ( ) { p . r e m o v e C l a s s ( k . a c t i v e C l a s s ) } , " c l i c k . u n i f o r m   t o u c h e n d . u n i f o r m " : f u n c t i o n ( r ) { i f ( a ( r . t a r g e t ) . i s ( " s p a n " ) | | a ( r . t a r g e t ) . i s ( " d i v " ) ) { i f ( o [ 0 ] . d i s p a t c h E v e n t ) { v a r   q = d o c u m e n t . c r e a t e E v e n t ( " M o u s e E v e n t s " ) ; q . i n i t E v e n t ( " c l i c k " , t r u e , t r u e ) ; o [ 0 ] . d i s p a t c h E v e n t ( q ) } e l s e { o [ 0 ] . c l i c k ( ) } } } } ) ; o . b i n d ( { " f o c u s . u n i f o r m " : f u n c t i o n ( ) { p . a d d C l a s s ( k . f o c u s C l a s s ) } , " b l u r . u n i f o r m " : f u n c t i o n ( ) { p . r e m o v e C l a s s ( k . f o c u s C l a s s ) } } ) ; a . u n i f o r m . n o S e l e c t ( p ) ; b ( o ) } f u n c t i o n   e ( o ) { v a r   m = a ( o ) ; v a r   p = a ( " < d i v   / > " ) , l = a ( " < s p a n   / > " ) ; i f ( ! m . c s s ( " d i s p l a y " ) = = " n o n e " & & k . a u t o H i d e ) { p . h i d e ( ) } p . a d d C l a s s ( k . s e l e c t C l a s s ) ; i f ( k . u s e I D & & o . a t t r ( " i d " ) ! = " " ) { p . a t t r ( " i d " , k . i d P r e f i x + " - " + o . a t t r ( " i d " ) ) } v a r   n = o . f i n d ( " : s e l e c t e d : f i r s t " ) ; i f ( n . l e n g t h = = 0 ) { n = o . f i n d ( " o p t i o n : f i r s t " ) } l . h t m l ( n . h t m l ( ) ) ; o . c s s ( " o p a c i t y " , 0 ) ; o . w r a p ( p ) ; o . b e f o r e ( l ) ; p = o . p a r e n t ( " d i v " ) ; l = o . s i b l i n g s ( " s p a n " ) ; o . b i n d ( { " c h a n g e . u n i f o r m " : f u n c t i o n ( ) { l . t e x t ( o . f i n d ( " : s e l e c t e d " ) . h t m l ( ) ) ; p . r e m o v e C l a s s ( k . a c t i v e C l a s s ) } , " f o c u s . u n i f o r m " : f u n c t i o n ( ) { p . a d d C l a s s ( k . f o c u s C l a s s ) } , " b l u r . u n i f o r m " : f u n c t i o n ( ) { p . r e m o v e C l a s s ( k . f o c u s C l a s s ) ; p . r e m o v e C l a s s ( k . a c t i v e C l a s s ) } , " m o u s e d o w n . u n i f o r m   t o u c h b e g i n . u n i f o r m " : f u n c t i o n ( ) { p . a d d C l a s s ( k . a c t i v e C l a s s ) } , " m o u s e u p . u n i f o r m   t o u c h e n d . u n i f o r m " : f u n c t i o n ( ) { p . r e m o v e C l a s s ( k . a c t i v e C l a s s ) } , " c l i c k . u n i f o r m   t o u c h e n d . u n i f o r m " : f u n c t i o n ( ) { p . r e m o v e C l a s s ( k . a c t i v e C l a s s ) } , " m o u s e e n t e r . u n i f o r m " : f u n c t i o n ( ) { p . a d d C l a s s ( k . h o v e r C l a s s ) } , " m o u s e l e a v e . u n i f o r m " : f u n c t i o n ( ) { p . r e m o v e C l a s s ( k . h o v e r C l a s s ) ; p . r e m o v e C l a s s ( k . a c t i v e C l a s s ) } , " k e y u p . u n i f o r m " : f u n c t i o n ( ) { l . t e x t ( o . f i n d ( " : s e l e c t e d " ) . h t m l ( ) ) } } ) ; i f ( a ( o ) . a t t r ( " d i s a b l e d " ) ) { p . a d d C l a s s ( k . d i s a b l e d C l a s s ) } a . u n i f o r m . n o S e l e c t ( l ) ; b ( o ) } f u n c t i o n   f ( n ) { v a r   m = a ( n ) ; v a r   o = a ( " < d i v   / > " ) , l = a ( " < s p a n   / > " ) ; i f ( ! m . c s s ( " d i s p l a y " ) = = " n o n e " & & k . a u t o H i d e ) { o . h i d e ( ) } o . a d d C l a s s ( k . c h e c k b o x C l a s s ) ; i f ( k . u s e I D & & n . a t t r ( " i d " ) ! = " " ) { o . a t t r ( " i d " , k . i d P r e f i x + " - " + n . a t t r ( " i d " ) ) } a ( n ) . w r a p ( o ) ; a ( n ) . w r a p ( l ) ; l = n . p a r e n t ( ) ; o = l . p a r e n t ( ) ; a ( n ) . c s s ( " o p a c i t y " , 0 ) . b i n d ( { " f o c u s . u n i f o r m " : f u n c t i o n ( ) { o . a d d C l a s s ( k . f o c u s C l a s s ) } , " b l u r . u n i f o r m " : f u n c t i o n ( ) { o . r e m o v e C l a s s ( k . f o c u s C l a s s ) } , " c l i c k . u n i f o r m   t o u c h e n d . u n i f o r m " : f u n c t i o n ( ) { i f ( ! a ( n ) . a t t r ( " c h e c k e d " ) ) { l . r e m o v e C l a s s ( k . c h e c k e d C l a s s ) } e l s e { l . a d d C l a s s ( k . c h e c k e d C l a s s ) } } , " m o u s e d o w n . u n i f o r m   t o u c h b e g i n . u n i f o r m " : f u n c t i o n ( ) { o . a d d C l a s s ( k . a c t i v e C l a s s ) } , " m o u s e u p . u n i f o r m   t o u c h e n d . u n i f o r m " : f u n c t i o n ( ) { o . r e m o v e C l a s s ( k . a c t i v e C l a s s ) } , " m o u s e e n t e r . u n i f o r m " : f u n c t i o n ( ) { o . a d d C l a s s ( k . h o v e r C l a s s ) } , " m o u s e l e a v e . u n i f o r m " : f u n c t i o n ( ) { o . r e m o v e C l a s s ( k . h o v e r C l a s s ) ; o . r e m o v e C l a s s ( k . a c t i v e C l a s s ) } } ) ; i f ( a ( n ) . a t t r ( " c h e c k e d " ) ) { l . a d d C l a s s ( k . c h e c k e d C l a s s ) } i f ( a ( n ) . a t t r ( " d i s a b l e d " ) ) { o . a d d C l a s s ( k . d i s a b l e d C l a s s ) } b ( n ) } f u n c t i o n   c ( n ) { v a r   m = a ( n ) ; v a r   o = a ( " < d i v   / > " ) , l = a ( " < s p a n   / > " ) ; i f ( ! m . c s s ( " d i s p l a y " ) = = " n o n e " & & k . a u t o H i d e ) { o . h i d e ( ) } o . a d d C l a s s ( k . r a d i o C l a s s ) ; i f ( k . u s e I D & & n . a t t r ( " i d " ) ! = " " ) { o . a t t r ( " i d " , k . i d P r e f i x + " - " + n . a t t r ( " i d " ) ) } a ( n ) . w r a p ( o ) ; a ( n ) . w r a p ( l ) ; l = n . p a r e n t ( ) ; o = l . p a r e n t ( ) ; a ( n ) . c s s ( " o p a c i t y " , 0 ) . b i n d ( { " f o c u s . u n i f o r m " : f u n c t i o n ( ) { o . a d d C l a s s ( k . f o c u s C l a s s ) } , " b l u r . u n i f o r m " : f u n c t i o n ( ) { o . r e m o v e C l a s s ( k . f o c u s C l a s s ) } , " c l i c k . u n i f o r m   t o u c h e n d . u n i f o r m " : f u n c t i o n ( ) { i f ( ! a ( n ) . a t t r ( " c h e c k e d " ) ) { l . r e m o v e C l a s s ( k . c h e c k e d C l a s s ) } e l s e { v a r   p = k . r a d i o C l a s s . s p l i t ( "   " ) [ 0 ] ; a ( " . " + p + "   s p a n . " + k . c h e c k e d C l a s s + " : h a s ( [ n a m e = ' " + a ( n ) . a t t r ( " n a m e " ) + " ' ] ) " ) . r e m o v e C l a s s ( k . c h e c k e d C l a s s ) ; l . a d d C l a s s ( k . c h e c k e d C l a s s ) } } , " m o u s e d o w n . u n i f o r m   t o u c h e n d . u n i f o r m " : f u n c t i o n ( ) { i f ( ! a ( n ) . i s ( " : d i s a b l e d " ) ) { o . a d d C l a s s ( k . a c t i v e C l a s s ) } } , " m o u s e u p . u n i f o r m   t o u c h b e g i n . u n i f o r m " : f u n c t i o n ( ) { o . r e m o v e C l a s s ( k . a c t i v e C l a s s ) } , " m o u s e e n t e r . u n i f o r m   t o u c h e n d . u n i f o r m " : f u n c t i o n ( ) { o . a d d C l a s s ( k . h o v e r C l a s s ) } , " m o u s e l e a v e . u n i f o r m " : f u n c t i o n ( ) { o . r e m o v e C l a s s ( k . h o v e r C l a s s ) ; o . r e m o v e C l a s s ( k . a c t i v e C l a s s ) } } ) ; i f ( a ( n ) . a t t r ( " c h e c k e d " ) ) { l . a d d C l a s s ( k . c h e c k e d C l a s s ) } i f ( a ( n ) . a t t r ( " d i s a b l e d " ) ) { o . a d d C l a s s ( k . d i s a b l e d C l a s s ) } b ( n ) } f u n c t i o n   h ( q ) { v a r   o = a ( q ) ; v a r   r = a ( " < d i v   / > " ) , p = a ( " < s p a n > " + k . f i l e D e f a u l t T e x t + " < / s p a n > " ) , m = a ( " < s p a n > " + k . f i l e B t n T e x t + " < / s p a n > " ) ; i f ( ! o . c s s ( " d i s p l a y " ) = = " n o n e " & & k . a u t o H i d e ) { r . h i d e ( ) } r . a d d C l a s s ( k . f i l e C l a s s ) ; p . a d d C l a s s ( k . f i l e n a m e C l a s s ) ; m . a d d C l a s s ( k . f i l e B t n C l a s s ) ; i f ( k . u s e I D & & o . a t t r ( " i d " ) ! = " " ) { r . a t t r ( " i d " , k . i d P r e f i x + " - " + o . a t t r ( " i d " ) ) } o . w r a p ( r ) ; o . a f t e r ( m ) ; o . a f t e r ( p ) ; r = o . c l o s e s t ( " d i v " ) ; p = o . s i b l i n g s ( " . " + k . f i l e n a m e C l a s s ) ; m = o . s i b l i n g s ( " . " + k . f i l e B t n C l a s s ) ; i f ( ! o . a t t r ( " s i z e " ) ) { v a r   l = r . w i d t h ( ) ; o . a t t r ( " s i z e " , l / 1 0 ) } v a r   n = f u n c t i o n ( ) { v a r   s = o . v a l ( ) ; i f ( s = = = " " ) { s = k . f i l e D e f a u l t T e x t } e l s e { s = s . s p l i t ( / [ \ / \ \ ] + / ) ; s = s [ ( s . l e n g t h - 1 ) ] } p . t e x t ( s ) } ; n ( ) ; o . c s s ( " o p a c i t y " , 0 ) . b i n d ( { " f o c u s . u n i f o r m " : f u n c t i o n ( ) { r . a d d C l a s s ( k . f o c u s C l a s s ) } , " b l u r . u n i f o r m " : f u n c t i o n ( ) { r . r e m o v e C l a s s ( k . f o c u s C l a s s ) } , " m o u s e d o w n . u n i f o r m " : f u n c t i o n ( ) { i f ( ! a ( q ) . i s ( " : d i s a b l e d " ) ) { r . a d d C l a s s ( k . a c t i v e C l a s s ) } } , " m o u s e u p . u n i f o r m " : f u n c t i o n ( ) { r . r e m o v e C l a s s ( k . a c t i v e C l a s s ) } , " m o u s e e n t e r . u n i f o r m " : f u n c t i o n ( ) { r . a d d C l a s s ( k . h o v e r C l a s s ) } , " m o u s e l e a v e . u n i f o r m " : f u n c t i o n ( ) { r . r e m o v e C l a s s ( k . h o v e r C l a s s ) ; r . r e m o v e C l a s s ( k . a c t i v e C l a s s ) } } ) ; i f ( a . b r o w s e r . m s i e ) { o . b i n d ( " c l i c k . u n i f o r m . i e 7 " , f u n c t i o n ( ) { s e t T i m e o u t ( n , 0 ) } ) } e l s e { o . b i n d ( " c h a n g e . u n i f o r m " , n ) } i f ( o . a t t r ( " d i s a b l e d " ) ) { r . a d d C l a s s ( k . d i s a b l e d C l a s s ) } a . u n i f o r m . n o S e l e c t ( p ) ; a . u n i f o r m . n o S e l e c t ( m ) ; b ( q ) } a . u n i f o r m . r e s t o r e = f u n c t i o n ( l ) { i f ( l = = u n d e f i n e d ) { l = a ( a . u n i f o r m . e l e m e n t s ) } a ( l ) . e a c h ( f u n c t i o n ( ) { i f ( a ( t h i s ) . i s ( " : c h e c k b o x " ) ) { a ( t h i s ) . u n w r a p ( ) . u n w r a p ( ) } e l s e { i f ( a ( t h i s ) . i s ( " s e l e c t " ) ) { a ( t h i s ) . s i b l i n g s ( " s p a n " ) . r e m o v e ( ) ; a ( t h i s ) . u n w r a p ( ) } e l s e { i f ( a ( t h i s ) . i s ( " : r a d i o " ) ) { a ( t h i s ) . u n w r a p ( ) . u n w r a p ( ) } e l s e { i f ( a ( t h i s ) . i s ( " : f i l e " ) ) { a ( t h i s ) . s i b l i n g s ( " s p a n " ) . r e m o v e ( ) ; a ( t h i s ) . u n w r a p ( ) } e l s e { i f ( a ( t h i s ) . i s ( " b u t t o n ,   : s u b m i t ,   : r e s e t ,   a ,   i n p u t [ t y p e = ' b u t t o n ' ] " ) ) { a ( t h i s ) . u n w r a p ( ) . u n w r a p ( ) } } } } } a ( t h i s ) . u n b i n d ( " . u n i f o r m " ) ; a ( t h i s ) . c s s ( " o p a c i t y " , " 1 " ) ; v a r   m = a . i n A r r a y ( a ( l ) , a . u n i f o r m . e l e m e n t s ) ; a . u n i f o r m . e l e m e n t s . s p l i c e ( m , 1 ) } ) } ; f u n c t i o n   b ( l ) { l = a ( l ) . g e t ( ) ; i f ( l . l e n g t h > 1 ) { a . e a c h ( l , f u n c t i o n ( m , n ) { a . u n i f o r m . e l e m e n t s . p u s h ( n ) } ) } e l s e { a . u n i f o r m . e l e m e n t s . p u s h ( l ) } } a . u n i f o r m . n o S e l e c t = f u n c t i o n ( l ) { f u n c t i o n   m ( ) { r e t u r n   f a l s e } a ( l ) . e a c h ( f u n c t i o n ( ) { t h i s . o n s e l e c t s t a r t = t h i s . o n d r a g s t a r t = m ; a ( t h i s ) . m o u s e d o w n ( m ) . c s s ( { M o z U s e r S e l e c t : " n o n e " } ) } ) } ; a . u n i f o r m . u p d a t e = f u n c t i o n ( l ) { i f ( l = = u n d e f i n e d ) { l = a ( a . u n i f o r m . e l e m e n t s ) } l = a ( l ) ; l . e a c h ( f u n c t i o n ( ) { v a r   n = a ( t h i s ) ; i f ( n . i s ( " s e l e c t " ) ) { v a r   m = n . s i b l i n g s ( " s p a n " ) ; v a r   p = n . p a r e n t ( " d i v " ) ; p . r e m o v e C l a s s ( k . h o v e r C l a s s + "   " + k . f o c u s C l a s s + "   " + k . a c t i v e C l a s s ) ; m . h t m l ( n . f i n d ( " : s e l e c t e d " ) . h t m l ( ) ) ; i f ( n . i s ( " : d i s a b l e d " ) ) { p . a d d C l a s s ( k . d i s a b l e d C l a s s ) } e l s e { p . r e m o v e C l a s s ( k . d i s a b l e d C l a s s ) } } e l s e { i f ( n . i s ( " : c h e c k b o x " ) ) { v a r   m = n . c l o s e s t ( " s p a n " ) ; v a r   p = n . c l o s e s t ( " d i v " ) ; p . r e m o v e C l a s s ( k . h o v e r C l a s s + "   " + k . f o c u s C l a s s + "   " + k . a c t i v e C l a s s ) ; m . r e m o v e C l a s s ( k . c h e c k e d C l a s s ) ; i f ( n . i s ( " : c h e c k e d " ) ) { m . a d d C l a s s ( k . c h e c k e d C l a s s ) } i f ( n . i s ( " : d i s a b l e d " ) ) { p . a d d C l a s s ( k . d i s a b l e d C l a s s ) } e l s e { p . r e m o v e C l a s s ( k . d i s a b l e d C l a s s ) } } e l s e { i f ( n . i s ( " : r a d i o " ) ) { v a r   m = n . c l o s e s t ( " s p a n " ) ; v a r   p = n . c l o s e s t ( " d i v " ) ; p . r e m o v e C l a s s ( k . h o v e r C l a s s + "   " + k . f o c u s C l a s s + "   " + k . a c t i v e C l a s s ) ; m . r e m o v e C l a s s ( k . c h e c k e d C l a s s ) ; i f ( n . i s ( " : c h e c k e d " ) ) { m . a d d C l a s s ( k . c h e c k e d C l a s s ) } i f ( n . i s ( " : d i s a b l e d " ) ) { p . a d d C l a s s ( k . d i s a b l e d C l a s s ) } e l s e { p . r e m o v e C l a s s ( k . d i s a b l e d C l a s s ) } } e l s e { i f ( n . i s ( " : f i l e " ) ) { v a r   p = n . p a r e n t ( " d i v " ) ; v a r   o = n . s i b l i n g s ( k . f i l e n a m e C l a s s ) ; b t n T a g = n . s i b l i n g s ( k . f i l e B t n C l a s s ) ; p . r e m o v e C l a s s ( k . h o v e r C l a s s + "   " + k . f o c u s C l a s s + "   " + k . a c t i v e C l a s s ) ; o . t e x t ( n . v a l ( ) ) ; i f ( n . i s ( " : d i s a b l e d " ) ) { p . a d d C l a s s ( k . d i s a b l e d C l a s s ) } e l s e { p . r e m o v e C l a s s ( k . d i s a b l e d C l a s s ) } } e l s e { i f ( n . i s ( " : s u b m i t " ) | | n . i s ( " : r e s e t " ) | | n . i s ( " b u t t o n " ) | | n . i s ( " a " ) | | l . i s ( " i n p u t [ t y p e = b u t t o n ] " ) ) { v a r   p = n . c l o s e s t ( " d i v " ) ; p . r e m o v e C l a s s ( k . h o v e r C l a s s + "   " + k . f o c u s C l a s s + "   " + k . a c t i v e C l a s s ) ; i f ( n . i s ( " : d i s a b l e d " ) ) { p . a d d C l a s s ( k . d i s a b l e d C l a s s ) } e l s e { p . r e m o v e C l a s s ( k . d i s a b l e d C l a s s ) } } } } } } } ) } ; r e t u r n   t h i s . e a c h ( f u n c t i o n ( ) { i f ( a . s u p p o r t . s e l e c t O p a c i t y ) { v a r   l = a ( t h i s ) ; i f ( l . i s ( " s e l e c t " ) ) { i f ( l . a t t r ( " m u l t i p l e " ) ! = t r u e ) { i f ( l . a t t r ( " s i z e " ) = = u n d e f i n e d | | l . a t t r ( " s i z e " ) < = 1 ) { e ( l ) } } } e l s e { i f ( l . i s ( " : c h e c k b o x " ) ) { f ( l ) } e l s e { i f ( l . i s ( " : r a d i o " ) ) { c ( l ) } e l s e { i f ( l . i s ( " : f i l e " ) ) { h ( l ) } e l s e { i f ( l . i s ( " : t e x t ,   : p a s s w o r d ,   i n p u t [ t y p e = ' e m a i l ' ] " ) ) { j ( l ) } e l s e { i f ( l . i s ( " t e x t a r e a " ) ) { g ( l ) } e l s e { i f ( l . i s ( " a " ) | | l . i s ( " : s u b m i t " ) | | l . i s ( " : r e s e t " ) | | l . i s ( " b u t t o n " ) | | l . i s ( " i n p u t [ t y p e = b u t t o n ] " ) ) { i ( l ) } } } } } } } } } ) } } ) ( j Q u e r y ) ;  
  
  
  
  
 / *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 	 C l a s s :   p r e t t y P h o t o  
 	 U s e :   L i g h t b o x   c l o n e   f o r   j Q u e r y  
 	 A u t h o r :   S t e p h a n e   C a r o n   ( h t t p : / / w w w . n o - m a r g i n - f o r - e r r o r s . c o m )  
 	 V e r s i o n :   3 . 1 . 3  
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   * /  
  
 ( f u n c t i o n ( $ ) { $ . p r e t t y P h o t o = { v e r s i o n : ' 3 . 1 . 3 ' } ; $ . f n . p r e t t y P h o t o = f u n c t i o n ( p p _ s e t t i n g s ) { p p _ s e t t i n g s = j Q u e r y . e x t e n d ( { a n i m a t i o n _ s p e e d : ' f a s t ' , s l i d e s h o w : 5 0 0 0 , a u t o p l a y _ s l i d e s h o w : f a l s e , o p a c i t y : 0 . 8 0 , s h o w _ t i t l e : t r u e , a l l o w _ r e s i z e : t r u e , d e f a u l t _ w i d t h : 5 0 0 , d e f a u l t _ h e i g h t : 3 4 4 , c o u n t e r _ s e p a r a t o r _ l a b e l : ' / ' , t h e m e : ' p p _ d e f a u l t ' , h o r i z o n t a l _ p a d d i n g : 2 0 , h i d e f l a s h : f a l s e , w m o d e : ' o p a q u e ' , a u t o p l a y : t r u e , m o d a l : f a l s e , d e e p l i n k i n g : t r u e , o v e r l a y _ g a l l e r y : t r u e , k e y b o a r d _ s h o r t c u t s : t r u e , c h a n g e p i c t u r e c a l l b a c k : f u n c t i o n ( ) { } , c a l l b a c k : f u n c t i o n ( ) { } , i e 6 _ f a l l b a c k : t r u e , m a r k u p : ' < d i v   c l a s s = " p p _ p i c _ h o l d e r " >   < d i v   c l a s s = " p p t " > & n b s p ; < / d i v >   < d i v   c l a s s = " p p _ t o p " >     < d i v   c l a s s = " p p _ l e f t " > < / d i v >     < d i v   c l a s s = " p p _ m i d d l e " > < / d i v >     < d i v   c l a s s = " p p _ r i g h t " > < / d i v >   < / d i v >   < d i v   c l a s s = " p p _ c o n t e n t _ c o n t a i n e r " >     < d i v   c l a s s = " p p _ l e f t " >     < d i v   c l a s s = " p p _ r i g h t " >       < d i v   c l a s s = " p p _ c o n t e n t " >         < d i v   c l a s s = " p p _ l o a d e r I c o n " > < / d i v >         < d i v   c l a s s = " p p _ f a d e " >           < a   h r e f = " # "   c l a s s = " p p _ e x p a n d "   t i t l e = " E x p a n d   t h e   i m a g e " > E x p a n d < / a >           < d i v   c l a s s = " p p _ h o v e r C o n t a i n e r " >             < a   c l a s s = " p p _ n e x t "   h r e f = " # " > n e x t < / a >             < a   c l a s s = " p p _ p r e v i o u s "   h r e f = " # " > p r e v i o u s < / a >           < / d i v >           < d i v   i d = " p p _ f u l l _ r e s " > < / d i v >           < d i v   c l a s s = " p p _ d e t a i l s " >             < d i v   c l a s s = " p p _ n a v " >               < a   h r e f = " # "   c l a s s = " p p _ a r r o w _ p r e v i o u s " > P r e v i o u s < / a >               < p   c l a s s = " c u r r e n t T e x t H o l d e r " > 0 / 0 < / p >               < a   h r e f = " # "   c l a s s = " p p _ a r r o w _ n e x t " > N e x t < / a >             < / d i v >             < p   c l a s s = " p p _ d e s c r i p t i o n " > < / p >             < d i v   c l a s s = " p p _ s o c i a l " > { p p _ s o c i a l } < / d i v >             < a   c l a s s = " p p _ c l o s e "   h r e f = " # " > C l o s e < / a >           < / d i v >         < / d i v >       < / d i v >     < / d i v >     < / d i v >   < / d i v >   < d i v   c l a s s = " p p _ b o t t o m " >     < d i v   c l a s s = " p p _ l e f t " > < / d i v >     < d i v   c l a s s = " p p _ m i d d l e " > < / d i v >     < d i v   c l a s s = " p p _ r i g h t " > < / d i v >   < / d i v >   < / d i v >   < d i v   c l a s s = " p p _ o v e r l a y " > < / d i v > ' , g a l l e r y _ m a r k u p : ' < d i v   c l a s s = " p p _ g a l l e r y " >       < a   h r e f = " # "   c l a s s = " p p _ a r r o w _ p r e v i o u s " > P r e v i o u s < / a >       < d i v >         < u l >           { g a l l e r y }         < / u l >       < / d i v >       < a   h r e f = " # "   c l a s s = " p p _ a r r o w _ n e x t " > N e x t < / a >     < / d i v > ' , i m a g e _ m a r k u p : ' < i m g   i d = " f u l l R e s I m a g e "   s r c = " { p a t h } "   / > ' , f l a s h _ m a r k u p : ' < o b j e c t   c l a s s i d = " c l s i d : D 2 7 C D B 6 E - A E 6 D - 1 1 c f - 9 6 B 8 - 4 4 4 5 5 3 5 4 0 0 0 0 "   w i d t h = " { w i d t h } "   h e i g h t = " { h e i g h t } " > < p a r a m   n a m e = " w m o d e "   v a l u e = " { w m o d e } "   / > < p a r a m   n a m e = " a l l o w f u l l s c r e e n "   v a l u e = " t r u e "   / > < p a r a m   n a m e = " a l l o w s c r i p t a c c e s s "   v a l u e = " a l w a y s "   / > < p a r a m   n a m e = " m o v i e "   v a l u e = " { p a t h } "   / > < e m b e d   s r c = " { p a t h } "   t y p e = " a p p l i c a t i o n / x - s h o c k w a v e - f l a s h "   a l l o w f u l l s c r e e n = " t r u e "   a l l o w s c r i p t a c c e s s = " a l w a y s "   w i d t h = " { w i d t h } "   h e i g h t = " { h e i g h t } "   w m o d e = " { w m o d e } " > < / e m b e d > < / o b j e c t > ' , q u i c k t i m e _ m a r k u p : ' < o b j e c t   c l a s s i d = " c l s i d : 0 2 B F 2 5 D 5 - 8 C 1 7 - 4 B 2 3 - B C 8 0 - D 3 4 8 8 A B D D C 6 B "   c o d e b a s e = " h t t p : / / w w w . a p p l e . c o m / q t a c t i v e x / q t p l u g i n . c a b "   h e i g h t = " { h e i g h t } "   w i d t h = " { w i d t h } " > < p a r a m   n a m e = " s r c "   v a l u e = " { p a t h } " > < p a r a m   n a m e = " a u t o p l a y "   v a l u e = " { a u t o p l a y } " > < p a r a m   n a m e = " t y p e "   v a l u e = " v i d e o / q u i c k t i m e " > < e m b e d   s r c = " { p a t h } "   h e i g h t = " { h e i g h t } "   w i d t h = " { w i d t h } "   a u t o p l a y = " { a u t o p l a y } "   t y p e = " v i d e o / q u i c k t i m e "   p l u g i n s p a g e = " h t t p : / / w w w . a p p l e . c o m / q u i c k t i m e / d o w n l o a d / " > < / e m b e d > < / o b j e c t > ' , i f r a m e _ m a r k u p : ' < i f r a m e   s r c   = " { p a t h } "   w i d t h = " { w i d t h } "   h e i g h t = " { h e i g h t } "   f r a m e b o r d e r = " n o " > < / i f r a m e > ' , i n l i n e _ m a r k u p : ' < d i v   c l a s s = " p p _ i n l i n e " > { c o n t e n t } < / d i v > ' , c u s t o m _ m a r k u p : ' ' , s o c i a l _ t o o l s : ' < d i v   c l a s s = " t w i t t e r " > < a   h r e f = " h t t p : / / t w i t t e r . c o m / s h a r e "   c l a s s = " t w i t t e r - s h a r e - b u t t o n "   d a t a - c o u n t = " n o n e " > T w e e t < / a > < s c r i p t   t y p e = " t e x t / j a v a s c r i p t "   s r c = " h t t p : / / p l a t f o r m . t w i t t e r . c o m / w i d g e t s . j s " > < / s c r i p t > < / d i v > < d i v   c l a s s = " f a c e b o o k " > < i f r a m e   s r c = " h t t p : / / w w w . f a c e b o o k . c o m / p l u g i n s / l i k e . p h p ? l o c a l e = e n _ U S & h r e f = { l o c a t i o n _ h r e f } & a m p ; l a y o u t = b u t t o n _ c o u n t & a m p ; s h o w _ f a c e s = t r u e & a m p ; w i d t h = 5 0 0 & a m p ; a c t i o n = l i k e & a m p ; f o n t & a m p ; c o l o r s c h e m e = l i g h t & a m p ; h e i g h t = 2 3 "   s c r o l l i n g = " n o "   f r a m e b o r d e r = " 0 "   s t y l e = " b o r d e r : n o n e ;   o v e r f l o w : h i d d e n ;   w i d t h : 5 0 0 p x ;   h e i g h t : 2 3 p x ; "   a l l o w T r a n s p a r e n c y = " t r u e " > < / i f r a m e > < / d i v > ' } , p p _ s e t t i n g s ) ; v a r   m a t c h e d O b j e c t s = t h i s , p e r c e n t B a s e d = f a l s e , p p _ d i m e n s i o n s , p p _ o p e n , p p _ c o n t e n t H e i g h t , p p _ c o n t e n t W i d t h , p p _ c o n t a i n e r H e i g h t , p p _ c o n t a i n e r W i d t h , w i n d o w H e i g h t = $ ( w i n d o w ) . h e i g h t ( ) , w i n d o w W i d t h = $ ( w i n d o w ) . w i d t h ( ) , p p _ s l i d e s h o w ; d o r e s i z e = t r u e , s c r o l l _ p o s = _ g e t _ s c r o l l ( ) ; $ ( w i n d o w ) . u n b i n d ( ' r e s i z e . p r e t t y p h o t o ' ) . b i n d ( ' r e s i z e . p r e t t y p h o t o ' , f u n c t i o n ( ) { _ c e n t e r _ o v e r l a y ( ) ; _ r e s i z e _ o v e r l a y ( ) ; } ) ; i f ( p p _ s e t t i n g s . k e y b o a r d _ s h o r t c u t s ) { $ ( d o c u m e n t ) . u n b i n d ( ' k e y d o w n . p r e t t y p h o t o ' ) . b i n d ( ' k e y d o w n . p r e t t y p h o t o ' , f u n c t i o n ( e ) { i f ( t y p e o f   $ p p _ p i c _ h o l d e r ! = ' u n d e f i n e d ' ) { i f ( $ p p _ p i c _ h o l d e r . i s ( ' : v i s i b l e ' ) ) { s w i t c h ( e . k e y C o d e ) { c a s e   3 7 : $ . p r e t t y P h o t o . c h a n g e P a g e ( ' p r e v i o u s ' ) ; e . p r e v e n t D e f a u l t ( ) ; b r e a k ; c a s e   3 9 : $ . p r e t t y P h o t o . c h a n g e P a g e ( ' n e x t ' ) ; e . p r e v e n t D e f a u l t ( ) ; b r e a k ; c a s e   2 7 : i f ( ! s e t t i n g s . m o d a l )  
 $ . p r e t t y P h o t o . c l o s e ( ) ; e . p r e v e n t D e f a u l t ( ) ; b r e a k ; } ; } ; } ; } ) ; } ; $ . p r e t t y P h o t o . i n i t i a l i z e = f u n c t i o n ( ) { s e t t i n g s = p p _ s e t t i n g s ; i f ( s e t t i n g s . t h e m e = = ' p p _ d e f a u l t ' ) s e t t i n g s . h o r i z o n t a l _ p a d d i n g = 1 6 ; i f ( s e t t i n g s . i e 6 _ f a l l b a c k & & $ . b r o w s e r . m s i e & & p a r s e I n t ( $ . b r o w s e r . v e r s i o n ) = = 6 ) s e t t i n g s . t h e m e = " l i g h t _ s q u a r e " ; t h e R e l = $ ( t h i s ) . a t t r ( ' r e l ' ) ; g a l l e r y R e g E x p = / \ [ ( ? : . * ) \ ] / ; i s S e t = ( g a l l e r y R e g E x p . e x e c ( t h e R e l ) ) ? t r u e : f a l s e ; p p _ i m a g e s = ( i s S e t ) ? j Q u e r y . m a p ( m a t c h e d O b j e c t s , f u n c t i o n ( n , i ) { i f ( $ ( n ) . a t t r ( ' r e l ' ) . i n d e x O f ( t h e R e l ) ! = - 1 ) r e t u r n   $ ( n ) . a t t r ( ' h r e f ' ) ; } ) : $ . m a k e A r r a y ( $ ( t h i s ) . a t t r ( ' h r e f ' ) ) ; p p _ t i t l e s = ( i s S e t ) ? j Q u e r y . m a p ( m a t c h e d O b j e c t s , f u n c t i o n ( n , i ) { i f ( $ ( n ) . a t t r ( ' r e l ' ) . i n d e x O f ( t h e R e l ) ! = - 1 ) r e t u r n ( $ ( n ) . f i n d ( ' i m g ' ) . a t t r ( ' a l t ' ) ) ? $ ( n ) . f i n d ( ' i m g ' ) . a t t r ( ' a l t ' ) : " " ; } ) : $ . m a k e A r r a y ( $ ( t h i s ) . f i n d ( ' i m g ' ) . a t t r ( ' a l t ' ) ) ; p p _ d e s c r i p t i o n s = ( i s S e t ) ? j Q u e r y . m a p ( m a t c h e d O b j e c t s , f u n c t i o n ( n , i ) { i f ( $ ( n ) . a t t r ( ' r e l ' ) . i n d e x O f ( t h e R e l ) ! = - 1 ) r e t u r n ( $ ( n ) . a t t r ( ' t i t l e ' ) ) ? $ ( n ) . a t t r ( ' t i t l e ' ) : " " ; } ) : $ . m a k e A r r a y ( $ ( t h i s ) . a t t r ( ' t i t l e ' ) ) ; i f ( p p _ i m a g e s . l e n g t h > 3 0 ) s e t t i n g s . o v e r l a y _ g a l l e r y = f a l s e ; s e t _ p o s i t i o n = j Q u e r y . i n A r r a y ( $ ( t h i s ) . a t t r ( ' h r e f ' ) , p p _ i m a g e s ) ; r e l _ i n d e x = ( i s S e t ) ? s e t _ p o s i t i o n : $ ( " a [ r e l ^ = ' " + t h e R e l + " ' ] " ) . i n d e x ( $ ( t h i s ) ) ; _ b u i l d _ o v e r l a y ( t h i s ) ; i f ( s e t t i n g s . a l l o w _ r e s i z e )  
 $ ( w i n d o w ) . b i n d ( ' s c r o l l . p r e t t y p h o t o ' , f u n c t i o n ( ) { _ c e n t e r _ o v e r l a y ( ) ; } ) ; $ . p r e t t y P h o t o . o p e n ( ) ; r e t u r n   f a l s e ; }  
 $ . p r e t t y P h o t o . o p e n = f u n c t i o n ( e v e n t ) { i f ( t y p e o f   s e t t i n g s = = " u n d e f i n e d " ) { s e t t i n g s = p p _ s e t t i n g s ; i f ( $ . b r o w s e r . m s i e & & $ . b r o w s e r . v e r s i o n = = 6 ) s e t t i n g s . t h e m e = " l i g h t _ s q u a r e " ; p p _ i m a g e s = $ . m a k e A r r a y ( a r g u m e n t s [ 0 ] ) ; p p _ t i t l e s = ( a r g u m e n t s [ 1 ] ) ? $ . m a k e A r r a y ( a r g u m e n t s [ 1 ] ) : $ . m a k e A r r a y ( " " ) ; p p _ d e s c r i p t i o n s = ( a r g u m e n t s [ 2 ] ) ? $ . m a k e A r r a y ( a r g u m e n t s [ 2 ] ) : $ . m a k e A r r a y ( " " ) ; i s S e t = ( p p _ i m a g e s . l e n g t h > 1 ) ? t r u e : f a l s e ; s e t _ p o s i t i o n = 0 ; _ b u i l d _ o v e r l a y ( e v e n t . t a r g e t ) ; }  
 i f ( $ . b r o w s e r . m s i e & & $ . b r o w s e r . v e r s i o n = = 6 ) $ ( ' s e l e c t ' ) . c s s ( ' v i s i b i l i t y ' , ' h i d d e n ' ) ; i f ( s e t t i n g s . h i d e f l a s h ) $ ( ' o b j e c t , e m b e d , i f r a m e [ s r c * = y o u t u b e ] , i f r a m e [ s r c * = v i m e o ] ' ) . c s s ( ' v i s i b i l i t y ' , ' h i d d e n ' ) ; _ c h e c k P o s i t i o n ( $ ( p p _ i m a g e s ) . s i z e ( ) ) ; $ ( ' . p p _ l o a d e r I c o n ' ) . s h o w ( ) ; i f ( s e t t i n g s . d e e p l i n k i n g )  
 s e t H a s h t a g ( ) ; i f ( s e t t i n g s . s o c i a l _ t o o l s ) { f a c e b o o k _ l i k e _ l i n k = s e t t i n g s . s o c i a l _ t o o l s . r e p l a c e ( ' { l o c a t i o n _ h r e f } ' , e n c o d e U R I C o m p o n e n t ( l o c a t i o n . h r e f ) ) ; $ p p _ p i c _ h o l d e r . f i n d ( ' . p p _ s o c i a l ' ) . h t m l ( f a c e b o o k _ l i k e _ l i n k ) ; }  
 i f ( $ p p t . i s ( ' : h i d d e n ' ) ) $ p p t . c s s ( ' o p a c i t y ' , 0 ) . s h o w ( ) ; $ p p _ o v e r l a y . s h o w ( ) . f a d e T o ( s e t t i n g s . a n i m a t i o n _ s p e e d , s e t t i n g s . o p a c i t y ) ; $ p p _ p i c _ h o l d e r . f i n d ( ' . c u r r e n t T e x t H o l d e r ' ) . t e x t ( ( s e t _ p o s i t i o n + 1 ) + s e t t i n g s . c o u n t e r _ s e p a r a t o r _ l a b e l + $ ( p p _ i m a g e s ) . s i z e ( ) ) ; i f ( p p _ d e s c r i p t i o n s [ s e t _ p o s i t i o n ] ! = " " ) { $ p p _ p i c _ h o l d e r . f i n d ( ' . p p _ d e s c r i p t i o n ' ) . s h o w ( ) . h t m l ( u n e s c a p e ( p p _ d e s c r i p t i o n s [ s e t _ p o s i t i o n ] ) ) ; } e l s e { $ p p _ p i c _ h o l d e r . f i n d ( ' . p p _ d e s c r i p t i o n ' ) . h i d e ( ) ; }  
 m o v i e _ w i d t h = ( p a r s e F l o a t ( g e t P a r a m ( ' w i d t h ' , p p _ i m a g e s [ s e t _ p o s i t i o n ] ) ) ) ? g e t P a r a m ( ' w i d t h ' , p p _ i m a g e s [ s e t _ p o s i t i o n ] ) : s e t t i n g s . d e f a u l t _ w i d t h . t o S t r i n g ( ) ; m o v i e _ h e i g h t = ( p a r s e F l o a t ( g e t P a r a m ( ' h e i g h t ' , p p _ i m a g e s [ s e t _ p o s i t i o n ] ) ) ) ? g e t P a r a m ( ' h e i g h t ' , p p _ i m a g e s [ s e t _ p o s i t i o n ] ) : s e t t i n g s . d e f a u l t _ h e i g h t . t o S t r i n g ( ) ; p e r c e n t B a s e d = f a l s e ; i f ( m o v i e _ h e i g h t . i n d e x O f ( ' % ' ) ! = - 1 ) { m o v i e _ h e i g h t = p a r s e F l o a t ( ( $ ( w i n d o w ) . h e i g h t ( ) * p a r s e F l o a t ( m o v i e _ h e i g h t ) / 1 0 0 ) - 1 5 0 ) ; p e r c e n t B a s e d = t r u e ; }  
 i f ( m o v i e _ w i d t h . i n d e x O f ( ' % ' ) ! = - 1 ) { m o v i e _ w i d t h = p a r s e F l o a t ( ( $ ( w i n d o w ) . w i d t h ( ) * p a r s e F l o a t ( m o v i e _ w i d t h ) / 1 0 0 ) - 1 5 0 ) ; p e r c e n t B a s e d = t r u e ; }  
 $ p p _ p i c _ h o l d e r . f a d e I n ( f u n c t i o n ( ) { ( s e t t i n g s . s h o w _ t i t l e & & p p _ t i t l e s [ s e t _ p o s i t i o n ] ! = " " & & t y p e o f   p p _ t i t l e s [ s e t _ p o s i t i o n ] ! = " u n d e f i n e d " ) ? $ p p t . h t m l ( u n e s c a p e ( p p _ t i t l e s [ s e t _ p o s i t i o n ] ) ) : $ p p t . h t m l ( ' & n b s p ; ' ) ; i m g P r e l o a d e r = " " ; s k i p I n j e c t i o n = f a l s e ; s w i t c h ( _ g e t F i l e T y p e ( p p _ i m a g e s [ s e t _ p o s i t i o n ] ) ) { c a s e ' i m a g e ' : i m g P r e l o a d e r = n e w   I m a g e ( ) ; n e x t I m a g e = n e w   I m a g e ( ) ; i f ( i s S e t & & s e t _ p o s i t i o n < $ ( p p _ i m a g e s ) . s i z e ( ) - 1 ) n e x t I m a g e . s r c = p p _ i m a g e s [ s e t _ p o s i t i o n + 1 ] ; p r e v I m a g e = n e w   I m a g e ( ) ; i f ( i s S e t & & p p _ i m a g e s [ s e t _ p o s i t i o n - 1 ] ) p r e v I m a g e . s r c = p p _ i m a g e s [ s e t _ p o s i t i o n - 1 ] ; $ p p _ p i c _ h o l d e r . f i n d ( ' # p p _ f u l l _ r e s ' ) [ 0 ] . i n n e r H T M L = s e t t i n g s . i m a g e _ m a r k u p . r e p l a c e ( / { p a t h } / g , p p _ i m a g e s [ s e t _ p o s i t i o n ] ) ; 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 ( ) { p p _ d i m e n s i o n s = _ f i t T o V i e w p o r t ( i m g P r e l o a d e r . w i d t h , i m g P r e l o a d e r . h e i g h t ) ; _ s h o w C o n t e n t ( ) ; } ; i m g P r e l o a d e r . o n e r r o r = f u n c t i o n ( ) { a l e r t ( ' I m a g e   c a n n o t   b e   l o a d e d .   M a k e   s u r e   t h e   p a t h   i s   c o r r e c t   a n d   i m a g e   e x i s t . ' ) ; $ . p r e t t y P h o t o . c l o s e ( ) ; } ; i m g P r e l o a d e r . s r c = p p _ i m a g e s [ s e t _ p o s i t i o n ] ; b r e a k ; c a s e ' y o u t u b e ' : p p _ d i m e n s i o n s = _ f i t T o V i e w p o r t ( m o v i e _ w i d t h , m o v i e _ h e i g h t ) ; m o v i e _ i d = g e t P a r a m ( ' v ' , p p _ i m a g e s [ s e t _ p o s i t i o n ] ) ; i f ( m o v i e _ i d = = " " ) { m o v i e _ i d = p p _ i m a g e s [ s e t _ p o s i t i o n ] . s p l i t ( ' y o u t u . b e / ' ) ; m o v i e _ i d = m o v i e _ i d [ 1 ] ; i f ( m o v i e _ i d . i n d e x O f ( ' ? ' ) > 0 )  
 m o v i e _ i d = m o v i e _ i d . s u b s t r ( 0 , m o v i e _ i d . i n d e x O f ( ' ? ' ) ) ; i f ( m o v i e _ i d . i n d e x O f ( ' & ' ) > 0 )  
 m o v i e _ i d = m o v i e _ i d . s u b s t r ( 0 , m o v i e _ i d . i n d e x O f ( ' & ' ) ) ; }  
 m o v i e = ' h t t p : / / w w w . y o u t u b e . c o m / e m b e d / ' + m o v i e _ i d ; ( g e t P a r a m ( ' r e l ' , p p _ i m a g e s [ s e t _ p o s i t i o n ] ) ) ? m o v i e + = " ? r e l = " + g e t P a r a m ( ' r e l ' , p p _ i m a g e s [ s e t _ p o s i t i o n ] ) : m o v i e + = " ? r e l = 1 " ; i f ( s e t t i n g s . a u t o p l a y ) m o v i e + = " & a u t o p l a y = 1 " ; t o I n j e c t = s e t t i n g s . i f r a m e _ m a r k u p . r e p l a c e ( / { w i d t h } / g , p p _ d i m e n s i o n s [ ' w i d t h ' ] ) . r e p l a c e ( / { h e i g h t } / g , p p _ d i m e n s i o n s [ ' h e i g h t ' ] ) . r e p l a c e ( / { w m o d e } / g , s e t t i n g s . w m o d e ) . r e p l a c e ( / { p a t h } / g , m o v i e ) ; b r e a k ; c a s e ' v i m e o ' : p p _ d i m e n s i o n s = _ f i t T o V i e w p o r t ( m o v i e _ w i d t h , m o v i e _ h e i g h t ) ; m o v i e _ i d = p p _ i m a g e s [ s e t _ p o s i t i o n ] ; v a r   r e g E x p = / h t t p : \ / \ / ( w w w \ . ) ? v i m e o . c o m \ / ( \ d + ) / ; v a r   m a t c h = m o v i e _ i d . m a t c h ( r e g E x p ) ; m o v i e = ' h t t p : / / p l a y e r . v i m e o . c o m / v i d e o / ' + m a t c h [ 2 ] + ' ? t i t l e = 0 & a m p ; b y l i n e = 0 & a m p ; p o r t r a i t = 0 ' ; i f ( s e t t i n g s . a u t o p l a y ) m o v i e + = " & a u t o p l a y = 1 ; " ; v i m e o _ w i d t h = p p _ d i m e n s i o n s [ ' w i d t h ' ] + ' / e m b e d / ? m o o g _ w i d t h = ' + p p _ d i m e n s i o n s [ ' w i d t h ' ] ; t o I n j e c t = s e t t i n g s . i f r a m e _ m a r k u p . r e p l a c e ( / { w i d t h } / g , v i m e o _ w i d t h ) . r e p l a c e ( / { h e i g h t } / g , p p _ d i m e n s i o n s [ ' h e i g h t ' ] ) . r e p l a c e ( / { p a t h } / g , m o v i e ) ; b r e a k ; c a s e ' q u i c k t i m e ' : p p _ d i m e n s i o n s = _ f i t T o V i e w p o r t ( m o v i e _ w i d t h , m o v i e _ h e i g h t ) ; p p _ d i m e n s i o n s [ ' h e i g h t ' ] + = 1 5 ; p p _ d i m e n s i o n s [ ' c o n t e n t H e i g h t ' ] + = 1 5 ; p p _ d i m e n s i o n s [ ' c o n t a i n e r H e i g h t ' ] + = 1 5 ; t o I n j e c t = s e t t i n g s . q u i c k t i m e _ m a r k u p . r e p l a c e ( / { w i d t h } / g , p p _ d i m e n s i o n s [ ' w i d t h ' ] ) . r e p l a c e ( / { h e i g h t } / g , p p _ d i m e n s i o n s [ ' h e i g h t ' ] ) . r e p l a c e ( / { w m o d e } / g , s e t t i n g s . w m o d e ) . r e p l a c e ( / { p a t h } / g , p p _ i m a g e s [ s e t _ p o s i t i o n ] ) . r e p l a c e ( / { a u t o p l a y } / g , s e t t i n g s . a u t o p l a y ) ; b r e a k ; c a s e ' f l a s h ' : p p _ d i m e n s i o n s = _ f i t T o V i e w p o r t ( m o v i e _ w i d t h , m o v i e _ h e i g h t ) ; f l a s h _ v a r s = p p _ i m a g e s [ s e t _ p o s i t i o n ] ; f l a s h _ v a r s = f l a s h _ v a r s . s u b s t r i n g ( p p _ i m a g e s [ s e t _ p o s i t i o n ] . i n d e x O f ( ' f l a s h v a r s ' ) + 1 0 , p p _ i m a g e s [ s e t _ p o s i t i o n ] . l e n g t h ) ; f i l e n a m e = p p _ i m a g e s [ s e t _ p o s i t i o n ] ; f i l e n a m e = f i l e n a m e . s u b s t r i n g ( 0 , f i l e n a m e . i n d e x O f ( ' ? ' ) ) ; t o I n j e c t = s e t t i n g s . f l a s h _ m a r k u p . r e p l a c e ( / { w i d t h } / g , p p _ d i m e n s i o n s [ ' w i d t h ' ] ) . r e p l a c e ( / { h e i g h t } / g , p p _ d i m e n s i o n s [ ' h e i g h t ' ] ) . r e p l a c e ( / { w m o d e } / g , s e t t i n g s . w m o d e ) . r e p l a c e ( / { p a t h } / g , f i l e n a m e + ' ? ' + f l a s h _ v a r s ) ; b r e a k ; c a s e ' i f r a m e ' : p p _ d i m e n s i o n s = _ f i t T o V i e w p o r t ( m o v i e _ w i d t h , m o v i e _ h e i g h t ) ; f r a m e _ u r l = p p _ i m a g e s [ s e t _ p o s i t i o n ] ; f r a m e _ u r l = f r a m e _ u r l . s u b s t r ( 0 , f r a m e _ u r l . i n d e x O f ( ' i f r a m e ' ) - 1 ) ; t o I n j e c t = s e t t i n g s . i f r a m e _ m a r k u p . r e p l a c e ( / { w i d t h } / g , p p _ d i m e n s i o n s [ ' w i d t h ' ] ) . r e p l a c e ( / { h e i g h t } / g , p p _ d i m e n s i o n s [ ' h e i g h t ' ] ) . r e p l a c e ( / { p a t h } / g , f r a m e _ u r l ) ; b r e a k ; c a s e ' a j a x ' : d o r e s i z e = f a l s e ; p p _ d i m e n s i o n s = _ f i t T o V i e w p o r t ( m o v i e _ w i d t h , m o v i e _ h e i g h t ) ; d o r e s i z e = t r u e ; s k i p I n j e c t i o n = t r u e ; $ . g e t ( p p _ i m a g e s [ s e t _ p o s i t i o n ] , f u n c t i o n ( r e s p o n s e H T M L ) { t o I n j e c t = s e t t i n g s . i n l i n e _ m a r k u p . r e p l a c e ( / { c o n t e n t } / g , r e s p o n s e H T M L ) ; $ p p _ p i c _ h o l d e r . f i n d ( ' # p p _ f u l l _ r e s ' ) [ 0 ] . i n n e r H T M L = t o I n j e c t ; _ s h o w C o n t e n t ( ) ; } ) ; b r e a k ; c a s e ' c u s t o m ' : p p _ d i m e n s i o n s = _ f i t T o V i e w p o r t ( m o v i e _ w i d t h , m o v i e _ h e i g h t ) ; t o I n j e c t = s e t t i n g s . c u s t o m _ m a r k u p ; b r e a k ; c a s e ' i n l i n e ' : m y C l o n e = $ ( p p _ i m a g e s [ s e t _ p o s i t i o n ] ) . c l o n e ( ) . a p p e n d ( ' < b r   c l e a r = " a l l "   / > ' ) . c s s ( { ' w i d t h ' : s e t t i n g s . d e f a u l t _ w i d t h } ) . w r a p I n n e r ( ' < d i v   i d = " p p _ f u l l _ r e s " > < d i v   c l a s s = " p p _ i n l i n e " > < / d i v > < / d i v > ' ) . a p p e n d T o ( $ ( ' b o d y ' ) ) . s h o w ( ) ; d o r e s i z e = f a l s e ; p p _ d i m e n s i o n s = _ f i t T o V i e w p o r t ( $ ( m y C l o n e ) . w i d t h ( ) , $ ( m y C l o n e ) . h e i g h t ( ) ) ; d o r e s i z e = t r u e ; $ ( m y C l o n e ) . r e m o v e ( ) ; t o I n j e c t = s e t t i n g s . i n l i n e _ m a r k u p . r e p l a c e ( / { c o n t e n t } / g , $ ( p p _ i m a g e s [ s e t _ p o s i t i o n ] ) . h t m l ( ) ) ; b r e a k ; } ; i f ( ! i m g P r e l o a d e r & & ! s k i p I n j e c t i o n ) { $ p p _ p i c _ h o l d e r . f i n d ( ' # p p _ f u l l _ r e s ' ) [ 0 ] . i n n e r H T M L = t o I n j e c t ; _ s h o w C o n t e n t ( ) ; } ; } ) ; r e t u r n   f a l s e ; } ; $ . p r e t t y P h o t o . c h a n g e P a g e = f u n c t i o n ( d i r e c t i o n ) { c u r r e n t G a l l e r y P a g e = 0 ; i f ( d i r e c t i o n = = ' p r e v i o u s ' ) { s e t _ p o s i t i o n - - ; i f ( s e t _ p o s i t i o n < 0 ) s e t _ p o s i t i o n = $ ( p p _ i m a g e s ) . s i z e ( ) - 1 ; } e l s e   i f ( d i r e c t i o n = = ' n e x t ' ) { s e t _ p o s i t i o n + + ; i f ( s e t _ p o s i t i o n > $ ( p p _ i m a g e s ) . s i z e ( ) - 1 ) s e t _ p o s i t i o n = 0 ; } e l s e { s e t _ p o s i t i o n = d i r e c t i o n ; } ; r e l _ i n d e x = s e t _ p o s i t i o n ; i f ( ! d o r e s i z e ) d o r e s i z e = t r u e ; $ ( ' . p p _ c o n t r a c t ' ) . r e m o v e C l a s s ( ' p p _ c o n t r a c t ' ) . a d d C l a s s ( ' p p _ e x p a n d ' ) ; _ h i d e C o n t e n t ( f u n c t i o n ( ) { $ . p r e t t y P h o t o . o p e n ( ) ; } ) ; } ; $ . p r e t t y P h o t o . c h a n g e G a l l e r y P a g e = f u n c t i o n ( d i r e c t i o n ) { i f ( d i r e c t i o n = = ' n e x t ' ) { c u r r e n t G a l l e r y P a g e + + ; i f ( c u r r e n t G a l l e r y P a g e > t o t a l P a g e ) c u r r e n t G a l l e r y P a g e = 0 ; } e l s e   i f ( d i r e c t i o n = = ' p r e v i o u s ' ) { c u r r e n t G a l l e r y P a g e - - ; i f ( c u r r e n t G a l l e r y P a g e < 0 ) c u r r e n t G a l l e r y P a g e = t o t a l P a g e ; } e l s e { c u r r e n t G a l l e r y P a g e = d i r e c t i o n ; } ; s l i d e _ s p e e d = ( d i r e c t i o n = = ' n e x t ' | | d i r e c t i o n = = ' p r e v i o u s ' ) ? s e t t i n g s . a n i m a t i o n _ s p e e d : 0 ; s l i d e _ t o = c u r r e n t G a l l e r y P a g e * ( i t e m s P e r P a g e * i t e m W i d t h ) ; $ p p _ g a l l e r y . f i n d ( ' u l ' ) . a n i m a t e ( { l e f t : - s l i d e _ t o } , s l i d e _ s p e e d ) ; } ; $ . p r e t t y P h o t o . s t a r t S l i d e s h o w = f u n c t i o n ( ) { i f ( t y p e o f   p p _ s l i d e s h o w = = ' u n d e f i n e d ' ) { $ p p _ p i c _ h o l d e r . f i n d ( ' . p p _ p l a y ' ) . u n b i n d ( ' c l i c k ' ) . r e m o v e C l a s s ( ' p p _ p l a y ' ) . a d d C l a s s ( ' p p _ p a u s e ' ) . c l i c k ( f u n c t i o n ( ) { $ . p r e t t y P h o t o . s t o p S l i d e s h o w ( ) ; r e t u r n   f a l s e ; } ) ; p p _ s l i d e s h o w = s e t I n t e r v a l ( $ . p r e t t y P h o t o . s t a r t S l i d e s h o w , s e t t i n g s . s l i d e s h o w ) ; } e l s e { $ . p r e t t y P h o t o . c h a n g e P a g e ( ' n e x t ' ) ; } ; }  
 $ . p r e t t y P h o t o . s t o p S l i d e s h o w = f u n c t i o n ( ) { $ p p _ p i c _ h o l d e r . f i n d ( ' . p p _ p a u s e ' ) . u n b i n d ( ' c l i c k ' ) . r e m o v e C l a s s ( ' p p _ p a u s e ' ) . a d d C l a s s ( ' p p _ p l a y ' ) . c l i c k ( f u n c t i o n ( ) { $ . p r e t t y P h o t o . s t a r t S l i d e s h o w ( ) ; r e t u r n   f a l s e ; } ) ; c l e a r I n t e r v a l ( p p _ s l i d e s h o w ) ; p p _ s l i d e s h o w = u n d e f i n e d ; }  
 $ . p r e t t y P h o t o . c l o s e = f u n c t i o n ( ) { i f ( $ p p _ o v e r l a y . i s ( " : a n i m a t e d " ) ) r e t u r n ; $ . p r e t t y P h o t o . s t o p S l i d e s h o w ( ) ; $ p p _ p i c _ h o l d e r . s t o p ( ) . f i n d ( ' o b j e c t , e m b e d ' ) . c s s ( ' v i s i b i l i t y ' , ' h i d d e n ' ) ; $ ( ' d i v . p p _ p i c _ h o l d e r , d i v . p p t , . p p _ f a d e ' ) . f a d e O u t ( s e t t i n g s . a n i m a t i o n _ s p e e d , f u n c t i o n ( ) { $ ( t h i s ) . r e m o v e ( ) ; } ) ; $ p p _ o v e r l a y . f a d e O u t ( s e t t i n g s . a n i m a t i o n _ s p e e d , f u n c t i o n ( ) { i f ( $ . b r o w s e r . m s i e & & $ . b r o w s e r . v e r s i o n = = 6 ) $ ( ' s e l e c t ' ) . c s s ( ' v i s i b i l i t y ' , ' v i s i b l e ' ) ; i f ( s e t t i n g s . h i d e f l a s h ) $ ( ' o b j e c t , e m b e d , i f r a m e [ s r c * = y o u t u b e ] , i f r a m e [ s r c * = v i m e o ] ' ) . c s s ( ' v i s i b i l i t y ' , ' v i s i b l e ' ) ; $ ( t h i s ) . r e m o v e ( ) ; $ ( w i n d o w ) . u n b i n d ( ' s c r o l l . p r e t t y p h o t o ' ) ; c l e a r H a s h t a g ( ) ; s e t t i n g s . c a l l b a c k ( ) ; d o r e s i z e = t r u e ; p p _ o p e n = f a l s e ; d e l e t e   s e t t i n g s ; } ) ; } ; f u n c t i o n   _ s h o w C o n t e n t ( ) { $ ( ' . p p _ l o a d e r I c o n ' ) . h i d e ( ) ; p r o j e c t e d T o p = s c r o l l _ p o s [ ' s c r o l l T o p ' ] + ( ( w i n d o w H e i g h t / 2 ) - ( p p _ d i m e n s i o n s [ ' c o n t a i n e r H e i g h t ' ] / 2 ) ) ; i f ( p r o j e c t e d T o p < 0 ) p r o j e c t e d T o p = 0 ; $ p p t . f a d e T o ( s e t t i n g s . a n i m a t i o n _ s p e e d , 1 ) ; $ p p _ p i c _ h o l d e r . f i n d ( ' . p p _ c o n t e n t ' ) . a n i m a t e ( { h e i g h t : p p _ d i m e n s i o n s [ ' c o n t e n t H e i g h t ' ] , w i d t h : p p _ d i m e n s i o n s [ ' c o n t e n t W i d t h ' ] } , s e t t i n g s . a n i m a t i o n _ s p e e d ) ; $ p p _ p i c _ h o l d e r . a n i m a t e ( { ' t o p ' : p r o j e c t e d T o p , ' l e f t ' : ( w i n d o w W i d t h / 2 ) - ( p p _ d i m e n s i o n s [ ' c o n t a i n e r W i d t h ' ] / 2 ) , w i d t h : p p _ d i m e n s i o n s [ ' c o n t a i n e r W i d t h ' ] } , s e t t i n g s . a n i m a t i o n _ s p e e d , f u n c t i o n ( ) { $ p p _ p i c _ h o l d e r . f i n d ( ' . p p _ h o v e r C o n t a i n e r , # f u l l R e s I m a g e ' ) . h e i g h t ( p p _ d i m e n s i o n s [ ' h e i g h t ' ] ) . w i d t h ( p p _ d i m e n s i o n s [ ' w i d t h ' ] ) ; $ p p _ p i c _ h o l d e r . f i n d ( ' . p p _ f a d e ' ) . f a d e I n ( s e t t i n g s . a n i m a t i o n _ s p e e d ) ; i f ( i s S e t & & _ g e t F i l e T y p e ( p p _ i m a g e s [ s e t _ p o s i t i o n ] ) = = " i m a g e " ) { $ p p _ p i c _ h o l d e r . f i n d ( ' . p p _ h o v e r C o n t a i n e r ' ) . s h o w ( ) ; } e l s e { $ p p _ p i c _ h o l d e r . f i n d ( ' . p p _ h o v e r C o n t a i n e r ' ) . h i d e ( ) ; }  
 i f ( p p _ d i m e n s i o n s [ ' r e s i z e d ' ] ) { $ ( ' a . p p _ e x p a n d , a . p p _ c o n t r a c t ' ) . s h o w ( ) ; } e l s e { $ ( ' a . p p _ e x p a n d ' ) . h i d e ( ) ; }  
 i f ( s e t t i n g s . a u t o p l a y _ s l i d e s h o w & & ! p p _ s l i d e s h o w & & ! p p _ o p e n ) $ . p r e t t y P h o t o . s t a r t S l i d e s h o w ( ) ; s e t t i n g s . c h a n g e p i c t u r e c a l l b a c k ( ) ; p p _ o p e n = t r u e ; } ) ; _ i n s e r t _ g a l l e r y ( ) ; } ; f u n c t i o n   _ h i d e C o n t e n t ( c a l l b a c k ) { $ p p _ p i c _ h o l d e r . f i n d ( ' # p p _ f u l l _ r e s   o b j e c t , # p p _ f u l l _ r e s   e m b e d ' ) . c s s ( ' v i s i b i l i t y ' , ' h i d d e n ' ) ; $ p p _ p i c _ h o l d e r . f i n d ( ' . p p _ f a d e ' ) . f a d e O u t ( s e t t i n g s . a n i m a t i o n _ s p e e d , f u n c t i o n ( ) { $ ( ' . p p _ l o a d e r I c o n ' ) . s h o w ( ) ; c a l l b a c k ( ) ; } ) ; } ; f u n c t i o n   _ c h e c k P o s i t i o n ( s e t C o u n t ) { ( s e t C o u n t > 1 ) ? $ ( ' . p p _ n a v ' ) . s h o w ( ) : $ ( ' . p p _ n a v ' ) . h i d e ( ) ; } ; f u n c t i o n   _ f i t T o V i e w p o r t ( w i d t h , h e i g h t ) { r e s i z e d = f a l s e ; _ g e t D i m e n s i o n s ( w i d t h , h e i g h t ) ; i m a g e W i d t h = w i d t h , i m a g e H e i g h t = h e i g h t ; i f ( ( ( p p _ c o n t a i n e r W i d t h > w i n d o w W i d t h ) | | ( p p _ c o n t a i n e r H e i g h t > w i n d o w H e i g h t ) ) & & d o r e s i z e & & s e t t i n g s . a l l o w _ r e s i z e & & ! p e r c e n t B a s e d ) { r e s i z e d = t r u e , f i t t i n g = f a l s e ; w h i l e ( ! f i t t i n g ) { i f ( ( p p _ c o n t a i n e r W i d t h > w i n d o w W i d t h ) ) { i m a g e W i d t h = ( w i n d o w W i d t h - 2 0 0 ) ; i m a g e H e i g h t = ( h e i g h t / w i d t h ) * i m a g e W i d t h ; } e l s e   i f ( ( p p _ c o n t a i n e r H e i g h t > w i n d o w H e i g h t ) ) { i m a g e H e i g h t = ( w i n d o w H e i g h t - 2 0 0 ) ; i m a g e W i d t h = ( w i d t h / h e i g h t ) * i m a g e H e i g h t ; } e l s e { f i t t i n g = t r u e ; } ; p p _ c o n t a i n e r H e i g h t = i m a g e H e i g h t , p p _ c o n t a i n e r W i d t h = i m a g e W i d t h ; } ; _ g e t D i m e n s i o n s ( i m a g e W i d t h , i m a g e H e i g h t ) ; i f ( ( p p _ c o n t a i n e r W i d t h > w i n d o w W i d t h ) | | ( p p _ c o n t a i n e r H e i g h t > w i n d o w H e i g h t ) ) { _ f i t T o V i e w p o r t ( p p _ c o n t a i n e r W i d t h , p p _ c o n t a i n e r H e i g h t ) } ; } ; r e t u r n { w i d t h : M a t h . f l o o r ( i m a g e W i d t h ) , h e i g h t : M a t h . f l o o r ( i m a g e H e i g h t ) , c o n t a i n e r H e i g h t : M a t h . f l o o r ( p p _ c o n t a i n e r H e i g h t ) , c o n t a i n e r W i d t h : M a t h . f l o o r ( p p _ c o n t a i n e r W i d t h ) + ( s e t t i n g s . h o r i z o n t a l _ p a d d i n g * 2 ) , c o n t e n t H e i g h t : M a t h . f l o o r ( p p _ c o n t e n t H e i g h t ) , c o n t e n t W i d t h : M a t h . f l o o r ( p p _ c o n t e n t W i d t h ) , r e s i z e d : r e s i z e d } ; } ; f u n c t i o n   _ g e t D i m e n s i o n s ( w i d t h , h e i g h t ) { w i d t h = p a r s e F l o a t ( w i d t h ) ; h e i g h t = p a r s e F l o a t ( h e i g h t ) ; $ p p _ d e t a i l s = $ p p _ p i c _ h o l d e r . f i n d ( ' . p p _ d e t a i l s ' ) ; $ p p _ d e t a i l s . w i d t h ( w i d t h ) ; d e t a i l s H e i g h t = p a r s e F l o a t ( $ p p _ d e t a i l s . c s s ( ' m a r g i n T o p ' ) ) + p a r s e F l o a t ( $ p p _ d e t a i l s . c s s ( ' m a r g i n B o t t o m ' ) ) ; $ p p _ d e t a i l s = $ p p _ d e t a i l s . c l o n e ( ) . a d d C l a s s ( s e t t i n g s . t h e m e ) . w i d t h ( w i d t h ) . a p p e n d T o ( $ ( ' b o d y ' ) ) . c s s ( { ' p o s i t i o n ' : ' a b s o l u t e ' , ' t o p ' : - 1 0 0 0 0 } ) ; d e t a i l s H e i g h t + = $ p p _ d e t a i l s . h e i g h t ( ) ; d e t a i l s H e i g h t = ( d e t a i l s H e i g h t < = 3 4 ) ? 3 6 : d e t a i l s H e i g h t ; i f ( $ . b r o w s e r . m s i e & & $ . b r o w s e r . v e r s i o n = = 7 ) d e t a i l s H e i g h t + = 8 ; $ p p _ d e t a i l s . r e m o v e ( ) ; $ p p _ t i t l e = $ p p _ p i c _ h o l d e r . f i n d ( ' . p p t ' ) ; $ p p _ t i t l e . w i d t h ( w i d t h ) ; t i t l e H e i g h t = p a r s e F l o a t ( $ p p _ t i t l e . c s s ( ' m a r g i n T o p ' ) ) + p a r s e F l o a t ( $ p p _ t i t l e . c s s ( ' m a r g i n B o t t o m ' ) ) ; $ p p _ t i t l e = $ p p _ t i t l e . c l o n e ( ) . a p p e n d T o ( $ ( ' b o d y ' ) ) . c s s ( { ' p o s i t i o n ' : ' a b s o l u t e ' , ' t o p ' : - 1 0 0 0 0 } ) ; t i t l e H e i g h t + = $ p p _ t i t l e . h e i g h t ( ) ; $ p p _ t i t l e . r e m o v e ( ) ; p p _ c o n t e n t H e i g h t = h e i g h t + d e t a i l s H e i g h t ; p p _ c o n t e n t W i d t h = w i d t h ; p p _ c o n t a i n e r H e i g h t = p p _ c o n t e n t H e i g h t + t i t l e H e i g h t + $ p p _ p i c _ h o l d e r . f i n d ( ' . p p _ t o p ' ) . h e i g h t ( ) + $ p p _ p i c _ h o l d e r . f i n d ( ' . p p _ b o t t o m ' ) . h e i g h t ( ) ; p p _ c o n t a i n e r W i d t h = w i d t h ; }  
 f u n c t i o n   _ g e t F i l e T y p e ( i t e m S r c ) { i f ( i t e m S r c . m a t c h ( / y o u t u b e \ . c o m \ / w a t c h / i ) | | i t e m S r c . m a t c h ( / y o u t u \ . b e / i ) ) { r e t u r n ' y o u t u b e ' ; } e l s e   i f ( i t e m S r c . m a t c h ( / v i m e o \ . c o m / i ) ) { r e t u r n ' v i m e o ' ; } e l s e   i f ( i t e m S r c . m a t c h ( / \ b . m o v \ b / i ) ) { r e t u r n ' q u i c k t i m e ' ; } e l s e   i f ( i t e m S r c . m a t c h ( / \ b . s w f \ b / i ) ) { r e t u r n ' f l a s h ' ; } e l s e   i f ( i t e m S r c . m a t c h ( / \ b i f r a m e = t r u e \ b / i ) ) { r e t u r n ' i f r a m e ' ; } e l s e   i f ( i t e m S r c . m a t c h ( / \ b a j a x = t r u e \ b / i ) ) { r e t u r n ' a j a x ' ; } e l s e   i f ( i t e m S r c . m a t c h ( / \ b c u s t o m = t r u e \ b / i ) ) { r e t u r n ' c u s t o m ' ; } e l s e   i f ( i t e m S r c . s u b s t r ( 0 , 1 ) = = ' # ' ) { r e t u r n ' i n l i n e ' ; } e l s e { r e t u r n ' i m a g e ' ; } ; } ; f u n c t i o n   _ c e n t e r _ o v e r l a y ( ) { i f ( d o r e s i z e & & t y p e o f   $ p p _ p i c _ h o l d e r ! = ' u n d e f i n e d ' ) { s c r o l l _ p o s = _ g e t _ s c r o l l ( ) ; c o n t e n t H e i g h t = $ p p _ p i c _ h o l d e r . h e i g h t ( ) , c o n t e n t w i d t h = $ p p _ p i c _ h o l d e r . w i d t h ( ) ; p r o j e c t e d T o p = ( w i n d o w H e i g h t / 2 ) + s c r o l l _ p o s [ ' s c r o l l T o p ' ] - ( c o n t e n t H e i g h t / 2 ) ; i f ( p r o j e c t e d T o p < 0 ) p r o j e c t e d T o p = 0 ; i f ( c o n t e n t H e i g h t > w i n d o w H e i g h t )  
 r e t u r n ; $ p p _ p i c _ h o l d e r . c s s ( { ' t o p ' : p r o j e c t e d T o p , ' l e f t ' : ( w i n d o w W i d t h / 2 ) + s c r o l l _ p o s [ ' s c r o l l L e f t ' ] - ( c o n t e n t w i d t h / 2 ) } ) ; } ; } ; f u n c t i o n   _ g e t _ s c r o l l ( ) { i f ( s e l f . p a g e Y O f f s e t ) { r e t u r n { s c r o l l T o p : s e l f . p a g e Y O f f s e t , s c r o l l L e f t : s e l f . p a g e X O f f s e t } ; } e l s e   i f ( d o c u m e n t . d o c u m e n t E l e m e n t & & d o c u m e n t . d o c u m e n t E l e m e n t . s c r o l l T o p ) { r e t u r n { s c r o l l T o p : d o c u m e n t . d o c u m e n t E l e m e n t . s c r o l l T o p , s c r o l l L e f t : d o c u m e n t . d o c u m e n t E l e m e n t . s c r o l l L e f t } ; } e l s e   i f ( d o c u m e n t . b o d y ) { r e t u r n { s c r o l l T o p : d o c u m e n t . b o d y . s c r o l l T o p , s c r o l l L e f t : d o c u m e n t . b o d y . s c r o l l L e f t } ; } ; } ; f u n c t i o n   _ r e s i z e _ o v e r l a y ( ) { w i n d o w H e i g h t = $ ( w i n d o w ) . h e i g h t ( ) , w i n d o w W i d t h = $ ( w i n d o w ) . w i d t h ( ) ; i f ( t y p e o f   $ p p _ o v e r l a y ! = " u n d e f i n e d " ) $ p p _ o v e r l a y . h e i g h t ( $ ( d o c u m e n t ) . h e i g h t ( ) ) . w i d t h ( w i n d o w W i d t h ) ; } ; f u n c t i o n   _ i n s e r t _ g a l l e r y ( ) { i f ( i s S e t & & s e t t i n g s . o v e r l a y _ g a l l e r y & & _ g e t F i l e T y p e ( p p _ i m a g e s [ s e t _ p o s i t i o n ] ) = = " i m a g e " & & ( s e t t i n g s . i e 6 _ f a l l b a c k & & ! ( $ . b r o w s e r . m s i e & & p a r s e I n t ( $ . b r o w s e r . v e r s i o n ) = = 6 ) ) ) { i t e m W i d t h = 5 2 + 5 ; n a v W i d t h = ( s e t t i n g s . t h e m e = = " f a c e b o o k " | | s e t t i n g s . t h e m e = = " p p _ d e f a u l t " ) ? 5 0 : 3 0 ; i t e m s P e r P a g e = M a t h . f l o o r ( ( p p _ d i m e n s i o n s [ ' c o n t a i n e r W i d t h ' ] - 1 0 0 - n a v W i d t h ) / i t e m W i d t h ) ; i t e m s P e r P a g e = ( i t e m s P e r P a g e < p p _ i m a g e s . l e n g t h ) ? i t e m s P e r P a g e : p p _ i m a g e s . l e n g t h ; t o t a l P a g e = M a t h . c e i l ( p p _ i m a g e s . l e n g t h / i t e m s P e r P a g e ) - 1 ; i f ( t o t a l P a g e = = 0 ) { n a v W i d t h = 0 ; $ p p _ g a l l e r y . f i n d ( ' . p p _ a r r o w _ n e x t , . p p _ a r r o w _ p r e v i o u s ' ) . h i d e ( ) ; } e l s e { $ p p _ g a l l e r y . f i n d ( ' . p p _ a r r o w _ n e x t , . p p _ a r r o w _ p r e v i o u s ' ) . s h o w ( ) ; } ; g a l l e r y W i d t h = i t e m s P e r P a g e * i t e m W i d t h ; f u l l G a l l e r y W i d t h = p p _ i m a g e s . l e n g t h * i t e m W i d t h ; $ p p _ g a l l e r y . c s s ( ' m a r g i n - l e f t ' , - ( ( g a l l e r y W i d t h / 2 ) + ( n a v W i d t h / 2 ) ) ) . f i n d ( ' d i v : f i r s t ' ) . w i d t h ( g a l l e r y W i d t h + 5 ) . f i n d ( ' u l ' ) . w i d t h ( f u l l G a l l e r y W i d t h ) . f i n d ( ' l i . s e l e c t e d ' ) . r e m o v e C l a s s ( ' s e l e c t e d ' ) ; g o T o P a g e = ( M a t h . f l o o r ( s e t _ p o s i t i o n / i t e m s P e r P a g e ) < t o t a l P a g e ) ? M a t h . f l o o r ( s e t _ p o s i t i o n / i t e m s P e r P a g e ) : t o t a l P a g e ; $ . p r e t t y P h o t o . c h a n g e G a l l e r y P a g e ( g o T o P a g e ) ; $ p p _ g a l l e r y _ l i . f i l t e r ( ' : e q ( ' + s e t _ p o s i t i o n + ' ) ' ) . a d d C l a s s ( ' s e l e c t e d ' ) ; } e l s e { $ p p _ p i c _ h o l d e r . f i n d ( ' . p p _ c o n t e n t ' ) . u n b i n d ( ' m o u s e e n t e r   m o u s e l e a v e ' ) ; } }  
 f u n c t i o n   _ b u i l d _ o v e r l a y ( c a l l e r ) { i f ( s e t t i n g s . s o c i a l _ t o o l s )  
 f a c e b o o k _ l i k e _ l i n k = s e t t i n g s . s o c i a l _ t o o l s . r e p l a c e ( ' { l o c a t i o n _ h r e f } ' , e n c o d e U R I C o m p o n e n t ( l o c a t i o n . h r e f ) ) ; s e t t i n g s . m a r k u p = s e t t i n g s . m a r k u p . r e p l a c e ( ' { p p _ s o c i a l } ' , ( s e t t i n g s . s o c i a l _ t o o l s ) ? f a c e b o o k _ l i k e _ l i n k : ' ' ) ; $ ( ' b o d y ' ) . a p p e n d ( s e t t i n g s . m a r k u p ) ; $ p p _ p i c _ h o l d e r = $ ( ' . p p _ p i c _ h o l d e r ' ) , $ p p t = $ ( ' . p p t ' ) , $ p p _ o v e r l a y = $ ( ' d i v . p p _ o v e r l a y ' ) ; i f ( i s S e t & & s e t t i n g s . o v e r l a y _ g a l l e r y ) { c u r r e n t G a l l e r y P a g e = 0 ; t o I n j e c t = " " ; f o r ( v a r   i = 0 ; i < p p _ i m a g e s . l e n g t h ; i + + ) { i f ( ! p p _ i m a g e s [ i ] . m a t c h ( / \ b ( j p g | j p e g | p n g | g i f ) \ b / g i ) ) { c l a s s n a m e = ' d e f a u l t ' ; i m g _ s r c = ' ' ; } e l s e { c l a s s n a m e = ' ' ; i m g _ s r c = p p _ i m a g e s [ i ] ; }  
 t o I n j e c t + = " < l i   c l a s s = ' " + c l a s s n a m e + " ' > < a   h r e f = ' # ' > < i m g   s r c = ' " + i m g _ s r c + " '   w i d t h = ' 5 0 '   a l t = ' '   / > < / a > < / l i > " ; } ; t o I n j e c t = s e t t i n g s . g a l l e r y _ m a r k u p . r e p l a c e ( / { g a l l e r y } / g , t o I n j e c t ) ; $ p p _ p i c _ h o l d e r . f i n d ( ' # p p _ f u l l _ r e s ' ) . a f t e r ( t o I n j e c t ) ; $ p p _ g a l l e r y = $ ( ' . p p _ p i c _ h o l d e r   . p p _ g a l l e r y ' ) , $ p p _ g a l l e r y _ l i = $ p p _ g a l l e r y . f i n d ( ' l i ' ) ; $ p p _ g a l l e r y . f i n d ( ' . p p _ a r r o w _ n e x t ' ) . c l i c k ( f u n c t i o n ( ) { $ . p r e t t y P h o t o . c h a n g e G a l l e r y P a g e ( ' n e x t ' ) ; $ . p r e t t y P h o t o . s t o p S l i d e s h o w ( ) ; r e t u r n   f a l s e ; } ) ; $ p p _ g a l l e r y . f i n d ( ' . p p _ a r r o w _ p r e v i o u s ' ) . c l i c k ( f u n c t i o n ( ) { $ . p r e t t y P h o t o . c h a n g e G a l l e r y P a g e ( ' p r e v i o u s ' ) ; $ . p r e t t y P h o t o . s t o p S l i d e s h o w ( ) ; r e t u r n   f a l s e ; } ) ; $ p p _ p i c _ h o l d e r . f i n d ( ' . p p _ c o n t e n t ' ) . h o v e r ( f u n c t i o n ( ) { $ p p _ p i c _ h o l d e r . f i n d ( ' . p p _ g a l l e r y : n o t ( . d i s a b l e d ) ' ) . f a d e I n ( ) ; } , f u n c t i o n ( ) { $ p p _ p i c _ h o l d e r . f i n d ( ' . p p _ g a l l e r y : n o t ( . d i s a b l e d ) ' ) . f a d e O u t ( ) ; } ) ; i t e m W i d t h = 5 2 + 5 ; $ p p _ g a l l e r y _ l i . e a c h ( f u n c t i o n ( i ) { $ ( t h i s ) . f i n d ( ' a ' ) . c l i c k ( f u n c t i o n ( ) { $ . p r e t t y P h o t o . c h a n g e P a g e ( i ) ; $ . p r e t t y P h o t o . s t o p S l i d e s h o w ( ) ; r e t u r n   f a l s e ; } ) ; } ) ; } ; i f ( s e t t i n g s . s l i d e s h o w ) { $ p p _ p i c _ h o l d e r . f i n d ( ' . p p _ n a v ' ) . p r e p e n d ( ' < a   h r e f = " # "   c l a s s = " p p _ p l a y " > P l a y < / a > ' )  
 $ p p _ p i c _ h o l d e r . f i n d ( ' . p p _ n a v   . p p _ p l a y ' ) . c l i c k ( f u n c t i o n ( ) { $ . p r e t t y P h o t o . s t a r t S l i d e s h o w ( ) ; r e t u r n   f a l s e ; } ) ; }  
 $ p p _ p i c _ h o l d e r . a t t r ( ' c l a s s ' , ' p p _ p i c _ h o l d e r   ' + s e t t i n g s . t h e m e ) ; $ p p _ o v e r l a y . c s s ( { ' o p a c i t y ' : 0 , ' h e i g h t ' : $ ( d o c u m e n t ) . h e i g h t ( ) , ' w i d t h ' : $ ( w i n d o w ) . w i d t h ( ) } ) . b i n d ( ' c l i c k ' , f u n c t i o n ( ) { i f ( ! s e t t i n g s . m o d a l ) $ . p r e t t y P h o t o . c l o s e ( ) ; } ) ; $ ( ' a . p p _ c l o s e ' ) . b i n d ( ' c l i c k ' , f u n c t i o n ( ) { $ . p r e t t y P h o t o . c l o s e ( ) ; r e t u r n   f a l s e ; } ) ; $ ( ' a . p p _ e x p a n d ' ) . b i n d ( ' c l i c k ' , f u n c t i o n ( e ) { i f ( $ ( t h i s ) . h a s C l a s s ( ' p p _ e x p a n d ' ) ) { $ ( t h i s ) . r e m o v e C l a s s ( ' p p _ e x p a n d ' ) . a d d C l a s s ( ' p p _ c o n t r a c t ' ) ; d o r e s i z e = f a l s e ; } e l s e { $ ( t h i s ) . r e m o v e C l a s s ( ' p p _ c o n t r a c t ' ) . a d d C l a s s ( ' p p _ e x p a n d ' ) ; d o r e s i z e = t r u e ; } ; _ h i d e C o n t e n t ( f u n c t i o n ( ) { $ . p r e t t y P h o t o . o p e n ( ) ; } ) ; r e t u r n   f a l s e ; } ) ; $ p p _ p i c _ h o l d e r . f i n d ( ' . p p _ p r e v i o u s ,   . p p _ n a v   . p p _ a r r o w _ p r e v i o u s ' ) . b i n d ( ' c l i c k ' , f u n c t i o n ( ) { $ . p r e t t y P h o t o . c h a n g e P a g e ( ' p r e v i o u s ' ) ; $ . p r e t t y P h o t o . s t o p S l i d e s h o w ( ) ; r e t u r n   f a l s e ; } ) ; $ p p _ p i c _ h o l d e r . f i n d ( ' . p p _ n e x t ,   . p p _ n a v   . p p _ a r r o w _ n e x t ' ) . b i n d ( ' c l i c k ' , f u n c t i o n ( ) { $ . p r e t t y P h o t o . c h a n g e P a g e ( ' n e x t ' ) ; $ . p r e t t y P h o t o . s t o p S l i d e s h o w ( ) ; r e t u r n   f a l s e ; } ) ; _ c e n t e r _ o v e r l a y ( ) ; } ; i f ( ! p p _ a l r e a d y I n i t i a l i z e d & & g e t H a s h t a g ( ) ) { p p _ a l r e a d y I n i t i a l i z e d = t r u e ; h a s h I n d e x = g e t H a s h t a g ( ) ; h a s h R e l = h a s h I n d e x ; h a s h I n d e x = h a s h I n d e x . s u b s t r i n g ( h a s h I n d e x . i n d e x O f ( ' / ' ) + 1 , h a s h I n d e x . l e n g t h - 1 ) ; h a s h R e l = h a s h R e l . s u b s t r i n g ( 0 , h a s h R e l . i n d e x O f ( ' / ' ) ) ; s e t T i m e o u t ( f u n c t i o n ( ) { $ ( " a [ r e l ^ = ' " + h a s h R e l + " ' ] : e q ( " + h a s h I n d e x + " ) " ) . t r i g g e r ( ' c l i c k ' ) ; } , 5 0 ) ; }  
 r e t u r n   t h i s . u n b i n d ( ' c l i c k . p r e t t y p h o t o ' ) . b i n d ( ' c l i c k . p r e t t y p h o t o ' , $ . p r e t t y P h o t o . i n i t i a l i z e ) ; } ; f u n c t i o n   g e t H a s h t a g ( ) { u r l = l o c a t i o n . h r e f ; h a s h t a g = ( u r l . i n d e x O f ( ' # ! ' ) ! = - 1 ) ? d e c o d e U R I ( u r l . s u b s t r i n g ( u r l . i n d e x O f ( ' # ! ' ) + 2 , u r l . l e n g t h ) ) : f a l s e ; r e t u r n   h a s h t a g ; } ; f u n c t i o n   s e t H a s h t a g ( ) { i f ( t y p e o f   t h e R e l = = ' u n d e f i n e d ' ) r e t u r n ; l o c a t i o n . h a s h = ' ! ' + t h e R e l + ' / ' + r e l _ i n d e x + ' / ' ; } ; f u n c t i o n   c l e a r H a s h t a g ( ) { u r l = l o c a t i o n . h r e f ; h a s h t a g = ( u r l . i n d e x O f ( ' # ! p r e t t y P h o t o ' ) ) ? t r u e : f a l s e ; i f ( h a s h t a g ) l o c a t i o n . h a s h = " ! p r e t t y P h o t o " ; }  
 f u n c t i o n   g e t P a r a m ( n a m e , u r l ) { n a m e = n a m e . r e p l a c e ( / [ \ [ ] / , " \ \ \ [ " ) . r e p l a c e ( / [ \ ] ] / , " \ \ \ ] " ) ; v a r   r e g e x S = " [ \ \ ? & ] " + n a m e + " = ( [ ^ & # ] * ) " ; v a r   r e g e x = n e w   R e g E x p ( r e g e x S ) ; v a r   r e s u l t s = r e g e x . e x e c ( u r l ) ; r e t u r n ( r e s u l t s = = n u l l ) ? " " : r e s u l t s [ 1 ] ; } } ) ( j Q u e r y ) ; v a r   p p _ a l r e a d y I n i t i a l i z e d = f a l s e ; 
