jQuery / AJAX Help

jQuery / AJAX Help

Hey guys, weirdest thing I've ever seen. I built a jQuery calendar and everything works except August for some completely unknown reason. If you load the page it will load the current month and you can use the next arrows to navigate through the months, until you get to August, where it crashes the browser. I've also manually tested September-December, and they work fine as well. Currently only the 'forward month' button works, not the 'previous month' button.

http://suckerpunchsallysdiner.com/test/schedules/

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Diner Scheduler</title>
<script type="text/javascript" src="../js/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
function date(month,year){
  $.get('_getDate.php',
       { 'month':month,'year':year },
       function(data){
         var mon = data.mon;
         $('#calendar tr:gt(0)').remove();
         $('#month').text(data.month+' '+data.year);
         $('#nextMonth').unbind().click(function(){
            date(Number(mon)+1);                  
         });
         $('<tr>').addClass('current').appendTo('#calendar');
         for(x = 1; x < (Number(data.theFirst) + Number(data.theLast)); x++){
           if(x==1){
            for(x = 0; x < data.theFirst; x++){
               $('<td>').html('&nbsp;').appendTo('.current');
             } 
           }   
           if(!(x%7)){
            $('.current').removeClass('current');
            $('<tr>').addClass('current').appendTo('#calendar');
           }
           $('<td>').text(x-data.theFirst+1).appendTo('.current');            
         }
       }
  ,'json');
}
$(function(){
  date();
});
</script>
<style type="text/css">
@import url('css/calendar.css');

</style>
</head>

<body>

<table id="calendar" cellspacing="0" cellpadding="0" summary="This month's calendar">
<caption><a id="prevMonth" href="#" title="previous month" class="nav">&laquo;</a> <span id="month"></span> <a id="nextMonth" href="#" title="next month" class="nav">&raquo;</a></caption>

<tr>
   <th scope="col" abbr="Sunday" title="Sunday">S</th>
   <th scope="col" abbr="Monday" title="Monday">M</th>
   <th scope="col" abbr="Tuesday" title="Tuesday">T</th>
   <th scope="col" abbr="Wednesday" title="Wednesday">W</th>
   <th scope="col" abbr="Thursday" title="Thursday">T</th>
   <th scope="col" abbr="Friday" title="Friday">F</th>
   <th scope="col" abbr="Saturday" title="Saturday">S</th>
</tr>
</table>


</body>
</html>



And the PHP if you're interested:
<?php

$year = $_GET['year'] <> 'undefined' ? $_GET['year']:date('Y');
$date = $_GET['month'] <> 'undefined' ? mktime(0,0,0,$_GET['month'],1,$year):time();
$dateInfo = getdate($date);
$theFirst = date('w',mktime(0,0,0,$dateInfo['mon'],1,$dateInfo['year']));

$dateInfo['theLast'] = date('t',$date);
$dateInfo['theFirst'] = $theFirst;

echo json_encode($dateInfo);

?>