ÿþv a r   M E S S A G E S   =   {  
     " f o r m a t . d a t e " :                                           " M M / d d / y y y y " ,  
     " f o r m a t . t i m e " :                                           " h : m m   a " ,  
  
     " p h o t o v i e w e r . t o o l b a r . f i r s t " :               " F i r s t   P h o t o   ( H o m e ) " ,  
     " p h o t o v i e w e r . t o o l b a r . p r e v " :                 " P r e v i o u s   P h o t o   ( L e f t   a r r o w ) " ,  
     " p h o t o v i e w e r . t o o l b a r . s l i d e S h o w " :       " S t a r t / P a u s e   S l i d e   S h o w   ( S p a c e ) " ,  
     " p h o t o v i e w e r . t o o l b a r . n e x t " :                 " N e x t   P h o t o   ( R i g h t   a r r o w ) " ,  
     " p h o t o v i e w e r . t o o l b a r . l a s t " :                 " L a s t   P h o t o   ( E n d ) " ,  
     " p h o t o v i e w e r . t o o l b a r . e m a i l " :               " E m a i l   P h o t o " ,  
     " p h o t o v i e w e r . t o o l b a r . p e r m a l i n k " :       " L i n k   t o   P h o t o " ,  
     " p h o t o v i e w e r . t o o l b a r . c l o s e " :               " E x i t   ( E s c ) " ,  
     " p h o t o v i e w e r . e m a i l . s u b j e c t . p h o t o " :   " P h o t o " ,  
  
     " g a l l e r y . n o p h o t o s " :                                 " N o   p h o t o s " ,  
     " g a l l e r y . t h u m b s . s t a r t " :                         " S t a r t " ,  
     " g a l l e r y . t h u m b s . e n d " :                             " E n d " ,  
     " g a l l e r y . t o o l b a r . f i r s t " :                       " F i r s t   P h o t o " ,  
     " g a l l e r y . t o o l b a r . p r e v " :                         " P r e v i o u s   P h o t o " ,  
     " g a l l e r y . t o o l b a r . v i e w " :                         " V i e w   P h o t o " ,  
     " g a l l e r y . t o o l b a r . n e x t " :                         " N e x t   P h o t o " ,  
     " g a l l e r y . t o o l b a r . l a s t " :                         " L a s t   P h o t o " ,  
     " g a l l e r y . v i e w . f u l l " :                               " M a x i m i z e   W i n d o w " ,  
     " g a l l e r y . v i e w . p h o t o " :                             " S h o w   P h o t o   O n l y " ,  
     " g a l l e r y . v i e w . t e x t " :                               " S h o w   D e s c r i p t i o n   O n l y " ,  
     " g a l l e r y . v i e w . c l o s e " :                             " C l o s e   W i n d o w "  
 } ;  
  
 v a 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 ( ) ; v a r   I E = ( a g e n t . i n d e x O f ( " m s i e " ) ! = - 1 & & a g e n t . i n d e x O f ( " o p e r a " ) = = - 1 ) ; v a r   I E 7 = ( a g e n t . i n d e x O f ( " m s i e   7 " ) ! = - 1 ) ; v a r   I E 8 = ( a g e n t . i n d e x O f ( " m s i e   8 " ) ! = - 1 ) ; v a r   O P E R A = ( a g e n t . i n d e x O f ( " o p e r a " ) ! = - 1 ) ; v a r   S A F A R I = ( a g e n t . i n d e x O f ( " s a f a r i " ) ! = - 1 ) ; v a r   F I R E F O X = ( a g e n t . i n d e x O f ( " g e c k o " ) ! = - 1 ) ; v a r   S T R I C T _ M O D E = ( d o c u m e n t . c o m p a t M o d e = = " C S S 1 C o m p a t " ) ; v a r   _ D O M A I N = u n d e f i n e d ; v a r   G A L L E R Y _ W = 6 5 0 ; v a r   G A L L E R Y _ H = 5 3 0 ; i f ( U S E _ G O O G L E _ M A P S = = u n d e f i n e d ) { v a r   U S E _ G O O G L E _ M A P S = t r u e ; }  
 v a r   U S E _ O L D _ M A P S = ! U S E _ G O O G L E _ M A P S ; v a r   T E S T I N G = f a l s e ; v a r   l o g = g e t L o g g e r ( ) ; i f ( d o c u m e n t . l o c a t i o n . h r e f . i n d e x O f ( " # j s l o g " ) ! = - 1 )  
 l o g . e n a b l e ( ) ; f u n c t i o n   L o g g e r ( ) { t h i s . e n a b l e = l o g g e r E n a b l e ; t h i s . c l e a r = l o g g e r C l e a r ; t h i s . l o g = l o g g e r L o g ; t h i s . d e b u g = l o g g e r D e b u g ; t h i s . i n f o = l o g g e r I n f o ; t h i s . e r r o r = l o g g e r E r r o r ; v a r   c o n s o l e = u n d e f i n e d ; t r y { c o n s o l e = d o c u m e n t . c r e a t e E l e m e n t ( " t e x t a r e a " ) ; c o n s o l e . s t y l e . d i s p l a y = " n o n e " ; c o n s o l e . s t y l e . p o s i t i o n = " a b s o l u t e " ; c o n s o l e . s t y l e . r i g h t = " 2 p x " ; c o n s o l e . s t y l e . b o t t o m = " 2 p x " ; c o n s o l e . s t y l e . w i d t h = " 2 3 e m " ; c o n s o l e . s t y l e . h e i g h t = " 4 0 e m " ; c o n s o l e . s t y l e . f o n t F a m i l y = " m o n o s p a c e " ; c o n s o l e . s t y l e . f o n t S i z e = " 9 p x " ; c o n s o l e . s t y l e . c o l o r = " # 0 0 0 0 0 0 " ; s e t O p a c i t y ( c o n s o l e , 0 . 7 ) ; c o n s o l e . b o r d e r = " 1 p x   s o l i d   # 8 0 8 0 8 0 " ; c o n s o l e . o n d b l c l i c k = c l e a r L o g g e r ; } c a t c h ( e ) { }  
 t h i s . c o n s o l e = c o n s o l e ; t h i s . e n a b l e d = f a l s e ; t h i s . l o g T i m e S t a r t = g e t T i m e M i l l i s ( ) ; }  
 f u n c t i o n   g e t L o g g e r ( ) { v a r   l o g = u n d e f i n e d ; v a r   w i n = w i n d o w ; w h i l e ( l o g = = u n d e f i n e d ) { t r y { l o g = w i n . d o c u m e n t . l o g ; } c a t c h ( e ) { b r e a k ; }  
 i f ( w i n = = w i n . p a r e n t )  
 b r e a k ; w i n = w i n . p a r e n t ; }  
 i f ( l o g = = u n d e f i n e d ) { l o g = n e w   L o g g e r ( ) ; d o c u m e n t . l o g = l o g ; }  
 r e t u r n   l o g ; }  
 f u n c t i o n   c l e a r L o g g e r ( ) { g e t L o g g e r ( ) . c l e a r ( ) ; }  
 f u n c t i o n   l o g g e r E n a b l e ( ) { i f ( t h i s . e n a b l e d | | t h i s . c o n s o l e = = u n d e f i n e d )  
 r e t u r n ; i f ( w i n d o w . d o c u m e n t . b o d y ! = u n d e f i n e d ) { w i n d o w . d o c u m e n t . b o d y . a p p e n d C h i l d ( t h i s . c o n s o l e ) ; t h i s . c o n s o l e . s t y l e . d i s p l a y = " " ; t h i s . e n a b l e d = t r u e ; } }  
 f u n c t i o n   l o g g e r D e b u g ( m s g ) { t h i s . l o g ( " D E B U G " , m s g ) ; }  
 f u n c t i o n   l o g g e r I n f o ( m s g ) { t h i s . l o g ( " I N F O " , m s g ) ; }  
 f u n c t i o n   l o g g e r E r r o r ( m s g , e ) { t h i s . l o g ( " E R R O R " , m s g , e ) ; }  
 f u n c t i o n   l o g g e r L o g ( l e v e l , m s g , e ) { i f ( ! t h i s . e n a b l e d | | t h i s . c o n s o l e = = u n d e f i n e d )  
 r e t u r n ; v a r   m i l l i s = ( g e t T i m e M i l l i s ( ) - t h i s . l o g T i m e S t a r t ) + " " ; w h i l e ( m i l l i s . l e n g t h < 6 )  
 m i l l i s + = "   " ; v a r   m = m i l l i s + "   " ; i f ( m s g ! = u n d e f i n e d )  
 m + = m s g + "   " ; i f ( e ! = u n d e f i n e d )  
 m + = e . n a m e + " :   " + e . m e s s a g e ; t h i s . c o n s o l e . v a l u e + = m + " \ n " ; }  
 f u n c t i o n   l o g g e r C l e a r ( ) { i f ( ! t h i s . e n a b l e d | | t h i s . c o n s o l e = = u n d e f i n e d )  
 r e t u r n ; t h i s . c o n s o l e . v a l u e = " " ; }  
 f u n c t i o n   g e t T i m e M i l l i s ( ) { v a r   t = n e w   D a t e ( ) ; r e t u r n   D a t e . U T C ( t . g e t F u l l Y e a r ( ) , t . g e t M o n t h ( ) , t . g e t D a y ( ) , t . g e t H o u r s ( ) , t . g e t M i n u t e s ( ) , t . g e t S e c o n d s ( ) , t . g e t M i l l i s e c o n d s ( ) ) ; }  
 f u n c t i o n   g e t E v e n t ( e v e n t ) { r e t u r n ( e v e n t ! = u n d e f i n e d ? e v e n t : w i n d o w . e v e n t ) ; }  
 f u n c t i o n   p r e v e n t D e f a u l t ( e v e n t ) { i f ( e v e n t . s t o p E v e n t )  
 e v e n t . s t o p E v e n t ( ) ; i f ( e v e n t . p r e v e n t D e f a u l t ) { e v e n t . p r e v e n t D e f a u l t ( ) ; e v e n t . s t o p P r o p a g a t i o n ( ) ; } e l s e { e v e n t . r e t u r n V a l u e = f a l s e ; e v e n t . c a n c e l B u b b l e = t r u e ; } }  
 f u n c t i o n   g e t E v e n t T a r g e t ( e v e n t ) { i f ( e v e n t = = u n d e f i n e d )  
 r e t u r n   u n d e f i n e d ; i f ( e v e n t . s r c E l e m e n t ! = u n d e f i n e d )  
 r e t u r n   e v e n t . s r c E l e m e n t ; e l s e  
 r e t u r n   e v e n t . t a r g e t ; }  
 f u n c t i o n   g e t M o u s e P o s i t i o n ( e v e n t ) { e v e n t = g e t E v e n t ( e v e n t ) ; v a r   s c r o l l L e f t = w i n d o w . p a g e X O f f s e t ; i f ( s c r o l l L e f t = = u n d e f i n e d | | s c r o l l L e f t = = = 0 )  
 s c r o l l L e f t = w i n d o w . 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 ; i f ( s c r o l l L e f t = = u n d e f i n e d | | s c r o l l L e f t = = = 0 )  
 s c r o l l L e f t = w i n d o w . d o c u m e n t . b o d y . s c r o l l L e f t ; v a r   s c r o l l T o p = w i n d o w . p a g e Y O f f s e t ; i f ( s c r o l l T o p = = u n d e f i n e d | | s c r o l l T o p = = = 0 )  
 s c r o l l T o p = w i n d o w . 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 ; i f ( s c r o l l T o p = = u n d e f i n e d | | s c r o l l T o p = = = 0 )  
 s c r o l l T o p = w i n d o w . d o c u m e n t . b o d y . s c r o l l T o p ; v a r   x = e v e n t . c l i e n t X + s c r o l l L e f t ; v a r   y = e v e n t . c l i e n t Y + s c r o l l T o p ; r e t u r n { x : x , y : y } ; }  
 f u n c t i o n   g e t R e s p o n s e ( u r l , a s y n c , g e t X M L , c a l l b a c k , d a t a ) { v a r   r e q = u n d e f i n e d ; t r y { r e q = n e w   A c t i v e X O b j e c t ( " M s x m l 2 . X M L H T T P " ) ; } c a t c h ( e 1 ) { t r y { r e q = n e w   A c t i v e X O b j e c t ( " M i c r o s o f t . X M L H T T P " ) ; } c a t c h ( e 2 ) { r e q = n e w   X M L H t t p R e q u e s t ( ) ; } }  
 i f ( r e q = = u n d e f i n e d ) { l o g . e r r o r ( " F a i l e d   t o   i n i t i a l i z e   X M L / H T T P " ) ; r e t u r n   u n d e f i n e d ; }  
 r e q . o p e n ( " G E T " , u r l , a s y n c ) ; i f ( ! a s y n c ) { r e q . s e n d ( u n d e f i n e d ) ; i f ( r e q . r e a d y S t a t e ! = 4 ) { l o g . e r r o r ( " R e q u e s t   f a i l e d :   " + r e q . r e a d y S t a t e ) ; r e t u r n   u n d e f i n e d ; }  
 i f ( ! g e t X M L )  
 r e t u r n   r e q . r e s p o n s e T e x t ; e l s e  
 r e t u r n   r e q . r e s p o n s e X M L ; } e l s e { p o l l R e s p o n s e ( r e q , c a l l b a c k , d a t a ) ; r e q . s e n d ( u n d e f i n e d ) ; r e t u r n   u n d e f i n e d ; } }  
 f u n c t i o n   p o l l R e s p o n s e ( r e q , c a l l b a c k , d a t a ) { i f ( r e q . r e a d y S t a t e ! = 4 )  
 w i n d o w . s e t T i m e o u t ( f u n c t i o n ( ) { p o l l R e s p o n s e ( r e q , c a l l b a c k , d a t a ) ; } , 1 0 0 ) ; e l s e  
 c a l l b a c k ( r e q , d a t a ) ; }  
 f u n c t i o n   g e t D O M L o c a t i o n ( n o d e ) { v a r   x = n o d e . o f f s e t L e f t ; v a r   y = n o d e . o f f s e t T o p ; w h i l e ( n o d e . o f f s e t P a r e n t ) { x = x + n o d e . o f f s e t P a r e n t . o f f s e t L e f t ; y = y + n o d e . o f f s e t P a r e n t . o f f s e t T o p ; i f ( n o d e = = 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 ' ) [ 0 ] ) { b r e a k ; } e l s e { n o d e = n o d e . o f f s e t P a r e n t ; } }  
 r e t u r n { x : x , y : y } ; }  
 f u n c t i o n   g e t E l e m e n t s B y T a g N a m e ( n o d e , t a g ) { i f ( n o d e = = u n d e f i n e d )  
 r e t u r n   u n d e f i n e d ; i f ( I E ) { r e t u r n   n o d e . g e t E l e m e n t s B y T a g N a m e ( t a g ) ; }  
 i f ( t a g . i n d e x O f ( " : " ) ! = - 1 ) { t a g = t a g . s p l i t ( " : " ) [ 1 ] ; }  
 r e t u r n   n o d e . g e t E l e m e n t s B y T a g N a m e N S ( " * " , t a g ) ; }  
 f u n c t i o n   g e t F i r s t E l e m e n t s V a l u e ( n o d e , t a g ) { i f ( n o d e = = u n d e f i n e d )  
 r e t u r n   u n d e f i n e d ; v a r   n o d e s = g e t E l e m e n t s B y T a g N a m e ( n o d e , t a g ) ; i f ( n o d e s . l e n g t h = = = 0 )  
 r e t u r n   u n d e f i n e d ; e l s e  
 r e t u r n   g e t E l e m e n t V a l u e ( n o d e s [ 0 ] ) ; }  
 f u n c t i o n   f i n d D O M E l e m e n t ( i d ) { v a r   e l = u n d e f i n e d ; v a r   w i n = w i n d o w ; w h i l e ( e l = = u n d e f i n e d ) { t r y { e l = w i n . d o c u m e n t . g e t E l e m e n t B y I d ( i d ) ; } c a t c h ( e ) { b r e a k ; }  
 i f ( w i n = = = w i n . p a r e n t ) { b r e a k ; }  
 w i n = w i n . p a r e n t ; }  
 r e t u r n   e l ; }  
 f u n c t i o n   g e t E l e m e n t V a l u e ( n o d e ) { v a r   i ; v a r   v a l = " " ; f o r ( i = 0 ; i < n o d e . c h i l d N o d e s . l e n g t h ; i + + ) { i f ( n o d e . c h i l d N o d e s [ i ] . n o d e V a l u e ! = = n u l l )  
 v a l + = n o d e . c h i l d N o d e s [ i ] . n o d e V a l u e ; }  
 r e t u r n   v a l ; }  
 f u n c t i o n   t r i m ( s t r ) { i f ( s t r = = u n d e f i n e d )  
 r e t u r n   u n d e f i n e d ; r e t u r n   s t r . r e p l a c e ( / ^ \ s * ( [ \ s \ S ] * \ S + ) \ s * $ | ^ \ s * $ / , ' $ 1 ' ) ; }  
 f u n c t i o n   t r i m T o L e n ( s t r , l e n ) { i f ( s t r = = u n d e f i n e d ) { r e t u r n   u n d e f i n e d ; }  
 i f ( s t r . l e n g t h > l e n ) { s t r = s t r . s u b s t r i n g ( 0 , l e n ) + " . . . " ; }  
 r e t u r n   s t r ; }  
 f u n c t i o n   g e t R o o t W i n d o w ( ) { v a r   w i n = w i n d o w ; w h i l e ( w i n ! = u n d e f i n e d ) { t r y { i f ( w i n = = = w i n . p a r e n t ) { b r e a k ; } e l s e   i f ( w i n . p a r e n t ! = u n d e f i n e d & & w i n . p a r e n t . d o c u m e n t . l o c a t i o n . h r e f . i n d e x O f ( " / s e l e n i u m - s e r v e r / " ) ! = - 1 ) { b r e a k ; }  
 w i n = w i n . p a r e n t ; } c a t c h ( e ) { w i n . p e r m i s s i o n D e n i e d = t r u e ; b r e a k ; } }  
 r e t u r n   w i n ; }  
 f u n c t i o n   g e t U R L P a r a m s ( ) { v a r   i , p a r a m s = [ ] ; v a r   u r l = w i n d o w . l o c a t i o n . s e a r c h ; i f ( u r l = = u n d e f i n e d | | u r l . l e n g t h = = = 0 )  
 r e t u r n   u n d e f i n e d ; u r l = u r l . s u b s t r i n g ( 1 ) ; v a r   n a m e v a l s = u r l . r e p l a c e ( / \ + / g , "   " ) . s p l i t ( " & " ) ; f o r ( i = 0 ; i < n a m e v a l s . l e n g t h ; i + + ) { v a r   n a m e , v a l ; v a r   p o s = n a m e v a l s [ i ] . i n d e x O f ( " = " ) ; i f ( p o s ! = - 1 ) { n a m e = n a m e v a l s [ i ] . s u b s t r i n g ( 0 , p o s ) ; v a l = u n e s c a p e ( n a m e v a l s [ i ] . s u b s t r i n g ( p o s + 1 ) ) ; } e l s e { n a m e = n a m e v a l s [ i ] ; v a l = u n d e f i n e d ; }  
 p a r a m s [ n a m e ] = v a l ; }  
 r e t u r n   p a r a m s ; }  
 f u n c t i o n   j o i n L i s t s ( l i s t 1 , l i s t 2 ) { v a r   i ; v a r   s i z e = 0 ; v a r   r e s u l t = [ ] ; i f ( l i s t 1 ! = u n d e f i n e d & & l i s t 1 . l e n g t h > 0 ) { f o r ( i = 0 ; i < l i s t 1 . l e n g t h ; i + + )  
 r e s u l t [ i ] = l i s t 1 [ i ] ; s i z e = l i s t 1 . l e n g t h ; }  
 i f ( l i s t 2 ! = u n d e f i n e d & & l i s t 2 . l e n g t h > 0 ) { f o r ( i = 0 ; i < l i s t 2 . l e n g t h ; i + + )  
 r e s u l t [ i + s i z e ] = l i s t 2 [ i ] ; }  
 r e t u r n   r e s u l t ; }  
 f u n c t i o n   s e t C o o k i e ( n a m e , v a l u e , e x p i r e ) { v a r   e x p i r y = ( e x p i r e = = u n d e f i n e d ) ? " " : ( " ;   e x p i r e s = " + e x p i r e . t o G M T S t r i n g ( ) ) ; d o c u m e n t . c o o k i e = n a m e + " = " + v a l u e + e x p i r y ; }  
 f u n c t i o n   g e t C o o k i e ( n a m e ) { i f ( d o c u m e n t . c o o k i e = = u n d e f i n e d | | d o c u m e n t . c o o k i e . l e n g t h = = = 0 )  
 r e t u r n   u n d e f i n e d ; v a r   s e a r c h = n a m e + " = " ; v a r   i n d e x = d o c u m e n t . c o o k i e . i n d e x O f ( s e a r c h ) ; i f ( i n d e x ! = - 1 ) { i n d e x + = s e a r c h . l e n g t h ; v a r   e n d = d o c u m e n t . c o o k i e . i n d e x O f ( " ; " , i n d e x ) ; i f ( e n d = = - 1 )  
 e n d = d o c u m e n t . c o o k i e . l e n g t h ; r e t u r n   u n e s c a p e ( d o c u m e n t . c o o k i e . s u b s t r i n g ( i n d e x , e n d ) ) ; } }  
 f u n c t i o n   r e m o v e C o o k i e ( n a m e ) { v a r   t o d a y = n e w   D a t e ( ) ; v a r   e x p i r e s = n e w   D a t e ( ) ; e x p i r e s . s e t T i m e ( t o d a y . g e t T i m e ( ) - 1 ) ; s e t C o o k i e ( n a m e , " " , e x p i r e s ) ; }  
 f u n c t i o n   g e t M e s s a g e ( i d ) { i f ( M E S S A G E S [ i d ] = = u n d e f i n e d ) { r e t u r n " ( " + i d + " ) " ; } e l s e { r e t u r n   M E S S A G E S [ i d ] ; } }  
 f u n c t i o n   l o c a l i z e N o d e A t t r i b s ( n o d e ) { v a r   i ; i f ( n o d e = = u n d e f i n e d )  
 r e t u r n ; i f ( n o d e . a l t ! = u n d e f i n e d & & n o d e . a l t . i n d e x O f ( " # " ) = = = 0 ) { n o d e . a l t = g e t M e s s a g e ( n o d e . a l t . s u b s t r i n g ( 1 ) ) ; }  
 i f ( n o d e . t i t l e ! = u n d e f i n e d & & n o d e . t i t l e . i n d e x O f ( " # " ) = = = 0 ) { n o d e . t i t l e = g e t M e s s a g e ( n o d e . t i t l e . s u b s t r i n g ( 1 ) ) ; }  
 i f ( n o d e . c h i l d N o d e s ! = u n d e f i n e d ) { f o r ( i = 0 ; i < n o d e . c h i l d N o d e s . l e n g t h ; i + + ) { l o c a l i z e N o d e A t t r i b s ( n o d e . c h i l d N o d e s [ i ] ) ; } } }  
 f u n c t i o n   p a d N u m b e r ( n , p a d ) { n = n + " " ; w h i l e ( n . l e n g t h < p a d ) { n = " 0 " + n ; }  
 r e t u r n   n ; }  
 f u n c t i o n   i s A r r a y ( o b j ) { i f ( o b j   i n s t a n c e o f   A r r a y )  
 r e t u r n   t r u e ; e l s e  
 r e t u r n   f a l s e ; }  
 f u n c t i o n   s i m p l e D a t e F o r m a t t e r ( d a t e , p a t t e r n ) { v a r   d = p a t t e r n ; d = d . r e p l a c e ( / y y y y / g , d a t e . g e t F u l l Y e a r ( ) ) ; d = d . r e p l a c e ( / y y / g , p a d N u m b e r ( d a t e . g e t F u l l Y e a r ( ) % 1 0 0 , 2 ) ) ; d = d . r e p l a c e ( / M M / g , p a d N u m b e r ( d a t e . g e t M o n t h ( ) + 1 , 2 ) ) ; d = d . r e p l a c e ( / M / g , d a t e . g e t M o n t h ( ) + 1 ) ; d = d . r e p l a c e ( / d d / g , p a d N u m b e r ( d a t e . g e t D a t e ( ) , 2 ) ) ; d = d . r e p l a c e ( / d / g , d a t e . g e t D a t e ( ) ) ; d = d . r e p l a c e ( / H H / g , p a d N u m b e r ( d a t e . g e t H o u r s ( ) , 2 ) ) ; d = d . r e p l a c e ( / H / g , d a t e . g e t H o u r s ( ) ) ; d = d . r e p l a c e ( / h h / g , p a d N u m b e r ( d a t e . g e t H o u r s ( ) % 1 2 , 2 ) ) ; d = d . r e p l a c e ( / h / g , d a t e . g e t H o u r s ( ) % 1 2 ) ; d = d . r e p l a c e ( / m m / g , p a d N u m b e r ( d a t e . g e t M i n u t e s ( ) , 2 ) ) ; d = d . r e p l a c e ( / m / g , d a t e . g e t M i n u t e s ( ) ) ; d = d . r e p l a c e ( / s s / g , p a d N u m b e r ( d a t e . g e t S e c o n d s ( ) , 2 ) ) ; d = d . r e p l a c e ( / s / g , d a t e . g e t S e c o n d s ( ) ) ; v a r   a m = ( d a t e . g e t H o u r s ( ) < 1 2 ? " A M " : " P M " ) ; d = d . r e p l a c e ( / a / g , a m ) ; r e t u r n   d ; }  
 f u n c t i o n   f o r m a t D a t e T i m e ( d a t e ) { i f ( d a t e = = u n d e f i n e d )  
 r e t u r n   u n d e f i n e d ; r e t u r n   f o r m a t D a t e ( d a t e ) + "   " + f o r m a t T i m e ( d a t e ) ; }  
 f u n c t i o n   f o r m a t D a t e ( d a t e ) { v a r   d a t e P a t t e r n = g e t M e s s a g e ( " f o r m a t . d a t e " ) ; r e t u r n   s i m p l e D a t e F o r m a t t e r ( d a t e , d a t e P a t t e r n ) ; }  
 f u n c t i o n   f o r m a t T i m e ( d a t e ) { v a r   t i m e P a t t e r n = g e t M e s s a g e ( " f o r m a t . t i m e " ) ; r e t u r n   s i m p l e D a t e F o r m a t t e r ( d a t e , t i m e P a t t e r n ) ; }  
 f u n c t i o n   p a r s e I S O T i m e ( s t r T i m e ) { i f ( s t r T i m e = = u n d e f i n e d )  
 r e t u r n   u n d e f i n e d ; v a r   i s o R E = / ^ ( \ d { 4 } ) - ( \ d \ d ) - ( \ d \ d ) T ( \ d \ d ) : ( \ d \ d ) : ( \ d \ d ) ( \ . \ d { 3 } ) ? ( [ Z + - ] ) ? ( \ d \ d ) ? : ? ( \ d \ d ) ? $ / ; i f ( ! i s o R E . t e s t ( s t r T i m e ) ) { r e t u r n   u n d e f i n e d ; } e l s e { r e t u r n   n e w   D a t e ( R e g E x p . $ 1 , R e g E x p . $ 2 - 1 , R e g E x p . $ 3 , R e g E x p . $ 4 , R e g E x p . $ 5 , R e g E x p . $ 6 ) ; } }  
 f u n c t i o n   s e t O p a c i t y ( e l t , o p a c i t y ) { i f ( I E ) { e l t . s t y l e . f i l t e r = " a l p h a ( o p a c i t y = " + p a r s e I n t ( o p a c i t y * 1 0 0 ) + " ) " ; }  
 e l t . s t y l e . K h t m l O p a c i t y = o p a c i t y ; e l t . s t y l e . o p a c i t y = o p a c i t y ; }  
 f u n c t i o n   v a l i d C o o r d i n a t e s ( l a t , l o n ) { i f ( M a t h . a b s ( l a t ) > 9 0 | | M a t h . a b s ( l o n ) > 1 8 0 ) { r e t u r n   f a l s e ; }  
 i f ( l a t = = = 0 . 0 & & l o n = = = 0 . 0 ) { r e t u r n   f a l s e ; }  
 r e t u r n   t r u e ; }  
 f u n c t i o n   i s H o s t e d ( ) { v a r   h o s t = d o c u m e n t . l o c a t i o n . h o s t ; i f ( h o s t = = u n d e f i n e d )  
 h o s t = " " ; r e t u r n ( ( h o s t . i n d e x O f ( " p i c h a k . n e t / b l o g c o d / g a l l e r y / " ) = = - 1 | | h o s t . i n d e x O f ( " p i c h a k . n e t / b l o g c o d / g a l l e r y / " ) ! = - 1 ) & & h o s t . i n d e x O f ( " r t v s l o . s i " ) = = - 1 & & h o s t ! = " l o c a l h o s t " & & ! c h e c k D o m a i n ( ) ) ; }  
 f u n c t i o n   c h e c k D o m a i n ( ) { t r y { i f ( _ D O M A I N = = u n d e f i n e d )  
 r e t u r n   f a l s e ; v a r   p r o t o c o l = d o c u m e n t . l o c a t i o n . p r o t o c o l ; i f ( p r o t o c o l = = u n d e f i n e d )  
 p r o t o c o l = " h t t p : " ; v a r   h o s t = d o c u m e n t . l o c a t i o n . h o s t ; i f ( h o s t = = u n d e f i n e d )  
 h o s t = " " ; h o s t = h o s t . t o L o w e r C a s e ( ) ; i f ( p r o t o c o l . t o L o w e r C a s e ( ) . i n d e x O f ( " f i l e " ) = = = 0 ) { r e t u r n   t r u e ; }  
 v a r   p o s = h o s t . l a s t I n d e x O f ( " : " ) ; i f ( p o s ! = - 1 ) { h o s t = h o s t . s u b s t r i n g ( 0 , p o s ) ; }  
 i f ( h o s t . i n d e x O f ( " w w w . " ) = = = 0 ) { h o s t = h o s t . s u b s t r i n g ( 4 ) ; }  
 i f ( h o s t = = = " " | | h o s t = = " l o c a l h o s t " | | h o s t = = " 1 2 7 . 0 . 0 . 1 " )  
 r e t u r n   t r u e ; v a r   d o m a i n = _ D O M A I N . t o L o w e r C a s e ( ) ; p o s = d o m a i n . i n d e x O f ( " : / / " ) ; i f ( p o s ! = - 1 ) { d o m a i n = d o m a i n . s u b s t r i n g ( p o s + 3 ) ; }  
 p o s = d o m a i n . i n d e x O f ( " / " ) ; i f ( p o s ! = - 1 ) { d o m a i n = d o m a i n . s u b s t r i n g ( 0 , p o s ) ; }  
 i f ( d o m a i n . i n d e x O f ( " w w w . " ) = = = 0 ) { d o m a i n = d o m a i n . s u b s t r i n g ( 4 ) ; }  
 i f ( h o s t = = d o m a i n ) { r e t u r n   t r u e ; } e l s e   i f ( n e w   R e g E x p ( d o m a i n ) . t e s t ( h o s t ) ) { r e t u r n   t r u e ; }  
 r e t u r n   f a l s e ; } c a t c h ( e ) { r e t u r n   t r u e ; } }  
 f u n c t i o n   g e t W i n d o w S i z e ( w i n ) { v a r   a v a i l W = w i n . i n n e r W i d t h ; i f ( a v a i l W = = u n d e f i n e d | | a v a i l W = = = 0 | | i s N a N ( a v a i l W ) )  
 a v a i l W = w i n . 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 ( a v a i l W = = u n d e f i n e d | | a v a i l W = = = 0 | | i s N a N ( a v a i l W ) )  
 a v a i l W = w i n . d o c u m e n t . b o d y . c l i e n t W i d t h ; v a r   a v a i l H = w i n . i n n e r H e i g h t ; i f ( a v a i l H = = u n d e f i n e d | | a v a i l H = = = 0 | | i s N a N ( a v a i l H ) )  
 a v a i l H = w i n . 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 ; i f ( a v a i l H = = u n d e f i n e d | | a v a i l H = = = 0 | | i s N a N ( a v a i l H ) )  
 a v a i l H = w i n . d o c u m e n t . b o d y . c l i e n t H e i g h t ; r e t u r n { w : a v a i l W , h : a v a i l H } ; }  
 f u n c t i o n   g e t D o c u m e n t S i z e ( w i n ) { v a r   w i n S i z e = g e t W i n d o w S i z e ( w i n ) ; v a r   s c r o l l P o s = g e t S c r o l l P o s ( w i n ) ; v a r   w = w i n S i z e . w + s c r o l l P o s . l e f t ; v a r   h = w i n S i z e . h + s c r o l l P o s . t o p ; w = M a t h . m a x ( w , w i n . d o c u m e n t . b o d y . o f f s e t W i d t h ) ; h = M a t h . m a x ( h , w i n . d o c u m e n t . b o d y . o f f s e t H e i g h t ) ; w = M a t h . m a x ( w , w i n . d o c u m e n t . b o d y . s c r o l l W i d t h ) ; h = M a t h . m a x ( h , w i n . d o c u m e n t . b o d y . s c r o l l H e i g h t ) ; r e t u r n { w : w , h : h } ; }  
 f u n c t i o n   g e t S c r o l l P o s ( w i n ) { v a r   s c r o l l T o p = w i n . p a g e Y O f f s e t ; i f ( s c r o l l T o p = = u n d e f i n e d | | s c r o l l T o p = = = 0 )  
 s c r o l l T o p = w i n . 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 ; i f ( s c r o l l T o p = = u n d e f i n e d | | s c r o l l T o p = = = 0 )  
 s c r o l l T o p = w i n . d o c u m e n t . b o d y . s c r o l l T o p ; v a r   s c r o l l L e f t = w i n . p a g e X O f f s e t ; i f ( s c r o l l L e f t = = u n d e f i n e d | | s c r o l l L e f t = = = 0 )  
 s c r o l l L e f t = w i n . 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 ; i f ( s c r o l l L e f t = = u n d e f i n e d | | s c r o l l L e f t = = = 0 )  
 s c r o l l L e f t = w i n . d o c u m e n t . b o d y . s c r o l l L e f t ; r e t u r n { t o p : s c r o l l T o p , l e f t : s c r o l l L e f t } ; }  
 v a r   C L E A R _ E V E N T S = [ " o n c l i c k " , " o n d b l c l i c k " , " o n k e y d o w n " , " o n k e y p r e s s " , " o n m o u s e d o w n " , " o n m o u s e u p " , " o n m o u s e m o v e " , " o n m o u s e o v e r " , " o n m o u s e o u t " , " o n m o u s e w h e e l d o w n " , " o n c o n t e x t m e n u " ] ; f u n c t i o n   c l e a r E v e n t s ( ) { v a r   i , j ; v a r   c o u n t = 0 ; i f ( d o c u m e n t . a l l = = u n d e f i n e d )  
 r e t u r n ; f o r ( i = 0 ; i < d o c u m e n t . a l l . l e n g t h ; i + + ) { f o r ( j = 0 ; j < C L E A R _ E V E N T S . l e n g t h ; j + + ) { v a r   e v e n t = d o c u m e n t . a l l [ i ] [ C L E A R _ E V E N T S [ j ] ] ; i f ( e v e n t ! = u n d e f i n e d ) { d o c u m e n t . a l l [ i ] [ C L E A R _ E V E N T S [ j ] ] = n u l l ; c o u n t + + ; } } } }  
 i f ( w i n d o w . a t t a c h E v e n t )  
 w i n d o w . a t t a c h E v e n t ( " o n u n l o a d " , c l e a r E v e n t s ) ; f u n c t i o n   g e t G a l l e r y ( ) { v a r   g a l l e r y = u n d e f i n e d ; v a r   w i n = w i n d o w ; w h i l e ( g a l l e r y = = u n d e f i n e d ) { t r y { g a l l e r y = w i n . d o c u m e n t . g a l l e r y ; } c a t c h ( e ) { b r e a k ; }  
 v a r   t m p W i n = w i n ; w i n = w i n . p a r e n t ; i f ( t m p W i n = = = w i n ) { b r e a k ; } }  
 r e t u r n   g a l l e r y ; }  
 f u n c t i o n   g e t M a p ( ) { i f ( t h i s . m a p ! = u n d e f i n e d )  
 r e t u r n   t h i s . m a p ; t r y { i f ( d o c u m e n t . m a p ! = u n d e f i n e d )  
 r e t u r n   d o c u m e n t . m a p ; } c a t c h ( e ) { }  
 t r y { i f ( w i n d o w . p a r e n t . d o c u m e n t . m a p ! = u n d e f i n e d )  
 r e t u r n   w i n d o w . p a r e n t . d o c u m e n t . m a p ; } c a t c h ( e ) { }  
 r e t u r n   u n d e f i n e d ; }  
 f u n c t i o n   v i e w e r C l o s e C a l l b a c k ( p h o t o I n d e x ) { v a r   i , j , n = 0 ; v a r   g a l l e r y = g e t G a l l e r y ( ) ; f o r ( i = 0 ; i < g a l l e r y . s e t s . l e n g t h ; i + + ) { f o r ( j = 0 ; j < g a l l e r y . s e t s [ i ] . p h o t o s . l e n g t h ; j + + ) { v a r   p = g a l l e r y . s e t s [ i ] . p h o t o s [ j ] ; i f ( p = = u n d e f i n e d | | p . o r i g = = u n d e f i n e d | | p . o r i g . s r c = = u n d e f i n e d )  
 c o n t i n u e ; i f ( n = = p h o t o I n d e x ) { g a l l e r y . s e t I n d e x = i ; g a l l e r y . p h o t o I n d e x = j ; g a l l e r y . r e n d e r P h o t o s ( ) ; g a l l e r y . w i n . f o c u s ( ) ; r e t u r n ; }  
 n + + ; } } }  
 v a r   V I E W E R _ I N D E X = 0 ; v a r   S L I D E _ D U R A T I O N = 4 0 0 0 ; v a r   S L I D E _ O F F S E T = 5 0 ; v a r   S L I D E _ P H O T O S = t r u e ; v a r   F A D E _ B O R D E R = f a l s e ; v a r   F A D E _ S T E P S = 1 0 ; v a r   M O V E _ S T E P = 1 ; v a r   P R E L O A D _ T I M E O U T = 6 0 0 0 0 ; v a r   B O R D E R _ W I D T H = 5 ; v a r   F O N T _ S I Z E = 1 0 ; v a r   L I N E _ H E I G H T = " 0 . 7 e m " ; v a r   O F F S E T _ L E F T = 0 ; v a r   O F F S E T _ T O P = 0 ; v a r   R E S T _ U R L = " / r e s t / " ; v a r   P _ I M G _ R O O T = " h t t p : / / p i c h a k . n e t / b l o g c o d / g a l l e r y / " ; v a r   T O O L B A R _ I M G = " t o o l b a r . p n g " ; v a r   T O O L B A R _ I M G _ R U N N I N G = " t o o l b a r 2 . p n g " ; v a r   T O O L B A R _ I M G _ B A C K = " t o o l b a r - b a c k " ; v a r   T O O L B A R _ I M G _ M A S K = " t o o l b a r - m a s k . p n g " ; v a r   T O O L B A R _ I M G _ L O A D I N G = " l o a d i n g - a n i m . g i f " ; v a r   T O O L B A R _ W = 4 4 0 ; v a r   T O O L B A R _ H = 7 5 ; v a r   T O O L B A R _ I M G _ W = 4 2 0 ; v a r   T O O L B A R _ I M G _ H = 4 4 ; v a r   T O O L B A R _ L I N K = " h t t p : / / w w w . p i c h a k . n e t / b l o g c o d / g a l l e r y / " ; v a r   T O O L B A R _ O P A C I T Y = 0 . 7 ; v a r   T O O L B A R _ F O N T _ C O L O R = " # f f f f f f " ; v a r   T O O L B A R _ F O N T _ S T Y L E = " t a h o m a " ; v a r   B Y L I N E _ F O N T _ C O L O R = T O O L B A R _ F O N T _ C O L O R ; v a r   B Y L I N E _ F O N T _ S T Y L E = T O O L B A R _ F O N T _ S T Y L E ; v a r   B Y L I N E _ P O S I T I O N _ R I G H T = 5 ; v a r   B Y L I N E _ P O S I T I O N _ B O T T O M = 5 ; v a r   V I E W E R _ I D _ P R E F I X = " P h o t o V i e w e r " ; v a r   V I E W E R _ I D _ B A C K = V I E W E R _ I D _ P R E F I X + " B a c k " ; v a r   V I E W E R _ I D _ T O O L B A R = V I E W E R _ I D _ P R E F I X + " T o o l b a r " ; v a r   V I E W E R _ I D _ T O O L B A R _ M A P = V I E W E R _ I D _ P R E F I X + " T o o l b a r M a p " ; v a r   V I E W E R _ I D _ T O O L B A R _ I M G = V I E W E R _ I D _ P R E F I X + " T o o l b a r I m g " ; v a r   V I E W E R _ I D _ L O A D I N G = V I E W E R _ I D _ P R E F I X + " L o a d i n g " ; v a r   V I E W E R _ I D _ T I M E = V I E W E R _ I D _ P R E F I X + " T i m e " ; v a r   V I E W E R _ I D _ T I T L E = V I E W E R _ I D _ P R E F I X + " T i t l e " ; v a r   V I E W E R _ I D _ B Y L I N E = V I E W E R _ I D _ P R E F I X + " B y l i n e " ; v a r   V I E W E R _ I D _ P H O T O = V I E W E R _ I D _ P R E F I X + " P h o t o " ; v a r   V I E W E R _ I D _ C T X M E N U = V I E W E R _ I D _ P R E F I X + " C t x M e n u " ; v a r   T I T L E _ M A X _ L E N G T H = 8 0 ; v a r   T O O L B A R _ I M G _ L O A D I N G _ L E F T = 2 7 3 ; v a r   T O O L B A R _ I M G _ L O A D I N G _ T O P = 2 4 ; f u n c t i o n   P h o t o V i e w e r ( w i n , h a n d l e K e y s ) { t h i s . s e t I m a g e R o o t = s e t I m a g e R o o t ; t h i s . a d d = a d d P h o t o ; t h i s . s h o w = s h o w P h o t o ; t h i s . c l o s e = c l o s e P h o t o ; t h i s . r a n d o m i z e = r a n d o m i z e ; t h i s . i s S h o w n = i s P h o t o S h o w n ; t h i s . s e t B a c k g r o u n d = s e t P h o t o B a c k g r o u n d ; t h i s . s e t S h o w T o o l b a r = s e t S h o w T o o l b a r ; t h i s . s e t T o o l b a r I m a g e = s e t T o o l b a r I m a g e ; t h i s . s e t S h o w C a l l b a c k = s e t S h o w C a l l b a c k ; t h i s . s e t C l o s e C a l l b a c k = s e t C l o s e C a l l b a c k ; t h i s . s e t E n d C a l l b a c k = s e t E n d C a l l b a c k ; t h i s . s e t L o a d i n g = s e t P h o t o L o a d i n g ; t h i s . a d d B a c k S h a d e = a d d B a c k S h a d e ; t h i s . a d d T o o l b a r = a d d T o o l b a r ; t h i s . a d d C a p t i o n s = a d d C a p t i o n s ; t h i s . a d d B y L i n e = a d d B y L i n e ; t h i s . a d d B y l i n e C a p t i o n = a d d B y l i n e C a p t i o n ; t h i s . n e x t = n e x t P h o t o ; t h i s . p r e v = p r e v P h o t o ; t h i s . f i r s t = f i r s t P h o t o ; t h i s . l a s t = l a s t P h o t o ; t h i s . s l i d e S h o w = s l i d e S h o w ; t h i s . s l i d e S h o w S t o p = s l i d e S h o w S t o p ; t h i s . s t a r t S l i d e S h o w = s t a r t S l i d e S h o w ; t h i s . h a n d l e K e y = v i e w e r H a n d l e K e y ; t h i s . c h e c k S t a r t F r a g m e n t I d e n t i f i e r = c h e c k S t a r t F r a g m e n t I d e n t i f i e r ; t h i s . c h e c k S t o p F r a g m e n t I d e n t i f i e r = c h e c k S t o p F r a g m e n t I d e n t i f i e r ; t h i s . s e t S t a r t F r a g m e n t I d e n t i f i e r = s e t S t a r t F r a g m e n t I d e n t i f i e r ; t h i s . s e t S t o p F r a g m e n t I d e n t i f i e r = s e t S t o p F r a g m e n t I d e n t i f i e r ; t h i s . e m a i l = e m a i l P h o t o ; t h i s . f a v o r i t e = f a v o r i t e P h o t o ; t h i s . p e r m a l i n k = l i n k P h o t o ; t h i s . s e t B a c k g r o u n d C o l o r = s e t B a c k g r o u n d C o l o r ; t h i s . s e t B o r d e r W i d t h = s e t B o r d e r W i d t h ; t h i s . s e t S l i d e D u r a t i o n = s e t S l i d e D u r a t i o n ; t h i s . d i s a b l e P a n n i n g = d i s a b l e P a n n i n g ; t h i s . e n a b l e P a n n i n g = e n a b l e P a n n i n g ; t h i s . d i s a b l e F a d i n g = d i s a b l e F a d i n g ; t h i s . e n a b l e F a d i n g = e n a b l e F a d i n g ; t h i s . d i s a b l e S h a d e = d i s a b l e S h a d e ; t h i s . e n a b l e S h a d e = e n a b l e S h a d e ; t h i s . s e t S h a d e C o l o r = s e t S h a d e C o l o r ; t h i s . s e t S h a d e O p a c i t y = s e t S h a d e O p a c i t y ; t h i s . s e t F o n t S i z e = s e t F o n t S i z e ; t h i s . s e t F o n t = s e t F o n t ; t h i s . e n a b l e A u t o P l a y = e n a b l e A u t o P l a y ; t h i s . d i s a b l e A u t o P l a y = d i s a b l e A u t o P l a y ; t h i s . e n a b l e E m a i l L i n k = e n a b l e E m a i l L i n k ; t h i s . d i s a b l e E m a i l L i n k = d i s a b l e E m a i l L i n k ; t h i s . e n a b l e P h o t o L i n k = e n a b l e P h o t o L i n k ; t h i s . d i s a b l e P h o t o L i n k = d i s a b l e P h o t o L i n k ; t h i s . s e t O n C l i c k E v e n t = s e t O n C l i c k E v e n t ; t h i s . s e t P h o t o O n C l i c k E v e n t = s e t P h o t o O n C l i c k E v e n t ; t h i s . s e t O n R i g h t c l i c k E v e n t = s e t O n R i g h t c l i c k E v e n t ; t h i s . e n a b l e L o o p = e n a b l e L o o p ; t h i s . d i s a b l e L o o p = d i s a b l e L o o p ; t h i s . e n a b l e T o o l b a r A n i m a t o r = e n a b l e T o o l b a r A n i m a t o r ; t h i s . d i s a b l e T o o l b a r A n i m a t o r = d i s a b l e T o o l b a r A n i m a t o r ; t h i s . e n a b l e T o o l b a r = e n a b l e T o o l b a r ; t h i s . d i s a b l e T o o l b a r = d i s a b l e T o o l b a r ; t h i s . s e t C o n t r o l s I m a g e M a p = s e t C o n t r o l s I m a g e M a p ; t h i s . s e t O v e r r i d e T o o l b a r S t y l e s = s e t O v e r r i d e T o o l b a r S t y l e s ; t h i s . s e t N o P a d d i n g = s e t N o P a d d i n g ; t h i s . g e t P h o t o = g e t P h o t o ; t h i s . g e t P h o t o I n d e x = g e t P h o t o I n d e x ; t h i s . h i d e O v e r l a p p i n g E l e m e n t s = h i d e O v e r l a p p i n g E l e m e n t s ; t h i s . s h o w O v e r l a p p i n g E l e m e n t s = s h o w O v e r l a p p i n g E l e m e n t s ; t h i s . a d d C o n t e x t M e n u = a d d C o n t e x t M e n u ; t h i s . s e t E m a i l A d d r e s s = s e t E m a i l A d d r e s s ; t h i s . i d = V I E W E R _ I D _ P R E F I X + V I E W E R _ I N D E X ; V I E W E R _ I N D E X + + ; t h i s . p h o t o s = [ ] ; t h i s . i n d e x = 0 ; t h i s . w i n = ( w i n ! = u n d e f i n e d ? w i n : w i n d o w ) ; t h i s . s h o w n = f a l s e ; t h i s . s h o w T o o l b a r = t r u e ; t h i s . b a c k g r o u n d C o l o r = " # 0 0 0 0 0 0 " ; t h i s . s h a d e C o l o r = " # 0 0 0 0 0 0 " ; t h i s . s h a d e O p a c i t y = 0 . 7 ; t h i s . b o r d e r C o l o r = " # 0 0 0 0 0 0 " ; t h i s . s h a d e C o l o r = " # 0 0 0 0 0 0 " ; t h i s . s h a d e O p a c i t y = 0 . 7 ; t h i s . b o r d e r W i d t h = B O R D E R _ W I D T H ; t h i s . b a c k g r o u n d S h a d e = t r u e ; t h i s . f a d e P h o t o s = t r u e ; t h i s . a u t o P l a y = f a l s e ; t h i s . e n a b l e E m a i l L i n k = t r u e ; t h i s . i s E n a b l e P h o t o L i n k = t r u e ; t h i s . s l i d e D u r a t i o n = S L I D E _ D U R A T I O N ; t h i s . p a n P h o t o s = S L I D E _ P H O T O S ; t h i s . f o n t S i z e = F O N T _ S I Z E ; t h i s . f o n t = u n d e f i n e d ; i f ( ( h a n d l e K e y s = = u n d e f i n e d | | h a n d l e K e y s ) & & ! V I E W E R _ K E Y _ E V E N T _ A D D E D ) { i f ( t h i s . w i n . a d d E v e n t L i s t e n e r ) { t h i s . w i n . a d d E v e n t L i s t e n e r ( " k e y d o w n " , v i e w e r H a n d l e K e y , f a l s e ) ; } e l s e { t h i s . w i n . d o c u m e n t . a t t a c h E v e n t ( " o n k e y d o w n " , v i e w e r H a n d l e K e y ) ; }  
 V I E W E R _ K E Y _ E V E N T _ A D D E D = t r u e ; }  
 t h i s . w i n . d o c u m e n t . v i e w e r = t h i s ; i f ( O P E R A )  
 t h i s . d i s a b l e F a d i n g ( ) ; }  
 v a r   V I E W E R _ K E Y _ E V E N T _ A D D E D = f a l s e ; f u n c t i o n   P h o t o I m g ( i d , s r c , w , h , t i m e , t i t l e , b y l i n e , l i n k ) { t h i s . i d = i d ; t h i s . s r c = s r c ; t h i s . w = p a r s e I n t ( w , 1 0 ) ; t h i s . h = p a r s e I n t ( h , 1 0 ) ; t h i s . t i m e = t i m e ; t h i s . t i t l e = t i t l e ; t h i s . b y l i n e = b y l i n e ; t h i s . l i n k = l i n k ; }  
 f u n c t i o n   g e t V i e w e r ( ) { v a r   v i e w e r = u n d e f i n e d ; v a r   w i n = w i n d o w ; w h i l e ( v i e w e r = = u n d e f i n e d ) { t r y { v i e w e r = w i n . d o c u m e n t . v i e w e r ; } c a t c h ( e ) { b r e a k ; }  
 i f ( w i n = = = w i n . p a r e n t ) { b r e a k ; }  
 w i n = w i n . p a r e n t ; }  
 r e t u r n   v i e w e r ; }  
 f u n c t i o n   s e t I m a g e R o o t ( r o o t ) { P _ I M G _ R O O T = r o o t ; }  
 f u n c t i o n   a d d P h o t o ( p h o t o , t i t l e , t i m e , b y l i n e , l i n k ) { v a r   t y p e = t y p e o f   p h o t o ; i f ( t y p e o f   p h o t o = = " s t r i n g " ) { p h o t o = n e w   P h o t o I m g ( u n d e f i n e d , p h o t o , u n d e f i n e d , u n d e f i n e d , t i m e , t i t l e , b y l i n e , l i n k ) ; }  
 t h i s . p h o t o s . p u s h ( p h o t o ) ; }  
 f u n c t i o n   r a n d o m i z e ( ) { v a r   o = t h i s . p h o t o s ; f o r ( v a r   j , x , i = o . l e n g t h ; i ; j = p a r s e I n t ( M a t h . r a n d o m ( ( n e w   D a t e ( ) ) . g e t S e c o n d s ( ) ) * i , 1 0 ) , x = o [ - - i ] , o [ i ] = o [ j ] , o [ j ] = x ) ; }  
 f u n c t i o n   s e t P h o t o B a c k g r o u n d ( c o l o r , b o r d e r , d o S h a d e ) { i f ( c o l o r ! = u n d e f i n e d )  
 t h i s . b a c k g r o u n d C o l o r = c o l o r ; i f ( b o r d e r ! = u n d e f i n e d )  
 t h i s . b o r d e r C o l o r = b o r d e r ; i f ( d o S h a d e ! = u n d e f i n e d )  
 t h i s . b a c k g r o u n d S h a d e = d o S h a d e ; }  
 f u n c t i o n   s e t P h o t o L o a d i n g ( i s L o a d i n g ) { t h i s . i s L o a d i n g = i s L o a d i n g ; v a r   e l t = t h i s . w i n . d o c u m e n t . g e t E l e m e n t B y I d ( V I E W E R _ I D _ L O A D I N G ) ; i f ( e l t = = u n d e f i n e d )  
 r e t u r n ; e l t . s t y l e . d i s p l a y = i s L o a d i n g ? " " : " n o n e " ; }  
 f u n c t i o n   s e t B a c k g r o u n d C o l o r ( c o l o r ) { t h i s . b a c k g r o u n d C o l o r = c o l o r ; t h i s . b o r d e r C o l o r = c o l o r ; }  
 f u n c t i o n   s e t B o r d e r W i d t h ( w i d t h ) { t h i s . b o r d e r W i d t h = w i d t h ; }  
 f u n c t i o n   s e t S l i d e D u r a t i o n ( d u r a t i o n ) { t h i s . s l i d e D u r a t i o n = d u r a t i o n ; }  
 f u n c t i o n   d i s a b l e S h a d e ( ) { t h i s . b a c k g r o u n d S h a d e = f a l s e ; }  
 f u n c t i o n   e n a b l e S h a d e ( ) { t h i s . b a c k g r o u n d S h a d e = t r u e ; }  
 f u n c t i o n   s e t S h a d e C o l o r ( c o l o r ) { t h i s . s h a d e C o l o r = c o l o r ; }  
 f u n c t i o n   s e t S h a d e O p a c i t y ( o p a c i t y ) { t h i s . s h a d e O p a c i t y = o p a c i t y ; }  
 f u n c t i o n   d i s a b l e F a d i n g ( ) { t h i s . f a d e P h o t o s = f a l s e ; }  
 f u n c t i o n   e n a b l e F a d i n g ( ) { t h i s . f a d e P h o t o s = t r u e ; }  
 f u n c t i o n   d i s a b l e P a n n i n g ( ) { t h i s . p a n P h o t o s = f a l s e ; }  
 f u n c t i o n   e n a b l e P a n n i n g ( ) { t h i s . p a n P h o t o s = t r u e ; }  
 f u n c t i o n   s e t F o n t S i z e ( s i z e ) { t h i s . f o n t S i z e = s i z e ; }  
 f u n c t i o n   s e t F o n t ( f o n t ) { t h i s . f o n t = f o n t ; }  
 f u n c t i o n   e n a b l e A u t o P l a y ( ) { t h i s . a u t o P l a y = t r u e ; }  
 f u n c t i o n   d i s a b l e A u t o P l a y ( ) { t h i s . a u t o P l a y = f a l s e ; }  
 f u n c t i o n   e n a b l e E m a i l L i n k ( ) { t h i s . e n a b l e E m a i l L i n k = t r u e ; }  
 f u n c t i o n   d i s a b l e E m a i l L i n k ( ) { t h i s . e n a b l e E m a i l L i n k = f a l s e ; }  
 f u n c t i o n   e n a b l e P h o t o L i n k ( ) { t h i s . i s E n a b l e P h o t o L i n k = t r u e ; }  
 f u n c t i o n   d i s a b l e P h o t o L i n k ( ) { t h i s . i s E n a b l e P h o t o L i n k = f a l s e ; }  
 f u n c t i o n   s e t O n C l i c k E v e n t ( n e w f u n c ) { t h i s . c u s t o m O n C l i c k E v e n t = n e w f u n c ; }  
 f u n c t i o n   s e t P h o t o O n C l i c k E v e n t ( n e w f u n c ) { t h i s . p h o t o O n C l i c k E v e n t = n e w f u n c ; }  
 f u n c t i o n   s e t O n R i g h t c l i c k E v e n t ( n e w f u n c ) { t h i s . c u s t o m O n R i g h t c l i c k E v e n t = n e w f u n c ; }  
 f u n c t i o n   e n a b l e L o o p ( ) { t h i s . l o o p = t r u e ; }  
 f u n c t i o n   d i s a b l e L o o p ( ) { t h i s . l o o p = f a l s e ; }  
 f u n c t i o n   e n a b l e T o o l b a r ( ) { t h i s . s h o w T o o l b a r = t r u e ; }  
 f u n c t i o n   d i s a b l e T o o l b a r ( ) { t h i s . s h o w T o o l b a r = f a l s e ; }  
 f u n c t i o n   e n a b l e T o o l b a r A n i m a t o r ( ) { t h i s . t o o l b a r A n i m a t o r = n e w   T o o l b a r A n i m a t o r ( t h i s ) ; }  
 f u n c t i o n   d i s a b l e T o o l b a r A n i m a t o r ( ) { i f ( t h i s . t o o l b a r A n i m a t o r ! = u n d e f i n e d ) { t h i s . t o o l b a r A n i m a t o r . r e s e t ( ) ; t h i s . t o o l b a r A n i m a t o r = u n d e f i n e d ; } }  
 f u n c t i o n   s e t C o n t r o l s I m a g e M a p ( i m a g e m a p ) { t h i s . c u s t o m I m a g e M a p = i m a g e m a p ; }  
 f u n c t i o n   s e t O v e r r i d e T o o l b a r S t y l e s ( o v e r r i d e T o o l b a r S t y l e s ) { t h i s . o v e r r i d e T o o l b a r S t y l e s = o v e r r i d e T o o l b a r S t y l e s ; }  
 f u n c t i o n   s e t N o P a d d i n g ( n o p a d d i n g ) { t h i s . n o p a d d i n g = n o p a d d i n g ; }  
 f u n c t i o n   s e t E m a i l A d d r e s s ( a d d r e s s ) { t h i s . e m a i l A d d r e s s = a d d r e s s ; }  
 f u n c t i o n   g e t P h o t o ( ) { r e t u r n   t h i s . p h o t o s [ t h i s . i n d e x ] ; }  
 f u n c t i o n   g e t P h o t o I n d e x ( s r c ) { i f ( ! s r c | | s r c . l e n g t h = = = 0 ) r e t u r n - 1 ; f o r ( v a r   i = 0 ; i < t h i s . p h o t o s . l e n g t h ; i + + ) { i f ( t h i s . p h o t o s [ i ] . s r c = = s r c ) r e t u r n   i ; }  
 r e t u r n - 1 ; }  
 f u n c t i o n   s h o w P h o t o ( i n d e x , c r o p W i d t h , o p a c i t y ) { i f ( t h i s . p h o t o s . l e n g t h = = = 0 ) { r e t u r n   t r u e ; }  
 i f ( g e t R o o t W i n d o w ( ) . p e r m i s s i o n D e n i e d & & t h i s . b a d g e M o d e = = u n d e f i n e d & & ! g e t R o o t W i n d o w ( ) . l i v e m o d e ) { t h i s . s e t S t a r t F r a g m e n t I d e n t i f i e r ( i n d e x ) ; r e t u r n   t r u e ; }  
 i f ( i n d e x ! = u n d e f i n e d )  
 t h i s . i n d e x = i n d e x ; i f ( t h i s . i n d e x < 0 | | t h i s . i n d e x > = t h i s . p h o t o s . l e n g t h ) { l o g . e r r o r ( " I n v a l i d   p h o t o   i n d e x " ) ; r e t u r n   t r u e ; }  
 v a r   d o c = t h i s . w i n . d o c u m e n t ; v a r   f i r s t S h o w = f a l s e ; i f ( ! t h i s . s h o w n ) { f i r s t S h o w = t r u e ; d o c . v i e w e r = t h i s ; t r y { t h i s . h i d e O v e r l a p p i n g E l e m e n t s ( ) ; } c a t c h ( e ) { } }  
 v a r   z I n d e x = 1 6 3 8 4 ; v a r   w i n S i z e = g e t W i n d o w S i z e ( t h i s . w i n ) ; v a r   a v a i l W = w i n S i z e . w - ( t h i s . n o p a d d i n g ? t h i s . b o r d e r W i d t h * 2 : 2 0 ) ; v a r   a v a i l H = w i n S i z e . h - ( t h i s . n o p a d d i n g ? t h i s . b o r d e r W i d t h * 2 : 2 0 ) ; v a r   s c r o l l P o s = g e t S c r o l l P o s ( t h i s . w i n ) ; v a r   s c r o l l L e f t = s c r o l l P o s . l e f t ; v a r   s c r o l l T o p = s c r o l l P o s . t o p ; t h i s . a d d B a c k S h a d e ( z I n d e x ) ; t h i s . a d d B y L i n e ( z I n d e x ) ; t h i s . a d d B y l i n e C a p t i o n ( ) ; i f ( t h i s . s h o w T o o l b a r ) { t h i s . a d d T o o l b a r ( a v a i l W , z I n d e x ) ; t h i s . a d d C a p t i o n s ( ) ; }  
 v a r   p h o t o = t h i s . p h o t o s [ t h i s . i n d e x ] ; i f ( i s N a N ( p h o t o . w ) | | i s N a N ( p h o t o . h ) ) { i f ( p h o t o . p r e l o a d I m a g e ! = u n d e f i n e d ) { i f ( i s N a N ( p h o t o . w ) & & p h o t o . p r e l o a d I m a g e . w i d t h > 0 )  
 p h o t o . w = p h o t o . p r e l o a d I m a g e . w i d t h ; i f ( i s N a N ( p h o t o . h ) & & p h o t o . p r e l o a d I m a g e . h e i g h t > 0 )  
 p h o t o . h = p h o t o . p r e l o a d I m a g e . h e i g h t ; } e l s e { t h i s . i n d e x - - ; t h i s . n e x t ( ) ; r e t u r n   f a l s e ; } }  
 i f ( i s N a N ( p h o t o . w ) | | i s N a N ( p h o t o . h ) ) { t h i s . i n d e x - - ; t h i s . n e x t ( ) ; r e t u r n   f a l s e ; }  
 t h i s . s h o w n = t r u e ; v a r   o f f s e t = ( t h i s . n o p a d d i n g ? 0 : 2 0 ) ; v a r   p w = - 1 ; v a r   p h = - 1 ; i f ( p a r s e I n t ( p h o t o . w ) > a v a i l W | | p a r s e I n t ( p h o t o . h ) > a v a i l H ) { i f ( p a r s e I n t ( p h o t o . w ) / a v a i l W > p a r s e I n t ( p h o t o . h ) / a v a i l H ) { p w = a v a i l W - o f f s e t ; p h = p a r s e I n t ( p w * p h o t o . h / p h o t o . w ) ; } e l s e { p h = a v a i l H - o f f s e t ; p w = p a r s e I n t ( p h * p h o t o . w / p h o t o . h ) ; } } e l s e { p w = p a r s e I n t ( p h o t o . w ) ; p h = p a r s e I n t ( p h o t o . h ) ; }  
 i f ( p w < = 0 | | p h < = 0 ) { i f ( ! t h i s . s h o w T o o l b a r )  
 t h r o w " M i s s i n g   p h o t o   d i m e n s i o n " ; }  
 i f ( c r o p W i d t h = = u n d e f i n e d )  
 c r o p W i d t h = 0 ; v a r   p h o t o D i v = d o c . c r e a t e E l e m e n t ( " d i v " ) ; p h o t o D i v . i d = V I E W E R _ I D _ P H O T O ; p h o t o D i v . 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 D i v . s t y l e . p o s i t i o n = " a b s o l u t e " ; p h o t o D i v . s t y l e . z I n d e x = z I n d e x ; p h o t o D i v . s t y l e . o v e r f l o w = " h i d d e n " ; p h o t o D i v . s t y l e . b o r d e r = t h i s . b o r d e r W i d t h + " p x   s o l i d   " + t h i s . b o r d e r C o l o r ; p h o t o D i v . s t y l e . t e x t A l i g n = " c e n t e r " ; p h o t o D i v . s t y l e . b a c k g r o u n d C o l o r = t h i s . b a c k g r o u n d C o l o r ; v a r   p h o t o E l t = d o c . c r e a t e E l e m e n t ( " i m g " ) ; p h o t o E l t . 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 E l t . s t y l e . p o s i t i o n = " r e l a t i v e " ; p h o t o E l t . s t y l e . b a c k g r o u n d C o l o r = t h i s . b a c k g r o u n d C o l o r ; p h o t o E l t . s t y l e . b o r d e r = " n o n e " ; p h o t o E l t . s t y l e . c u r s o r = " p o i n t e r " ; p h o t o E l t . s t y l e . z I n d e x = ( p a r s e I n t ( p h o t o D i v . s t y l e . z I n d e x ) + 1 ) + " " ; p h o t o E l t . o n c l i c k = t h i s . p h o t o O n C l i c k E v e n t ? t h i s . p h o t o O n C l i c k E v e n t : o n C l i c k E v e n t ; p h o t o E l t . o n c o n t e x t m e n u = o n C o n t e x t M e n u E v e n t ; i f ( o p a c i t y ! = u n d e f i n e d & & t h i s . f a d e P h o t o s ) { v a r   f a d e E l t = ( F A D E _ B O R D E R ? p h o t o D i v : p h o t o E l t ) ; s e t O p a c i t y ( f a d e E l t , o p a c i t y ) ; }  
 v a r   l e f t = p a r s e I n t ( ( a v a i l W - p w ) / 2 ) + ( t h i s . n o p a d d i n g ? 0 : O F F S E T _ L E F T ) ; p h o t o D i v . s t y l e . l e f t = ( l e f t + s c r o l l L e f t + c r o p W i d t h / 2 ) + " p x " ; v a r   t o p = p a r s e I n t ( ( a v a i l H - p h ) / 2 ) + ( t h i s . n o p a d d i n g ? 0 : O F F S E T _ T O P ) ; p h o t o D i v . s t y l e . t o p = ( t o p + s c r o l l T o p ) + " p x " ; p h o t o E l t . 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 D i v . s t y l e . w i d t h = ( p w - c r o p W i d t h > 0 ? p w - c r o p W i d t h : p w ) + " p x " ; p h o t o D i v . s t y l e . h e i g h t = p h + " p x " ; p h o t o E l t . s t y l e . w i d t h = p w + " p x " ; p h o t o E l t . s t y l e . h e i g h t = p h + " p x " ; p h o t o E l t . s r c = p h o t o . s r c ; p h o t o D i v . 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 E l t . 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 D i v . a p p e n d C h i l d ( p h o t o E l t ) ; d o c . b o d y . a p p e n d C h i l d ( p h o t o D i v ) ; i f ( t h i s . p h o t o D i v ! = u n d e f i n e d ) { t r y { d o c . b o d y . r e m o v e C h i l d ( t h i s . p h o t o D i v ) ; } c a t c h ( e ) { } }  
 t h i s . p h o t o D i v = p h o t o D i v ; t h i s . p h o t o I m g = p h o t o E l t ; t h i s . s e t L o a d i n g ( f a l s e ) ; i f ( t h i s . s h o w C a l l b a c k ! = u n d e f i n e d )  
 t h i s . s h o w C a l l b a c k ( t h i s . i n d e x ) ; i f ( f i r s t S h o w & & t h i s . a u t o P l a y ) { t h i s . s l i d e S h o w ( t r u e ) ; }  
 r e t u r n   f a l s e ; }  
 f u n c t i o n   i s P h o t o S h o w n ( ) { r e t u r n   t h i s . s h o w n ; }  
 f u n c t i o n   c l o s e V i e w e r ( ) { g e t V i e w e r ( ) . c l o s e ( ) ; }  
 f u n c t i o n   o n P h o t o L o a d ( e v e n t ) { v a r   v i e w e r = g e t V i e w e r ( ) ; i f ( v i e w e r ! = u n d e f i n e d ) { i f ( f l i c k r H a c k ( v i e w e r , v i e w e r . i n d e x ) ) { v i e w e r . s e t L o a d i n g ( f a l s e ) ; v i e w e r . i n d e x - - ; v i e w e r . n e x t ( ) ; r e t u r n ; }  
 v i e w e r . s h o w ( ) ; } }  
 f u n c t i o n   c l o s e P h o t o ( ) { v a r   w i n = t h i s . w i n ; i f ( w i n = = u n d e f i n e d )  
 w i n = w i n d o w ; v a r   d o c = w i n . d o c u m e n t ; v a r   e l t = t h i s . p h o t o D i v ; i f ( e l t ! = u n d e f i n e d )  
 d o c . b o d y . r e m o v e C h i l d ( e l t ) ; e l t = d o c . g e t E l e m e n t B y I d ( V I E W E R _ I D _ T O O L B A R ) ; i f ( e l t ! = u n d e f i n e d )  
 d o c . b o d y . r e m o v e C h i l d ( e l t ) ; e l t = d o c . g e t E l e m e n t B y I d ( V I E W E R _ I D _ B Y L I N E ) ; i f ( e l t ! = u n d e f i n e d )  
 d o c . b o d y . r e m o v e C h i l d ( e l t ) ; e l t = d o c . g e t E l e m e n t B y I d ( V I E W E R _ I D _ B A C K ) ; i f ( e l t ! = u n d e f i n e d )  
 d o c . b o d y . r e m o v e C h i l d ( e l t ) ; t h i s . s h o w n = f a l s e ; t h i s . s l i d e S h o w R u n n i n g = f a l s e ; t h i s . s l i d e S h o w P a u s e d = f a l s e ; t r y { t h i s . s h o w O v e r l a p p i n g E l e m e n t s ( ) ; } c a t c h ( e ) { l o g . e r r o r ( e ) ; }  
 i f ( t h i s . t o o l b a r A n i m a t o r ! = u n d e f i n e d ) { t h i s . t o o l b a r A n i m a t o r . r e s e t ( ) ; }  
 i f ( t h i s . c l o s e C a l l b a c k ! = u n d e f i n e d )  
 t h i s . c l o s e C a l l b a c k ( t h i s . i n d e x ) ; i f ( t h i s . c o n t e x t M e n u ! = u n d e f i n e d )  
 t h i s . c o n t e x t M e n u . h i d e ( ) ; }  
 f u n c t i o n   n e x t P h o t o ( n ) { i f ( t h i s . c o n t e x t M e n u ! = u n d e f i n e d & & t h i s . c o n t e x t M e n u . v i s i b l e )  
 t h i s . c o n t e x t M e n u . h i d e ( ) ; i f ( t h i s . i s L o a d i n g )  
 r e t u r n ; i f ( n = = u n d e f i n e d )  
 n = 1 ; v a r   o l d I n d e x = t h i s . i n d e x ; i f ( t h i s . i n d e x + n > = t h i s . p h o t o s . l e n g t h ) { i f ( t h i s . l o o p & & n ! = t h i s . p h o t o s . l e n g t h ) { t h i s . i n d e x = 0 ; } e l s e { t h i s . i n d e x = t h i s . p h o t o s . l e n g t h - 1 ; } } e l s e   i f ( t h i s . i n d e x + n < 0 ) { i f ( n < - 1 )  
 t h i s . i n d e x = 0 ; e l s e   i f ( t h i s . l o o p )  
 t h i s . i n d e x = t h i s . p h o t o s . l e n g t h - 1 ; e l s e  
 r e t u r n ; } e l s e { t h i s . i n d e x + = n ; }  
 i f ( t h i s . i n d e x = = o l d I n d e x )  
 r e t u r n ; t h i s . s l i d e S h o w S t o p ( ) ; v a r   i m g = n e w   I m a g e ( ) ; t h i s . p h o t o s [ t h i s . i n d e x ] . p r e l o a d I m a g e = i m g ; t h i s . s e t L o a d i n g ( t r u e ) ; i m g . o n l o a d = o n P h o t o L o a d ; i m g . o n e r r o r = o n P h o t o L o a d ; i f ( t h i s . p h o t o s [ t h i s . i n d e x ] . s r c ! = u n d e f i n e d ) { i m g . s r c = t h i s . p h o t o s [ t h i s . i n d e x ] . s r c ; } e l s e { o n P h o t o L o a d ( ) ; } }  
 f u n c t i o n   p r e v P h o t o ( n ) { i f ( t h i s . c o n t e x t M e n u ! = u n d e f i n e d & & t h i s . c o n t e x t M e n u . v i s i b l e )  
 t h i s . c o n t e x t M e n u . h i d e ( ) ; i f ( n = = u n d e f i n e d )  
 n = 1 ; t h i s . n e x t ( - n ) ; }  
 f u n c t i o n   f i r s t P h o t o ( ) { i f ( t h i s . c o n t e x t M e n u ! = u n d e f i n e d & & t h i s . c o n t e x t M e n u . v i s i b l e )  
 t h i s . c o n t e x t M e n u . h i d e ( ) ; t h i s . p r e v ( t h i s . p h o t o s . l e n g t h ) ; }  
 f u n c t i o n   l a s t P h o t o ( ) { i f ( t h i s . c o n t e x t M e n u ! = u n d e f i n e d & & t h i s . c o n t e x t M e n u . v i s i b l e )  
 t h i s . c o n t e x t M e n u . h i d e ( ) ; t h i s . n e x t ( t h i s . p h o t o s . l e n g t h ) ; }  
 f u n c t i o n   s t a r t S l i d e S h o w ( ) { i f ( t h i s . c o n t e x t M e n u ! = u n d e f i n e d & & t h i s . c o n t e x t M e n u . v i s i b l e )  
 t h i s . c o n t e x t M e n u . h i d e ( ) ; g e t V i e w e r ( ) . s l i d e S h o w ( t r u e ) ; }  
 v a r   s l i d e T i m e o u t ; v a r   s l i d e P r e l o a d I m a g e L o a d e d = f a l s e ; v a r   s l i d e P r e l o a d T i m e = u n d e f i n e d ; f u n c t i o n   s l i d e S h o w ( s t a r t ) { i f ( t h i s . t o o l b a r A n i m a t o r ! = u n d e f i n e d )  
 t h i s . t o o l b a r A n i m a t o r . s l i d e s h o w A c t i o n ( ) ; v a r   n e x t I n d e x = t h i s . i n d e x + 1 ; i f ( n e x t I n d e x > = t h i s . p h o t o s . l e n g t h ) { i f ( t h i s . l o o p )  
 n e x t I n d e x = 0 ; e l s e   i f ( ! t h i s . s l i d e S h o w P a u s e d & & ! t h i s . s l i d e S h o w R u n n i n g ) { t h i s . s e t T o o l b a r I m a g e ( P _ I M G _ R O O T + " / " + T O O L B A R _ I M G ) ; r e t u r n ; } }  
 v a r   d o c = t h i s . w i n . d o c u m e n t ; v a r   v i e w e r = t h i s ; v a r   p h o t o E l t = t h i s . p h o t o I m g ; i f ( p h o t o E l t = = u n d e f i n e d )  
 r e t u r n ; v a r   p h o t o D i v = t h i s . p h o t o D i v ; v a r   f a d e E l t = ( F A D E _ B O R D E R ? p h o t o D i v : p h o t o E l t ) ; i f ( s t a r t ! = u n d e f i n e d & & s t a r t = = = t r u e ) { i f ( t h i s . s l i d e S h o w P a u s e d ) { t h i s . s l i d e S h o w P a u s e d = f a l s e ; t h i s . s e t T o o l b a r I m a g e ( P _ I M G _ R O O T + " / " + T O O L B A R _ I M G _ R U N N I N G ) ; i f ( t h i s . c o n t e x t M e n u ! = u n d e f i n e d & & t h i s . c o n t e x t M e n u . v i s i b l e )  
 t h i s . c o n t e x t M e n u . h i d e ( ) ; r e t u r n ; } e l s e   i f ( t h i s . s l i d e S h o w R u n n i n g ) { t h i s . s l i d e S h o w P a u s e d = t r u e ; t h i s . s e t T o o l b a r I m a g e ( P _ I M G _ R O O T + " / " + T O O L B A R _ I M G ) ; r e t u r n ; } e l s e { i f ( t h i s . c o n t e x t M e n u ! = u n d e f i n e d & & t h i s . c o n t e x t M e n u . v i s i b l e )  
 t h i s . c o n t e x t M e n u . h i d e ( ) ; t h i s . s l i d e S h o w R u n n i n g = t r u e ; t h i s . s l i d e S h o w P a u s e d = f a l s e ; t h i s . s l i d e F i r s t P h o t o = t r u e ; t h i s . s e t T o o l b a r I m a g e ( P _ I M G _ R O O T + " / " + T O O L B A R _ I M G _ R U N N I N G ) ; }  
 i f ( t h i s . i s L o a d i n g | | t h i s . i n d e x > t h i s . p h o t o s . l e n g t h - 1 ) { r e t u r n ; } } e l s e   i f ( t h i s . s l i d e S h o w P a u s e d ) { w i n d o w . s e t T i m e o u t ( f u n c t i o n ( ) { v i e w e r . s l i d e S h o w ( f a l s e ) ; } , 2 0 0 ) ; r e t u r n ; } e l s e   i f ( ! t h i s . s l i d e S h o w R u n n i n g ) { t h i s . s e t T o o l b a r I m a g e ( P _ I M G _ R O O T + " / " + T O O L B A R _ I M G ) ; r e t u r n ; }  
 v a r   l e f t = 0 ; i f ( p h o t o E l t . l e f t O f f s e t ! = u n d e f i n e d ) { l e f t = p a r s e F l o a t ( p h o t o E l t . l e f t O f f s e t ) ; }  
 i f ( l e f t = = = 0 ) { i f ( n e x t I n d e x < t h i s . p h o t o s . l e n g t h ) { s l i d e P r e l o a d I m a g e L o a d e d = f a l s e ; v a r   s l i d e P r e l o a d I m a g e = n e w   I m a g e ( ) ; t h i s . p h o t o s [ n e x t I n d e x ] . p r e l o a d I m a g e = s l i d e P r e l o a d I m a g e ; s l i d e P r e l o a d T i m e = g e t T i m e M i l l i s ( ) ; s l i d e P r e l o a d I m a g e . o n l o a d = o n S l i d e L o a d ; s l i d e P r e l o a d I m a g e . o n e r r o r = o n S l i d e L o a d ; s l i d e P r e l o a d I m a g e . s r c = t h i s . p h o t o s [ n e x t I n d e x ] . s r c ; } }  
 i f ( l e f t > - S L I D E _ O F F S E T ) { l e f t - = M O V E _ S T E P ; i f ( - l e f t < = F A D E _ S T E P S ) { i f ( f a d e E l t . s t y l e . o p a c i t y ! = u n d e f i n e d & & p a r s e F l o a t ( f a d e E l t . s t y l e . o p a c i t y ) < 1 ) { i f ( t h i s . f a d e P h o t o s & & t h i s . p h o t o s [ t h i s . i n d e x ] . s r c ! = u n d e f i n e d )  
 s e t O p a c i t y ( f a d e E l t , - l e f t / F A D E _ S T E P S ) ; } } e l s e   i f ( l e f t + S L I D E _ O F F S E T < F A D E _ S T E P S ) { i f ( n e x t I n d e x < t h i s . p h o t o s . l e n g t h & & ! s l i d e P r e l o a d I m a g e L o a d e d ) { i f ( s l i d e P r e l o a d T i m e ! = u n d e f i n e d & & g e t T i m e M i l l i s ( ) - s l i d e P r e l o a d T i m e > P R E L O A D _ T I M E O U T )  
 s l i d e P r e l o a d I m a g e L o a d e d = t r u e ; l e f t + + ; t h i s . s e t L o a d i n g ( t r u e ) ; } e l s e { i f ( n e x t I n d e x < t h i s . p h o t o s . l e n g t h & & t h i s . f a d e P h o t o s & & t h i s . p h o t o s [ t h i s . i n d e x ] . s r c ! = u n d e f i n e d )  
 s e t O p a c i t y ( f a d e E l t , ( l e f t + S L I D E _ O F F S E T ) / F A D E _ S T E P S ) ; } }  
 p h o t o E l t . l e f t O f f s e t = l e f t ; i f ( t h i s . p a n P h o t o s & & ! t h i s . s l i d e F i r s t P h o t o ) { p h o t o E l t . s t y l e . l e f t = l e f t + " p x " ; } } e l s e { i f ( n e x t I n d e x > = t h i s . p h o t o s . l e n g t h ) { t h i s . s l i d e S h o w R u n n i n g = f a l s e ; t h i s . s l i d e S h o w P a u s e d = f a l s e ; t h i s . s e t T o o l b a r I m a g e ( P _ I M G _ R O O T + " / " + T O O L B A R _ I M G ) ; i f ( t h i s . t o o l b a r A n i m a t o r ! = u n d e f i n e d )  
 t h i s . t o o l b a r A n i m a t o r . r e s e t ( ) ; i f ( t h i s . e n d C a l l b a c k ! = u n d e f i n e d )  
 t h i s . e n d C a l l b a c k ( ) ; r e t u r n ; }  
 t h i s . i n d e x = n e x t I n d e x ; t h i s . s l i d e F i r s t P h o t o = f a l s e ; t h i s . s h o w ( u n d e f i n e d , ( t h i s . p a n P h o t o s ? S L I D E _ O F F S E T : 0 ) , 0 ) ; f a d e E l t = ( F A D E _ B O R D E R ? t h i s . p h o t o D i v : t h i s . p h o t o I m g ) ; i f ( t h i s . f a d e P h o t o s )  
 s e t O p a c i t y ( f a d e E l t , 0 ) ; t h i s . p h o t o I m g . l e f t O f f s e t = 0 ; i f ( t h i s . p a n P h o t o s )  
 t h i s . p h o t o I m g . s t y l e . l e f t = " 0 p x " ; }  
 v a r   p a u s e = t h i s . s l i d e D u r a t i o n / S L I D E _ O F F S E T ; i f ( t h i s . s l i d e F i r s t P h o t o ) { p a u s e / = 2 ; }  
 s l i d e T i m e o u t = w i n d o w . s e t T i m e o u t ( f u n c t i o n ( ) { v i e w e r . s l i d e S h o w ( f a l s e ) ; } , p a u s e ) ; }  
 f u n c t i o n   o n S l i d e L o a d ( e v e n t ) { v a r   v i e w e r = g e t V i e w e r ( ) ; i f ( v i e w e r ! = u n d e f i n e d ) { i f ( f l i c k r H a c k ( v i e w e r , v i e w e r . i n d e x + 1 ) ) { v a r   s l i d e P r e l o a d I m a g e = v i e w e r . p h o t o s [ v i e w e r . i n d e x + 1 ] . p r e l o a d I m a g e ; s l i d e P r e l o a d I m a g e . s r c = v i e w e r . p h o t o s [ v i e w e r . i n d e x + 1 ] . s r c ; s l i d e P r e l o a d T i m e = g e t T i m e M i l l i s ( ) ; r e t u r n ; }  
 s l i d e P r e l o a d I m a g e L o a d e d = t r u e ; v i e w e r . s e t L o a d i n g ( f a l s e ) ; } }  
 f u n c t i o n   s l i d e S h o w S t o p ( ) { t h i s . s l i d e S h o w R u n n i n g = f a l s e ; t h i s . s l i d e S h o w P a u s e d = f a l s e ; v a r   d o c = t h i s . w i n . d o c u m e n t ; v a r   p h o t o E l t = t h i s . p h o t o I m g ; i f ( p h o t o E l t ! = u n d e f i n e d ) { i f ( t h i s . f a d e P h o t o s ) { v a r   f a d e E l t = ( F A D E _ B O R D E R ? t h i s . p h o t o D i v : p h o t o E l t ) ; s e t O p a c i t y ( f a d e E l t , 1 ) ; }  
 p h o t o E l t . s t y l e . l e f t = " 0 p x " ; } }  
 f u n c t i o n   a d d B a c k S h a d e ( z I n d e x ) { v a r   d o c = t h i s . w i n . d o c u m e n t ; i f ( d o c . g e t E l e m e n t B y I d ( V I E W E R _ I D _ B A C K ) ! = u n d e f i n e d ) { r e t u r n ; }  
 v a r   p h o t o B a c k = d o c . c r e a t e E l e m e n t ( " d i v " ) ; p h o t o B a c k . i d = V I E W E R _ I D _ B A C K ; p h o t o B a c k . s t y l e . t o p = " 0 p x " ; p h o t o B a c k . s t y l e . l e f t = " 0 p x " ; p h o t o B a c k . s t y l e . b o t t o m = " 0 p x " ; p h o t o B a c k . s t y l e . r i g h t = " 0 p x " ; p h o t o B a c k . s t y l e . m a r g i n = " 0 " ; p h o t o B a c k . s t y l e . p a d d i n g = " 0 " ; p h o t o B a c k . s t y l e . b o r d e r = " n o n e " ; p h o t o B a c k . s t y l e . c u r s o r = " p o i n t e r " ; i f ( I E & & ! ( I E 7 & & S T R I C T _ M O D E ) ) { p h o t o B a c k . s t y l e . p o s i t i o n = " a b s o l u t e " ; v a r   d o c S i z e = g e t D o c u m e n t S i z e ( t h i s . w i n ) ; p h o t o B a c k . s t y l e . w i d t h = ( d o c S i z e . w - 2 1 ) + " p x " ; p h o t o B a c k . s t y l e . h e i g h t = ( d o c S i z e . h - 4 ) + " p x " ; } e l s e { p h o t o B a c k . s t y l e . p o s i t i o n = " f i x e d " ; p h o t o B a c k . s t y l e . w i d t h = " 1 0 0 % " ; p h o t o B a c k . s t y l e . h e i g h t = " 1 0 0 % " ; }  
 p h o t o B a c k . s t y l e . z I n d e x = z I n d e x - 1 ; p h o t o B a c k . s t y l e . b a c k g r o u n d C o l o r = t h i s . s h a d e C o l o r ; i f ( t h i s . b a c k g r o u n d S h a d e )  
 s e t O p a c i t y ( p h o t o B a c k , t h i s . s h a d e O p a c i t y ) ; e l s e  
 s e t O p a c i t y ( p h o t o B a c k , 0 . 0 ) ; p h o t o B a c k . o n c l i c k = o n C l i c k E v e n t ; d o c . b o d y . a p p e n d C h i l d ( p h o t o B a c k ) ; }  
 f u n c t i o n   a d d T o o l b a r ( a v a i l W , z I n d e x ) { v a r   d o c = t h i s . w i n . d o c u m e n t ; v a r   i ; i f ( d o c . g e t E l e m e n t B y I d ( V I E W E R _ I D _ T O O L B A R ) ! = u n d e f i n e d )  
 r e t u r n ; v a r   p h o t o T o o l b a r = d o c . c r e a t e E l e m e n t ( " d i v " ) ; p h o t o T o o l b a r . i d = V I E W E R _ I D _ T O O L B A R ; s e t O p a c i t y ( p h o t o T o o l b a r , T O O L B A R _ O P A C I T Y ) ; p h o t o T o o l b a r . s t y l e . z I n d e x = z I n d e x + 1 ; v a r   i m g B a c k = T O O L B A R _ I M G _ B A C K ; i f ( ! i s H o s t e d ( ) ) { i m g B a c k + = " - n o l o g o " ; }  
 i f ( I E & & ! I E 7 ) { i m g B a c k + = " - i n d e x e d " ; }  
 i m g B a c k + = " . p n g " ; i f ( ! t h i s . o v e r r i d e T o o l b a r S t y l e s ) { v a r   b o t t o m = 1 0 ; i f ( I E & & ! ( I E 7 & & S T R I C T _ M O D E ) ) { p h o t o T o o l b a r . s t y l e . p o s i t i o n = " a b s o l u t e " ; i f ( I E 7 | | I E 8 ) { v a r   t o p = g e t W i n d o w S i z e ( t h i s . w i n ) . h + g e t S c r o l l P o s ( t h i s . w i n ) . t o p ; p h o t o T o o l b a r . s t y l e . t o p = ( t o p - T O O L B A R _ H - 1 0 ) + " p x " ; } e l s e { p h o t o T o o l b a r . s t y l e . b o t t o m = b o t t o m + " p x " ; } } e l s e { p h o t o T o o l b a r . s t y l e . p o s i t i o n = " f i x e d " ; p h o t o T o o l b a r . s t y l e . b o t t o m = b o t t o m + " p x " ; }  
 p h o t o T o o l b a r . s t y l e . l e f t = ( a v a i l W - T O O L B A R _ W + 1 0 ) / 2 + " p x " ; p h o t o T o o l b a r . s t y l e . w i d t h = T O O L B A R _ W + " p x " ; p h o t o T o o l b a r . s t y l e . h e i g h t = T O O L B A R _ H + " p x " ; p h o t o T o o l b a r . s t y l e . t e x t A l i g n = " c e n t e r " ; p h o t o T o o l b a r . s t y l e . b a c k g r o u n d I m a g e = " u r l ( ' " + P _ I M G _ R O O T + " / " + i m g B a c k + " ' ) " ; p h o t o T o o l b a r . s t y l e . b a c k g r o u n d P o s i t i o n = " 5 0 %   0 % " ; p h o t o T o o l b a r . s t y l e . b a c k g r o u n d R e p e a t = " n o - r e p e a t " ; p h o t o T o o l b a r . s t y l e . l i n e H e i g h t = L I N E _ H E I G H T ; p h o t o T o o l b a r . s t y l e . b o r d e r = " n o n e " ; }  
 v a r   t o o l b a r M a s k = u n d e f i n e d ; i f ( ! t h i s . e n a b l e E m a i l L i n k & & T O O L B A R _ I M G _ M A S K ! = u n d e f i n e d ) { t o o l b a r M a s k = d o c . c r e a t e E l e m e n t ( " i m g " ) ; t o o l b a r M a s k . s t y l e . p o s i t i o n = " a b s o l u t e " ; t o o l b a r M a s k . s t y l e . w i d t h = 4 4 ; t o o l b a r M a s k . s t y l e . h e i g h t = 4 4 ; t o o l b a r M a s k . s t y l e . l e f t = " 2 8 9 p x " ; t o o l b a r M a s k . s t y l e . t o p = " 0 p x " ; t o o l b a r M a s k . s t y l e . b o r d e r = " n o n e " ; t o o l b a r M a s k . s r c = P _ I M G _ R O O T + " / " + T O O L B A R _ I M G _ M A S K ; p h o t o T o o l b a r . a p p e n d C h i l d ( t o o l b a r M a s k ) ; }  
 i f ( ! t h i s . i s E n a b l e P h o t o L i n k & & T O O L B A R _ I M G _ M A S K ! = u n d e f i n e d ) { t o o l b a r M a s k = d o c . c r e a t e E l e m e n t ( " i m g " ) ; t o o l b a r M a s k . s t y l e . p o s i t i o n = " a b s o l u t e " ; t o o l b a r M a s k . s t y l e . w i d t h = 4 4 ; t o o l b a r M a s k . s t y l e . h e i g h t = 4 4 ; t o o l b a r M a s k . s t y l e . l e f t = " 3 3 9 p x " ; t o o l b a r M a s k . s t y l e . t o p = " 0 p x " ; t o o l b a r M a s k . s t y l e . b o r d e r = " n o n e " ; t o o l b a r M a s k . s r c = P _ I M G _ R O O T + " / " + T O O L B A R _ I M G _ M A S K ; p h o t o T o o l b a r . a p p e n d C h i l d ( t o o l b a r M a s k ) ; }  
 v a r   i m g M a p = t h i s . c u s t o m I m a g e M a p ; i f ( i m g M a p = = = u n d e f i n e d ) { i m g M a p = d o c . c r e a t e E l e m e n t ( " m a p " ) ; v a r   s s l = f a l s e ; t r y { s s l = ( w i n d o w . p a r e n t . d o c u m e n t . l o c a t i o n . p r o t o c o l = = " h t t p s : " ) ; } c a t c h ( e x ) { }  
 v a r   a r e a s = [ ] ; a r e a s . p u s h ( [ " g e t V i e w e r ( ) . f i r s t ( ) " , " 1 7 " , g e t M e s s a g e ( " p h o t o v i e w e r . t o o l b a r . f i r s t " ) ] ) ; a r e a s . p u s h ( [ " g e t V i e w e r ( ) . p r e v ( ) " , " 6 8 " , g e t M e s s a g e ( " p h o t o v i e w e r . t o o l b a r . p r e v " ) ] ) ; a r e a s . p u s h ( [ " g e t V i e w e r ( ) . s l i d e S h o w ( t r u e ) " , " 1 2 2 " , g e t M e s s a g e ( " p h o t o v i e w e r . t o o l b a r . s l i d e S h o w " ) ] ) ; a r e a s . p u s h ( [ " g e t V i e w e r ( ) . n e x t ( ) " , " 1 7 5 " , g e t M e s s a g e ( " p h o t o v i e w e r . t o o l b a r . n e x t " ) ] ) ; a r e a s . p u s h ( [ " g e t V i e w e r ( ) . l a s t ( ) " , " 2 2 7 " , g e t M e s s a g e ( " p h o t o v i e w e r . t o o l b a r . l a s t " ) ] ) ; i f ( t h i s . e n a b l e E m a i l L i n k )  
 a r e a s . p u s h ( [ " g e t V i e w e r ( ) . e m a i l ( ) " , " 3 0 0 " , g e t M e s s a g e ( " p h o t o v i e w e r . t o o l b a r . e m a i l " ) ] ) ; i f ( t h i s . i s E n a b l e P h o t o L i n k )  
 a r e a s . p u s h ( [ " g e t V i e w e r ( ) . p e r m a l i n k ( ) " , " 3 5 0 " , g e t M e s s a g e ( " p h o t o v i e w e r . t o o l b a r . p e r m a l i n k " ) ] ) ; a r e a s . p u s h ( [ " g e t V i e w e r ( ) . c l o s e ( ) " , " 4 0 2 " , g e t M e s s a g e ( " p h o t o v i e w e r . t o o l b a r . c l o s e " ) ] ) ; f o r ( i = 0 ; i < a r e a s . l e n g t h ; i + + ) { v a r   a r e a = d o c . c r e a t e E l e m e n t ( " a r e a " ) ; i f ( ! s s l )  
 a r e a . h r e f = " j a v a s c r i p t : v o i d ( 0 ) " ; a r e a . a l t = a r e a s [ i ] [ 2 ] ; a r e a . t i t l e = a r e a . a l t ; a r e a . s h a p e = " c i r c l e " ; a r e a . c o o r d s = a r e a s [ i ] [ 1 ] + " ,   2 1 ,   2 2 " ; a r e a . o n c l i c k = b u i l d A r e a M a p C l o s u r e ( a r e a s [ i ] [ 0 ] ) ; i m g M a p . a p p e n d C h i l d ( a r e a ) ; } }  
 i m g M a p . n a m e = V I E W E R _ I D _ T O O L B A R _ M A P ; i m g M a p . i d = V I E W E R _ I D _ T O O L B A R _ M A P ; v a r   i m g = d o c . c r e a t e E l e m e n t ( " i m g " ) ; i m g . i d = V I E W E R _ I D _ T O O L B A R _ I M G ; i m g . s r c = P _ I M G _ R O O T + " / " + T O O L B A R _ I M G ; i m g . w i d t h = T O O L B A R _ I M G _ W ; i m g . h e i g h t = T O O L B A R _ I M G _ H ; i m g . s t y l e . b o r d e r = " n o n e " ; i m g . s t y l e . b a c k g r o u n d = " n o n e " ; i f ( S T R I C T _ M O D E ) { i m g . s t y l e . m a r g i n = " 4 p x   0 p x   0 p x   0 p x " ; } e l s e { i m g . s t y l e . m a r g i n = " 4 p x " ; }  
 i m g . u s e M a p = " # " + V I E W E R _ I D _ T O O L B A R _ M A P ; p h o t o T o o l b a r . a p p e n d C h i l d ( i m g M a p ) ; p h o t o T o o l b a r . a p p e n d C h i l d ( i m g ) ; i f ( i s H o s t e d ( ) ) { v a r   t t L i n k = d o c . c r e a t e E l e m e n t ( " a " ) ; t t L i n k . s t y l e . p o s i t i o n = " a b s o l u t e " ; t t L i n k . s t y l e . b o t t o m = " 0 p x " ; t t L i n k . s t y l e . r i g h t = " 0 p x " ; t t L i n k . s t y l e . w i d t h = " 9 5 p x " ; t t L i n k . s t y l e . h e i g h t = " 2 5 p x " ; t t L i n k . s t y l e . b a c k g r o u n d = " n o n e " ; t t L i n k . a l t = " p   i   c   h   a   k   .   n   e   t " ; t t L i n k . t i t l e = t t L i n k . a l t ; t t L i n k . c u r s o r = t t L i n k . a l t ; t t L i n k . h r e f = T O O L B A R _ L I N K ; t t L i n k . t a r g e t = " _ n e w " ; t t L i n k . a l t = " p   i   c   h   a   k   .   n   e   t " ; t t L i n k . t i t l e = t t L i n k . a l t ; p h o t o T o o l b a r . a p p e n d C h i l d ( t t L i n k ) ; }  
 v a r   l o a d i n g I c o n = d o c . c r e a t e E l e m e n t ( " i m g " ) ; l o a d i n g I c o n . i d = V I E W E R _ I D _ L O A D I N G ; l o a d i n g I c o n . w i d t h = 1 6 ; l o a d i n g I c o n . h e i g h t = 1 6 ; l o a d i n g I c o n . s t y l e . d i s p l a y = " n o n e " ; l o a d i n g I c o n . s t y l e . p o s i t i o n = " a b s o l u t e " ; l o a d i n g I c o n . s t y l e . l e f t = ( T O O L B A R _ I M G _ L O A D I N G _ L E F T - 8 ) + " p x " ; l o a d i n g I c o n . s t y l e . t o p = ( T O O L B A R _ I M G _ L O A D I N G _ T O P - 8 ) + " p x " ; l o a d i n g I c o n . s r c = P _ I M G _ R O O T + " / " + T O O L B A R _ I M G _ L O A D I N G ; l o a d i n g I c o n . s t y l e . b o r d e r = " n o n e " ; l o a d i n g I c o n . s t y l e . b a c k g r o u n d = " n o n e " ; p h o t o T o o l b a r . a p p e n d C h i l d ( l o a d i n g I c o n ) ; p h o t o T o o l b a r . a p p e n d C h i l d ( d o c . c r e a t e E l e m e n t ( " b r " ) ) ; v a r   p h o t o T i m e = d o c . c r e a t e E l e m e n t ( " s p a n " ) ; p h o t o T i m e . i d = V I E W E R _ I D _ T I M E ; i f ( ! t h i s . o v e r r i d e T o o l b a r S t y l e s ) { p h o t o T i m e . p o s i t i o n = " r e l a t i v e " ; p h o t o T i m e . s t y l e . c o l o r = T O O L B A R _ F O N T _ C O L O R ; p h o t o T i m e . s t y l e . f o n t F a m i l y = T O O L B A R _ F O N T _ S T Y L E ; p h o t o T i m e . s t y l e . f o n t S i z e = t h i s . f o n t S i z e + " p x " ; i f ( S T R I C T _ M O D E ) { p h o t o T i m e . s t y l e . l i n e H e i g h t = t h i s . f o n t S i z e + " p x " ; }  
 i f ( t h i s . f o n t ! = u n d e f i n e d ) { p h o t o T i m e . s t y l e . f o n t = t h i s . f o n t ; }  
 p h o t o T i m e . s t y l e . c s s F l o a t = " n o n e " ; p h o t o T i m e . s t y l e . t e x t A l i g n = " r i g h t " ; p h o t o T i m e . s t y l e . p a d d i n g = " 0 p x   1 0 p x " ; }  
 p h o t o T i m e . a p p e n d C h i l d ( d o c . c r e a t e T e x t N o d e ( "   " ) ) ; p h o t o T o o l b a r . a p p e n d C h i l d ( p h o t o T i m e ) ; v a r   p h o t o T i t l e = d o c . c r e a t e E l e m e n t ( " s p a n " ) ; p h o t o T i t l e . i d = V I E W E R _ I D _ T I T L E ; i f ( ! t h i s . o v e r r i d e T o o l b a r S t y l e s ) { p h o t o T i t l e . p o s i t i o n = " r e l a t i v e " ; p h o t o T i t l e . s t y l e . c o l o r = T O O L B A R _ F O N T _ C O L O R ; p h o t o T i t l e . s t y l e . f o n t F a m i l y = T O O L B A R _ F O N T _ S T Y L E ; p h o t o T i t l e . s t y l e . f o n t S i z e = t h i s . f o n t S i z e + " p x " ; i f ( S T R I C T _ M O D E ) { p h o t o T i t l e . s t y l e . l i n e H e i g h t = t h i s . f o n t S i z e + " p x " ; }  
 i f ( t h i s . f o n t ! = u n d e f i n e d ) { p h o t o T i t l e . s t y l e . f o n t = t h i s . f o n t ; }  
 p h o t o T i t l e . s t y l e . c s s F l o a t = " r i g h t " ; p h o t o T i t l e . s t y l e . t e x t A l i g n = " l e f t " ; p h o t o T i t l e . s t y l e . p a d d i n g r i g h t = " 2 0 p x " ; }  
 p h o t o T i t l e . a p p e n d C h i l d ( d o c . c r e a t e T e x t N o d e ( "   " ) ) ; p h o t o T o o l b a r . a p p e n d C h i l d ( p h o t o T i t l e ) ; d o c . b o d y . a p p e n d C h i l d ( p h o t o T o o l b a r ) ; }  
 f u n c t i o n   a d d B y L i n e ( z I n d e x ) { v a r   d o c = t h i s . w i n . d o c u m e n t ; i f ( d o c . g e t E l e m e n t B y I d ( V I E W E R _ I D _ B Y L I N E ) ! = u n d e f i n e d )  
 r e t u r n ; v a r   p h o t o B y l i n e = d o c . c r e a t e E l e m e n t ( " d i v " ) ; p h o t o B y l i n e . a p p e n d C h i l d ( d o c . c r e a t e T e x t N o d e ( " " ) ) ; p h o t o B y l i n e . s t y l e . c o l o r = B Y L I N E _ F O N T _ C O L O R ; p h o t o B y l i n e . s t y l e . f o n t F a m i l y = B Y L I N E _ F O N T _ S T Y L E ; p h o t o B y l i n e . s t y l e . f o n t S i z e = t h i s . f o n t S i z e + " p x " ; i f ( t h i s . f o n t ! = u n d e f i n e d ) { p h o t o B y l i n e . s t y l e . f o n t = t h i s . f o n t ; }  
 p h o t o B y l i n e . i d = V I E W E R _ I D _ B Y L I N E ; p h o t o B y l i n e . s t y l e . p o s i t i o n = " a b s o l u t e " ; p h o t o B y l i n e . s t y l e . r i g h t = B Y L I N E _ P O S I T I O N _ R I G H T + " p x " ; i f ( I E & & ! ( I E 7 & & S T R I C T _ M O D E ) ) { p h o t o B y l i n e . s t y l e . p o s i t i o n = " a b s o l u t e " ; i f ( I E 7 | | I E 8 ) { v a r   t o p = g e t W i n d o w S i z e ( t h i s . w i n ) . h + g e t S c r o l l P o s ( t h i s . w i n ) . t o p ; p h o t o B y l i n e . s t y l e . t o p = ( t o p - 3 0 ) + " p x " ; } e l s e { p h o t o B y l i n e . s t y l e . b o t t o m = B Y L I N E _ P O S I T I O N _ B O T T O M + " p x " ; } } e l s e { p h o t o B y l i n e . s t y l e . p o s i t i o n = " f i x e d " ; p h o t o B y l i n e . s t y l e . b o t t o m = B Y L I N E _ P O S I T I O N _ B O T T O M + " p x " ; }  
 p h o t o B y l i n e . s t y l e . z I n d e x = z I n d e x + 1 ; p h o t o B y l i n e . a p p e n d C h i l d ( d o c . c r e a t e T e x t N o d e ( "   " ) ) ; d o c . b o d y . a p p e n d C h i l d ( p h o t o B y l i n e ) ; }  
 f u n c t i o n   b u i l d A r e a M a p C l o s u r e ( f u n c ) { r e t u r n   f u n c t i o n ( e v e n t ) { e v a l ( f u n c ) ; b l u r E l e m e n t ( e v e n t ) ; r e t u r n   f a l s e ; } ; }  
 f u n c t i o n   b l u r E l e m e n t ( e v e n t ) { v a r   t a r g e t = g e t E v e n t T a r g e t ( g e t E v e n t ( e v e n t ) ) ; i f ( t a r g e t ! = u n d e f i n e d )  
 t a r g e t . b l u r ( ) ; }  
 f u n c t i o n   s e t T o o l b a r I m a g e ( i m g ) { v a r   d o c = t h i s . w i n . d o c u m e n t ; v a r   e l t = d o c . g e t E l e m e n t B y I d ( V I E W E R _ I D _ T O O L B A R _ I M G ) ; i f ( e l t ! = u n d e f i n e d )  
 e l t . s r c = i m g ; }  
 f u n c t i o n   s e t S h o w T o o l b a r ( d o S h o w ) { t h i s . s h o w T o o l b a r = d o S h o w ; }  
 f u n c t i o n   a d d C a p t i o n s ( ) { v a r   p h o t o = t h i s . p h o t o s [ t h i s . i n d e x ] ; v a r   d o c = t h i s . w i n . d o c u m e n t ; v a r   p h o t o T i m e = d o c . g e t E l e m e n t B y I d ( V I E W E R _ I D _ T I M E ) ; v a r   p h o t o T i t l e = d o c . g e t E l e m e n t B y I d ( V I E W E R _ I D _ T I T L E ) ; v a r   t i m e = ( t h i s . i n d e x + 1 ) + " / " + t h i s . p h o t o s . l e n g t h ; i f ( p h o t o . t i m e ! = u n d e f i n e d ) { t i m e + = "   [ " + p h o t o . t i m e + " ] " ; }  
 p h o t o T i m e . f i r s t C h i l d . n o d e V a l u e = t i m e ; v a r   t i t l e = ( p h o t o . t i t l e ! = u n d e f i n e d ? p h o t o . t i t l e : " " ) ; p h o t o T i t l e . t i t l e = " " ; p h o t o T i t l e . a l t = " " ; i f ( t i t l e . l e n g t h > T I T L E _ M A X _ L E N G T H ) { p h o t o T i t l e . t i t l e = t i t l e ; p h o t o T i t l e . a l t = t i t l e ; t i t l e = t i t l e . s u b s t r i n g ( 0 , T I T L E _ M A X _ L E N G T H ) + "   . . . " ; }  
 i f ( t i t l e . i n d e x O f ( " \ n " ) ! = = 0 ) { t i t l e = t i t l e . r e p l a c e ( " \ n " , " < b r   / > " ) ; p h o t o T i t l e . i n n e r H T M L = t i t l e ; } e l s e { p h o t o T i t l e . n o d e V a l u e = t i t l e ; } }  
 f u n c t i o n   a d d B y l i n e C a p t i o n ( ) { v a r   p h o t o = t h i s . p h o t o s [ t h i s . i n d e x ] ; v a r   d o c = t h i s . w i n . d o c u m e n t ; v a r   p h o t o B y l i n e = d o c . g e t E l e m e n t B y I d ( V I E W E R _ I D _ B Y L I N E ) ; i f ( p h o t o . b y l i n e ! = u n d e f i n e d & & p h o t o . b y l i n e . l e n g t h > 0 ) { p h o t o B y l i n e . f i r s t C h i l d . n o d e V a l u e = p h o t o . b y l i n e ; } e l s e { p h o t o B y l i n e . f i r s t C h i l d . n o d e V a l u e = " " ; } }  
 f u n c t i o n   s e t C l o s e C a l l b a c k ( c a l l b a c k ) { t h i s . c l o s e C a l l b a c k = c a l l b a c k ; }  
 f u n c t i o n   s e t S h o w C a l l b a c k ( c a l l b a c k ) { t h i s . s h o w C a l l b a c k = c a l l b a c k ; }  
 f u n c t i o n   s e t E n d C a l l b a c k ( c a l l b a c k ) { t h i s . e n d C a l l b a c k = c a l l b a c k ; }  
 f u n c t i o n   e m a i l P h o t o ( ) { v a r   p h o t o = t h i s . p h o t o s [ t h i s . i n d e x ] ; v a r   d o c = t h i s . w i n . d o c u m e n t ; v a r   t i t l e = ( p h o t o . t i t l e ! = u n d e f i n e d ? p h o t o . t i t l e : g e t M e s s a g e ( " p h o t o v i e w e r . e m a i l . s u b j e c t . p h o t o " ) ) ; v a r   e m a i l A d d r e s s = t h i s . e m a i l A d d r e s s ! = = u n d e f i n e d ? t h i s . e m a i l A d d r e s s : " " ; v a r   m a i l t o L i n k = " m a i l t o : " + e m a i l A d d r e s s + " ? s u b j e c t = " + t i t l e + " & b o d y = " +  
 g e t P h o t o U R L ( p h o t o . s r c ) ; d o c . l o c a t i o n . h r e f = m a i l t o L i n k ; }  
 f u n c t i o n   g e t P h o t o U R L ( u r l ) { v a r   l o c = d o c u m e n t . l o c a t i o n ; i f ( / \ w + : \ / \ / . + / . t e s t ( u r l ) ) { r e t u r n   u r l ; } e l s e   i f ( u r l . i n d e x O f ( " / " ) = = = 0 ) { r e t u r n   l o c . p r o t o c o l + " / / " + l o c . h o s t + u r l ; } e l s e { v a r   p a t h = l o c . p a t h n a m e ; v a r   p o s = p a t h . l a s t I n d e x O f ( " / " ) ; i f ( p o s ! = - 1 ) { p a t h = p a t h . s u b s t r i n g ( 0 , p o s ) ; }  
 r e t u r n   l o c . p r o t o c o l + " / / " + l o c . h o s t + p a t h + " / " + u r l ; } }  
 f u n c t i o n   l i n k P h o t o ( ) { v a r   p h o t o = t h i s . p h o t o s [ t h i s . i n d e x ] ; w i n d o w . o p e n ( p h o t o . l i n k ? p h o t o . l i n k : p h o t o . s r c ) ; }  
 f u n c t i o n   f a v o r i t e P h o t o ( ) { v a r   p h o t o = t h i s . p h o t o s [ t h i s . i n d e x ] ; v a r   d o c = t h i s . w i n . d o c u m e n t ; v a r   r e s t U R L = R E S T _ U R L + " m a r k f e a t u r e d ? i d " + p h o t o . i d ; t r y { v a r   r e s = g e t R e s p o n s e ( r e s t U R L , f a l s e , t r u e ) ; } c a t c h ( e ) { r e t u r n ; } }  
 f u n c t i o n   h i d e O v e r l a p p i n g E l e m e n t s ( n o d e ) { i f ( n o d e = = u n d e f i n e d ) { n o d e = t h i s . w i n . d o c u m e n t . b o d y ; t h i s . h i d e O v e r l a p p i n g E l e m e n t s ( n o d e ) ; r e t u r n ; }  
 i f ( n o d e . s t y l e ! = u n d e f i n e d & & n o d e . s t y l e . v i s i b i l i t y ! = " h i d d e n " ) { v a r   n o d e N a m e = n o d e . n o d e N a m e . t o L o w e r C a s e ( ) ; i f ( ( n o d e . c l a s s N a m e ! = u n d e f i n e d & & n o d e . c l a s s N a m e . i n d e x O f ( " S l i d e s h o w D o H i d e " ) ! = - 1 ) | | ( ( I E | | F I R E F O X ) & & ( n o d e N a m e = = " s e l e c t " | | n o d e N a m e = = " o b j e c t " | | n o d e N a m e = = " e m b e d " ) ) ) { n o d e . s t y l e . v i s i b i l i t y = " h i d d e n " ; i f ( t h i s . h i d d e n E l e m e n t s = = u n d e f i n e d )  
 t h i s . h i d d e n E l e m e n t s = [ ] ; t h i s . h i d d e n E l e m e n t s . p u s h ( n o d e ) ; } }  
 i f ( n o d e . c h i l d N o d e s ! = u n d e f i n e d ) { v a r   i ; f o r ( i = 0 ; i < n o d e . c h i l d N o d e s . l e n g t h ; i + + ) { t h i s . h i d e O v e r l a p p i n g E l e m e n t s ( n o d e . c h i l d N o d e s [ i ] ) ; } } }  
 f u n c t i o n   s h o w O v e r l a p p i n g E l e m e n t s ( ) { v a r   i ; i f ( t h i s . h i d d e n E l e m e n t s ! = u n d e f i n e d ) { f o r ( i = 0 ; i < t h i s . h i d d e n E l e m e n t s . l e n g t h ; i + + ) { t h i s . h i d d e n E l e m e n 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 " ; }  
 t h i s . h i d d e n E l e m e n t s = [ ] ; } }  
 f u n c t i o n   v i e w e r H a n d l e K e y ( e v e n t ) { i f ( t y p e o f   g e t V i e w e r = = ' u n d e f i n e d ' | | ! g e t V i e w e r )  
 r e t u r n   t r u e ; v a r   v i e w e r = g e t V i e w e r ( ) ; i f ( v i e w e r = = u n d e f i n e d | | ! v i e w e r . s h o w n )  
 r e t u r n   t r u e ; e v e n t = g e t E v e n t ( e v e n t ) ; i f ( e v e n t . c t r l K e y | | e v e n t . a l t K e y )  
 r e t u r n   t r u e ; v a r   k e y C o d e = e v e n t . k e y C o d e ; s w i t c h ( k e y C o d e ) { c a s e   3 7 : c a s e   3 8 : v i e w e r . p r e v ( ) ; b r e a k ; c a s e   3 9 : c a s e   4 0 : v i e w e r . n e x t ( ) ; b r e a k ; c a s e   3 3 : v i e w e r . p r e v ( 1 0 ) ; b r e a k ; c a s e   3 4 : v i e w e r . n e x t ( 1 0 ) ; b r e a k ; c a s e   3 6 : v i e w e r . f i r s t ( ) ; b r e a k ; c a s e   3 5 : v i e w e r . l a s t ( ) ; b r e a k ; c a s e   3 2 : c a s e   1 3 : v i e w e r . s l i d e S h o w ( t r u e ) ; b r e a k ; c a s e   2 7 : v i e w e r . c l o s e ( ) ; b r e a k ; d e f a u l t : r e t u r n   t r u e ; }  
 p r e v e n t D e f a u l t ( e v e n t ) ; r e t u r n   f a l s e ; }  
 f u n c t i o n   f l i c k r H a c k ( v i e w e r , i n d e x ) { i f ( v i e w e r . p h o t o s [ i n d e x ] ! = u n d e f i n e d ) { v a r   p r e l o a d P h o t o = v i e w e r . p h o t o s [ i n d e x ] . p r e l o a d I m a g e ; i f ( p r e l o a d P h o t o ! = u n d e f i n e d & & p r e l o a d P h o t o . w i d t h = = 5 0 0 & & p r e l o a d P h o t o . h e i g h t = = 3 7 5 ) { v a r   f l i c k r R E = / . + s t a t i c \ . f l i c k r \ . c o m . + _ b \ . j p g / ; i f ( f l i c k r R E . t e s t ( p r e l o a d P h o t o . s r c ) ) { v i e w e r . p h o t o s [ i n d e x ] . s r c = v i e w e r . p h o t o s [ i n d e x ] . s r c . r e p l a c e ( / _ b \ . j p g / , " _ o . j p g " ) ; r e t u r n   t r u e ; } } }  
 r e t u r n   f a l s e ; }  
 f u n c t i o n   f i n d P h o t o s T T ( v i e w e r , n o d e ) { v a r   i ; i f ( n o d e . n o d e N a m e . t o L o w e r C a s e ( ) = = " a " ) { v a r   o n c l i c k = n o d e . g e t A t t r i b u t e ( " o n c l i c k " ) ; i f ( o n c l i c k = = u n d e f i n e d ) { o n c l i c k = n o d e . o n c l i c k ; }  
 i f ( o n c l i c k ! = u n d e f i n e d & & n e w   S t r i n g ( o n c l i c k ) . i n d e x O f ( " p o p u p I m g " ) ! = - 1 ) { v a r   p o p u p R E = / . * p o p u p I m g \ ( ( . + ? ) , ( . + ? ) , ( . + ? ) \ ) . * / ; i f ( p o p u p R E . t e s t ( o n c l i c k ) ) { v a r   u r l , w , h ; i f ( n o d e . p h o t o U r l ! = u n d e f i n e d ) { u r l = n o d e . p h o t o U r l ; w = n o d e . p h o t o W ; h = n o d e . p h o t o H ; } e l s e { u r l = R e g E x p . $ 1 ; i f ( u r l . c h a r A t ( 0 ) = = " ' " & & u r l . c h a r A t ( u r l . l e n g t h - 1 ) = = " ' " )  
 u r l = u r l . s u b s t r i n g ( 1 , u r l . l e n g t h - 1 ) ; w = p a r s e I n t ( R e g E x p . $ 2 ) ; h = p a r s e I n t ( R e g E x p . $ 3 ) ; }  
 v a r   p h o t o = n e w   P h o t o I m g ( u n d e f i n e d , u r l , w , h ) ; v a r   f o u n d = f a l s e ; f o r ( i = 0 ; i < v i e w e r . p h o t o s . l e n g t h ; i + + ) { i f ( v i e w e r . p h o t o s [ i ] . s r c = = p h o t o . s r c ) { f o u n d = t r u e ; b r e a k ; } }  
 i f ( ! f o u n d )  
 v i e w e r . a d d ( p h o t o ) ; } } }  
 i f ( n o d e . c h i l d N o d e s ! = u n d e f i n e d ) { f o r ( i = 0 ; i < n o d e . c h i l d N o d e s . l e n g t h ; i + + ) { f i n d P h o t o s T T ( v i e w e r , n o d e . c h i l d N o d e s [ i ] ) ; } } }  
 v a r   d e f a u l t V i e w e r = u n d e f i n e d ; f u n c t i o n   p o p u p I m g ( u r l , w , h , b a c k C o l o r , s h o w T o o l b a r ) { v a r   i ; i f ( d e f a u l t V i e w e r = = u n d e f i n e d )  
 d e f a u l t V i e w e r = n e w   P h o t o V i e w e r ( ) ; e l s e { d e f a u l t V i e w e r . p h o t o s = [ ] ; d e f a u l t V i e w e r . i n d e x = 0 ; }  
 i f ( b a c k C o l o r ! = u n d e f i n e d )  
 d e f a u l t V i e w e r . s e t B a c k g r o u n d ( b a c k C o l o r , b a c k C o l o r , f a l s e ) ; i f ( s h o w T o o l b a r = = u n d e f i n e d | | s h o w T o o l b a r ) { f i n d P h o t o s T T ( d e f a u l t V i e w e r , w i n d o w . d o c u m e n t . b o d y ) ; f o r ( i = 0 ; i < d e f a u l t V i e w e r . p h o t o s . l e n g t h ; i + + ) { i f ( d e f a u l t V i e w e r . p h o t o s [ i ] . s r c = = u r l ) { d e f a u l t V i e w e r . s h o w ( i ) ; } } }  
 i f ( d e f a u l t V i e w e r . p h o t o s = = = u n d e f i n e d | | d e f a u l t V i e w e r . p h o t o s . l e n g t h = = = 0 ) { d e f a u l t V i e w e r . s e t S h o w T o o l b a r ( f a l s e ) ; d e f a u l t V i e w e r . a d d ( n e w   P h o t o I m g ( u n d e f i n e d , u r l , w , h ) ) ; d e f a u l t V i e w e r . s h o w ( ) ; }  
 r e t u r n   f a l s e ; }  
 f u n c t i o n   o n C l i c k E v e n t ( )  
 { v a r   v = g e t V i e w e r ( ) ; i f ( v . c o n t e x t M e n u ! = u n d e f i n e d & & v . c o n t e x t M e n u . v i s i b l e ) { v . c o n t e x t M e n u . h i d e ( ) ; r e t u r n ; }  
 i f ( v . t o o l b a r A n i m a t o r ! = u n d e f i n e d )  
 v . t o o l b a r A n i m a t o r . r e s e t ( ) ; i f ( v . c u s t o m O n C l i c k E v e n t ! = u n d e f i n e d )  
 v . c u s t o m O n C l i c k E v e n t ( ) ; e l s e  
 c l o s e V i e w e r ( ) ; }  
 f u n c t i o n   o n C o n t e x t M e n u E v e n t ( e )  
 { v a r   v = g e t V i e w e r ( ) ; v a r   e v e n t = g e t E v e n t ( e ) ; i f ( v . c o n t e x t M e n u = = u n d e f i n e d & & v . c u s t o m O n R i g h t c l i c k E v e n t = = u n d e f i n e d ) { r e t u r n   t r u e ; }  
 e v e n t . c a n c e l B u b b l e = t r u e ; i f ( v . c u s t o m O n R i g h t c l i c k E v e n t ! = u n d e f i n e d )  
 v . c u s t o m O n R i g h t c l i c k E v e n t ( e ) ; i f ( v . c o n t e x t M e n u ! = u n d e f i n e d & & ( ! v . s l i d e S h o w R u n n i n g | | v . s l i d e S h o w P a u s e d ) )  
 v . c o n t e x t M e n u . s h o w ( g e t M o u s e P o s i t i o n ( e ) ) ; r e t u r n   f a l s e ; }  
 f u n c t i o n   s e t u p F r a g m e n t I d e n t i f i e r M o d e P h o t o V i e w e r ( i f r a m e L o c a t i o n , i f r a m e n a m e , v i e w e r J S O N A r r a y )  
 { v a r   v i e w e r = n e w   P h o t o V i e w e r ( ) ; v i e w e r . o r i g R o o t L o c a t i o n = d o c u m e n t . l o c a t i o n . h r e f ; v i e w e r . o r i g I F r a m e L o c a t i o n = i f r a m e L o c a t i o n ; v i e w e r . i f r a m e n a m e = i f r a m e n a m e ; v i e w e r . s e t C l o s e C a l l b a c k ( v i e w e r . s e t S t o p F r a g m e n t I d e n t i f i e r ) ; f o r ( v a r   i = 0 ; i < v i e w e r J S O N A r r a y . l e n g t h ; i + + ) { v i e w e r . a d d ( v i e w e r J S O N A r r a y [ i ] . u r l , v i e w e r J S O N A r r a y [ i ] . t i t l e , v i e w e r J S O N A r r a y [ i ] . d a t e , v i e w e r J S O N A r r a y [ i ] . b y l i n e ) ; }  
 w i n d o w . f r a m e s [ v i e w e r . i f r a m e n a m e ] . l o c a t i o n = v i e w e r . o r i g I F r a m e L o c a t i o n + " # " + v i e w e r . o r i g R o o t L o c a t i o n ; v i e w e r . c h e c k S t a r t F r a g m e n t I d e n t i f i e r ( ) ; }  
 f u n c t i o n   c h e c k S t a r t F r a g m e n t I d e n t i f i e r ( ) { v a r   h r e f = d o c u m e n t . l o c a t i o n . h r e f ; i f ( h r e f . i n d e x O f ( " # s t a r t p h o t o = " ) = = - 1 ) { w i n d o w . s e t T i m e o u t ( c h e c k S t a r t F r a g m e n t I d e n t i f i e r , 5 0 0 ) ; } e l s e { v a r   s t a r t P h o t o = p a r s e I n t ( h r e f . s u b s t r i n g ( h r e f . l a s t I n d e x O f ( " = " ) + 1 ) ) ; v a r   v i e w e r = g e t V i e w e r ( ) ; i f ( v i e w e r . o r i g R o o t L o c a t i o n . i n d e x O f ( " # " ) = = - 1 )  
 v i e w e r . o r i g R o o t L o c a t i o n + = " # " ; i f ( F I R E F O X ) { w i n d o w . h i s t o r y . b a c k ( ) ; } e l s e { d o c u m e n t . l o c a t i o n . h r e f = v i e w e r . o r i g R o o t L o c a t i o n ; }  
 v i e w e r . s h o w ( s t a r t P h o t o ) ; } }  
 f u n c t i o n   s e t S t o p F r a g m e n t I d e n t i f i e r ( i n d e x ) { w i n d o w . f r a m e s [ g e t V i e w e r ( ) . i f r a m e n a m e ] . l o c a t i o n = t h i s . o r i g I F r a m e L o c a t i o n + " # s t o p p h o t o = " + i n d e x ; c h e c k S t a r t F r a g m e n t I d e n t i f i e r ( ) ; }  
 f u n c t i o n   s e t S t a r t F r a g m e n t I d e n t i f i e r ( i n d e x ) { v a r   r o o t W i n = g e t R o o t W i n d o w ( ) ; i f ( t h i s . o r i g I F r a m e L o c a t i o n = = u n d e f i n e d )  
 t h i s . o r i g I F r a m e L o c a t i o n = r o o t W i n . l o c a t i o n . h r e f . s u b s t r i n g ( 0 , r o o t W i n . l o c a t i o n . h r e f . i n d e x O f ( " # " ) ) ; i f ( t h i s . o r i g R o o t L o c a t i o n = = u n d e f i n e d )  
 t h i s . o r i g R o o t L o c a t i o n = r o o t W i n . l o c a t i o n . h r e f . s u b s t r i n g ( r o o t W i n . l o c a t i o n . h r e f . i n d e x O f ( " # " ) + 1 ) ; t h i s . c h e c k S t o p F r a g m e n t I d e n t i f i e r ( ) ; v a r   f r I d e n t i f i e r = " # s t a r t p h o t o = " + i n d e x ; r o o t W i n . p a r e n t . l o c a t i o n = t h i s . o r i g R o o t L o c a t i o n + f r I d e n t i f i e r ; }  
 f u n c t i o n   c h e c k S t o p F r a g m e n t I d e n t i f i e r ( ) { v a r   h r e f = g e t R o o t W i n d o w ( ) . l o c a t i o n . h r e f ; i f ( h r e f . i n d e x O f ( " # s t o p p h o t o " ) = = - 1 ) { w i n d o w . s e t T i m e o u t ( c h e c k S t o p F r a g m e n t I d e n t i f i e r , 5 0 0 ) ; } e l s e { v a r   v i e w e r = g e t V i e w e r ( ) ; v a r   i n d e x = h r e f . s u b s t r i n g ( h r e f . l a s t I n d e x O f ( " = " ) + 1 ) ; i f ( v i e w e r . o r i g I F r a m e L o c a t i o n . i n d e x O f ( " # " ) = = - 1 )  
 v i e w e r . o r i g I F r a m e L o c a t i o n + = " # " ; i f ( F I R E F O X ) { w i n d o w . h i s t o r y . b a c k ( ) ; } e l s e { g e t R o o t W i n d o w ( ) . l o c a t i o n . h r e f = v i e w e r . o r i g I F r a m e L o c a t i o n ; }  
 v i e w e r C l o s e C a l l b a c k ( i n d e x ) ; } }  
 f u n c t i o n   T o o l b a r A n i m a t o r ( v i e w e r ) { t h i s . v i e w e r = v i e w e r ; }  
 T o o l b a r A n i m a t o r . p r o t o t y p e . i n i t i a l i z e = f u n c t i o n ( ) { v a r   _ t h i s = t h i s ; v a r   b a c k D i v = f i n d D O M E l e m e n t ( V I E W E R _ I D _ B A C K ) ; v a r   f r o n t D i v = f i n d D O M E l e m e n t ( V I E W E R _ I D _ P H O T O ) ; v a r   t o o l b a r = f i n d D O M E l e m e n t ( V I E W E R _ I D _ T O O L B A R ) ; i f ( b a c k D i v ! = u n d e f i n e d & & f r o n t D i v ! = u n d e f i n e d & & t o o l b a r ! = u n d e f i n e d ) { v a r   f u n c = f u n c t i o n ( ) { _ t h i s . m o u s e A c t i o n ( ) ; } ; b a c k D i v . o n m o u s e m o v e = f u n c ; f r o n t D i v . o n m o u s e m o v e = f u n c ; t o o l b a r . o n m o u s e m o v e = f u n c ; t o o l b a r . o n c l i c k = f u n c ; t h i s . i n i t i a l i z e d = t r u e ; } } ; T o o l b a r A n i m a t o r . p r o t o t y p e . r e s e t = f u n c t i o n ( ) { t h i s . s t o p ( ) ; v a r   b a c k D i v = f i n d D O M E l e m e n t ( V I E W E R _ I D _ B A C K ) ; v a r   f r o n t D i v = f i n d D O M E l e m e n t ( V I E W E R _ I D _ P H O T O ) ; v a r   t o o l b a r = f i n d D O M E l e m e n t ( V I E W E R _ I D _ T O O L B A R ) ; i f ( b a c k D i v ! = u n d e f i n e d & & f r o n t D i v ! = u n d e f i n e d & & t o o l b a r ! = u n d e f i n e d ) { b a c k D i v . o n m o u s e m o v e = n u l l ; f r o n t D i v . o n m o u s e m o v e = n u l l ; t o o l b a r . o n m o u s e m o v e = n u l l ; t o o l b a r . o n c l i c k = n u l l ; }  
 t h i s . i n i t i a l i z e d = f a l s e ; } ; T o o l b a r A n i m a t o r . p r o t o t y p e . s t o p = f u n c t i o n ( ) { v a r   _ t h i s = t h i s ; i f ( t h i s . h i d e r I D ! = u n d e f i n e d ) { w i n d o w . c l e a r T i m e o u t ( t h i s . h i d e r I D ) ; t h i s . h i d e r I D = u n d e f i n e d ; }  
 i f ( t h i s . h i d d e n ) { t h i s . s h o w T o o l b a r ( ) ; } } ; T o o l b a r A n i m a t o r . p r o t o t y p e . m o u s e A c t i o n = f u n c t i o n ( ) { t h i s . s t o p ( ) ; } ; T o o l b a r A n i m a t o r . p r o t o t y p e . s l i d e s h o w A c t i o n = f u n c t i o n ( ) { v a r   _ t h i s = t h i s ; i f ( t h i s . v i e w e r . s l i d e S h o w R u n n i n g & & ! t h i s . v i e w e r . s l i d e S h o w P a u s e d & & t h i s . h i d e r I D = = u n d e f i n e d ) { i f ( ! t h i s . i n i t i a l i z e d ) { t h i s . i n i t i a l i z e ( ) ; }  
 t h i s . h i d e r I D = w i n d o w . s e t T i m e o u t ( f u n c t i o n ( ) { _ t h i s . h i d e T o o l b a r ( ) ; } , 5 0 0 0 ) ; } e l s e   i f ( t h i s . v i e w e r . s l i d e S h o w P a u s e d ) { t h i s . r e s e t ( ) ; } } ; T o o l b a r A n i m a t o r . p r o t o t y p e . h i d e T o o l b a r = f u n c t i o n ( ) { v a r   _ t h i s = t h i s ; v a r   t o o l b a r = f i n d D O M E l e m e n t ( V I E W E R _ I D _ T O O L B A R ) ; i f ( t o o l b a r = = u n d e f i n e d ) { r e t u r n ; }  
 v a r   o p a c i t y = t o o l b a r . s t y l e . K h t m l O p a c i t y ; i f ( o p a c i t y = = u n d e f i n e d ) { o p a c i t y = t o o l b a r . s t y l e . o p a c i t y ; }  
 i f ( o p a c i t y = = = 0 ) { t o o l b a r . s t y l e . d i s p l a y = " n o n e " ; r e t u r n ; }  
 o p a c i t y = o p a c i t y - 0 . 0 5 ; s e t O p a c i t y ( t o o l b a r , o p a c i t y > 0 ? o p a c i t y : 0 ) ; t h i s . h i d d e n = t r u e ; t h i s . h i d e r I D = w i n d o w . s e t T i m e o u t ( f u n c t i o n ( ) { _ t h i s . h i d e T o o l b a r ( ) ; } , 1 0 0 ) ; } ; T o o l b a r A n i m a t o r . p r o t o t y p e . s h o w T o o l b a r = f u n c t i o n ( ) { v a r   t o o l b a r = f i n d D O M E l e m e n t ( V I E W E R _ I D _ T O O L B A R ) ; i f ( t o o l b a r ! = u n d e f i n e d ) { t o o l b a r . s t y l e . d i s p l a y = " b l o c k " ; s e t O p a c i t y ( t o o l b a r , T O O L B A R _ O P A C I T Y ) ; }  
 t h i s . h i d d e n = f a l s e ; } ; f u n c t i o n   a d d C o n t e x t M e n u ( c o n t e x t M e n u ) { i f ( i s H o s t e d ( ) | | g e t V i e w e r ( ) . c o n t e x t M e n u ! = u n d e f i n e d ) { r e t u r n ; }  
 t h i s . c o n t e x t M e n u = c o n t e x t M e n u ; t h i s . c o n t e x t M e n u . i n i t i a l i z e ( ) ; }  
 f u n c t i o n   P h o t o V i e w e r C t x M e n u I t e m ( t e x t , c a l l b a c k ) { t h i s . t e x t = t e x t ; t h i s . c a l l b a c k = c a l l b a c k ; }  
 f u n c t i o n   P h o t o V i e w e r C t x M e n u ( c s s C l a s s ) { t h i s . c s s C l a s s = c s s C l a s s ; t h i s . i t e m s = [ ] ; t h i s . c t x S u b M e n u s = [ ] ; }  
 P h o t o V i e w e r C t x M e n u . p r o t o t y p e . m o u s e o v e r = f u n c t i o n ( e ) { v a r   v i e w e r = g e t V i e w e r ( ) ; v a r   c t x M e n u = v i e w e r . c o n t e x t M e n u ; i f ( ! c t x M e n u . v i s i b l e ) { r e t u r n ; }  
 f o r ( v a r   i = 0 ; i < c t x M e n u . c t x S u b M e n u s . l e n g t h ; i + + ) { c t x M e n u . c t x S u b M e n u 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   s u b M e n u I d = t h i s . i d + " _ s u b " ; v a r   s u b M e n u = d o c u m e n t . g e t E l e m e n t B y I d ( s u b M e n u I d ) ; v a r   m e n u D i v = t h i s . p a r e n t N o d e . p a r e n t N o d e ; v a r   m o u s e L o c = g e t M o u s e P o s i t i o n ( e ) ; v a r   i t e m L o c = g e t D O M L o c a t i o n ( t h i s ) ; v a r   m e n u L o c = g e t D O M L o c a t i o n ( m e n u D i v ) ; i f ( s u b M e n u & & m e n u D i v ) { s u b M e n u . s t y l e . l e f t = ( m e n u L o c . x + m e n u D i v . c l i e n t W i d t h ) + " p x " ; s u b M e n u . s t y l e . t o p = i t e m L o c . y + " p x " ; s u b M e n u . 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 V i e w e r C t x M e n u . p r o t o t y p e . m o u s e c l i c k = f u n c t i o n ( e ) { v a r   v i e w e r = g e t V i e w e r ( ) ; v a r   m e n u = v i e w e r . c o n t e x t M e n u ; v a r   m e n u I t e m = u n d e f i n e d ; f o r ( v a r   i = 0 ; i < m e n u . i t e m s . l e n g t h ; i + + ) { i f ( m e n u . i t e m s [ i ] . D O M E l e m e n t = = t h i s ) { m e n u I t e m = m e n u . i t e m s [ i ] ; b r e a k ; }  
 v a r   i t e m F o u n d = f a l s e ; i f ( m e n u . i t e m s [ i ] . s u b i t e m s = = u n d e f i n e d ) { c o n t i n u e ; }  
 f o r ( v a r   j = 0 ; j < m e n u . i t e m s [ i ] . s u b i t e m s . l e n g t h ; j + + ) { i f ( m e n u . i t e m s [ i ] . s u b i t e m s [ j ] . D O M E l e m e n t . i d = = = t h i s . i d ) { m e n u I t e m = m e n u . i t e m s [ i ] . s u b i t e m s [ j ] ; i t e m F o u n d = t r u e ; b r e a k ; } }  
 i f ( i t e m F o u n d ) { b r e a k ; } }  
 i f ( m e n u I t e m ! = u n d e f i n e d & & m e n u I t e m . c a l l b a c k ! = u n d e f i n e d ) { v i e w e r . c o n t e x t M e n u . h i d e ( ) ; m e n u I t e m . c a l l b a c k ( v i e w e r . p h o t o s [ v i e w e r . i n d e x ] . s r c , e ) ; } } ; P h o t o V i e w e r C t x M e n u . p r o t o t y p e . a d d = f u n c t i o n ( i t e m , s u b i t e m s ) { i t e m . s u b i t e m s = s u b i t e m s ; t h i s . i t e m s . p u s h ( i t e m ) ; } ; P h o t o V i e w e r C t x M e n u . p r o t o t y p e . i n i t i a l i z e = f u n c t i o n ( ) { v a r   v i e w e r = g e t V i e w e r ( ) ; v a r   d o c = v i e w e r . w i n . d o c u m e n t ; t h i s . c r e a t e M e n u ( d o c , v i e w e r ) ; t h i s . i n i t i a l i z e d = t r u e ; } ; P h o t o V i e w e r C t x M e n u . p r o t o t y p e . c r e a t e M e n u = f u n c t i o n ( d o c , v i e w e r ) { v a r   c t x M e n u D i v = d o c . c r e a t e E l e m e n t ( " d i v " ) ; c t x M e n u D i v . i d = V I E W E R _ I D _ C T X M E N U ; c t x M e n u D i v . s t y l e . v i s i b i l i t y = " h i d d e n " ; c t x M e n u D i v . s t y l e . p o s i t i o n = " a b s o l u t e " ; c t x M e n u D i v . s t y l e . z I n d e x = 9 9 9 9 9 9 ; v a r   c t x M e n u = d o c . c r e a t e E l e m e n t ( " u l " ) ; f o r ( v a r   i = 0 ; i < t h i s . i t e m s . l e n g t h ; i + + ) { v a r   c t x M e n u I t e m = d o c . c r e a t e E l e m e n t ( " l i " ) ; c t x M e n u I t e m . a p p e n d C h i l d ( d o c . c r e a t e T e x t N o d e ( t h i s . i t e m s [ i ] . t e x t ) ) ; c t x M e n u I t e m . o n c l i c k = t h i s . m o u s e c l i c k ; c t x M e n u I t e m . i d = V I E W E R _ I D _ C T X M E N U + " _ " + i ; c t x M e n u I t e m . o n m o u s e o v e r = t h i s . m o u s e o v e r ; t h i s . i t e m s [ i ] . D O M E l e m e n t = c t x M e n u I t e m ; c t x M e n u . a p p e n d C h i l d ( c t x M e n u I t e m ) ; i f ( t h i s . i t e m s [ i ] . s u b i t e m s ! = u n d e f i n e d ) { c t x M e n u I t e m . c l a s s N a m e = " c t x m e n u _ e x p a n d e d " ; v a r   s u b m e n u i d = c t x M e n u I t e m . i d + " _ s u b " ; t h i s . c r e a t e S u b M e n u ( d o c , v i e w e r , t h i s . i t e m s [ i ] . s u b i t e m s , s u b m e n u i d ) ; } }  
 c t x M e n u D i v . a p p e n d C h i l d ( c t x M e n u ) ; c t x M e n u D i v . c l a s s N a m e = t h i s . c s s C l a s s ; d o c . b o d y . a p p e n d C h i l d ( c t x M e n u D i v ) ; t h i s . c t x M e n u D O M = c t x M e n u D i v ; } ; P h o t o V i e w e r C t x M e n u . p r o t o t y p e . c r e a t e S u b M e n u = f u n c t i o n ( d o c , v i e w e r , s u b i t e m s , i d ) { v a r   c t x S u b M e n u D i v = d o c . c r e a t e E l e m e n t ( " d i v " ) ; c t x S u b M e n u D i v . i d = i d ; c t x S u b M e n u D i v . s t y l e . v i s i b i l i t y = " h i d d e n " ; c t x S u b M e n u D i v . s t y l e . p o s i t i o n = " a b s o l u t e " ; c t x S u b M e n u D i v . s t y l e . z I n d e x = 9 9 9 9 9 9 ; v a r   c t x S u b M e n u = d o c . c r e a t e E l e m e n t ( " u l " ) ; f o r ( v a r   i = 0 ; i < s u b i t e m s . l e n g t h ; i + + ) { v a r   c t x S u b M e n u I t e m = d o c . c r e a t e E l e m e n t ( " l i " ) ; c t x S u b M e n u I t e m . i d = i d + " _ " + i ; c t x S u b M e n u I t e m . a p p e n d C h i l d ( d o c . c r e a t e T e x t N o d e ( s u b i t e m s [ i ] . t e x t ) ) ; c t x S u b M e n u I t e m . o n c l i c k = t h i s . m o u s e c l i c k ; s u b i t e m s [ i ] . D O M E l e m e n t = c t x S u b M e n u I t e m ; c t x S u b M e n u . a p p e n d C h i l d ( c t x S u b M e n u I t e m ) ; }  
 c t x S u b M e n u D i v . a p p e n d C h i l d ( c t x S u b M e n u ) ; c t x S u b M e n u D i v . c l a s s N a m e = t h i s . c s s C l a s s ; d o c . b o d y . a p p e n d C h i l d ( c t x S u b M e n u D i v ) ; t h i s . c t x S u b M e n u s . p u s h ( c t x S u b M e n u D i v ) ; } ; P h o t o V i e w e r C t x M e n u . p r o t o t y p e . s h o w = f u n c t i o n ( l o c ) { i f ( ! t h i s . i n i t i a l i z e d ) { t h i s . i n i t i a l i z e ( ) ; }  
 f o r ( v a r   i = 0 ; i < t h i s . c t x S u b M e n u s . l e n g t h ; i + + ) { t h i s . c t x S u b M e n u s [ i ] . s t y l e . v i s i b i l i t y = " h i d d e n " ; }  
 t h i s . c t x M e n u D O M . s t y l e . l e f t = l o c . x + " p x " ; t h i s . c t x M e n u D O M . s t y l e . t o p = l o c . y + " p x " ; t h i s . c t x M e n u D O M . s t y l e . v i s i b i l i t y = " v i s i b l e " ; t h i s . v i s i b l e = t r u e ; } ; P h o t o V i e w e r C t x M e n u . p r o t o t y p e . h i d e = f u n c t i o n ( ) { t h i s . c t x M e n u D O M . s t y l e . v i s i b i l i t y = " h i d d e n " ; f o r ( v a r   i = 0 ; i < t h i s . c t x S u b M e n u s . l e n g t h ; i + + ) { t h i s . c t x S u b M e n u s [ i ] . s t y l e . v i s i b i l i t y = " h i d d e n " ; }  
 t h i s . v i s i b l e = f a l s e ; } ;  
  
 v a r   v i e w e r   =   n e w   P h o t o V i e w e r ( ) ;  
 v i e w e r . s e t F o n t S i z e ( 1 1 ) ;  
 v i e w e r . d i s a b l e E m a i l L i n k ( ) ;  
 v i e w e r . e n a b l e L o o p ( ) ;  
  
  
  
 
