function Calculate()
{
	var focalLength = 413.1781;
	var startAge = 25.48807;
	var startIncOffset = -2.35626;
	var eqCorrection = 134.9106;
	var ageIncOff = 2.369763;
	var startAgeOffset = 585.2361;
	var cutOffYear = 3;
	var cutOffMonths = cutOffYear * 12;

	var dogWeight = parseFloat(document.example.weight.value); 
	if (dogWeight < 5) {
	  dogWeight = 5;
	  document.example.weight.value = dogWeight;
	}

	var originalDogAge = parseFloat(document.example.age.value);
	var dogAge = originalDogAge;
	
	if ( originalDogAge < cutOffYear ) {
	  dogAge = cutOffYear ;
	}

	var zb = ((dogWeight + startAgeOffset) * (dogWeight + startAgeOffset))/(eqCorrection * focalLength);
	var winc = zb + startIncOffset;

	var humanAge = (winc * (dogAge - ageIncOff)) + startAge;

	if ( originalDogAge < 3) {
	  var humanAgeAt3 = humanAge;
	  var underThreeFl = (humanAgeAt3 * humanAgeAt3)/(4 * cutOffMonths);
	  var dogAgeInMonths = originalDogAge * 12;
	  var humanAge = Math.sqrt(4*dogAgeInMonths *underThreeFl); 
	}
	humanAge = Math.round(humanAge * 10)/10;
	document.example.humanAgeResult.value = humanAge;
	document.example.humanAgeResult7x.value = Math.round(originalDogAge * 7 * 10)/10;
}
