ÿþ 
 f u n c t i o n   e m a i l c h e c k ( s t r )    
 {  
 	 v a r   a t = " @ " ;  
 	 v a r   d o t = " . " ;  
 	 v a r   l a t = s t r . i n d e x O f ( a t ) ;  
 	 v a r   l s t r = s t r . l e n g t h ;  
 	 v a r   l d o t = s t r . i n d e x O f ( d o t ) ;  
 	 i f   ( s t r . i n d e x O f ( a t ) = = - 1 ) {  
 	       a l e r t ( " Ëa   c h É  e m a i l   k h ô n g   h ãp   l Ç. " ) ;  
 	       r e t u r n   f a l s e ;  
 	 }  
  
 	 i f   ( s t r . i n d e x O f ( a t ) = = - 1   | |   s t r . i n d e x O f ( a t ) = = 0   | |   s t r . i n d e x O f ( a t ) = = l s t r ) {  
 	       a l e r t ( " Ëa   c h É  e m a i l   k h ô n g   h ãp   l Ç. " ) ;  
 	       r e t u r n   f a l s e ;  
 	 }  
  
 	 i f   ( s t r . i n d e x O f ( d o t ) = = - 1   | |   s t r . i n d e x O f ( d o t ) = = 0   | |   s t r . i n d e x O f ( d o t ) = = l s t r ) {  
 	         a l e r t ( " Ëa   c h É  e m a i l   k h ô n g   h ãp   l Ç. " ) ;  
 	         r e t u r n   f a l s e ;  
 	 }  
  
 	   i f   ( s t r . i n d e x O f ( a t , ( l a t + 1 ) ) ! = - 1 ) {  
 	         a l e r t ( " Ëa   c h É  e m a i l   k h ô n g   h ãp   l Ç. " ) ;  
 	         r e t u r n   f a l s e ;  
 	   }  
  
 	   i f   ( s t r . s u b s t r i n g ( l a t - 1 , l a t ) = = d o t   | |   s t r . s u b s t r i n g ( l a t + 1 , l a t + 2 ) = = d o t ) {  
 	         a l e r t ( " Ëa   c h É  e m a i l   k h ô n g   h ãp   l Ç. " ) ;  
 	         r e t u r n   f a l s e ;  
 	   }  
  
 	   i f   ( s t r . i n d e x O f ( d o t , ( l a t + 2 ) ) = = - 1 ) {  
 	         a l e r t ( " Ëa   c h É  e m a i l   k h ô n g   h ãp   l Ç. " ) ;  
 	         r e t u r n   f a l s e ;  
 	   }  
 	  
 	   i f   ( s t r . i n d e x O f ( "   " ) ! = - 1 ) {  
 	         a l e r t ( " Ëa   c h É  e m a i l   k h ô n g   h ãp   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   V a l i d a t e N e w s l e t t e r F o r m ( )  
 {  
         i f   ( ( d o c u m e n t . g e t E l e m e n t B y I d ( " t x t E m a i l " ) . v a l u e = = n u l l ) | | ( d o c u m e n t . g e t E l e m e n t B y I d ( " t x t E m a i l " ) . v a l u e = = " " ) ) {  
 	 	 a l e r t ( " V u i   l ò n g   n h ­p   Ëa   c h É  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 ( " t x t E m a i l " ) . f o c u s ( ) ;  
 	 	 r e t u r n   f a l s e ;  
 	 }  
 	 i f   ( e m a i l c h e c k ( d o c u m e n t . g e t E l e m e n t B y I d ( " t x t E m a i l " ) . v a l u e ) = = f a 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 ( " t x t E m a i l " ) . v a l u e =   " " ;  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( " t x t E m a i l " ) . f o c u s ( ) ;  
 	 	 r e t u r n   f a l s e ;  
 	 }  
  
 / /         d o c u m e n t . F o r m 1 . a c t i o n   = ' d e f a u l t . a s p x ' ;  
 / /         d o c u m e n t . F o r m 1 . s u b m i t ( ) ;  
 	 r e t u r n   t r u e ;  
 }  
  
 f u n c t i o n   V a l i d a t e N e w s l e t t e r F o r m E n g ( )  
 {  
         i f   ( ( d o c u m e n t . g e t E l e m e n t B y I d ( " t x t E m a i l " ) . v a l u e = = n u l l ) | | ( d o c u m e n t . g e t E l e m e n t B y I d ( " t x t E m a i l " ) . v a l u e = = " " ) ) {  
 	 	 a l e r t ( " P l e a s e   i n p u t   y o u r   e m a i l   a d d r e s s . " ) ;  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( " t x t E m a i l " ) . f o c u s ( ) ;  
 	 	 r e t u r n   f a l s e ;  
 	 }  
 	 i f   ( e m a i l c h e c k ( d o c u m e n t . g e t E l e m e n t B y I d ( " t x t E m a i l " ) . v a l u e ) = = f a 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 ( " t x t E m a i l " ) . v a l u e =   " " ;  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( " t x t E m a i l " ) . f o c u s ( ) ;  
 	 	 r e t u r n   f a l s e ;  
 	 }  
  
 / /         d o c u m e n t . F o r m 1 . a c t i o n   = ' d e f a u l t . a s p x ' ;  
 / /         d o c u m e n t . F o r m 1 . s u b m i t ( ) ;  
 	 r e t u r n   t r u e ;  
 }  
  
 f u n c t i o n   V a l i d a t e N e w s l e t t e r F o r m R u s ( )  
 {  
         i f   ( ( d o c u m e n t . g e t E l e m e n t B y I d ( " t x t E m a i l " ) . v a l u e = = n u l l ) | | ( d o c u m e n t . g e t E l e m e n t B y I d ( " t x t E m a i l " ) . v a l u e = = " " ) ) {  
 	 	 a l e r t ( " P l e a s e   i n p u t   y o u r   e m a i l   a d d r e s s . " ) ;  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( " t x t E m a i l " ) . f o c u s ( ) ;  
 	 	 r e t u r n   f a l s e ;  
 	 }  
 	 i f   ( e m a i l c h e c k ( d o c u m e n t . g e t E l e m e n t B y I d ( " t x t E m a i l " ) . v a l u e ) = = f a 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 ( " t x t E m a i l " ) . v a l u e =   " " ;  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( " t x t E m a i l " ) . f o c u s ( ) ;  
 	 	 r e t u r n   f a l s e ;  
 	 }  
  
 / /         d o c u m e n t . F o r m 1 . a c t i o n   = ' d e f a u l t . a s p x ' ;  
 / /         d o c u m e n t . F o r m 1 . s u b m i t ( ) ;  
 	 r e t u r n   t r u e ;  
 }  
  
 f u n c t i o n   V a l i d a t e B o o k i n g F o r m E n g ( )  
 {  
         i f   ( ( d o c u m e n t . g e t E l e m e n t B y I d ( " A r r i v a l D a t e " ) . v a l u e = = n u l l ) | | ( d o c u m e n t . g e t E l e m e n t B y I d ( " A r r i v a l D a t e " ) . v a l u e = = " " ) ) {  
 	 	 a l e r t ( " P l e a s e   s e l e c t   a r r i v a l   d a t 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 r i v a l D a t e " ) . f o c u s ( ) ;  
 	 	 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 ( " D e p a r t u r e D a t e " ) . v a l u e = = n u l l ) | | ( d o c u m e n t . g e t E l e m e n t B y I d ( " D e p a r t u r e D a t e " ) . v a l u e = = " " ) ) {  
 	 	 a l e r t ( " P l e a s e   s e l e c t   d e p a r t u r e   d a t e . " ) ;  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( " D e p a r t u r e D a t e " ) . f o c u s ( ) ;  
 	 	 r e t u r n   f a l s e ;  
 	 }  
 	  
         d o c u m e n t . F o r m 1 . a c t i o n   = ' h t t p : / / r e s e r v a t i o n . c o m a n c h e i n t e r n a t i o n a l . c o m / R e s e r v a t i o n s / A v a i l a b i l i t y . d o ' ;  
         d o c u m e n t . F o r m 1 . m e t h o d   =   ' p o s t ' ;  
         d o c u m e n t . F o r m 1 . s u b m i t ( ) ;  
 }  
  
 f u n c t i o n   V a l i d a t e B o o k i n g F o r m R u s ( )  
 {  
         i f   ( ( d o c u m e n t . g e t E l e m e n t B y I d ( " A r r i v a l D a t e " ) . v a l u e = = n u l l ) | | ( d o c u m e n t . g e t E l e m e n t B y I d ( " A r r i v a l D a t e " ) . v a l u e = = " " ) ) {  
 	 	 a l e r t ( " P l e a s e   s e l e c t   a r r i v a l   d a t 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 r i v a l D a t e " ) . f o c u s ( ) ;  
 	 	 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 ( " D e p a r t u r e D a t e " ) . v a l u e = = n u l l ) | | ( d o c u m e n t . g e t E l e m e n t B y I d ( " D e p a r t u r e D a t e " ) . v a l u e = = " " ) ) {  
 	 	 a l e r t ( " P l e a s e   s e l e c t   d e p a r t u r e   d a t e . " ) ;  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( " D e p a r t u r e D a t e " ) . f o c u s ( ) ;  
 	 	 r e t u r n   f a l s e ;  
 	 }  
 	  
         d o c u m e n t . F o r m 1 . a c t i o n   = ' h t t p : / / r e s e r v a t i o n . c o m a n c h e i n t e r n a t i o n a l . c o m / R e s e r v a t i o n s / A v a i l a b i l i t y . d o ' ;  
         d o c u m e n t . F o r m 1 . m e t h o d   =   ' p o s t ' ;  
         d o c u m e n t . F o r m 1 . s u b m i t ( ) ;  
 }  
  
 f u n c t i o n   V a l i d a t e B o o k i n g F o r m V i 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 ( " A r r i v a l D a t e " ) . v a l u e = = n u l l ) | | ( d o c u m e n t . g e t E l e m e n t B y I d ( " A r r i v a l D a t e " ) . v a l u e = = " " ) ) {  
 	 	 a l e r t ( " V u i   l ò n g   c h Ín   n g à y   ¿n . " ) ;  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( " A r r i v a l D a t e " ) . f o c u s ( ) ;  
 	 	 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 ( " D e p a r t u r e D a t e " ) . v a l u e = = n u l l ) | | ( d o c u m e n t . g e t E l e m e n t B y I d ( " D e p a r t u r e D a t e " ) . v a l u e = = " " ) ) {  
 	 	 a l e r t ( " V u i   l ò n g   c h Ín   n g à y   i . " ) ;  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( " D e p a r t u r e D a t e " ) . f o c u s ( ) ;  
 	 	 r e t u r n   f a l s e ;  
 	 }  
 	 e l s e {  
                 d o c u m e n t . F o r m 1 . a c t i o n   = ' h t t p : / / r e s e r v a t i o n . c o m a n c h e i n t e r n a t i o n a l . c o m / R e s e r v a t i o n s / A v a i l a b i l i t y . d o ' ;  
                 d o c u m e n t . F o r m 1 . m e t h o d   =   ' p o s t ' ;  
                 d o c u m e n t . F o r m 1 . s u b m i t ( ) ;  
         }  
 }  
 
