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