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