function LoadMonth(sel_months_,sel_days_,year_) 
{
	DayArray = new Array("31","28","31","30","31","30","31","31","30","31","30","31");
  sel_days   = document.getElementById(sel_days_);
  sel_months = document.getElementById(sel_months_);
  year       = document.getElementById(year_);

	var monthInteger, monthLen,dayInteger,today,yr,defday,object,curMonthInteger;
	monthInteger = sel_months.selectedIndex;  
	monthLen = sel_days.length; // Current # of entries
	defday = sel_days.selectedIndex; // current selected day

	today = new Date();
	
/*	
	yr = today.getFullYear();
	curMonthInteger = today.getMonth();
	if(monthInteger < curMonthInteger) yr++;
  year.value = yr;
*/
  yr = year.options[year.selectedIndex].value;  
 
	if(yr % 4 == 0) DayArray[1] = "29"; // Leap year

	popMonthNum(sel_days,DayArray[monthInteger]-1,monthLen-1); 
	// Use previous day number, if invalid set to first day
	sel_days.selectedIndex = defday;
	if(sel_days.selectedIndex < 0) sel_days.selectedIndex = 0;
}

function popMonthNum(theList,newMaxItemNo,curMaxItemNo) {
// Assume all months have at least 28 days and that the list
// was created with 31 days
   var option28 = new Option("29", "29");
   var option29 = new Option("30", "30");
   var option30 = new Option("31", "31");

// Delete entries from 29 to current maximum
   for (var i=curMaxItemNo; i>=28; i--) {
       theList.options[i]=null;
   }
// Add entries from 28 to new maximum
   for (var i=28; i<=newMaxItemNo; i++) {
      eval("theList.options[i]=option" + i);
   }
}
