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