f u n c t i o n   c h o s e y e a r m o n t h ( o b j , m , y )  
 	 	 	 	 	 {  
 	 	 	 	 	 	  
 	 	 	 	 	 	 v a r   t ;  
 	 	 	 	 	 	 t = o b j . s e l e c t e d I n d e x ; 	 	 	 	 	 	  
 	 	 	 	 	 	 o b j . o p t i o n s . l e n g t h = 1 ;  
 	 	 	 	 	 	 v a r   n g a y = 0 ;  
 	 	 	 	 	 	 s w i t c h ( m )  
 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 c a s e   " 4 " : 	  
 	 	 	 	 	 	 	 c a s e   " 6 " :  
 	 	 	 	 	 	 	 c a s e   " 9 " : 	  
 	 	 	 	 	 	 	 c a s e   " 1 1 " :  
 	 	 	 	 	 	 	 	 n g a y = 3 0 ;    
 	 	 	 	 	 	 	 b r e a k ;  
 	 	 	 	 	 	 	 c a s e   " 2 " :  
 	 	 	 	 	 	 	 i f ( e v a l ( y ) % 4 = = 0 ) 	 	 	 	 	 	 	  
 	 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 	 n g a y = 2 9 ;  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 	 n g a y = 2 8 ;  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	 b r e a k ;  
 	 	 	 	 	 	 	 d e f a u l t :  
 	 	 	 	 	 	 	 n g a y = 3 1 ;  
 	 	 	 	 	 	 } 	 	 	 	 	 	  
 	 	 	 	 	 	 f o r   ( v a r   i = 1 ;   i < = n g a y ; i + + ) { 	 	 	 	 	 	  
 	 	 	 	 	 	 o b j . o p t i o n s . a d d ( n e w   O p t i o n ( i , i ) ) ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 	 i f ( t < = n g a y )  
 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 o b j . o p t i o n s [ t ] . s e l e c t e d = t r u e ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 }  
  
  
 f u n c t i o n   g e t _ o b j e c t ( i d n a m 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 )  
 	 {  
 	 	 r e t u r 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 n a m e ) ;  
 	 }  
 	 e l s e   i f   ( d o c u m e n t . a l l )  
 	 {  
 	 	 r e t u r n   d o c u m e n t . a l l [ i d n a m e ] ;  
 	 }  
 	 e l s e   i f   ( d o c u m e n t . l a y e r s )  
 	 {  
 	 	 r e t u r n   d o c u m e n t . l a y e r s [ i d n a m e ] ;  
 	 }  
 	 e l s e  
 	 {  
 	 	 r e t u r n   n u l l ;  
 	 }  
 }  
  
 f u n c t i o n   g e t _ t a g s ( p a r e n t o b j ,   t a g )  
 {  
 	 i f   ( t y p e o f   p a r e n t o b j . g e t E l e m e n t s B y T a g N a m e   ! =   ' u n d e f i n e d ' )  
 	 {  
 	 	 r e t u r n   p a r e n t o b j . g e t E l e m e n t s B y T a g N a m e ( t a g ) ;  
 	 }  
 	 e l s e   i f   ( p a r e n t o b j . a l l   & &   p a r e n t o b j . a l l . t a g s )  
 	 {  
 	 	 r e t u r n   p a r e n t o b j . a l l . t a g s ( t a g ) ;  
 	 }  
 	 e l s e  
 	 {  
 	 	 r e t u r n   n u l l ;  
 	 }  
 }  
  
  
 v a r   x m l H t t p ;  
 f u n c t i o n   c r e a t e X M L H t t p R e q u e s t ( )   {  
 	 i f   ( w i n d o w . A c t i v e X O b j e c t )   {  
 	 	 x m l H t t p   =   n e w   A c t i v e X O b j e c t ( " M i c r o s o f t . X M L H T T P " ) ;  
 	 }  
 	 e l s e   i f   ( w i n d o w . X M L H t t p R e q u e s t )   {  
 	 	 x m l H t t p   =   n e w   X M L H t t p R e q u e s t ( ) ;  
 	 }  
 }  
  
 f u n c t i o n   s t a r t R e q u e s t H T M L ( s t r U r l ,   s t r D i v N a m e )   {  
 	 c r e a t e X M L H t t p R e q u e s t ( ) ;  
 	 w i n d o w . s c r o l l T o ( 0 , 0 ) ;  
 	 x m l H t t p . o n r e a d y s t a t e c h a n g e   =   f u n c t i o n ( ) {  
 	 	 i f ( x m l H t t p . r e a d y S t a t e   = =   4 )   {  
 	 	 	 i f ( x m l H t t p . s t a t u s   = =   2 0 0 )   {  
 	 	 	 	 g e t _ o b j e c t ( s t r D i v N a m e ) . i n n e r H T M L   =   x m l H t t p . r e s p o n s e T e x t ;  
 	 	 	 }  
 	 	 }  
 	 } ;  
 	 x m l H t t p . o p e n ( " G E T " , s t r U r l ,   t r u e ) ;  
 	 x m l H t t p . s e n d ( n u l l ) ;  
 	 r e t u r n   f a l s e ;  
 }  
  
  
 f u n c t i o n   s t a t e L o a d ( o b j )  
 {  
 	 g e t _ o b j e c t ( o b j ) . i n n e r H T M L = ' < d i v   c l a s s = " l o a d i n g " > L o a d i n g   d a t a . . . < / d i v > '  
  
 }  
 f u n c t i o n   l o a d X M L D o c ( u r l ,   c a l l b a c k F u n c t i o n ,   d i v D e s c ,   Q U E R Y _ S T R I N G )   {  
 	 a F l a g = f a l s e ;  
         / /   b r a n c h   f o r   n a t i v e   X M L H t t p R e q u e s t   o b j e c t  
         i f   ( w i n d o w . X M L H t t p R e q u e s t )   {  
                 x m l H t t p   =   n e w   X M L H t t p R e q u e s t ( ) ;  
 	 	 x m l H t t p . o n r e a d y s t a t e c h a n g e   = 	 f u n c t i o n ( ) {  
 	 	 	 	 	 	 	 	 	 	 / /   o n l y   i f   r e q   s h o w s   " c o m p l e t e "  
 	 	 	 	 	 	 	 	 	 	 i f   ( x m l H t t p . r e a d y S t a t e   = =   4 )   {  
 	 	 	 	 	 	 	 	 	 	 	 i f ( d i v D e s c )   s t a t e L o a d ( d i v D e s c ) ;  
 	 	 	 	 	 	 	 	 	 	 	 e v a l ( c a l l b a c k F u n c t i o n ) ;  
 	 	 	 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	 	 	 }  
 	 	 i f ( Q U E R Y _ S T R I N G ) {  
 	 	         x m l H t t p . o p e n ( " P O S T " ,   u r l ,   t r u e ) ;  
 	 	 	 x m l H t t p . s e t R e q u e s t H e a d e r ( " C o n t e n t - T y p e " ,   " a p p l i c a t i o n / x - w w w - f o r m - u r l e n c o d e d " ) ;  
 	 	 	 x m l H t t p . s e n d ( Q U E R Y _ S T R I N G ) ;  
 	 	 }  
                 e l s e {  
 	                 x m l H t t p . o p e n ( " G E T " ,   u r l ,   t r u e ) ;  
 	                 x m l H t t p . s e n d ( n u l l ) ;  
 	         }  
         / /   b r a n c h   f o r   I E / W i n d o w s   A c t i v e X   v e r s i o n  
         }   e l s e   i f   ( w i n d o w . A c t i v e X O b j e c t )   {  
                 x m l H t t p   =   n e w   A c t i v e X O b j e c t ( " M i c r o s o f t . X M L H T T P " ) ;  
                 i f   ( x m l H t t p )   {  
                 	 x m l H t t p . o n r e a d y s t a t e c h a n g e   = 	 f u n c t i o n ( ) {  
 	 	 	 	 	 	 	 	 	 	 	 / /   o n l y   i f   r e q   s h o w s   " c o m p l e t e "  
 	 	 	 	 	 	 	 	 	 	 	 i f   ( x m l H t t p . r e a d y S t a t e   = =   4 )   {  
 	 	 	 	 	 	 	 	 	 	 	 	 i f ( d i v D e s c )   s t a t e L o a d ( d i v D e s c ) ;  
 	 	 	 	 	 	 	 	 	 	 	 	 e v a l ( c a l l b a c k F u n c t i o n ) ;  
 	 	 	 	 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	 	 	 	 }  
 	 	 	 i f ( Q U E R Y _ S T R I N G ) {  
 	 	 	         x m l H t t p . o p e n ( " P O S T " ,   u r l ,   t r u e ) ;  
 	 	 	 	 x m l H t t p . s e t R e q u e s t H e a d e r ( " C o n t e n t - T y p e " ,   " a p p l i c a t i o n / x - w w w - f o r m - u r l e n c o d e d " ) ;  
 	 	 	 	 x m l H t t p . s e n d ( Q U E R Y _ S T R I N G ) ;  
 	 	 	 }  
 	 	 	 e l s e {  
 	 	 	         x m l H t t p . o p e n ( " G E T " ,   u r l ,   t r u e ) ;  
 	 	 	         x m l H t t p . s e n d ( n u l l ) ;  
 	 	 	 }  
                 }  
         }  
 }  
  
 f u n c t i o n   o p e n W i n ( s t r U r l ,   s t r N a m e ,   s t r F e a t u r e s )  
 {  
 	 v a r   o b j W i n   =   w i n d o w . o p e n ( s t r U r l ,   s t r N a m e ,   s t r F e a t u r e s ) ;  
 	 i f ( ! o b j W i n )   {  
 	 	 a l e r t ( " L ×i :   K h ô n g   t h Ã  m ß  c ía   s Õ  én g   d ån g ! \ n B ¡n   v u i   l ò n g   t ¯t   c h éc   n n g   c h ·n   p o p u p   c ça   t r ì n h   d u y Çt   v à   t h í  l ¡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   a d v C l i c k ( s t r U R L )  
 {  
 	 r e t u r n   o p e n W i n ( s t r U R L , " _ b l a n k " , " s c r o l l b a r s = y e s ,   t o o l b a r = y e s ,   m e n u b a r = y e s ,   s t a t u s = y e s ,   r e s i z a b l e = y e s " ) ;  
 }  
  
 f u n c t i o n   c h e c k E m a i l ( c h e c k S t r )    
 {  
 	 i f   ( / ^ \ w + ( [ \ . - ] ? \ w + ) * @ \ w + ( [ \ . - ] ? \ w + ) * ( \ . \ w { 2 , 3 } ) + $ / . t e s t ( c h e c k S t r ) )  
 	 {  
 	 	 r e t u r n   ( t r u e )  
 	 }  
 	 r e t u r n   ( f a l s e )  
 }  
  
 