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