function checkForm(whichform) {
  switch (whichform) {
    case "contact":
      if ($F('name')=='' || $F('email')=='' || $F('message')=='') {
        alert("All fields are required! Please fill in all the fields and try again.");
      } else {
        document.forms[0].submit();
      }
      break;
    case "appointment":
      if ($F('name')=='' || $F('email')=='' || $F('phone')=='' || $F('when')=='' || $F('where')=='') {
        alert("All fields are required! Please fill in all the fields and try again.");
      } else {
        document.forms[0].submit();
      }
      break;
    case "refill":
      if ($F('name')=='' || $F('email')=='' || $F('phone')=='' || $F('medicine')=='' || $F('dosage')=='') {
        alert("All fields are required! Please fill in all the fields and try again.");
      } else {
        document.forms[0].submit();
      }
      break;
    default:
      alert("The type of form you are trying to check does not exist!");
  }
}

function showService(whichone) {
  switch(whichone) {
    case "pt":
      $('pt_tab').addClassName('active');
      $('bmi_tab').removeClassName('active');
      $('bmd_tab').removeClassName('active');
      $('pt').show();
      $('bmi').hide();
      $('bmd').hide();
      break;
    case "bmi":
      $('pt_tab').removeClassName('active');
      $('bmi_tab').addClassName('active');
      $('bmd_tab').removeClassName('active');
      $('pt').hide();
      $('bmi').show();
      $('bmd').hide();
      break;
    case "bmd":
      $('pt_tab').removeClassName('active');
      $('bmi_tab').removeClassName('active');
      $('bmd_tab').addClassName('active');
      $('pt').hide();
      $('bmi').hide();
      $('bmd').show();
      break;
  }
}
