//0.5323*weight^3 - 10.355*weight^2 + 265.82*weight
//roast = =0.0751*A2^3 - 1.5219*A2^2 + 43.815*A2

function defrost(weight) {
//  weight = (0.5323*(weight^3)) - (10.355*(weight^2)) + (265.82*weight);
  weight = weight * 240;
  return (makeTime(weight));
}

function makeTime(time) {
  var hours = parseInt(time/60);
  var minutes = parseInt(time%60);
  return (hours + ' h and ' + minutes + ' m');
}

function roast(weight) {
	if (weight >= 4) {
		weight = (weight * 20) + 90;
	} else {
		weight = (weight * 20) + 70;
		}
  return (makeTime(weight));
}

function callbackRoast(weight) {
  document.forms.roastCalculator.elements['turkeyWeight'].value = weight;
  document.forms.roastCalculator.elements.roastTime.value = roast(weight);
}

function callbackDefrost(weight) {
  document.forms.defrostCalculator.elements['turkeyWeight'].value = weight;
  document.forms.defrostCalculator.elements.defrostTime.value = defrost(weight);
}

// 235.81959999999