function calendar(start) {
	 //If no parameter is passed use the current date.
	 if(start == null)
	    start = 0;
	    
	 date = new Date();
	 date.setMonth(date.getMonth()+start);

	 day = date.getDate();
	 month = date.getMonth();
	 year = date.getFullYear();

	 months = new Array('January',
			    'February',
			    'March',
			    'April',
			    'May',
			    'June',
			    'July',
			    'August',
			    'September',
			    'October',
			    'November',
			    'December');

	 days = new Array('S','M','T','W','T','F','S');

	 this_month = new Date(year, month, 1);
	 next_month = new Date(year, month + 1, 1);

	 //Find out when this month starts and ends.         
	 first_week_day = this_month.getDay();
	 days_in_this_month = Math.floor((next_month.getTime() - this_month.getTime()) / (1000 * 60 * 60 * 24));

	 calendar_html = '<table width="90%" style="background-color:ebedda; color:ffffff;">';

	 calendar_html += '<tr><td colspan="7" align="center" style="background-color:acad9f; color:000000;"><p><font color="white">' + 
			  months[month] + ' ' + year + '</font></td></tr>'


	 calendar_html += '<tr>';

	 for(week_day = 0; week_day < 7; week_day++) {
	   calendar_html += "<td><p>&nbsp;"+days[week_day]+"</td>";
	 }

	 calendar_html += '</tr>';

	 calendar_html += '<tr><td colspan="7" bgcolor="#cacbb9"><img src="img/1px_trans.gif" height="1"></td></tr>';

	 calendar_html += '<tr>';

	 //Fill the first week of the month with the appropriate number of blanks.       
	 for(week_day = 0; week_day < first_week_day; week_day++)
	    {
	    calendar_html += '<td style="background-color:ebedda; color:000000;"> </td>';   
	    }

	 week_day = first_week_day;
	 for(day_counter = 1; day_counter <= days_in_this_month; day_counter++)
	    {
	    week_day %= 7;

	    if(week_day == 0)
	       calendar_html += '</tr><tr>';

	    //Do something different for the current day.
	    if(day == day_counter && start == 0)   
	       calendar_html += '<td align="center"><p><b><a href="availability.php" class="calendar">' + day_counter + '</a></b></td>';
	    else
	       calendar_html += '<td align="center" style="background-color:ebedda; color:000000;"><p><a href="availability.php" class="calendar"> ' + day_counter + ' </a></td>';

	    week_day++;
	    }


	 calendar_html += '<tr><td colspan="7" bgcolor="#cacbb9"><img src="img/1px_trans.gif" height="1"></td></tr>';

	 calendar_html += '</tr>';
	 calendar_html += '</table>';

	 //Display the calendar.     
	 document.write(calendar_html);                  
}
