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