

var heading = "#006ab3";
var bgcolor1 = "#006ab3";
var bgcolor2 = "#ffffff";
var font1 = "#000000";
var font2 = "#ffffff";
var height = "150";
var width = "150";


function DaysInMonth(Y, M) {
    with (new Date(Y, M, 1, 12)) {
        setDate(0);
        return getDate();
    }
}

function setcal(mon,yea)
{
	mon=mon+1;
	var days = DaysInMonth(yea,mon);
	var D = new Date(mon+"/01/"+yea);
	var day = D.getDay();
		
	var ar = new Array("Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień");
	var df = ar[mon-1];
	df = df+", "+D.getFullYear();
	document.xxx.ddd.value = df;

	var ddf = document.calen.length;
	
	for(var xx=0; xx<ddf; xx++)
		document.calen[xx].value = "";


	var exd = new Date();
	var monthe_glo = exd.getMonth();
	var yeare_glo = exd.getFullYear();
	var day_glo = exd.getDate(); 		
		

	var ss = 1;
	for(var xx=day; xx<day+days; xx++){
		document.calen[xx].value = ss++;
		if(ss==(day_glo+1) && yea==yeare_glo && mon==(monthe_glo+1)) document.calen[xx].style.fontWeight="bold";
		else document.calen[xx].style.fontWeight="normal";
	}
}

var exd = new Date();
var monthe = exd.getMonth();
var yeare = exd.getFullYear();
var day = exd.getDate(); 


function prev()
{
	monthe = monthe-1;
	if(monthe < 0)
	{
		yeare = yeare-1;	
		monthe = 11;
	}
	setcal(monthe, yeare);
	return false;
}

function next()
{
	monthe = monthe+1;
	if(monthe > 11)
	{
		yeare = yeare+1;	
		monthe = 0;
	}
	setcal(monthe, yeare);
	return false;
}

function thismon()
{
	//yeare = yeare+1900;
	setcal(monthe, yeare);
}

document.write("<table align='center' width="+width+" height="+height+" cellpadding=1 cellspacing=0 \
		style=\"font-family: tahoma; color: "+font1+"; font-size: 11px;\" bgcolor="+bgcolor1+" border=0>\
			<tr bgcolor="+heading+" align=center><td colspan=7>\
				<table width=100% align=center style=\"color: "+font2+"; font-size: 11px;\" align=center>\
				<tr align=center><td><a style=\"cursor: pointer; font-weight: bold; color: #ffffff;\" onclick=\"return prev()\">&laquo;&laquo;</a></td>\
				<td><form name=xxx style=\"margin: 0px; padding: 0px;\"><input size=14 style=\"font-size: 11px; \
				font-weight: bold; text-align: center; font-family: tahoma;\" type=text name=ddd></form></td>\
				<td><a style=\"cursor: pointer; font-weight: bold; color: #ffffff;\" onclick=\"return next()\">&raquo;&raquo;</a></td></tr></table>\
			</td></tr>\
			<tr bgcolor="+bgcolor2+" align=center><td>Nd</td><td>Pn</td><td>Wt</td><td>Śr</td><td>Czw</td><td>Pt</td><td>So</td></tr>");
document.write("<form name=calen style=\"border: 0px; padding:0px;\">");
for(var xx=0; xx<6; xx++)
{
	document.write("<tr>");
	for(var cc=0; cc<7; cc++){
		var dd = xx*7+cc;
		if(dd == 41)
			document.write("<td align=center><a style=\"font-size: 9px; color: 888888; text-decoration: none;\" href=http://www.hscripts.com></a></td>");
		else
			document.write("<td align=center><input style=\"background-color: "+bgcolor1+"; color: "+font2+"; border: 0px; font-size: 11px;\" name=x"+dd+" readonly size=1></td>");
	}
	document.write("</tr>");
}

document.write("</form></table>");

thismon();




