Javascript homework. Making a yearly calendar
<p>I am trying to print a yearly calendar on one page using JS. This specifically seems to be the function giving me issues. Let me know if you could point me in the right direction, or if I can provide more info. Thanks</p>

<pre><code>function yearly(calDate)    {
    if (calDate == null) calendarDay = new Date();
    else calendarDay = new Date(calDate)

    var currentTime = calendarDay.getTime();
    var thisYear = calendarDay.getFullYear();

    &lt;table id='yearly_table'&gt;&lt;tr&gt;
        &lt;th id='yearly_title' colspan='4'&gt;
        thisYear;
    &lt;/th&gt;
    &lt;/tr&gt;
    var monthNum=-1;

    for (var i=1;i&lt;=3;i++)  {
        document.write("&lt;tr&gt;");
    for (var j=1;j&lt;=4;j++) {
        monthNum=monthNum++;
        calendarDay.setDate(1);
        calendarDay.setMonth(monthNum);
        writeMonthCell(calendarDay, currentTime);
    }
    &lt;"&lt;/tr&gt;"&gt;
    }
}
</code></pre>
