//Set the events for the objects on the page
function setEvents() {
  if(document.getElementById("lnkDate")) {
    document.getElementById("lnkDate").onclick = function() { popupCalendar(document.getElementById("ctl00_ContentPlaceHolder1_txtStartDate"), this.id); return false; }
    document.getElementById("ctl00_ContentPlaceHolder1_rbRaisingFunds_0").onclick = function() { document.getElementById("ctl00_ContentPlaceHolder1_cboAmtAnnually").options[0].selected = true; }
    document.getElementById("ctl00_ContentPlaceHolder1_rbRaisingFunds_1").onclick = function() { document.getElementById("ctl00_ContentPlaceHolder1_cboAmtAnnually").options[1].selected = true; }
  }
}

//Setup the calendar
function popupCalendar(txtobj, anchorid){
  var now = new Date(); var cal = new CalendarPopup("divCal");
  cal.addDisabledDates(null,formatDate(new Date(now.getFullYear(), now.getMonth(), now.getDate()-1,0,0,0),"yyyy-MM-dd"));
  cal.offsetX = 70;cal.offsetY = -70; cal.setCssPrefix("C4K"); 
  cal.setYearSelectStartOffset(0); cal.setYearSelectStopOffset(5);
  cal.showNavigationDropdowns();
  cal.select(txtobj,anchorid,'MM/dd/yyyy');
}

window.onload = function() { setEvents(); }

