ÿþf u n c t i o n   c h e c k C o n t a c t I n f o ( )  
 {  
  
 v a r   f i r s t 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 ( ' t x t F i r s t N a m e ' ) . v a l u e ;  
 v a r   l a s t 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 ( ' t x t L a s t 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 ( ' t x t E m a i l ' ) . v a l u e ;  
 v a r   c o m m e n t 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 C o m m e n t s ' ) . v a l u e ;  
 v a r   p h o n 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 P h o n e ' ) . v a l u e ;  
 v a r   f a x               =   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 F a x ' ) . v a l u e ;  
  
 i f ( f i r s t N a m e   = =   " " )  
 {  
 a l e r t ( ' P l e a s e   s p e c i f y   y o u r   f i r s t   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 ( ' t x t F i r s t N a m e ' ) . f o c u s ( ) ;  
 r e t u r n   f a l s e  
 }  
  
 i f ( l a s t N a m e   = =   " " )  
 {  
 a l e r t ( ' P l e a s e   s p e c i f y   y o u r   l a s t     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 ( ' t x t L a s t N a m e ' ) . f o c u s ( ) ;  
 r e t u r n   f a l s e  
 }  
  
 i f ( e m a i l   = =   " " )  
 {  
 a l e r t ( ' T h e   e m a i l   f i e l d   c a n   n o t   b e   l e f t   b l a n 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 ' ) . f o c u s ( ) ;  
 r e t u r n   f a l s e  
 }  
  
 i f   ( e c h e c k ( e m a i l ) = = 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 ' ) . f o c u s ( ) ;  
 r e t u r n   f a l s e  
 }  
  
  
 i f   ( i s N a N ( p h o n e )   & &   p h o n e   ! =   " " )  
 {  
 a l e r t ( ' I n v a l i d   p h o n e   n u m b e r ! ' ) ;  
 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 P h o n e ' ) . f o c u s ( ) ;  
 r e t u r n   f a l s e  
 }  
  
 i f   ( i s N a N ( f a x )   & &   f a x   ! =   " " )  
 {  
 a l e r t ( ' I n v a l i d   f a x   n u m b e r ! ' ) ;  
 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 F a x ' ) . f o c u s ( ) ;  
 r e t u r n   f a l s e  
 }  
  
 i f ( c o m m e n t s   = =   " " )  
 {  
 a l e r t ( ' P l e a s e   l e t   u s   k n o w   h o w   w e   c a n   s e r v i c e   y o u   b y   e i t h e r   e n t e r i n g   a   q u e s t i o n   o r   c o m m e n t   i n   t h e   f i e l d   b e l o w ! ' ) ;  
 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 C o m m e n t s ' ) . 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 ;  
 }  
  
  
 f u n c t i o n   e 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 ( " I n v a l i d   E - m a i l   I D " )  
 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 ( " I n v a l i d   E - m a i l   I D " )  
 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 ( " I n v a l i d   E - m a i l   I D " )  
 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 ( " I n v a l i d   E - m a i l   I D " )  
 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 ( " I n v a l i d   E - m a i l   I D " )  
 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 ( " I n v a l i d   E - m a i l   I D " )  
 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 ( " I n v a l i d   E - m a i l   I D " )  
 r e t u r n   f a l s e  
 }  
 r e t u r n   t r u e 	 	 	 	 	  
 } 
