var wrong_date = 0;var Day0 = 3;var Year0 = 1999;var nbrDaysMonth = new Array (31,28,31,30,31,30,31,31,30,31,30,31);function getFullYear(d)// Date.getYear() does not work the same way on all browsers !!{		var y = d.getYear();	if (y < 1000) y+=1900;	return y;}function leap_year(y){	var f = ((y % 4 == 0) && (y % 4000 != 0) && ((y % 100 != 0) || (y % 400 == 0)));	if (f)		nbrDaysMonth[1] = 29;	else		nbrDaysMonth[1] = 28;	return f;}function getWeekDay(y, m, d)// must calculate myself because Date.getDay() is buggy in Navigator 4.51 !{	var i, ly;	var nbrDays = Day0;	var DayOfWeek;				if (Year0 < y)	{		for (i=Year0;i<y;i++)		{			ly = leap_year(i);			if (ly) 				nbrDays += 366;			else				nbrDays += 365;		}	}	ly = leap_year(y);	if (m > 0)	{		for (i=0;i<m;i++)			nbrDays += nbrDaysMonth[i];	}	nbrDays += d;	DayOfWeek = nbrDays % 7;		return DayOfWeek;}function InitDate (my){	var y, h;	var today = new Date ();		y = getFullYear(today);	my.AnJahr.options[0].text = y.toString(10);	my.AnJahr.options[1].text = (y+1).toString(10);	my.AnJahr.options[2].text = (y+2).toString(10);	my.TheYear.value = (y).toString(10);	my.AnMonat.selectedIndex = today.getMonth();					my.AnTag.selectedIndex = today.getDate() - 1;			h = today.getHours() + 2;	if (h < 11 || h > 23) 		h = 11;	my.AnStunden.selectedIndex = h - 10;				my.AnMinuten.selectedIndex = 0;	UpdateDay (my);}function UpdateDay (my){	var nWeekDay, i, d, m, y, ly;	d = my.AnTag.selectedIndex+1;	m = my.AnMonat.selectedIndex;	y = my.AnJahr.options[my.AnJahr.selectedIndex].text;	ly = leap_year(y);		if ((m == 0) || (m == 2) || (m == 4) || (m == 6) || (m == 7) || (m == 9) || (m == 11))	{		my.AnTag.options[28].text = "29.";		my.AnTag.options[29].text = "30.";		my.AnTag.options[30].text = "31.";	}	if ((m == 3) || (m == 5) || (m == 8) || (m == 10))	{		my.AnTag.options[28].text = "29.";		my.AnTag.options[29].text = "30.";		my.AnTag.options[30].text = "";	}	if (m == 1)	{					if (ly)																	   			my.AnTag.options[28].text = "29.";		else			my.AnTag.options[28].text = "";		my.AnTag.options[29].text = "";		my.AnTag.options[30].text = "";	}	if (d > nbrDaysMonth[m])		wrong_date = 1;	else		wrong_date = 0;		if (wrong_date == 1)	{		alert ("Falsches Datum, bitte korrigieren.");	}	else	{		nWeekDay = getWeekDay(y, m, d);			}	}function Form_Check(){	if (wrong_date == 1)	{		alert ("Falsches Datum, bitte korrigieren.");		return false;	}	else		return true;}		