// This code automatically pulls system date and puts it into proper format for BlueHornet
// For F35 Autoresponder Series

function autoDate () {
	var tDay = new Date();
	var tMonth = tDay.getMonth()+1;
	var tDate = tDay.getDate();
	if ( tMonth < 10) tMonth = "0"+tMonth;
	if ( tDate < 10) tDate = "0"+tDate;
	document.getElementById("cd_mon[206046]").value = tMonth;
	document.getElementById("cd_day[206046]").value = tDate;
	document.getElementById("cd_year[206046]").value = tDay.getFullYear();
 }

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(function() {
  autoDate();
});
