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