function setCal() { // standard time attributes var now = new Date(); var year = now.getFullYear(); var month = now.getMonth(); var monthName = getMonthName(month); var date = now.getDate(); now = null;
// create instance of first day of month, and extract the day on which it occurs var firstDayInstance = new Date(year, month, 1); var firstDay = firstDayInstance.getDay(); firstDayInstance = null;
// number of days in current month var days = getDays(month, year);
// call function to draw calendar drawCal(firstDay + 1, days, date, monthName, year); }