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