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?

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

    <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; }
<form id="loginForm" method="POST" action="#">
    <label for="loginId">Username</label>
    <input id="loginId" type="text" name="loginId" value="" />
    <label for="password">Password</label>
    <input id="password" type="password" name="password" value="" />
  <div id="uaButtonDiv">
    <input id="loginButton" type="submit" name="login" value="Login" class="uauthLogin" />
<script language="JavaScript" type="text/javascript">
Event.observe('loginButton', 'click', 'catchEnterKey');

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

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]