function getBirthday() {
	DAYS_TO_MILLISEC = 24 * 60 * 60 * 1000;
	GEST_EARLY = 315 * DAYS_TO_MILLISEC;
	GEST_LATE = 365 * DAYS_TO_MILLISEC;
	GEST_AVERAGE = 341 * DAYS_TO_MILLISEC;
	concMonth = document.getElementById("month").value-1;
	concDay = document.getElementById("day").value;
	concYear = document.getElementById("year").value;
	
	if (concMonth > 11 || concMonth < 0) {
		alert("Month is out of range!");
		return false;
	}
	
	if (concDay > 31 || concDay < 1) {
		alert("Day is out of range!");
		return false;
	}
	
	if (concYear < 10) {
		concYear = 2000 + parseInt(concYear);
	}
	
	concDate = new Date(concYear, concMonth, concDay);
//	alert(concMonth + "/" + concDay + "/" + concYear + " = " + concDate.toString());
	dates = new Object;
	dates.expectedDate = new Date(concDate.valueOf()+GEST_AVERAGE);
	dates.earliestDate = new Date(concDate.valueOf()+GEST_EARLY);
	dates.latestDate = new Date(concDate.valueOf()+GEST_LATE);
	
	return dates;
}

function alertBD() {
	if (dates = getBirthday()) {
		htmlMsg = "<html><head><title>Foaling Due Date</title></head><link rel=stylesheet href=style.css type=text/css>";
		htmlMsg += "<body class=background_dark>";
		htmlMsg += "<H2>Your foal is due on, ";
		htmlMsg +=  (dates.expectedDate.getMonth()+1) + "/" + dates.expectedDate.getDate() + "/" + dates.expectedDate.getYear();
		htmlMsg += ".</H2><br>";
		htmlMsg += "</body></html>";
		upwindow = window.open('javascript:"' + htmlMsg + '"', "upwin", "width=300,height=100,resizeable=yes");
	}
}