			var now = new Date
			var dd = now.getDate()
			var mm = now.getMonth()
			var dow = now.getDay()
			var yyyy = now.getFullYear()
			var selMonth = mm;
			var selYear = yyyy;
			var posToday;

			function maxDays(mm, yyyy){
			var mDay;
				if((mm == 3) || (mm == 5) || (mm == 8) || (mm == 10)){
					mDay = 30;
				}
				else{
					mDay = 31
					if(mm == 1){
						if (yyyy/4 - parseInt(yyyy/4) != 0){
							mDay = 28
						}
					   	else{
							mDay = 29
						}
					}
				}
			return mDay;
			}

			function writeCalendar(){
			var tmpCalendarLabelWidth = widthCalendarTables - widthImgNavBack - widthImgNavNext
			var arrY = new Array()
				for (ii=0;ii<=4;ii++){
					arrY[ii] = yyyy - 2 + ii
				}
			var text = "" 
			text += "<form name='calForm'>"
			text += "<div class='calendarScriptHeader'>"
			text += "<div class='calendarScriptHeaderPict'>"
			text += "<a href='" + urlPathBeforeDate + "'>"
			text += "<img src='"+imgDir+imgEvents+"' alt='"+altImgEvents+"' border='0'/>"
			text += "<\/a>"
			text += "<\/div>"
			text += "<div class='calendarScriptHeaderLeft'>"
			text += "<a href='javascript:showPreviousMonth()'><img src='"+imgDir+imgNavBack+"' alt='"+altImgNavBack+"' border='"+borderImgNavBack+"' style='"+styleImgNavBack+"'/><\/a>"
			text += "<\/div>"
			text += "<div class='calendarScriptHeaderMonth'>"
			text += "<div id='spmm' width='"+tmpCalendarLabelWidth+"'>Monat Jahr<\/div>"
			text += "<\/div>"
			text += "<div class='calendarScriptHeaderRight'>"
			text += "<a href='javascript:showNextMonth()'><img src='"+imgDir+imgNavNext+"' alt='"+altImgNavNext+"' border='"+borderImgNavNext+"' style='"+styleImgNavNext+"' align='right'/><\/a>"
			text += "<\/div>"
			text += "<div class='calendarScriptBox'>"
			text += "<table cellpadding='0' cellspacing='0' style='"+styleCalendar+"' class='calendarScript' summary='"+summary+"'>"
			text += "<caption>"+caption+"<\/caption>"
			text += "<thead>"
			text += "<tr>"
			for (ii=0;ii<=6;ii++){
				text += "<th align='center' id='"+ arrD[ii] +"'><span class='foot'>" + arrD[ii] + "<\/span><\/th>"
			}
			text += "<\/tr>"
			text += "<\/thead>"
			text += "<tbody>"
			
			forZahl0 = 0
			for (forZahl1=0;forZahl1<=5;forZahl1++){
				text += "<tr>"
				for (forZahl2=0;forZahl2<=6;forZahl2++){
					if (forZahl1!=5) {
						text += "<td align='center' headers='"+ arrD[forZahl2] +"' id=sp"+forZahl0+">[]<\/td>"
					} else {
					text += "<td align='center' class='last' headers='"+ arrD[forZahl2] +"' id=sp"+forZahl0+">[]<\/td>"
					}
					forZahl0 += 1
				}
				text += "<\/tr>"
			}
			text += "<\/tbody>"
			text += "<\/table>"
			text += "<\/div>" 
			text += "<\/div>"  
			text += "<\/form>"
			document.write(text)
			changeCal()
			}

			function changeCal(){
				var arrN = new Array(41)
				var aa
				var dCount = 0
				var tmpMonth
				var tmpDay
				var tmpYear
				var tmpShowYear
				var curDate = new Date()
				curDate.setDate(1)
				curDate.setMonth(selMonth)
				curDate.setFullYear(selYear)
								
				var day1;
				if (weekMode == 1) {
					day1 = curDate.getDay() - 1;
				}
				else {
					day1 = curDate.getDay();
				}
				if (day1 < 0) {
					day1 = 7 - Math.abs(day1);
				}
								
				var prevM
				if (selMonth!=0){
					prevM = selMonth - 1
				}
				else{
					prevM = 11
				}
				for (forZahl0=0;forZahl0<day1;forZahl0++){
					arrN[forZahl0] = maxDays((prevM),selYear) - day1 + forZahl0 + 1
				}
				forZahl0 = 1
				for (forZahl1=day1;forZahl1<=day1+maxDays(selMonth,selYear)-1;forZahl1++){
					arrN[forZahl1] = forZahl0
					forZahl0 += 1
				}
				forZahl0 = 1
				for (forZahl1=day1+maxDays(selMonth,selYear);forZahl1<=41;forZahl1++){
					arrN[forZahl1] = forZahl0
					forZahl0 += 1
				}
				for (forZahl0=0;forZahl0<=41;forZahl0++){
				}
				if (dateYearFormat == "short") {
					tmpYear =   selYear.toString().substr(2,2) 
				}
				else {
					tmpYear = selYear
				}
				if (showYearFormat == "short") {
					tmpShowYear = selYear.toString().substr(2,2)
				}
				else {
					tmpShowYear = selYear    
				}
				tmpMonth = selMonth
				tmpMonth++
				if(selMonth < 9) {
					tmpMonth = "0" + tmpMonth; 
				}
				for (ii=0;ii<=41;ii++){
					if((selMonth < mm || selYear < yyyy) && selYear <= yyyy) {
						document.getElementById("sp"+ii).innerHTML = "<span class=\"foot\" style='"+styleMonthDays+"'>"+arrN[ii]+"<\/span>";
					}
					else {

						if (((ii<7)&&(arrN[ii]>20))||((ii>27)&&(arrN[ii]<20))){
							if (ii>7) {
								document.getElementById("sp"+ii).innerHTML = "<a href='javascript:showNextMonth()' class='foot'>"+arrN[ii]+"<\/a>"
							}
							else {
								document.getElementById("sp"+ii).innerHTML = "<a href='javascript:showPreviousMonth()' class='foot'>"+arrN[ii]+"<\/a>"
							} 
						}
						else {
							if (arrN[ii] <= 9) {
								tmpDay = "0"+arrN[ii];
							} else {
								tmpDay = arrN[ii];            			   
							}
							tmpHREF = urlServer+urlPathBeforeDate+tmpDay+dateFormatChar+tmpMonth+dateFormatChar+tmpYear+urlToDate+tmpDay+dateFormatChar+tmpMonth+dateFormatChar+tmpYear;

							if ((dCount==0)||(dCount==6)){
								document.getElementById("sp"+ii).innerHTML = "<a href='"+tmpHREF+"' class='foot'><span style='"+styleMonthDays+"'>"+arrN[ii]+"<\/span><\/a>"
							}
							else{
								document.getElementById("sp"+ii).innerHTML = "<a href='"+tmpHREF+"' class='foot'><span style='"+styleMonthDays+"'>"+arrN[ii]+"<\/span><\/a>"
							}
							
							if ((arrN[ii]==dd)&&(mm==selMonth)&&(yyyy==selYear)){
								document.getElementById("sp"+ii).style.backgroundColor=colorHighlightToday
								posToday = ii;
							}
						}
					}
					dCount += 1
					if (dCount>6){
						dCount=0
					}
				}
				document.getElementById("spmm").innerHTML = arrM[selMonth]+" "+tmpShowYear
			}

			function nextMonth() {
				if (selMonth == 11){
					selMonth = 0;
					selYear++;
				}
				else {
					selMonth++;
				}
			}

			function showNextMonth() {
				nextMonth();
				changeCal();
				highlightToday();
			}

			function previousMonth() {
				if (selMonth == 0){
					selMonth = 11;
					selYear--;
				}
				else {
					selMonth--;
				}
            }

			function showPreviousMonth() {
				previousMonth();
				changeCal();
				highlightToday();
			}

			function highlightToday() {
				if(mm == selMonth & yyyy == selYear) {
					document.getElementById("sp"+posToday).style.backgroundColor=colorHighlightToday
				}
				else {
					document.getElementById("sp"+posToday).style.backgroundColor=colorResetHighlightToday
				}
			}
			
			function getCalToday() {
				selMonth = mm;
				selYear = yyyy;
				changeCal();
				highlightToday();
			}
