Ok, I've been trying to figure out why this doesn't work for a couple of days on the prototype user mailing list with no luck.

Can any of you gurus figure out what's busted?

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Untitled</title>
    <script language="JavaScript" type="text/javascript" src = "scriptaculous/prototype.js"></script>
    <script language="JavaScript" type="text/javascript" src = "scriptaculous/scriptaculous.js"></script>
    <script language="JavaScript" type="text/javascript">
        function catchEnterKey(e) {
            if (!e) { e = window.event; }
            alert('ok');
        }
        //-->
    </script>
</head>
<body>
<form id="loginForm" method="POST" action="#">
  <div>
    <label for="loginId">Username</label>
    <input id="loginId" type="text" name="loginId" value="" />
  </div>
  <div>
    <label for="password">Password</label>
    <input id="password" type="password" name="password" value="" />
  </div>
  <div id="uaButtonDiv">
    <input id="loginButton" type="submit" name="login" value="Login" class="uauthLogin" />
  </div>
</form>
<script language="JavaScript" type="text/javascript">
<!--
Event.observe('loginButton', 'click', 'catchEnterKey');

//the following lines work
//var button = document.getElementById('loginButton');
//button.onclick = catchEnterKey;
//-->
</script>

</body>
</html>
When i rund this in FF2 I get the following error from FireBug:
uncaught exception: [Exception... "Could not convert JavaScript argument" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame :: file:///withheld/scriptaculous/prototype.js :: anonymous :: line 2999" data: no]