	function checkDate(objdate,objyear,objmonth,objday) {
		var my_date = objmonth.value + '/' + objday.value + '/' + objyear.value;
		current_date = new Date();
		thedate = new Date(my_date);
		if (thedate.getMonth() + 1 != objmonth.value) {
			var Month = objmonth.value;
			var Year = objyear.value;
			var TotalDays = 1;
			TotalDays = Math.floor((Month == 2) ? (28 + (!(!(Year%100)?(Year%400):(Year%4)))) : (28 + (((Month%8)+(Month/8))%2)+2));
			objday.selectedIndex = TotalDays - 1;
			alert('Invalid date\nThe date has been set to the end of the month.');
		}
		objdate.value = objyear.value + '-' + objmonth.value + '-' + objday.value;
	}

