function loadfd(form) {
  checkVal = form.fd.selectedIndex;
  if (checkVal == 30){
    checkVal = checkVal-1;
  }
  form.td.options[checkVal+1].selected=1;
}

function loadfm(form) {
  checkVal = form.fm.selectedIndex;
  form.tm.options[checkVal].selected=1;
}

function loadfy(form) {
  checkVal = form.fy.selectedIndex;
  form.ty.options[checkVal].selected=1;
}

//Set current dates on form load
function LoadDates(form) {
  curDate = new Date();
  curDay = curDate.getDate();
  curMonth = curDate.getMonth();
  curYear = curDate.getFullYear();
  setYear = curYear - form.ty.options[0].text;

  if(curDay >= 28) {
    form.fd.selectedIndex = 0;
    if(curMonth == 11) {
      form.fm.selectedIndex = 0;
      form.fy.selectedIndex = setYear+1;
      form.ty.selectedIndex = setYear+1;
    } else if(curDay >= 28) {
      form.fm.selectedIndex = curMonth+1;
      form.fy.selectedIndex = setYear;
    }
  } else if(curDay < 28) {
    form.fd.selectedIndex = curDay+2;
    form.fm.selectedIndex = curMonth;
    form.fy.selectedIndex = setYear;
  }
}
