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