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