ÿþ/ *   R e q u i r e d   F i e l d   V a l i d a t i o n   * /  
  
  
 v a r   m s g r e q u i r e d   =   " P l e a s e   e n t e r   a l l   t h e   r e q u i r e d   f i e l d s " ;  
 v a r   m s g r e q u i r e d a r   =   " 'D1,'!  '/.'D  ,EJ9  'D-BHD  'DE7DH()" ;  
  
 f u n c t i o n   M s g R e q u i r e d ( )  
 {  
 	 i f ( l a n g u a g e   ! =   ' ' )  
 	 {  
 	 	 i f ( l a n g u a g e . t o L o w e r C a s e ( )   = =   " e n - u s " )  
 	 	 {  
 	 	 	 r e t u r n   m s g r e q u i r e d ;  
 	 	 }  
 	 	 e l s e  
 	 	 {  
 	 	 	 r e t u r n   m s g r e q u i r e d a r ;  
 	 	 }  
 	 }  
 }  
  
  
 f u n c t i o n   V a l i d a t e R e q u i r e d F i e l d ( f i e l d n a m e )  
 {  
 	 f i e l d 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 ( f i e l d n a m e ) . v a l u e ;  
         r e t u r n   f i e l d v a l u e   ! =   ' ' ;  
 }  
  
 f u n c t i o n   V a l i d a t e R e q u i r e d F i e l d s ( a r r R e q F i e l d s )  
 {  
 	 v a r   v a l i d   =   t r u e ;  
 	 f o r ( v a r   i = 0 ;   i < a r r R e q F i e l d s . l e n g t h ;   i + + )  
 	 {  
 	 	 i f ( ! V a l i d a t e R e q u i r e d F i e l d ( a r r R e q F i e l d s [ i ] ) )  
 	 	 {        
 	 	 	 v a l i d   =   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 ( a r r R e q F i e l d s [ i ] ) . c l a s s N a m e   + =   '   i n v a l i d ' ;  
 	 	 	 a l e r t ( M s g R e q u i r e d ( ) ) ;  
 	 	 	 b r e a k ;  
 	 	 }  
 	 	 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 r R e q F i e l d s [ i ] ) . c l a s s 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 ( a r r R e q F i e l d s [ i ] ) . c l a s s N a m e . r e p l a c e ( '   i n v a l i d ' , ' ' ) ;  
 	 	 }  
 	 }  
 	 r e t u r n   v a l i d ;  
 }  
  
 / *   E n d   o f   R e q u i r e d   F i e l d   V a l i d a t i o n   * /  
  
  
  
  
 / *   E m a i l   V a l i d a t i o n   * /  
  
 v a r   m s g e m a i l   =   " T h e   e m a i l   y o u   e n t e r e d   i s   i n v a l i d " ;  
 v a r   m s g e m a i l a r   =   " 'D(1J/  'D'DC*1HFJ  'D0J  #/.D*G  :J1  5-J-" ;  
  
  
 f u n c t i o n   M s g E m a i l ( )  
 {  
 	 i f ( l a n g u a g e   ! =   ' ' )  
 	 {  
 	 	 i f ( l a n g u a g e . t o L o w e r C a s e ( )   = =   " e n - u s " )  
 	 	 {  
 	 	 	 r e t u r n   m s g e m a i l ;  
 	 	 }  
 	 	 e l s e  
 	 	 {  
 	 	 	 r e t u r n   m s g e m a i l a r ;  
 	 	 }  
 	 }  
 }  
  
 f u n c t i o n   V a l i d a t e E m a i l ( f i e l d n a m e )  
 {  
 	 f i e l d 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 ( f i e l d n a m e ) . v a l u e ;  
 	 v a r   f i l t e r   = / ^ . + \ @ . + . . { 2 , 3 } $ /   ;  
 	 r e t u r n   f i l t e r . t e s t ( f i e l d v a l u e ) ; 	  
 }  
  
 f u n c t i o n   V a l i d a t e E m a i l F i e l d s ( a r r R e q F i e l d s )  
 { 	  
 	 v a r   v a l i d   =   t r u e ;  
 	 f o r ( v a r   i = 0 ;   i < a r r R e q F i e l d s . l e n g t h ;   i + + )  
 	 {  
 	 	 i f ( ! V a l i d a t e E m a i l ( a r r R e q F i e l d s [ i ] ) )  
 	 	 {  
 	 	 	 v a l i d   =   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 ( a r r R e q F i e l d s [ i ] ) . c l a s s N a m e   + =   '   i n v a l i d ' ;  
 	 	 	 a l e r t ( M s g E m a i l ( ) ) ;  
 	 	 	 b r e a k ;  
 	 	 }  
 	 	 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 r R e q F i e l d s [ i ] ) . c l a s s 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 ( a r r R e q F i e l d s [ i ] ) . c l a s s N a m e . r e p l a c e ( '   i n v a l i d ' , ' ' ) ;  
 	 	 }  
 	 }  
 	 r e t u r n   v a l i d ; 	  
 }  
  
 / *   E n d   o f   E m a i l   V a l i d a t i o n   * /  
  
  
 / *   P h o n e   V a l i d a t i o n   * /  
  
  
 v a r   m s g p h o n e   =   " T h e   n u m b e r   y o u   e n t e r e d   i s   n o t   c o r r e c t " ;  
 v a r   m s g p h o n e a r   =   " 'D1BE  'D0J  '/.D*G  :J1  5-J-" ;  
  
  
 f u n c t i o n   M s g P h o n e ( )  
 {  
 	 i f ( l a n g u a g e   ! =   ' ' )  
 	 {  
 	 	 i f ( l a n g u a g e . t o L o w e r C a s e ( )   = =   " e n - u s " )  
 	 	 {  
 	 	 	 r e t u r n   m s g p h o n e ;  
 	 	 }  
 	 	 e l s e  
 	 	 {  
 	 	 	 r e t u r n   m s g p h o n e a r ;  
 	 	 }  
 	 }  
 }  
  
 f u n c t i o n   V a l i d a t e N u m b e r ( f i e l d n a m e )  
 {  
 	 f i e l d 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 ( f i e l d n a m e ) . v a l u e ;  
 	 v a r   f i l t e r   =   / ^ \ d { 3 , } $ / ;  
 	 r e t u r n   f i l t e r . t e s t ( f i e l d v a l u e ) ;  
 }  
  
  
  
 f u n c t i o n   V a l i d a t e P h o n e F i e l d s ( a r r R e q F i e l d s )  
 {  
 	 v a r   v a l i d   =   t r u e ;  
 	 f o r ( v a r   i = 0 ;   i < a r r R e q F i e l d s . l e n g t h ;   i + + )  
 	 {  
 	 	 i f ( ! V a l i d a t e N u m b e r ( a r r R e q F i e l d s [ i ] ) )  
 	 	 {  
 	 	 	 v a l i d   =   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 ( a r r R e q F i e l d s [ i ] ) . c l a s s N a m e   + =   '   i n v a l i d ' ;  
 	 	 	 a l e r t ( M s g P h o n e ( ) ) ;  
 	 	 	 b r e a k ;  
 	 	 }  
 	 	 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 r R e q F i e l d s [ i ] ) . c l a s s 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 ( a r r R e q F i e l d s [ i ] ) . c l a s s N a m e . r e p l a c e ( '   i n v a l i d ' , ' ' ) ;  
 	 	 }  
  
 	 }  
 	 r e t u r n   v a l i d ;  
 }  
  
 / *   E n d   o f   P h o n e   V a l i d a t i o n   * /  
  
  
 / *   O t h e r   V a l i d a t i o n s   * /  
  
 v a r   m s g m a t c h f i e l d s   =   " T h e   h i g h l i g h t e d   f i e l d s   s h o u l d   b e   i d e n t i c a l " ;  
 v a r   m s g m a t c h f i e l d s a r   =   " G0G  'D-BHD  J,(  'F  *CHF  E*7'(B)" ;  
  
  
 f u n c t i o n   M s g M a t c h i n g ( )  
 {  
 	 i f ( l a n g u a g e   ! =   ' ' )  
 	 {  
 	 	 i f ( l a n g u a g e . t o L o w e r C a s e ( )   = =   " e n - u s " )  
 	 	 {  
 	 	 	 r e t u r n   m s g m a t c h f i e l d s ;  
 	 	 }  
 	 	 e l s e  
 	 	 {  
 	 	 	 r e t u r n   m s g m a t c h f i e l d s a r ;  
 	 	 }  
 	 }  
 }  
  
  
  
 f u n c t i o n   C h e c k F i e l d M a t c h ( f i e l d n a m e 1 ,   f i e l d n a m e 2 )  
 {  
 	 v a r   v a l i d   =   t r u e ;  
 	 f i e l d 1   =   d o c u m e n t . g e t E l e m e n t B y I d ( f i e l d n a m e 1 ) ;  
 	 f i e l d 2   =   d o c u m e n t . g e t E l e m e n t B y I d ( f i e l d n a m e 2 ) ;  
         i f ( f i e l d 1 . v a l u e   ! =   f i e l d 2 . v a l u e )  
         {  
         	 f i e l d 1 . c l a s s N a m e   + =   '   i n v a l i d ' ;  
         	 f i e l d 2 . c l a s s N a m e   + =   '   i n v a l i d ' ;  
         	 a l e r t ( M s g M a t c h i n g ( ) ) ;         	  
         	 v a l i d   =   f a l s e ;  
         }  
         e l s e  
         {  
         	 f i e l d 1 . c l a s s N a m e   =   f i e l d 1 . c l a s s N a m e . r e p l a c e ( '   i n v a l i d ' , ' ' ) ;  
         	 f i e l d 2 . c l a s s N a m e   =   f i e l d 2 . c l a s s N a m e . r e p l a c e ( '   i n v a l i d ' , ' ' ) ;  
         	 v a l i d   =   t r u e ;          
         }      
         r e t u r n   v a l i d   ;  
 }  
  
 / *   E n d   o f   O t h e r   V a l i d a t i o n s   * /  
 
