document.write("<table summary='Calendar'>");
var date = new Date();
var dd = date.getDate();
var mm = date.getMonth();
var yy = date.getYear();
if(yy < 1900) yy += 1900;
if(mm == 0) monat = "januar";
if(mm == 1) monat = "februar";
if(mm == 2) monat = "märz";
if(mm == 3) monat = "april";
if(mm == 4) monat = "mai";
if(mm == 5) monat = "juni";
if(mm == 6) monat = "juli";
if(mm == 7) monat = "august";
if(mm == 8) monat = "september";
if(mm == 9) monat = "oktober";
if(mm == 10) monat = "november";
if(mm == 11) monat = "dezember";
document.write("<caption>", monat, " ", yy, "</caption>");
// Wochentag des 1. des Monats ermitteln
date.setDate(1);
var kk = date.getDay();
if(kk == 0) kk = 7;
document.write("<thread><tr>");
document.write("<th abbr='montag' scope='col' title='montag'>Mo</th>");
document.write("<th abbr='dienstag' scope='col' title='dienstag'>Di</th>");
document.write("<th abbr='mittwoch' scope='col' title='mittwoch'>Mi</th>");
document.write("<th abbr='donnerstag' scope='col' title='donnerstag'>Do</th>");
document.write("<th abbr='freitag' scope='col' title='freitag'>Fr</th>");
document.write("<th abbr='samstag' scope='col' title='samstag'>Sa</th>");
document.write("<th abbr='sonntag' scope='col' title='sonntag'>So</th>");
document.write("</tr></thread>");
document.write("<tbody><tr>");
// erste Zeile auffuellen
for(var ii = 1; ii < kk; ii++) document.write("<td>");
for(ii = 1; ii < 32; ii++) {
  date.setDate(ii);
  if(date.getMonth() != mm) break;
	if(ii == dd) document.write("<td id='today'>", ii, "</td>"); else document.write("<td>", ii, "</td>");
	kk++;
	if(kk > 7) {
		document.write("</tr>\n<tr>");
		kk = 1;
	}
}
document.write("<td class='pad' colspan='4'>&nbsp;</td></tr>\</tbody>");
document.write("</table>");
