
function WriteDays(strFldName, intYear, intMonth, intDay) {
	var intNumDays = 31;
	if(intMonth == 4 || intMonth == 6 || intMonth == 9 || intMonth == 11) {
		intNumDays = 30;
	}
	else if(intMonth == 2) {
		if( (intYear/4) == (parseInt(intYear/4)) ) { // then this is possibly a leap year 
			if( (intYear/100) == (parseInt(intYear/100)) ) { // then this is a century year 
				if( ((intYear/100)/4) == (parseInt((intYear/100)/4)) ) { // this century year is a leap year 
					intNumDays = 29;
				}
				else { // this century year is not a leap year 
					intNumDays = 28;
				}
			}
			else { // this is not a century year, but is a leap year 
				intNumDays = 29;
			}
		}
		else { // this is definitely not a leap year 
			intNumDays = 28;
		}
	}
	var objDayPicker = eval('document.forms[0].' + strFldName + '_DD');
	objDayPicker.length = intNumDays;
	for(var x = 0; x < intNumDays; x++) {
		y = x+1;
		var strX = y.toString();
		if(y < 10) strX = '0' + strX;
		objDayPicker.options[x].value = strX;
		objDayPicker.options[x].text = y;
		if(y == intDay) objDayPicker.options[x].selected = true;
		else if(intDay > intNumDays && x == intNumDays-1) objDayPicker.options[x].selected = true;
	}
}

