function isValidEmail(str) {
   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
 
}

function valForm(theForm) {

  error="";

  if(theForm.name.value == "") {
    error = "Please Enter a Name \n";
  }

  if(theForm.email.value == "" || !isValidEmail(theForm.email.value)) {
    error += "Please Enter a Valid Email Address \n";
  }
    

  if(error != "") {
    alert(error);
    return false;
  }
}