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