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