    
    function validate() {

      themessage="Please correct the following: \n";
      thecounter=0;
      
      if (!document.SampleForm.name.value) {
        themessage = themessage + 'Please enter your name.\n';
        thecounter=thecounter + 1;
      }
      
      if (!document.SampleForm.email.value) 
      {
        themessage = themessage + 'Your valid email address is required.\n';
        thecounter=thecounter + 1;
      }
      
      if (document.SampleForm.email.value)
      {
        var email = document.SampleForm.email;
        var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
        if (!filter.test(email.value)) 
        {
          themessage = themessage + 'Your valid email address is required.\n';
          thecounter=thecounter + 1;
        }
      }
   
      
      if (thecounter > 0) {
        alert(themessage);
        return false;
      }
    }



