function alertIfInvalidForm(form) {
  form.observe('submit', function (e) {
    var n = LiveValidation.invalidCount;
    if (n) {
      alert(
        "Please review the "+n+" field"+(n > 1 ? "s" : "")+
        " with incomplete or invalid responses."
      );
      $$('.LV_invalid')[0].scrollIntoView();
    }
  });
}

