ÿþ 
 f u n c t i o n   r e m a i n t i m e ( T i m e L e f t ,   f o r m a t )  
 {  
           h t m l _ c o d e   =   ' < d i v   i d = " c o u n t d o w n " > < / d i v > ' ;  
           d o c u m e n t . w r i t e ( h t m l _ c o d e ) ;  
           c o u n t d o w n ( T i m e L e f t ,   f o r m a t ) ;                                  
 }  
 f u n c t i o n   c o u n t d o w n ( T i m e _ L e f t ,   f o r m a t )  
 {  
 	 T i m e L e f t = T i m e _ L e f t ;  
 	 i f ( T i m e _ L e f t   <   0 )  
 	 {  
 	         w i n d o w . l o c a t i o n . r e l o a d ( ) ;  
 	 }  
 	  
 	 s w i t c h ( f o r m a t )  
 	 {  
 	 	 c a s e   0 :  
 	 	 	 / / T h e   s i m p l e s t   w a y   t o   d i s p l a y   t h e   t i m e   l e f t .  
 	 	 	 d o c u m e n t . a l l . c o u n t d o w n . i n n e r H T M L   =   T i m e _ L e f t   +   '   g i â y ' ;  
 	 	 	 b r e a k ;  
 	 	 c a s e   1 :  
 	 	 	 / / M o r e   d a t a i l e d .  
 	 	 	  
 	 	 	 d a y s   =   M a t h . f l o o r ( T i m e _ L e f t   /   ( 6 0   *   6 0   *   2 4 ) ) ;  
 	 	 	 T i m e _ L e f t   % =   ( 6 0   *   6 0   *   2 4 ) ;  
 	 	 	 h o u r s   =   M a t h . f l o o r ( T i m e _ L e f t   /   ( 6 0   *   6 0 ) ) ;  
 	 	 	 T i m e _ L e f t   % =   ( 6 0   *   6 0 ) ;  
 	 	 	 m i n u t e s   =   M a t h . f l o o r ( T i m e _ L e f t   /   6 0 ) ;  
 	 	 	 T i m e _ L e f t   % =   6 0 ;  
 	 	 	 s e c o n d s   =   T i m e _ L e f t ;  
 	 	 	  
 	 	 	 d p s   =   ' ' ;   h p s   =   ' ' ;   m p s   =   ' ' ;   s p s   =   ' ' ;  
 	 	 	 / / p s   i s   s h o r t   f o r   p l u r a l   s u f f i x .  
 	 	 	 i f ( d a y s   = =   1 )   d p s   = ' ' ;  
 	 	 	 i f ( h o u r s   = =   1 )   h p s   = ' ' ;  
 	 	 	 i f ( m i n u t e s   = =   1 )   m p s   = ' ' ;  
 	 	 	 i f ( s e c o n d s   = =   1 )   s p s   = ' ' ;  
 	 	 	  
 	 	 	 a   =   ' ' ;  
 	 	 	 a   =   d a y s   +   '   n g à y '   +   d p s   +   '   ' ;  
 	 	 	 a   + =   h o u r s   +   '   g i Ý'   +   h p s   +   '   ' ;  
 	 	 	 a   + =   m i n u t e s   +   '   p h ú t '   +   m p s   +   '   ' ;  
 	 	 	 a   + =   M a t h . r o u n d ( s e c o n d s )   +   '   g i â y '   +   s p 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 u n t d o w n ' ) . i n n e r H T M L   =   a ;  
 	 	 	 b r e a k ;  
 	 	 d e f a u l t :    
 	 	 	 d o c u m e n t . a l l . c o u n t d o w n . i n n e r H T M L   =   T i m e _ L e f t   +   '   g i â y ' ;  
 	 } 	 	 	 	 	  
 	 s e t T i m e o u t ( " c o u n t d o w n ( "   +   ( T i m e L e f t - 1 )   + " , " + f o r m a t +   " ) " ,   1 0 0 0 ) ; 	 	  
 }  
  
 f u n c t i o n   s h o w D i a l o g ( v L i n k ,   v W i d t h ,   v H e i g h t )  
 {  
 r e t u r n   s h o w W i n d o w ( v L i n k ,   f a l s e ,   f a l s e ,   f a l s e ,   f a l s e ,   f a l s e ,   f a l s e ,   t r u e ,   t r u e ,   v W i d t h ,   v H e i g h t ,   0 ,   0 ) ;  
 }  
  
  
  
 f u n c t i o n   s h o w W i n d o w ( v L i n k ,   v S t a t u s ,   v R e s i z e a b l e ,   v S c r o l l b a r s ,   v T o o l b a r ,   v L o c a t i o n ,   v F u l l s c r e e n ,   v T i t l e b a r ,   v C e n t e r e d ,   v W i d t h ,   v H e i g h t ,   v T o p ,   v L e f t )  
 {  
 v a r   s L i n k   =   ( t y p e o f ( v L i n k . h r e f )   = =   ' u n d e f i n e d ' )   ?   v L i n k   :   v L i n k . h r e f ;  
  
 w i n D e f   =   ' ' ;  
 w i n D e f   =   w i n D e f . c o n c a t ( ' s t a t u s = ' ) . c o n c a t ( ( v S t a t u s )   ?   ' y e s '   :   ' n o ' ) . c o n c a t ( ' , ' ) ;  
 w i n D e f   =   w i n D e f . c o n c a t ( ' r e s i z a b l e = ' ) . c o n c a t ( ( v R e s i z e a b l e )   ?   ' y e s '   :   ' n o ' ) . c o n c a t ( ' , ' ) ;  
 w i n D e f   =   w i n D e f . c o n c a t ( ' s c r o l l b a r s = ' ) . c o n c a t ( ( v S c r o l l b a r s )   ?   ' y e s '   :   ' n o ' ) . c o n c a t ( ' , ' ) ;  
 w i n D e f   =   w i n D e f . c o n c a t ( ' t o o l b a r = ' ) . c o n c a t ( ( v T o o l b a r )   ?   ' y e s '   :   ' n o ' ) . c o n c a t ( ' , ' ) ;  
 w i n D e f   =   w i n D e f . c o n c a t ( ' l o c a t i o n = ' ) . c o n c a t ( ( v L o c a t i o n )   ?   ' y e s '   :   ' n o ' ) . c o n c a t ( ' , ' ) ;  
 w i n D e f   =   w i n D e f . c o n c a t ( ' f u l l s c r e e n = ' ) . c o n c a t ( ( v F u l l s c r e e n )   ?   ' y e s '   :   ' n o ' ) . c o n c a t ( ' , ' ) ;  
 w i n D e f   =   w i n D e f . c o n c a t ( ' t i t l e b a r = ' ) . c o n c a t ( ( v T i t l e b a r )   ?   ' y e s '   :   ' n o ' ) . c o n c a t ( ' , ' ) ;  
 w i n D e f   =   w i n D e f . c o n c a t ( ' h e i g h t = ' ) . c o n c a t ( v H e i g h t ) . c o n c a t ( ' , ' ) ;  
 w i n D e f   =   w i n D e f . c o n c a t ( ' w i d t h = ' ) . c o n c a t ( v W i d t h ) . c o n c a t ( ' , ' ) ;  
  
 i f   ( v C e n t e r e d )  
 {  
 	 w i n D e f   =   w i n D e f . c o n c a t ( ' t o p = ' ) . c o n c a t ( ( s c r e e n . h e i g h t   -   v H e i g h t ) / 2 ) . c o n c a t ( ' , ' ) ;  
 	 w i n D e f   =   w i n D e f . c o n c a t ( ' l e f t = ' ) . c o n c a t ( ( s c r e e n . w i d t h   -   v W i d t h ) / 2 ) ;  
 }  
 e l s e  
 {  
 	 w i n D e f   =   w i n D e f . c o n c a t ( ' t o p = ' ) . c o n c a t ( v T o p ) . c o n c a t ( ' , ' ) ;  
 	 w i n D e f   =   w i n D e f . c o n c a t ( ' l e f t = ' ) . c o n c a t ( v L e f t ) ;  
 }  
  
 o p e n ( s L i n k ,   ' _ b l a n k ' ,   w i n D e f ) ;  
  
 i f   ( t y p e o f ( v L i n k . h r e f )   ! =   ' u n d e f i n e d ' )  
 {  
 	 r e t u r n   f a l s e ;  
 }  
 } 
