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