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