Event.observe(window, "load", function () {
  // Warning about javascript being off.
  // If we can run this, the warning is irrelevant.
  var warning = $$(".captcha .warning")[0];
  if (warning != null) {
    warning.hide();
  }
  var comment_form = $$(".response form")[0];
  if (comment_form != null) {
    Event.observe(comment_form, "submit", function () {
      var captcha_sum = $$(".captcha input")[0];
      if (captcha_sum != null) {
        var email = $("comment_author_email").value;
        captcha_sum.value = hex_sha1(email);
      } else {
        alert("ERROR: Could not find field to auto-insert anti-spam hash.");
      }
    });
  }
});
