function tcCal (  ) {

theStartYearBox = document.getElementById("start.year");
theStartYear = theStartYearBox.options[theStartYearBox.selectedIndex].value;
theStartMonthBox = document.getElementById("start.month");
theStartMonth = theStartMonthBox.options[theStartMonthBox.selectedIndex].value;
theStartDayBox = document.getElementById("start.day");
theStartDay = theStartDayBox.options[theStartDayBox.selectedIndex].value;
numberOfStartYearItems = theStartYearBox.length;
numberOfStartMonthItems = theStartMonthBox.length;
numberOfStartDayItems = theStartDayBox.length;
	var selectBegin = document.getElementById("start.day");
	if ( theStartMonth == 9 || theStartMonth == 4 || theStartMonth == 6 || theStartMonth == 11 ) {
		if ( numberOfStartDayItems == 30 ) {
			// Do nothing
		}
		else if (numberOfStartDayItems > 30 ) {
			if ( theStartDayBox.options[theStartDayBox.selectedIndex].value > 30 ) {
				theStartDayBox.selectedIndex = 29;
			}	
			selectBegin.remove(30);
				
		}
		else if ( numberOfStartDayItems <= 30 ) {
			for ( var j = numberOfStartDayItems + 1; j <= 30; j++ ) {
				selectBegin.options[select.options.length]=new Option(j, j, false, false);
			}
		}		 
	}
	else if ( theStartMonth == 2 ) {
		var monthlyLimit;
		if (theStartYear % 400 == 0) {  
			monthlyLimit = 29
		}	
 		else if (theStartYear % 100 == 0) { 
			monthlyLimit = 28
		}	
	 	else if (theStartYear % 4 == 0) {
			monthlyLimit = 29
		}	
 		else {
			monthlyLimit = 28
		}
		if ( theStartDayBox.length > monthlyLimit ) {
			while  (theStartDayBox.length > monthlyLimit) {
				if ( theStartDayBox.options[theStartDayBox.selectedIndex].value > monthlyLimit ) {
					theStartDayBox.selectedIndex = monthlyLimit - 1;
				}	
				selectBegin.remove(theStartDayBox.length-1);	
			}
		}
		else if (theStartDayBox.length < monthlyLimit) {
			for ( var j = theStartDayBox.length + 1; j <= monthlyLimit; j++ ) {
				selectBegin.options[selectBegin.options.length]=new Option(j, j, false, false);
			}	
		}	

	}
	else {
		if ( numberOfStartDayItems <= 30 ) {
			for ( var j = numberOfStartDayItems + 1; j <= 31; j++ ) {
				selectBegin.options[selectBegin.options.length]=new Option(j, j, false, false);
			}	
		}	
	}


theEndYearBox = document.getElementById("end.year");
theEndYear = theEndYearBox.options[theEndYearBox.selectedIndex].value;
theEndMonthBox = document.getElementById("end.month");
theEndMonth = theEndMonthBox.options[theEndMonthBox.selectedIndex].value;
theEndDayBox = document.getElementById("end.day");
theEndDay = theEndDayBox.options[theEndDayBox.selectedIndex].value;
numberOfEndYearItems = theEndYearBox.length;
numberOfEndMonthItems = theEndMonthBox.length;
numberOfEndDayItems = theEndDayBox.length;
	var selectEnd = document.getElementById("end.day");
	if ( theEndMonth == 9 || theEndMonth == 4 || theEndMonth == 6 || theEndMonth == 11 ) {
		if ( numberOfEndDayItems == 30 ) {
			// Do nothing
		}
		else if (numberOfEndDayItems > 30 ) {
			if ( theEndDayBox.options[theEndDayBox.selectedIndex].value > 30 ) {
				theEndDayBox.selectedIndex = 29;
			}	
			selectEnd.remove(30);	
		}
		else if ( numberOfEndDayItems <= 30 ) {
			for ( var j = numberOfEndDayItems + 1; j <= 30; j++ ) {
				selectEnd.options[selectEnd.options.length]=new Option(j, j, false, false);
			}
		}		 
	}
	else if ( theEndMonth == 2 ) {
		var monthlyLimit;
		if (theEndYear % 400 == 0) {  
			monthlyLimit = 29
		}	
 		else if (theEndYear % 100 == 0) { 
			monthlyLimit = 28
		}	
	 	else if (theEndYear % 4 == 0) {
			monthlyLimit = 29
		}	
 		else {
			monthlyLimit = 28
		}
		
		if ( theEndDayBox.length > monthlyLimit ) {
			while  (theEndDayBox.length > monthlyLimit) {
				if ( theEndDayBox.options[theEndDayBox.selectedIndex].value > monthlyLimit ) {
					theEndDayBox.selectedIndex = monthlyLimit - 1;
				}	
				selectEnd.remove(theEndDayBox.length-1);	
			}
		}
		else if (theEndDayBox.length < monthlyLimit) {
			for ( var j = theEndDayBox.length + 1; j <= monthlyLimit; j++ ) {
				selectEnd.options[selectEnd.options.length]=new Option(j, j, false, false);
			}	
		}	
	}
	else {
		if ( numberOfEndDayItems <= 30 ) {
			for ( var j = numberOfEndDayItems + 1; j <= 31; j++ ) {
				selectEnd.options[selectEnd.options.length]=new Option(j, j, false, false);
			}	
		}	
	}



}