document.writeln("<style type=text/css><!--");
document.writeln("td{ text-align: center;height:22;}");
document.writeln("td.tuki{cursor:pointer;color:#ffffff;font-size:10pt;background-color:#ddaa66;}");
document.writeln("--></style>");
document.write("<table border=1 cellspacing=0><tr>");
document.write("<td class='tuki'onclick='Fore()'>前月</td>");
document.write("<td ID='midasi' bgcolor='#ddddff'></td>");
document.write("<td class='tuki'onclick='Next()'>次月</td>");
document.write("</tr><tr><td colspan=3><table>");
WeekTd = new Array("日","月","火","水","木","金","土");
for(i=0;i<7;i++){
(!i)?document.write("<td bgcolor='#ff66bb'width=24>"+WeekTd[i]+"</td>"):
document.write("<td bgcolor='#ddddff'width=24>"+WeekTd[i]+"</td>");
}
for(i=0;i<42;i++){
if(!(i%7))document.write("</tr><tr>");
document.write("<td ID='DayTd"+i+"'> </td>");
}
document.write("</tr></table></tr></table>");
dd = new Date();
yy = new Date().getFullYear();
mm = new Date().getMonth();
mmdd = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
function Now(){
if ((!(yy%4) && yy%100) || !(yy%400)){mmdd[1] = 29;}else{mmdd[1] =28;}
dd.setDate(1);
fWeek = dd.getDay()-1;
setday=0;
(mm<9)?Mm="0"+(mm+1):Mm=mm+1;
if(document.all){document.all("midasi").innerText =yy+"/"+Mm;
}else{document.getElementById("midasi").innerHTML =yy+"/"+Mm;}
for(i=0;i<42;i++){
set_day=(i>fWeek && i<=(mmdd[mm]+fWeek))?++setday:" ";
if(document.all){
document.all("DayTd"+i).innerHTML =set_day;
document.all("DayTd"+i).style.backgroundColor="#ffffff";
document.all("DayTd"+i).style.textDecoration="none";
if(!(i%7))document.all("DayTd"+i).style.color="#ff66bb";
if(i%7==6)document.all("DayTd"+i).style.color="#77aaff";
if(setday == new Date().getDate() && yy == new Date().getFullYear() && mm == new Date().getMonth())
document.all("DayTd"+i).style.textDecoration="underline";
}else{
document.getElementById("DayTd"+i).innerHTML =set_day;
document.getElementById("DayTd"+i).style.backgroundColor="#ffffff";
document.getElementById("DayTd"+i).style.textDecoration="none";
if(!(i%7))document.getElementById("DayTd"+i).style.color="#ff66bb";
if(i%7==6)document.getElementById("DayTd"+i).style.color="#77aaff";
if(setday == new Date().getDate() && yy == new Date().getFullYear() && mm == new Date().getMonth())
document.getElementById("DayTd"+i).style.textDecoration="underline";
}
}
}
function Next(){
if(mm==11){yy++;mm=0;}else{mm++;}
dd.setFullYear(yy);
dd.setMonth(mm);
Now();
}
function Fore(){
if(mm==0){yy--;mm=11;}else{mm--;}
dd.setFullYear(yy);
dd.setMonth(mm);
Now();
}
Now();/* himajin.moo.jp */