ÿþ   
  
  
  
 f u n c t i o n   n u m c h a r ( s t r ,   x )  
 {  
   v a r   c o u n t ;  
   c o u n t = 0 ;  
       f o r ( i = 0 ;   i < = ( s t r . l e n g t h   - 1 ) ;   i + + )  
           {  
               i f   ( s t r . c h a r A t ( i ) = = x )  
               {  
                   c o u n t + + ;  
               }  
             }  
                 r e t u r n   c o u n t ;  
 }  
  
    
    
    
 f u n c t i o n   m e s s a g e _ v a l i d a t e ( f )  
 {  
       i f   ( f . m e s s a g e . v a l u e = = " T y p e   y o u r   m e s s a g e   h e r e "     )  
         {    
           f . m e s s a g e . v a l u e = " " ;  
           }  
 }  
    
  
  
 f u n c t i o n   s u b m i t _ f o r m ( )  
   {    
  
 m i s s i n g i n f o   = " " ;  
  
    
 i f   ( f o r m . n a m e . v a l u e . l e n g t h < 2 )  
       {  
         m i s s i n g i n f o   + =   " \ n   E n t e r   y o u r   n a m e " ;  
         }  
  
  
   i f   (   ( f o r m . e m a i l . v a l u e . l e n g t h < 5 )   | |   ( n u m c h a r ( f o r m . e m a i l . v a l u e , "   " )   > 0 )   | |   ( n u m c h a r ( f o r m . e m a i l . v a l u e ,   " @ " ) ! = 1 ) | | ( n u m c h a r ( f o r m . e m a i l . v a l u e ,   " . " ) = = 0 )   )  
       {  
              
             m i s s i n g i n f o   + = " \ n   W r o n g   E m a i l   a d d r e s s " ;  
     }    
  
 i f   ( f o r m . s u b j e c t . v a l u e . l e n g t h < 2 )  
       {  
         m i s s i n g i n f o   + = " \ n   E n t e r   s u b j e c t " ;  
         }  
  
  
    
    
  
 i f   (   ( f o r m . m e s s a g e . v a l u e = = " " )   | |   ( f o r m . m e s s a g e . v a l u e = = " T y p e   y o u r   m e s s a g e   h e r e " )   )  
   {  
  
           m i s s i n g i n f o   + = " \ n   P l e a s e ,   t y p e   y o u r   m e s s a g e " ;  
                  
         }                          
      
            
 i f   ( m i s s i n g i n f o   ! =   " " )   {  
 m i s s i n g i n f o   = " _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \ n "   +  
 " Y o u   f a i l e d   t o   c o r r e c t l y   f i l l   i n   y o u r : \ n "   +  
 m i s s i n g i n f o   +   " \ n _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ "   +  
 " \ n P l e a s e   r e - e n t e r   a n d   s u b m i t   a g a i n ! " ;  
 a l e r t ( m i s s i n g i n f o ) ;  
 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 ;  
 }    
  
                
 }    
    
            
    
  
  
  
  
 
