ÿþv a r   h t t p   =   c r e a t e R e q u e s t O b j e c t ( ) ;  
 v a r   a r e a l   =   M a t h . r a n d o m ( )   +   " " ;  
 v a r   r e a l   =   a r e a l . s u b s t r i n g ( 2 , 6 ) ;  
  
 f u n c t i o n   c r e a t e R e q u e s t O b j e c t ( )   {  
 	 v a r   x m l h t t p ;  
 	 t r y   {   x m l h t t p = n e w   A c t i v e X O b j e c t ( " M s x m l 2 . X M L H T T P " ) ;   }  
     c a t c h ( e )   {  
         t r y   {   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 " ) ; }  
         c a t c h ( f )   {   x m l h t t p = n u l l ;   }  
     }  
     i f ( ! x m l h t t p & & t y p e o f   X M L H t t p R e q u e s t ! = " u n d e f i n e d " )   {  
     	 x m l h t t p = n e w   X M L H t t p R e q u e s t ( ) ;  
     }  
 	 r e t u r n     x m l h t t p ;  
 }  
  
 f u n c t i o n   s e n d R e q u e s t ( )   {  
 	 v a r   r n d   =   M a t h . r a n d o m ( ) ;  
 	 v a r   n a m e   =   e s c a p e ( d o c u m e n t . g e t E l e m e n t B y I d ( " n a m e " ) . v a l u e ) ;  
 	 v a r   e m a i l   =   e s c a p e ( d o c u m e n t . g e t E l e m e n t B y I d ( " e m a i l " ) . v a l u e ) ;  
 	 v a r   s u b j e c t   =   e s c a p e ( d o c u m e n t . g e t E l e m e n t B y I d ( " s u b j e c t " ) . v a l u e ) ;  
 	 v a r   b o d y   =   e s c a p e ( d o c u m e n t . g e t E l e m e n t B y I d ( " b o d y " ) . v a l u e ) ;  
  
 	 t r y {  
         h t t p . o p e n ( ' P O S T ' ,     ' p f o r m . p h p ' ) ;  
         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 ' ) ;  
         h t t p . o n r e a d y s t a t e c h a n g e   =   h a n d l e R e s p o n s e ;  
 	 	 h t t p . s e n d ( ' n a m e = ' + n a m e + ' & e m a i l = ' + e m a i l + ' & s u b j e c t = ' + s u b j e c t + ' & b o d y = ' + b o d y + ' & r n d = ' + r n d ) ;  
 	 }  
 	 c a t c h ( e ) { }  
 	 f i n a l l y { }  
 }  
  
 f u n c t i o n   c h e c k _ v a l u e s ( )   {  
 	 v a r   v a l i d   =   ' ' ;  
 	  
 	 v a r   n a m e   =   d o c u m e n t . g e t E l e m e n t B y I d ( " n a m e " ) . v a l u e ;  
 	 v a r   e m a i l   =   d o c u m e n t . g e t E l e m e n t B y I d ( " e m a i l " ) . v a l u e ;  
 	 v a r   s u b j e c t   =   d o c u m e n t . g e t E l e m e n t B y I d ( " s u b j e c t " ) . v a l u e ;  
 	 v a r   b o d y   =   d o c u m e n t . g e t E l e m e n t B y I d ( " b o d y " ) . v a l u e ;  
 	 i f ( t r i m ( n a m e )   = =   " "   | |  
 	 	 t r i m ( e m a i l )   = =   " "   | |  
 	 	 t r i m ( s u b j e c t )   = =   " "   | |  
 	 	 t r i m ( b o d y )   = =   " " )   {  
 	 	 	 a l e r t ( " 0?>;=8B5  ?>60;C9AB0  2A5  3@0DK. " ) ;  
 	 }   e l s e   {  
 	 	 i f ( i s E m a i l ( e m a i l ) )   {  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( " s u b m i t " ) . d i s a b l e d = t r u e ;  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( " s u b m i t " ) . v a l u e = ' P r o c e s s i n g . . . ' ;  
 	 	 	 s e n d R e q u e s t ( ) ;  
 	 	 }   e l s e   {  
 	 	 	 a l e r t ( " #:068B5  04@5A  M;5:B@>==>9  ?>GBK. " ) ;  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( " e m a i l " ) . f o c u s ( ) ;  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( " e m a i l " ) . s e l e c t ( ) ;  
 	 	 }  
 	 }  
 }  
  
 f u n c t i o n   h a n d l e R e s p o n s e ( )   {  
 	 t r y {  
         i f ( ( h t t p . r e a d y S t a t e   = =   4 ) & & ( h t t p . s t a t u s   = =   2 0 0 ) ) {  
         	 v a r   r e s p o n s e   =   h t t p . r e s p o n s e T e x t ;  
             d o c u m e n t . g e t E l e m e n t B y I d ( " c o n f i r m a t i o n " ) . i n n e r H T M L   =   r e s p o n s e ;  
             d o c u m e n t . g e t E l e m e n t B y I d ( " c o n f i r m a t i o n " ) . s t y l e . d i s p l a y   = " " ;  
 	 	 }  
     }  
 	 c a t c h ( e ) { }  
 	 f i n a l l y { }  
 }  
  
 f u n c t i o n   i s U n d e f i n e d ( a )   {  
       r e t u r n   t y p e o f   a   = =   ' u n d e f i n e d ' ;  
 }  
  
 f u n c t i o n   t r i m ( a )   {  
 	 r e t u r n   a . r e p l a c e ( / ^ s * ( S * ( s + S + ) * ) s * $ / ,   " $ 1 " ) ;  
 }  
  
 f u n c t i o n   i s E m a i l ( a )   {  
       r e t u r n   ( a . i n d e x O f ( " . " )   >   0 )   & &   ( a . i n d e x O f ( " @ " )   >   0 ) ;  
 }  
 
