	//formt Datumsstring der Form 'YYYY-MM-DD' in Date um
	function strToDate(strDate) {
		var y = strDate.substring(0,4);
		var m = strDate.substring(5,7);
		var d = strDate.substring(8);
		d = new Date(y, m-1, d);
		return (d);
	}
	
	//Erzeugt Tabellenzellen mit Tages-Nummern : 29 30 31 1 2
	function makeCal(messe, von, bis, laufzeit) {
		var txt = "";
		var txt2 = "";
		var start = strToDate(von);
		var ende = strToDate(bis);
		var diff = ende.getTime() - start.getTime();
		var tage = Math.round(diff / (3600000*24),0) + 1;
		var index;
		
		// Eingabezeile mit Checkboxen erzeugen
		for (i = -2; i < (tage + 2); i++) {
			index = i + 3;
			if ((i < 0) || (i > (tage-1)))
				txt2 = txt2 + '<td class="outday"><input type="checkbox" name="ch' + index +'" value="1" /></td>';
			else
				txt2 = txt2 + '<td class="inday"><input type="checkbox" name="ch' + index +'" value="1" /></td>';
		}
		// Datumzeile erzeugen
		var cur = new Date();
		var thisClass;
		for (i = -2; i < (tage + 2); i++) {
			if ((i < 0) || (i > (tage-1)))
				thisClass = "outday";
			else
				thisClass = "inday";
			cur.setTime(start.getTime() + (86400000 * i));
			if (cur.getHours() == 23) {
				// Korrektur Sommerzeit -> Winterzeit um eine Stunde
				cur.setTime(cur.getTime() + 3600000);
			}
			wday = cur.getDay();
			dayno = cur.getDate();
			if (dayno < 10)
				dayno = "&nbsp;" + dayno + "&nbsp;";
			switch (wday) {
			case 0:
			case 6:
				txt = txt + '<td class="' + thisClass + '" style="color:red;">' + dayno + "</td>";
				break;
			default:
				txt = txt + '<td class="' + thisClass + '">' + dayno + "</td>";
			}
		}
		document.write('<div class="cal"><form action="anfrage-messezimmer" method="post">');
		document.write('<input type="hidden" name="Messe" value="' + messe + '" />');
		document.write('<input type="hidden" name="von" value="' + von + '" />');
		document.write('<input type="hidden" name="bis" value="' + bis + '" />');
		document.write('<input type="hidden" name="Laufzeit" value="' + laufzeit + '" />');
		document.write('<table border="0" cellpadding="0" cellspacing="0">');
		document.write('<tr>');
		document.write('<td colspan="2">&nbsp;</td>');
		document.write('<td colspan="' + tage + '" class="calTitle">' + laufzeit + '</td>');
		document.write('<td colspan="3">&nbsp;</td>');
		document.write('</tr>');
		document.write('<tr>' + txt2 + '<td class="anfrage"><input value="anfragen ..." type="submit" /></td></tr>');
		document.write('<tr>' + txt + '<td>&nbsp;</td></tr></table></form></div>');
	}
