Enter is not working in Internet explorer and Firefox
<p>This function is not working in Internet Explorer and Firefox. In Firefox, it returns the following error:</p>

<blockquote>
  <p>TypeError: e is undefined<br>
  [Break On This Error]<br>
  ...e.which == "number") ? e.which : e.keyCode; keyCodeEntered = (e.which) ? e.which... </p>
</blockquote>

<p>The function:</p>

<pre><code>function onSearchPhraseKeyDown(e) {
    var buttonId = '&lt;%=SearchButton.ClientID %&gt;';
        if (!e)
            var e = (typeof e.which == "number") ? e.which : e.keyCode;
        keyCodeEntered = (e.which) ? e.which : window.event.keyCode;

        if ((keyCodeEntered == 13) || (keyCodeEntered == 13)) {
            document.getElementById(buttonId).click();
            return false;
        } else {
            return true;
        }
}
</code></pre>

<p>Can anyone see what's wrong?</p>
