// This function calculates the age of a person given their birthday
// data which is passed to the function
/* The HTML document should containg the date of birth data within script tags:
   document.write(AGE_living(1964,0,27));    */

function AGE_living(month,day,year){
	var bday = new Date(year,month-1,day);
	var today = new Date();
	var AgeMS = today.getTime() - bday.getTime();
	var age = Math.floor(AgeMS/(1000*60*60*24*365));
	return age;
}

function AGE_dead(month,day,year,monthD,dayD,yearD){
	var bday = new Date(year,month-1,day);
	var dday = new Date(yearD,monthD-1,dayD);
	var AgeMS = dday.getTime() - bday.getTime();
	var age = Math.floor(AgeMS/(1000*60*60*24*365));
	return age;
}


