//Date Selection Stuff
function getDaysInMonth(month, year) {
    monthdays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
    if (month != 1) {
        return monthdays[month];
    } else {
	return ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0 ? 29 : 28);
    }
}

function setDaysInMonth(box,month,year) {
    var numDays = getDaysInMonth(month-1,year);
    box.length = 0;
    for(i=1;i<=numDays;i++) {
        box.options[i] = new Option(i, i, 1, 1);
    }
    box.options[1].selected = true;
}

function selectCurrentDate(formName,monthBox,dayBox,yearBox) {
    var today = new Date();
    formName[yearBox].length = 0;
    //formName[yearBox].options[0] = new Option(today.getYear(), today.getYear(),1,1);
    //formName[yearBox].options[1] = new Option(today.getYear()+1, today.getYear()+1,1,1);
    formName[yearBox].options[0] = new Option(2009, 2009,1,1);
    formName[yearBox].options[1] = new Option(2010, 2010,1,1);
    formName[yearBox].options[0].selected = true;
    formName[monthBox].options[today.getMonth()].selected = true;
    setDaysInMonth(formName[dayBox],today.getMonth()+1,today.getYear());
    formName[dayBox].options[today.getDate()].selected = true;
}