schedule("window", initForm);
 
 
 

function initForm()
{
 var downloadForm = document.getElementById("downloadForm");
 
 downloadForm.onsubmit = checkForm;
};
 
function checkForm()
{
 //1
 var name = document.getElementById("name");
 //2
 var email = document.getElementById("email");

 

 
 

 
 
 // set up the new variable to return code
 var ret = true; // default the value to be successful
 
 

//1
 if (name.value == "")
 {
  name.focus();
  alert("Please fill in your first name");
  ret = false; // now there is an error, so set the ret variable to be false;
 }
 //2
 if (email.value == "")
 {
  email.focus();
  alert("Please fill in your last name");
  ret = false; // now there is an error, so set the ret variable to be false;
 }


 // now you can check if the funtion has been successful or not... if it has been then we can send it
 if (ret == true)
  send_mail();
 
 // now return the functions success value
 return ret;
};
