

function checkSubscribeForm() 
 { 

   var errorcount = 0;  
   name = document.subscribeform.Name.value
   email = document.subscribeform.Email.value
   AtPos = email.indexOf("@")
   StopPos = email.lastIndexOf(".")

   if (name == "") {
     errorcount++;
   }

   if (email == "") {
     errorcount++;
   }
   if (AtPos == -1 || StopPos == -1) {
     errorcount++;
   }
   if (StopPos < AtPos) {
     errorcount++;
   }
   if (StopPos - AtPos == 1) {
     errorcount++;
   } 
	      
   if (errorcount > 0) {
     alert('Please enter both a name and a valid email address.');
     return
   }
   else
   {
     document.subscribeform.submit()
   }
 } 