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