//-----------------------
// checkEmail()
//-----------------------
function checkEmail(){
  var d = document.form1;
  var emailPattern = /^[\w\-]+(\.[\w\-]+)*@[\w\-]+\.[\w\-]+(\.[\w\-]+)*$/;
  var emailMatch = false;

  if (d.email.value.match(emailPattern)){
    d.submit();
  }
  else{
    alert("The email address you have supplied does not appear to be in a recognised format - please check it and try again");
  }
}


//-----------------------
// nextStep()
//-----------------------
function nextStep(){
  var d = document.form1;

  if (d.medSchool.selectedIndex == 0){
    alert("Please select your medical school from the list provided");
  }
  else if (d.yearOfStudy.selectedIndex == 0){
    alert("Please select your year of study from the list provided");
  }
  else if (d.prevExams.selectedIndex == 0){
    alert("Please state whether you have done an MCQ based exam already");
  }
  else if (d.usedWebsite.selectedIndex == 0){
    alert("Please tell us whether you have used an online MCQ resource before by using the drop down list");
  }
  else if (d.pay.selectedIndex == 0){
    alert("Please tell us whether you would be willing to pay £40 per year for the proposed improvements to ClinicalTutor.com");
  }
  else{
    d.submit();
  }
}

