function writeMiniCalendar(dateType) {
	myCalText = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	myCalText += "<tr>";
	myCalText += "<td colspan=\"7\" style=\"height:4px;background-color:#e9bb61;\"><!-- --></td>";
	myCalText += "</tr>";
	myCalText += "<tr>";
	myCalText += "<td colspan=\"7\" style=\"height:2px;\"><!-- --></td>";
	myCalText += "</tr>";
	myCalText += "<tr style=\"background-color:#445169;\">";
	myCalText += "<td colspan=\"2\" align=\"center\" valign=\"middle\">";
	myCalText += "<table border=\"0\" cellspacing=\"2\" cellpadding=\"0\">";
	myCalText += "<tr>";
	myCalText += "<td onclick=\"backMonth('" + dateType + "');\" onmousedown=\"previous" + dateType + "Month.src='img/arrowSm_left_press.gif';\" onmouseup=\"previous" + dateType + "Month.src='img/arrowSm_left.gif';\" onmouseout=\"previous" + dateType + "Month.src='img/arrowSm_left.gif';\" align=\"left\"><img src=\"img/arrowSm_left.gif\" id=\"previous" + dateType + "Month\" name=\"previous" + dateType + "Month\" width=\"7\" height=\"14\" alt=\"Previous Month\" border=\"0\" /></td>";
	myCalText += "<td>&nbsp;</td>";
	myCalText += "<td onclick=\"forwardMonth('" + dateType + "');\" onmousedown=\"next" + dateType + "Month.src='img/arrowSm_right_press.gif';\" onmouseup=\"next" + dateType + "Month.src='img/arrowSm_right.gif';\" onmouseout=\"next" + dateType + "Month.src='img/arrowSm_right.gif';\" align=\"left\"><img src=\"img/arrowSm_right.gif\" id=\"next" + dateType + "Month\" name=\"next" + dateType + "Month\" width=\"7\" height=\"14\" alt=\"Next Month\" border=\"0\" /></td>";
	myCalText += "</tr>";
	myCalText += "</table>";
	myCalText += "</td>";
	myCalText += "<td colspan=\"3\" align=\"left\" valign=\"middle\" class=\"monthText\" id=\"monthText\" style=\"font-size:10pt;\">" + myCalendar[dateType].monthName + "</td>";
	myCalText += "<td colspan=\"2\" align=\"right\" valign=\"middle\" class=\"yearText\" id=\"yearText\" style=\"font-size:10pt;\">" + myCalendar[dateType].year + "</td>";
	myCalText += "</tr>";
	myCalText += "<tr>";
	myCalText += "<td colspan=\"7\" style=\"height:2px;\"><!-- --></td>";
	myCalText += "</tr>";
	myCalText += "<tr class=\"weekDayTextSm\">";
	myCalText += "<td align=\"center\" valign=\"middle\" style=\"width:20px;padding:2px;\">S</td>";
	myCalText += "<td align=\"center\" valign=\"middle\" style=\"width:20px;padding:2px;\">M</td>";
	myCalText += "<td align=\"center\" valign=\"middle\" style=\"width:20px;padding:2px;\">T</td>";
	myCalText += "<td align=\"center\" valign=\"middle\" style=\"width:20px;padding:2px;\">W</td>";
	myCalText += "<td align=\"center\" valign=\"middle\" style=\"width:20px;padding:2px;\">T</td>";
	myCalText += "<td align=\"center\" valign=\"middle\" style=\"width:20px;padding:2px;\">F</td>";
	myCalText += "<td align=\"center\" valign=\"middle\" style=\"width:20px;padding:2px;\">S</td>";
	myCalText += "</tr>";
	myCalText += "<tr>";
	myCalText += "<td colspan=\"7\" style=\"height:2px;\"><!-- --></td>";
	myCalText += "</tr>";
	myCalText += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	myCalText += "<tr>";
	myCalText += "<td colspan=\"7\">";
	for(i=0;i<myCalendar[dateType].beginningDay;i++) {
		if (i == 0) {
			myCalText += "<tr>";
		}
		myCalText += "<td valign=\"top\" style=\"padding:2px;\"></td>";
			
	}
	for(i=1;i<=myCalendar[dateType].daysInMonth;i++) {
		dayOfWeek = new Date(myCalendar[dateType].year, myCalendar[dateType].month, i).getDay();
		dayOfMonth = new Date(myCalendar[dateType].year, myCalendar[dateType].month, i).getDate();
		if (dayOfWeek == 0 && i < 6) {
			myCalText += "<tr>";
		}
		if ((myCalendar[dateType].tYear >= myCalendar[dateType].year && myCalendar[dateType].tMonth > myCalendar[dateType].month) || (myCalendar[dateType].tDay > i && myCalendar[dateType].tMonth == myCalendar[dateType].month && myCalendar[dateType].tYear == myCalendar[dateType].year) || myCalendar[dateType].tYear > myCalendar[dateType].year) {
			myCalText += "<td valign=\"middle\" align=\"center\" id=\"" + dateType + i + "\" style=\"padding:2px;width:20px;\" class=\"dayTextSm\">";
		}else{
			myCalText += "<td valign=\"middle\" align=\"center\" id=\"" + dateType + i + "\" style=\"padding:2px;width:20px;\" class=\"dayTextSm\" onclick=\"returnDate(this,'" + dateType + "')\">";
		}
		if ((myCalendar[dateType].tYear >= myCalendar[dateType].year && myCalendar[dateType].tMonth > myCalendar[dateType].month) || (myCalendar[dateType].tDay > i && myCalendar[dateType].tMonth == myCalendar[dateType].month && myCalendar[dateType].tYear == myCalendar[dateType].year) || myCalendar[dateType].tYear > myCalendar[dateType].year) {
			myCalText += dayOfMonth;
		}else{
			myCalText += "<span style=\"text-decoration:underline;\">" + dayOfMonth + "</span>";
		}
		myCalText += "</td>";
		if (dayOfWeek == 6) {
			myCalText += "</tr>";
		}
	}
	myCalText += "</table>";
	myCalText += "</td>";
	myCalText += "</tr>";
	myCalText += "</table>";
	document.getElementById('calendarDays' + dateType).style.visibility = "visible";
	document.getElementById('calendarDays' + dateType).innerHTML = myCalText;
}
function returnDate(me,dateType) {
	myId = me.id;
	myIndex = dateType.length;
	myNum = myId.substring(myIndex);
	if (myNum < 10) {
		myNum = "0" + myNum;
	}
	myMonth = myCalendar[dateType].month + 1;
	if (myMonth < 10) {
		myMonth = "0" + myMonth;
	}
	document.recur[dateType + 'Date'].value = myMonth + "/" + myNum + "/" + myCalendar[dateType].year;
	document.getElementById('calendarDays' + dateType).style.visibility = "hidden";
	document.getElementById('calendarDays' + dateType).innerHTML = "";
}