arrDays = new Array("31","28","31","30","31","30","31","31","30","31","30","31");

function refreshDates(formName, idx, date, year) {
	var includeAny=0;
	var days = arrDays[idx];
	formName.Date.options.length=0;
	if (idx==1 && (year % 4 == 0)) days = 29;
	//window.alert(idx+", "+days+", "+year);
	if (formName==document.frmSearch) { formName.Date.options[0] = new Option('*Any','any'); includeAny=1;}
	for (inti=includeAny;inti<=days-(1-includeAny);inti++) {
		formName.Date.options[inti] = new Option(inti+1-includeAny,inti+1-includeAny);
	}
	if (date<=formName.Date.options.length) formName.Date.selectedIndex=date-1;
}

function notPast(year,month,ndate,todayOK) {
	today=new Date();
	thisYear=today.getFullYear();
	thisMonth=today.getMonth()+1;	//month is 0-11, so add 1
	thisMonth=thisMonth.toString();
	thisDate=today.getDate();
	thisDate=thisDate.toString();
	val=false;

	if (month.length==1) month='0'+month;
	if (ndate.length==1) ndate='0'+ndate;
	if (thisMonth.length==1) thisMonth='0'+thisMonth;
	if (thisDate.length==1) thisDate='0'+thisDate;

//window.alert(year+'-'+month+'-'+ndate+':'+thisYear+'-'+thisMonth+'-'+thisDate);
	if (year>thisYear) val = true;
	else if (year<thisYear) val = false;
	//the date to be checked is in this year
	else if (month>thisMonth) val = true;
	else if (month<thisMonth) val = false;
	//the month to be checked is in this month
	else if (ndate>thisDate) val = true;
	else if (ndate<thisDate) val = false;
	else if (ndate==thisDate && todayOK) val = true;
return val;	
}