 function calendar_j()
 {
    var today;
    today = new Date();
    var thisDay1;
    var thisMon;
    var holiday=0;
    var holiday2=0;
    var holiday3=0;
    var holiday4=0;
    var holiday5=0;
    var monthNames = " 1 2 3 4 5 6 7 8 9101112";
    var monthDays = new Array("31","28","31","30","31","30","31","31","30","31","30","31");   
    year = today.getYear();
 	if(year <100){
 		year += 1900;
 	}
 //今年の年数を変数yearに格納します。
    thisDay1 = today.getDate();
 //今日の日をthisDayに格納します。
    thisMon = today.getMonth();
 //今日の月をthisMonに格納します。
    if (thisMon == 0) {
    holiday = 1;
    holiday2 = 2;
    holiday3 = 3;
    holiday4 = 10;
 }
 //１月の休日を設定します。
    
    if (thisMon == 1) { 
    holiday2 = 11
 }
 //２月の休日を設定します。   
    if (thisMon == 2) {
    holiday = eval(Math.floor(20.8431+0.242194*(year-1980)-Math.floor((year-1980)/4)))
 }
 //３月の休日を設定します。   
    if (thisMon == 3) 
    holiday = 29
 //４月の休日を設定します。
    
    if (thisMon == 4){ 
    holiday = 3;
    holiday2 = 4;
    holiday3 = 5;
 }
 //５月の休日を設定します。
    if (thisMon == 6) 
    holiday = 20
 //７月の休日を設定します。
    if (thisMon == 8) {
    holiday = 15;
    holiday2 = eval(Math.floor(23.2488+0.242194*(year-1980)-Math.floor((year-1980)/4)));
 }
 //９月の休日を設定します。
    if (thisMon == 9) 
    holiday = 9
 //１０月の休日を設定します。
    
    if (thisMon == 10){ 
    holiday = 3;
    holiday2 = 23;
 }
 //１１月の休日を設定します。
    
    if (thisMon == 11){ 
    holiday = 23;
    holiday2 = 29;
    holiday3 = 30;
    holiday4 = 31;
 }   
 //１２月の休日を設定します。
     
    if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))
 monthDays[1] = 29;
 //うるう年の場合、２月の末日を２９日に設定します。
    nDays = monthDays[today.getMonth()];
 //あらかじめ設定しておいた末日から今月の末日を取り出します。
    firstDay = today;
 //今日の年月日データをfirstDayに格納します。
    firstDay.setDate(1);
 //日付を１日に仮定します。
    startDay = firstDay.getDay();
 //今月１日の曜日をstartDayに格納します。
    document.write("<TABLE BORDER=0 width=100 CELLPADDING=\"1\">");
    document.write("<TR><TH COLSPAN=7>");
    document.write("<FONT face=verdana size=1>",year,"/");
 //今年の年を表示します。
    document.write(monthNames.substring(today.getMonth() * 2,(today.getMonth() + 1) * 2));
 //文字列として格納しておいた月の変数から今月に該当する月を取り出して表示します。
    document.write("</font><TR><TD align=center><font face=verdana color=red size=1>S</font><TD align=center><font face=verdana size=1>M</font><TD align=center><font face=verdana size=1>T</font><TD align=center><font face=verdana size=1>W</font><TD align=center><font face=verdana size=1>T</font><TD align=center><font face=verdana size=1>F</font><TD align=center><font color=blue face=verdana size=1>S</font>");
    document.write("<TR>");
    column = 0;
    for (i=0; i<startDay; i++)
    {
 document.write("<TD>");
 column++;
    }
    for (i=1; i<=nDays; i++)
    {
 document.write("<TD bgcolor=\"#f5f5f5\">");
 if (column == 0) 
 document.write("<FONT COLOR=\"#FF0000\" face=verdana size=1>")
 if (column == 6) 
 document.write("<FONT COLOR=\"#0000FF\" face=verdana size=1>")
 if (i == thisDay1)
 document.write("<FONT COLOR=\"#008080\" face=verdana size=1><b>")
 if (i == holiday)
 document.write("<FONT COLOR=\"#FF0000\" face=verdana size=1>")
 if (i == holiday2)
 document.write("<FONT COLOR=\"#FF0000\" face=verdana size=1>")
 if (i == holiday3)
 document.write("<FONT COLOR=\"#FF0000\" face=verdana size=1>")
 if (i == holiday4)
 document.write("<FONT COLOR=\"#FF0000\" face=verdana size=1>")
 if (i == holiday5)
 document.write("<FONT COLOR=\"#FF0000\" face=verdana size=1>")
 if (column == 1 && i-1 == holiday)
 document.write("<FONT COLOR=\"#FF0000\" face=verdana size=1>")
 if (column == 1 && i-1 == holiday2)
 document.write("<FONT COLOR=\"#FF0000\" face=verdana size=1>")
 if (column == 1 && i-1 == holiday3)
 document.write("<FONT COLOR=\"#FF0000\" face=verdana size=1>")
 if (column == 1 && i-1 == holiday4)
 document.write("<FONT COLOR=\"#FF0000\" face=verdana size=1>")
 if (column == 1 && i-1 == holiday5)
 document.write("<FONT COLOR=\"#FF0000\" face=verdana size=1>")
 document.write("<CENTER><FONT face=verdana size=1>");
 document.write(i);
 document.write("</FONT></CENTER>");
 if (column == 7||column == 0||i == thisDay1) 
 document.write("</FONT>")
 column++;
 if (column == 7)
 {
 document.write("<TR>");
 column = 0;
 }
    }
    document.write("</TABLE>");
 }
 // -->
calendar_j()


