function maxDays(mm, yyyy){ var mDay; if((mm == 3) || (mm == 5) || (mm == 8) || (mm == 10)){ mDay = 30; } else{ mDay = 31 if(mm == 1){ if (yyyy/4 - parseInt(yyyy/4) != 0){ mDay = 28 } else{ mDay = 29 } } } return mDay; } function changeBg(id){ if (eval(id).style.backgroundColor != "yellow"){ eval(id).style.backgroundColor = "yellow" } else{ eval(id).style.backgroundColor = "#ffffff" } } function writeCalendar(){ var now = new Date var dd = now.getDate() var mm = now.getMonth() var dow = now.getDay() var yyyy = now.getFullYear() var arrM = new Array("January","February","March","April","May","June","July","August","September","October","November","December") var arrY = new Array() for (ii=0;ii<=4;ii++){ arrY[ii] = yyyy - 2 + ii } var arrD = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat") var text = "" text = "
" text += "" text += "" text += "" text += "
" text += "" text += "" text += "" text += "
" text += "" text += "" text += "" text += "
" text += "
" text += "" text += "" for (ii=0;ii<=6;ii++){ text += "" } text += "" aa = 0 for (kk=0;kk<=5;kk++){ text += "" for (ii=0;ii<=6;ii++){ text += "" aa += 1 } text += "" } text += "
" + arrD[ii] + "
1
" text += "
" text += "
" document.write(text) changeCal() } function changeCal(){ var now = new Date var dd = now.getDate() var mm = now.getMonth() var dow = now.getDay() var yyyy = now.getFullYear() var currM = parseInt(document.calForm.selMonth.value) var prevM if (currM!=0){ prevM = currM - 1 } else{ prevM = 11 } var currY = parseInt(document.calForm.selYear.value) var mmyyyy = new Date() mmyyyy.setFullYear(currY) mmyyyy.setMonth(currM) mmyyyy.setDate(1) var day1 = mmyyyy.getDay() if (day1 == 0){ day1 = 7 } var arrN = new Array(41) var aa for (ii=0;ii20))||((ii>27)&&(arrN[ii]<20))){ eval("sp"+ii).innerHTML = arrN[ii] eval("sp"+ii).className = "c3" } else{ eval("sp"+ii).innerHTML = arrN[ii] if ((dCount==0)||(dCount==6)){ eval("sp"+ii).className = "c2" } else{ eval("sp"+ii).className = "c1" } if ((arrN[ii]==dd)&&(mm==currM)&&(yyyy==currY)){ eval("sp"+ii).style.backgroundColor="#90EE90" } } dCount += 1 if (dCount>6){ dCount=0 } } } document.write('')