ÿþ< ! - -  
  
 / / f u n c t i o n   r e t u r n s   t r u e   i s   s u b j e c t   o r   c o m m e n t s   i s   i n v a l i d ,   f a l s e   i f   v a l i d  
 f u n c t i o n   V a l i d C h a r ( i t e m )  
 {  
 v a r   i ;  
 i f   ( i t e m . l e n g t h < 1 )  
 	 {  
 	 r e t u r n   f a l s e  
 	 }  
 f o r   ( i = 0 ;   i < i t e m . l e n g t h ;   i + + )  
 	 {  
 	 i f   ( i t e m . c h a r A t ( i ) ! = '   ' )  
 	 	 r e t u r n   t r u e ;  
 	 }  
 r e t u r n   f a l s e  
 }  
  
 f u n c t i o n   H a v e C h a r ( i t e m )  
 {  
 v a r   i ;  
 i f   ( i t e m . l e n g t h < 1 )  
 	 {  
 	 r e t u r n   f a l s e  
 	 }  
 i f   ( i t e m . l e n g t h > 0 )  
 	 {  
 	 r e t u r n   t r u e  
 	 }  
 }  
  
  
  
 / / f u n c t i o n   f o r   c h a n g i n g   s t a t u s   l i n e   i f   s u b j e c t   i s   i n c o r r e c t  
 f u n c t i o n   V C h a r ( i t e m )  
 {  
 v a r   i ;  
 i f   ( i t e m . l e n g t h < 1 )  
 	 {  
 	 w i n d o w . s t a t u s = " R e q u i r e d   F i e l d   I n v a l i d :   A R E A   O F   I N T E R E S T . "  
 	 r e t u r n   f a l s e  
 	 }  
 f o r   ( i = 0 ;   i < i t e m . l e n g t h ;   i + + )  
 	 {  
 	 i f   ( i t e m . c h a r A t ( i ) ! = '   ' )  
 	 	 {  
 	 	 w i n d o w . s t a t u s = " "  
 	 	 r e t u r n   t r u e  
 	 	 }  
 	 }  
 	 	  
 w i n d o w . s t a t u s = " R e q u i r e d   F i e l d   I n v a l i d :   A R E A   O F   I N T E R E S T . "  
 r e t u r n   f a l s e 	  
 }  
  
  
 / / f u n c t i o n   f o r   c h a n g i n g   s t a t u s   l i n e   i f   c o m m e n t s   i s   i n c o r r e c t  
 f u n c t i o n   V C h a r 2 ( i t e m )  
 {  
 v a r   i ;  
 i f   ( i t e m . l e n g t h < 1 )  
 	 {  
 	 w i n d o w . s t a t u s = " P l e a s e   D E S C R I B E   Y O U R   E N Q U I R Y . "  
 	 r e t u r n   f a l s e  
 	 }  
 f o r   ( i = 0 ;   i < i t e m . l e n g t h ;   i + + )  
 	 {  
 	 i f   ( i t e m . c h a r A t ( i ) ! = '   ' )  
 	 	 {  
 	 	 w i n d o w . s t a t u s = " "  
 	 	 r e t u r n   t r u e  
 	 	 }  
 	 }  
 w i n d o w . s t a t u s = " P l e a s e   D E S C R I B E   Y O U R   E N Q U I R Y . "  
 r e t u r n   f a l s e 	  
 }  
  
 f u n c t i o n   V C h a r 3 ( i t e m )  
 {  
 v a r   i ;  
 i f   ( i t e m . l e n g t h < 1 )  
 	 {  
 	 w i n d o w . s t a t u s = " y o u   m u s t   t y p e :   Y E S "  
 	 r e t u r n   f a l s e  
 	 }  
 f o r   ( i = 0 ;   i < i t e m . l e n g t h ;   i + + )  
 	 {  
 	 i f   ( i t e m . c h a r A t ( i ) ! = '   ' )  
 	 	 {  
 	 	 w i n d o w . s t a t u s = " "  
 	 	 r e t u r n   t r u e  
 	 	 }  
 	 }  
 	 	  
 w i n d o w . s t a t u s = " Y o u   o n l y   e n t e r e d   s p a c e s   f o r   t h e   Y E S   f i e l d . "  
 r e t u r n   f a l s e 	  
 }  
  
  
 / / f u n c t i o n   f o r   c h a n g i n g   s t a t u s   l i n e   i f   e m a i l   i s   i n c o r r e c t  
 f u n c t i o n   V E m a i l ( i t e m )  
 {  
 i f   ( i t e m . l e n g t h < 7   | |    
 	 i t e m . i n d e x O f ( " @ " ) = = - 1   | |    
 	 i t e m . i n d e x O f ( " . " )   = =   - 1   | |  
 	 i t e m . i n d e x O f ( "   " )   ! =   - 1 )  
 	 {  
 	 w i n d o w . s t a t u s = " R e q u i r e d   F i e l d   I n v a l i d :   E M A I L   A D D R E S S . "  
 	 r e t u r n   t r u e  
 	 }  
 w i n d o w . s t a t u s = " "  
 r e t u r n   f a l s e  
 }  
  
 / / f u n c t i o n   f o r   v a l i d a t i n g   p h o n e   n u m b e r  
 f u n c t i o n   V N a m e ( i t e m )  
 {  
 i s I n t e g e r   =   / \ D / ;  
 i f   ( i t e m . l e n g t h < 8   | |   i s I n t e g e r . t e s t ( i t e m ) ! = 1 )  
 	 {  
 	 w i n d o w . s t a t u s = " R e q u i r e d   F i e l d   I n v a l i d :   F U L L   N A M E . "  
 	 r e t u r n   t r u e ;  
 	 }  
 r e t u r n   f a l s e ;  
 }  
  
 / / f u n c t i o n   f o r   v a l i d a t i n g   p h o n e   n u m b e r  
 f u n c t i o n   V P h o n e ( i t e m )  
 {  
 i s I n t e g e r   =   / \ D / ;  
 i f   ( i t e m . l e n g t h   > =   1 )  
 { i t e m   =   i t e m . r e p l a c e ( /   / g ,   " " ) ; }  
 i f   ( i t e m . l e n g t h   > =   1 )  
 { i t e m   =   i t e m . r e p l a c e ( / \ ( / g ,   " " ) ; }  
 i f   ( i t e m . l e n g t h   > =   1 )  
 { i t e m   =   i t e m . r e p l a c e ( / \ ) / g ,   " " ) ; }  
 i f   ( i t e m . l e n g t h   > =   1 )  
 { i t e m   =   i t e m . r e p l a c e ( / \ - / g ,   " " ) ; }  
  
 i f   ( i t e m . l e n g t h < 8   | |   i s I n t e g e r . t e s t ( i t e m ) ! = 0 )  
 	 {  
 	 r e t u r n   t r u e ;  
 	 w i n d o w . s t a t u s = " R e q u i r e d   F i e l d   I n v a l i d :   P H O N E   N U M B E R . "  
 	 }  
 r e t u r n   f a l s e ;  
 }  
  
 / / f u n c t i o n   r e t u r n s   t r u e   i s   e m a i l   i s   i n v a l i d ,   f a l s e   i f   v a l i d  
 f u n c t i o n   V a l i d E m a i l ( i t e m )  
 {  
 i f   ( i t e m . l e n g t h < 7   | |   i t e m . i n d e x O f ( " @ " ) = = - 1   | |   i t e m . i n d e x O f ( " . " )   = =   - 1   | | i t e m . i n d e x O f ( "   " )   ! =   - 1 )  
 	 { r e t u r n   t r u e }  
 r e t u r n   f a l s e  
 }  
  
 f u n c t i o n   A d d E r r o r ( f u l l E r r ,   e r r o r S t r )  
 {  
 i f   ( f u l l E r r . l e n g t h   = =   0 )  
 	 {  
 	 f u l l E r r   =   " T h e   f o l l o w i n g   R e q u i r e d   F i e l d s   h a v e   n o t   b e e n   f i l l e d   o u t   p r o p e r l y   : " ;  
 	 }  
 f u l l E r r   =   f u l l E r r   +   " \ n "   +   e r r o r S t r ;  
 r e t u r n   f u l l E r r ;  
 }  
  
 f u n c t i o n   V a l i d a t e E n q u i r y F o r m ( )    
 {  
 / / a l e r t ( " t e s t 1 " )  
 v a r   A l l E r r o r s   =   " "  
 v a r   e = 0  
 v a r   s = 0  
 v a r   p = 0  
 v a r   n = 0  
 v a r   b = 0  
 i f   ( V a l i d E m a i l ( d o c u m e n t . C u s t S r v c . f r o m . v a l u e ) )  
 	 { e + + }  
 i f   ( d o c u m e n t . C u s t S r v c . S u b j e c t . s e l e c t e d I n d e x = = 0 )    
 	 { s + + }  
 i f   ( V P h o n e ( d o c u m e n t . C u s t S r v c . P h o n e . v a l u e ) )  
 	 { p + + }  
 i f   ( V N a m e ( d o c u m e n t . C u s t S r v c . F u l l N a m e . v a l u e ) )  
 	 { n + + }  
 i f   ( ! V C h a r 2 ( d o c u m e n t . C u s t S r v c . b o d y . v a l u e ) )  
 	 { b + + }  
 	  
 i f   ( n ! = 0 )  
 	 { A l l E r r o r s   =   A d d E r r o r ( A l l E r r o r s ,   "   -   P l e a s e   e n t e r   y o u r   F U L L   N A M E . " ) ; }  
 i f   ( p ! = 0 )  
 	 { A l l E r r o r s   =   A d d E r r o r ( A l l E r r o r s ,   "   -   P l e a s e   e n t e r   a   v a l i d   P H O N E   N U M B E R . " ) ; }  
 i f   ( e ! = 0 )  
 	 { A l l E r r o r s   =   A d d E r r o r ( A l l E r r o r s ,   "   -   P l e a s e   e n t e r   a   v a l i d   E M A I L   A D D R E S S . " ) ; }  
 i f   ( s ! = 0 )  
 	 { A l l E r r o r s   =   A d d E r r o r ( A l l E r r o r s ,   "   -   P l e a s e   s e l e c t   a n   A R E A   O F   I N T E R E S T . " ) ; }  
 i f   ( b ! = 0 )  
 	 { A l l E r r o r s   =   A d d E r r o r ( A l l E r r o r s ,   "   -   P l e a s e   D E S C R I B E   Y O U R   E N Q U I R Y . " ) ; }  
 i f   ( A l l E r r o r s . l e n g t h   = =   0 )  
 	 { r e t u r n   t r u e ; }  
 e l s e  
 	 { a l e r t ( A l l E r r o r s ) ;  
 	 r e t u r n   f a l s e ; }  
 }  
  
 f u n c t i o n   A d d E r r o r A r a b i c ( f u l l E r r ,   e r r o r S t r )  
 {  
 i f   ( f u l l E r r . l e n g t h   = =   0 )  
 	 {  
 	 f u l l E r r   =   " 'D-BHD  'DE7DH()  'D*'DJ)  DJ3*  C'ED)  : " ;  
 	 }  
 f u l l E r r   =   f u l l E r r   +   " \ n "   +   e r r o r S t r ;  
 r e t u r n   f u l l E r r ;  
 }  
  
  
 f u n c t i o n   V a l i d a t e E n q u i r y F o r m A r a b i c ( )    
 {  
 / / a l e r t ( " t e s t 1 " )  
 v a r   A l l E r r o r s   =   " "  
 v a r   e = 0  
 v a r   s = 0  
 v a r   p = 0  
 v a r   n = 0  
 v a r   b = 0  
 i f   ( V a l i d E m a i l ( d o c u m e n t . C u s t S r v c . f r o m . v a l u e ) )  
 	 { e + + }  
 i f   ( d o c u m e n t . C u s t S r v c . S u b j e c t . s e l e c t e d I n d e x = = 0 )    
 	 { s + + }  
 i f   ( V P h o n e ( d o c u m e n t . C u s t S r v c . P h o n e . v a l u e ) )  
 	 { p + + }  
 i f   ( V N a m e ( d o c u m e n t . C u s t S r v c . F u l l N a m e . v a l u e ) )  
 	 { n + + }  
 i f   ( ! V C h a r 2 ( d o c u m e n t . C u s t S r v c . b o d y . v a l u e ) )  
 	 { b + + }  
 	  
 i f   ( n ! = 0 )  
 	 { A l l E r r o r s   =   A d d E r r o r A r a b i c ( A l l E r r o r s ,   "   -   'D1,'!  %/.'D  '3ECE  'DC'ED. " ) ; }  
 i f   ( p ! = 0 )  
 	 { A l l E r r o r s   =   A d d E r r o r A r a b i c ( A l l E r r o r s ,   "   -   'D1,'!  %/.'D  1BE  'DG'*A. " ) ; }  
 i f   ( e ! = 0 )  
 	 { A l l E r r o r s   =   A d d E r r o r A r a b i c ( A l l E r r o r s ,   "   -   'D1,'!  %/.'D  9FH'F  (1J/CE  'D%DC*1HFJ. " ) ; }  
 i f   ( s ! = 0 )  
 	 { A l l E r r o r s   =   A d d E r r o r A r a b i c ( A l l E r r o r s ,   "   -   J1,I  '.*J'1  EH6H9  'G*E'ECE. " ) ; }  
 i f   ( b ! = 0 )  
 	 { A l l E r r o r s   =   A d d E r r o r A r a b i c ( A l l E r r o r s ,   "   -   'D1,'!  H5A  '3*A3'1CE. " ) ; }  
 i f   ( A l l E r r o r s . l e n g t h   = =   0 )  
 	 { r e t u r n   t r u e ; }  
 e l s e  
 	 { a l e r t ( A l l E r r o r s ) ;  
 	 r e t u r n   f a l s e ; }  
 }  
  
  
 f u n c t i o n   S e t D r o p D o w n S u b j e c t ( )  
 {  
 I n s t r x s ( ) ;  
 G e t E m a i l S u b j e c t ( ) ;  
 }  
  
 f u n c t i o n   G e t E m a i l S u b j e c t ( )  
 {  
 p r e v   =   d o c u m e n t . r e f e r r e r ;  
  
 i f   ( p r e v . i n d e x O f ( " / t r a i n i n g - d u b a i / " )   ! =   - 1   | |   p r e v . i n d e x O f ( " / t r a i n i n g - c o u r s e s / " )   ! =   - 1   | |   p r e v . i n d e x O f ( " / h e a d e r - f r a m e " )   ! =   - 1 )  
 	 {  
 	 d o c u m e n t . C u s t S r v c . S u b j e c t . s e l e c t e d I n d e x   =   1 ;  
 	 }  
 i f   ( p r e v . i n d e x O f ( " / c l a s s r o o m - t r a i n i n g - l a b - r e n t a l " )   ! =   - 1   | |   p r e v . i n d e x O f ( " / a - c l a s s r o o m - t r a i n i n g - l a b - r e n t a l " )   ! =   - 1 )  
 	 {  
 	 d o c u m e n t . C u s t S r v c . S u b j e c t . s e l e c t e d I n d e x   =   2 ;  
 	 }  
 i f   ( p r e v . i n d e x O f ( " / a s s e s s m e n t / " )   ! =   - 1 )  
 	 {  
 	 d o c u m e n t . C u s t S r v c . S u b j e c t . s e l e c t e d I n d e x   =   3 ;  
 	 }  
 i f   ( p r e v . i n d e x O f ( " / c e r t i f i c a t i o n - t e s t i n g " )   ! =   - 1   | |   p r e v . i n d e x O f ( " / a - c e r t i f i c a t i o n - t e s t i n g " )   ! =   - 1 )  
 	 {  
 	 d o c u m e n t . C u s t S r v c . S u b j e c t . s e l e c t e d I n d e x   =   4 ;  
 	 }  
  
 / / a l e r t ( p r e v ) ;  
 }  
  
 - - >  
 
