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