In the code below I have a variable called (uncreatively enough) "number". This variable is supposed to be incremented every 2 seconds, and as a test I "alert" it out to the screen.

However, the first alert says "undefined", and all subsequent alerts say "NaN".

I'm fairly new to JavaScript, but not to programming. I declare and initialize it in the head, and then increment it in the function. I have tried placing the declaration in the function, thinking it might be a scope problem, but I get the same alerts.

Any boot in the right direction would be greatly appreciated!

PHP Code:
<html>
  <
head>
    <
title>Campaign Promises for 2004</title>
    <
link href="style.css" rel="stylesheet" type="text/css">

    <
script language="javascript" type="text/javascript">
      <!--
        var 
dollars = new array(0123456789","":""$");
        var 
number 9999;
        function 
window_onload()
        {
          
window.setInterval("updateDollars()"2000);
        }
      -->
    
</script>

  </head>
  <body language="javascript" onload="return window_onload();">
    <div align="center">
      <table width="750" border="1">
        <tr>
          <td>
      <table width="750" border="0" cellpadding="0" cellspacing="0" summary="page table">
        <tr>
          <td colspan="5" height="50" background="graphics/logo.gif">
            &nbsp;
          </td>
        </tr>
        <tr class="nav" valign="top">
          <td height="20" width="375" background="graphics/timeBar.gif">
            <span class="moneySpent">Money Spent: $</span>
            <img name="1" src="graphics/placeHolder.gif">

            <script language="javascript" type="text/javascript">
              <!--
                var startDollars = 10000000;
                function updateDollars()
                {
                  alert('number = ' + number);
                  number++;
                  if( number > 9 ) number = 0;
                }
              -->
            </script>

          </td>
          <td align="center">
            nav
          </td>
          <td align="center">
            nav
          </td>
          <td align="center">
            nav
          </td>
          <td align="center">
            nav
          </td>
        </tr>
        <tr height="15">
          <td colspan="5" background="graphics/logoUnderbar.gif">
          </td>
        </tr>
      </table>
          </td>
        </tr>
      </table>
    </div>
  </body>
</html>