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