ÿþf u n c t i o n   s h o w D a t e V N ( )  
 {  
 	 v a r   s t r d a t e ;  
 	 v a r   d t   =   n e w   D a t e ( ) ;  
                             v a r   s t r a r r D a y   =   n e w   A r r a y ( " C h ç  n h ­t " ,   " T h é  h a i " ,   " T h é  b a " ,   " T h é  t °" ,   " T h é  n m " ,   " T h é  s á u " ,   " T h é  b £y " ) ;    
                             v a r   s t r a r r M o n t h   =   n e w   A r r a y ( " 0 1 " , " 0 2 " , " 0 3 " , " 0 4 " , " 0 5 " , " 0 6 " , " 0 7 " , " 0 8 " , " 0 9 " , " 1 0 " , " 1 1 " , " 1 2 " ) ;    
                             v a r   s t r T h u   =   d t . g e t D a y ( ) ;  
                             s t r T h u   =   s t r a r r D a y [ s t r T h u ]   +   " ,   " ;  
                             v a r   s t r D a y = d t . g e t D a t e ( ) ;  
                             i f   ( s t r D a y < 1 0 )   s t r D a y = " 0 "   +   s t r D a y  
                             v a r   s t r M o n t h =   d t . g e t M o n t h ( ) ;  
                             s t r M o n t h =   s t r a r r M o n t h [ s t r M o n t h ]   ;  
                             v a r   s t r Y e a r s   =   d t . g e t Y e a r ( ) ;  
                             i f   ( s t r Y e a r s < 1 9 0 0 )   s t r Y e a r s   + =   1 9 0 0 ;  
                             s t r d a t e = s t r T h u   +   "   "   +   s t r D a y   +   " / "   +   s t r M o n t h   +   " / "   +   s t r Y e a r s  
                             w i n d o w . d o c u m e n t . w r i t e   ( s t r d a t e ) ;  
 }  
 f u n c t i o n   s h o w D a t e E N ( )  
 {  
 	 v a r   s t r d a t e ;  
 	 v a r   d t   =   n e w   D a t e ( ) ;  
                             v a r   s t r a r r D a y   =   n e w   A r r a y ( " S u n d a y " ,   " M o n d a y " ,   " T u e s d a y " ,   " W e d n e s d a y " ,   " T h u r s d a y " ,   " F r i d a y " ,   " S a t u r d a y " ) ;    
                             v a r   s t r a r r M o n t h   =   n e w   A r r a y ( " 0 1 " , " 0 2 " , " 0 3 " , " 0 4 " , " 0 5 " , " 0 6 " , " 0 7 " , " 0 8 " , " 0 9 " , " 1 0 " , " 1 1 " , " 1 2 " ) ;    
                             v a r   s t r T h u   =   d t . g e t D a y ( ) ;  
                             s t r T h u   =   s t r a r r D a y [ s t r T h u ]   +   " ,   " ;  
                             v a r   s t r D a y = d t . g e t D a t e ( ) ;  
                             i f   ( s t r D a y < 1 0 )   s t r D a y = " 0 "   +   s t r D a y  
                             v a r   s t r M o n t h =   d t . g e t M o n t h ( ) ;  
                             s t r M o n t h =   s t r a r r M o n t h [ s t r M o n t h ]   ;  
                             v a r   s t r Y e a r s   =   d t . g e t Y e a r ( ) ;  
                             i f   ( s t r Y e a r s < 1 9 0 0 )   s t r Y e a r s   + =   1 9 0 0 ;  
                             s t r d a t e = s t r T h u   +   "   "   +   s t r M o n t h   +   " / "   +   s t r D a y   +   " / "   +   s t r Y e a r s  
                             w i n d o w . d o c u m e n t . w r i t e   ( s t r d a t e ) ;  
 }  
 f u n c t i o n   s h o w D a t e C N ( )  
 {  
 	 v a r   s t r d a t e ;  
 	 v a r   d t   =   n e w   D a t e ( ) ;  
                             v a r   s t r a r r D a y   =   n e w   A r r a y ( " f  g  åe" ,   " f  g   N" ,   " f  g  ŒN" ,   " f  g  	N" ,   " f  g  ÛV" ,   " f  g  ”N" ,   " f  g  mQ" ) ;    
                             v a r   s t r a r r M o n t h   =   n e w   A r r a y ( " 0 1 " , " 0 2 " , " 0 3 " , " 0 4 " , " 0 5 " , " 0 6 " , " 0 7 " , " 0 8 " , " 0 9 " , " 1 0 " , " 1 1 " , " 1 2 " ) ;    
                             v a r   s t r T h u   =   d t . g e t D a y ( ) ;  
                             s t r T h u   =   s t r a r r D a y [ s t r T h u ]   +   " ,   " ;  
                             v a r   s t r D a y = d t . g e t D a t e ( ) ;  
                             i f   ( s t r D a y < 1 0 )   s t r D a y = " 0 "   +   s t r D a y  
                             v a r   s t r M o n t h =   d t . g e t M o n t h ( ) ;  
                             s t r M o n t h =   s t r a r r M o n t h [ s t r M o n t h ]   ;  
                             v a r   s t r Y e a r s   =   d t . g e t Y e a r ( ) ;  
                             i f   ( s t r Y e a r s < 1 9 0 0 )   s t r Y e a r s   + =   1 9 0 0 ;  
                             s t r d a t e = s t r T h u   +   "   "   +   s t r D a y   +   " / "   +   s t r M o n t h   +   " / "   +   s t r Y e a r s  
                             w i n d o w . d o c u m e n t . w r i t e   ( s t r d a t e ) ;  
 }  
  
 f u n c t i o n   d o P a g e 1 ( C a t _ i d ,   P a g e I n d e x )  
 {  
 	 v a r   f r m S u b m i t = d o c u m e n t . f r m W e b s i t e ; 	  
 	 f r m S u b m i t . a c t i o n = " d e f a u l t . a s p x ? c = "   +   C a t _ i d   +   " & P a g e I n d e x = "   +   P a g e I n d e x ;  
 	 f r m S u b m i t . s u b m i t ( ) ;  
 }  
  
 f u n c t i o n   d o P a g e S e a r c h ( s ,   p )  
 {  
 	 v a r   f r m S u b m i t = d o c u m e n t . f r m W e b s i t e ;  
 	 f r m S u b m i t . a c t i o n = " d e f a u l t . a s p x ? f s e a r c h = 1 & s = "   +   s   +   " & p = "   +   p ;  
 	 f r m S u b m i t . s u b m i t ( ) ;  
 }  
  
 f u n c t i o n   d o D e a l e r S e a r c h ( p )  
 {  
 	 v a r   f r m S u b m i t = d o c u m e n t . f r m W e b s i t e ;  
 	 f r m S u b m i t . a c t i o n = " D e a l e r . a s p x ? p = "   +   p ;  
 	 f r m S u b m i t . s u b m i t ( ) ;  
 }  
  
  
 f u n c t i o n   o p e n p a g e ( p a g e u r l ,   p a g e n a m e ,   p a g e w i d t h ,   p a g e h e i g h t )    
 {                                                                          
 	 v a r   a t t r ;                                                                                      
 	 a t t r = " w i d t h = " + p a g e w i d t h + " , h e i g h t = " + p a g e h e i g h t + " , s c r o l l b a r s = y e s , s t a t u s = n o , t i t l e = y e s , t o o l b a r s = y e s , r e s i z a b l e = n o " ;  
 	 w i n d o w . o p e n ( p a g e u r l ,   p a g e n a m e ,   a t t r ) ;        
 }  
  
 f u n c t i o n   s e t C e n t e r S c r e e n ( )  
 {  
 	 w i n d o w . f o c u s ( ) ;  
 	 w i n d o w . m o v e T o ( ( s c r e e n . w i d t h - 4 5 0 ) / 2 , ( s c r e e n . h e i g h t - 4 0 0 ) / 2 ) ;                                                                                
 }  
  
 f u n c t i o n   s e t C e n t e r S c r e e n F e e d B a c k ( )  
 {  
 	 w i n d o w . f o c u s ( ) ;  
 	 w i n d o w . m o v e T o ( ( s c r e e n . w i d t h - 5 0 8 ) / 2 , ( s c r e e n . h e i g h t - 7 0 0 ) / 2 ) ;                                                                                
 }  
  
 f u n c t i o n   G e t P a g e ( C ,   P )  
 {  
 	 v a r   f r m S u b m i t = d o c u m e n t . f r m W e b s i t e ;  
 	 f r m S u b m i t . a c t i o n = " d e f a u l t . a s p x ? c = "   +   C   +   " & p = "   +   P ;  
 	 f r m S u b m i t . s u b m i t ( ) ;  
 }  
  
 f u n c t i o n   G e t P a g e 1 ( P )  
 {  
 	 v a r   f r m S u b m i t = d o c u m e n t . f r m W e b s i t e ;  
 	 f r m S u b m i t . a c t i o n = " d e f a u l t . a s p x ? s = 1 & s t = 1 & p = "   +   P ;  
 	 f r m S u b m i t . s u b m i t ( ) ;  
 }  
  
 f u n c t i o n   d o A d v a n c e S e a r c h ( )  
 {  
 	 f r m W e b s i t e . a c t i o n = " d e f a u l t . a s p x ? s = 1 & s t = 1 " ;  
 	 f r m W e b s i t e . s u b m i t ( ) ;  
 }  
  
 f u n c t i o n   t r i m ( t e x t )  
 {  
 	 p o s 1 = 0 ;  
 	 p o s 2 = t e x t . l e n g t h - 1 ;  
 	 f o r ( i = 0 ; i < = t e x t . l e n g t h - 1 ; i + + )  
 	 	 i f ( t e x t . s u b s t r ( i , 1 ) = = "   " )   p o s 1 = i ;  
 	 	 e l s e   b r e a k ;  
 	 f o r ( i = l e n g t h - 1 ; i > = 0 ; i - - )  
 	 	 i f ( t e x t . s u b s t r ( i , 1 ) = = "   " )   p o s 2 = i ;  
 	 	 e l s e   b r e a k ;  
 	 i f   ( p o s 2 < p o s 1 )   r e t u r n   " " ;  
 	 r e t u r n   t e x t . s u b s t r ( p o s 1 , p o s 2 - p o s 1 ) ;  
 }  
  
 f u n c t i o n   t r i m s t r i n g ( s t r i n )  
 {    
 	 v a r   s t r t e m p ;  
 	 v a r   i ;    
 	 s t r t e m p = " " ;  
 	 i = 0 ;  
 	 i f   ( s t r i n . c h a r A t ( i ) ! = "   " ) { s t r t e m p = s t r t e m p + s t r i n . c h a r A t ( i ) ; }  
 	 f o r   ( v a r   i = 1 ; i < s t r i n . l e n g t h - 1 ; i + + ) {  
 	 	 i f   ( s t r i n . c h a r A t ( i ) = = "   " ) {  
 	 	 	 i f   ( s t r i n . c h a r A t ( i + 1 ) ! = "   " )   { s t r t e m p = s t r t e m p + s t r i n . c h a r A t ( i ) }  
 	 	 }  
 	 	 e l s e   { s t r t e m p = s t r t e m p + s t r i n . c h a r A t ( i ) }    
 	 }  
 	 i = s t r i n . l e n g t h ;  
 	 i f   ( s t r i n . c h a r A t ( i ) ! = "   " ) { s t r t e m p = s t r t e m p + s t r i n . c h a r A t ( i ) }  
 	 r e t u r n   s t r t e m p ;    
 }  
 f u n c t i o n   p o p u p I m a g e ( s r c ,   n o t e ,   t i t l e ,   c s s ,   b o r d e r )    
 {  
         v a r   p p i m g N W ;  
         i f   ( b o r d e r = = n u l l )   b o r d e r   =   0 ;  
         i f   ( n o t e = = n u l l )   n o t e   =   ' ' ;  
         i f   ( p p i m g N W   ! =   n u l l )   p p i m g N W . c l o s e ( ) ;  
         p p i m g N W   =   w i n d o w . o p e n ( ' ' , ' _ b l a n k ' , ' w i d t h = 5 0 0 , h e i g h t = 5 0 0 ' ) ;  
         v a r   d o c   =   p p i m g N W . d o c u m e n t ;  
         d o c . w r i t e ( ' < h t m l > ' ) ;  
         d o c . w r i t e ( ' < h e a d > ' ) ;  
         i f   ( t i t l e ! = n u l l )   d o c . w r i t e ( ' < t i t l e > ' +   t i t l e   + ' < / t i t l e > ' ) ;  
         d o c . w r i t e ( ' < s t y l e >   b o d y   { ' + c s s + ' }   # p p I m g T e x t { ' +   c s s   + ' }   # p p I m g { c u r s o r : h a n d } < / s t y l e > < / h e a d > ' ) ;  
         d o c . w r i t e ( ' < b o d y   l e f t m a r g i n = " 0 "   t o p m a r g i n = " '   +   b o r d e r   +   ' "   o n l o a d = " d o R e s i z e ( ) ; " > ' ) ;  
         d o c . w r i t e ( ' < d i v   a l i g n = " c e n t e r " > ' ) ;  
         d o c . w r i t e ( ' < i m g   s r c = " '   +   s r c   +   ' "   i d = " p p I m g "   o n c l i c k = " s e l f . c l o s e ( ) ; "   t i t l e = " C l o s e " > ' ) ;  
         d o c . w r i t e ( ' < / d i v > ' ) ;  
         d o c . w r i t e ( ' < d i v   s t y l e = " h e i g h t : 1 ;   w i d t h : '   +   b o r d e r   +   ' ;   f o n t - s i z e : 4 p t ; " > ' ) ;  
         d o c . w r i t e ( ' < / d i v > ' ) ;  
         d o c . w r i t e ( ' < d i v   i d = " p p I m g T e x t "   a l i g n = " c e n t e r " > ' ) ;  
         d o c . w r i t e ( n o t e ) ;  
         d o c . w r i t e ( ' < / d i v > ' ) ;  
         d o c . w r i t e ( ' < / b o d y > ' ) ;  
         d o c . w r i t e ( ' < / h t m l > ' ) ;  
         d o c . w r i t e ( ' < '   +   ' s c r i p t > ' ) ;  
         d o c . w r i t e ( ' f u n c t i o n   d o R e s i z e ( )   { ' ) ;  
         d o c . w r i t e ( '     v a r   i m g W   =   p p I m g . w i d t h ,   i m g H   =   p p I m g . h e i g h t ; ' ) ;        
         d o c . w r i t e ( '     w i n d o w . r e s i z e T o ( i m g W   +   8   + '   +   b o r d e r * 2   + ' ,   i m g H   +   p p I m g T e x t . o f f s e t H e i g h t   +   3 5   +   ' +   b o r d e r * 2   + ' ) ; ' ) ;  
         d o c . w r i t e ( '     s e t T i m e o u t ( \ ' d o R e s i z e ( ) \ ' ,   1 0 0 0 ) ; ' ) ;  
         d o c . w r i t e ( ' } ' ) ;  
         d o c . w r i t e ( ' d o R e s i z e ( ) ;   ' ) ;  
         d o c . w r i t e ( ' < / '   +   ' s c r i p t > ' ) ;  
 }  
 
