var day_of_week = new Array('Mon','Tue','Wed','Thu','Fri','Sat','Sun'); var month_of_year = new Array('January','February','March','April','May','Junu','July','August','September','October','November','December'); function IsNoteDay(x) { for(var i=0;i
'; if(month == 0) { cal += '<<'; } else { cal += '<<'; } cal += ' ' + month_of_year[month] +' '+ year; if(month == 11) { cal += '  >>' + TD_end + TR_end; } else { cal += '  >>' + TD_end + TR_end; } cal += TR_start ; for(index=0; index < DAYS_OF_WEEK; index++) { if(weekday == index) cal += TD_start + '' + day_of_week[index] + '' + TD_end; else cal += TD_start + day_of_week[index] + TD_end; } cal += TR_end; cal += TR_start; for(index=0; index < 2; index++) { cal += TD_start + ' ' + TD_end; } for(index=0; index < DAYS_OF_MONTH; index++) { if( Calendar.getDate() > index ) { week_day =Calendar.getDay() -1; if(week_day == 0) cal += TR_start; if(week_day != DAYS_OF_WEEK) { var day = Calendar.getDate(); if( today==Calendar.getDate() ) { if(IsNoteDay(day)) { cal += highlight_start + "" + day + "" + highlight_end + TD_end; } else { cal += highlight_start + day + highlight_end + TD_end; } } else { if(IsNoteDay(day)) { cal += TD_start + "" + day + "" + TD_end; } else { cal += TD_start + day + TD_end; } } } if(week_day == DAYS_OF_WEEK) cal += TR_end; } Calendar.setDate(Calendar.getDate()+1); } cal += ''; document.write(cal);