function listMonth(target,shortform,oldindex) {
	monthfull = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
	monthshort = new Array("JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC");
	target.options.length = 13;
	target.options[0].text = "Month";
	target.options[0].value = "0";
	if(!shortform) {
		for(i=1;i<=12;i++) {
			target.options[i].text = monthfull[i-1];
			target.options[i].value = i;
		}	
	}else{
		for(i=1;i<=12;i++) {
			target.options[i].text = monthshort[i-1];
			target.options[i].value = i;
		}	
	}
	if(oldindex != null) {
		target.options.selectedIndex = oldindex;
	}
}
function listDay(target,pyear,pmonth,oldindex) {
	day = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
	if(parseInt(pmonth) == 2) {
		if(parseInt(pyear) % 4 == 0){
			target.options.length = 30;
		}else{
			target.options.length = 29;
		}
	}else{
		target.options.length = day[pmonth-1]+1;
	}
	target.options[0].text = "Day";
	target.options[0].value = "0";
	for(i=1;i<target.options.length;i++) {
		target.options[i].text = i;
		target.options[i].value = i;
	}	
	//if(oldindex != null) {
		if(target.options.length-1 >= oldindex) {
			target.options.selectedIndex = oldindex;
		}else{
			target.options.selectedIndex = target.options.length-1;
		}
	//}
}
function listYear(target,pyear,advance,oldindex) {
	target.options.length = advance+2;
	target.options[0].text = "Year";
	target.options[0].value = "0";
	for(i=pyear;i<=pyear+advance;i++) {
		target.options[i-pyear+1].text = i;
		target.options[i-pyear+1].value = i;
	}
	if(oldindex != null) {
		target.options.selectedIndex = oldindex;
	}
}
