function CalcBMI() {
//	var h = frmBMI.h.value;
	var h;
	h = (eval(frmBMI.hf.value) * 12) + eval(frmBMI.hi.value);
	frmBMI.b.value = convdec((frmBMI.w.value / (h * h)) * 703);
	if (frmBMI.b.value < 18.5) {
		OutText.innerText = "You may be underweight";
		OutText.className = "Under";
		OutCell.className = "Under";
	} else if (frmBMI.b.value >= 18.5 & frmBMI.b.value <= 24.9) {
		OutText.innerText = "Your BMI is normal";
		OutText.className = "Normal";
		OutCell.className = "Normal";
	} else if (frmBMI.b.value >= 25.0 & frmBMI.b.value <= 29.9) {
		OutText.innerText = "You may be overweight";
		OutText.className = "Over";
		OutCell.className = "Over";
	} else if (frmBMI.b.value >= 30.0 & frmBMI.b.value <= 40.0) {
		OutText.innerText = "You may be obese";
		OutText.className = "Obese";
		OutCell.className = "Obese";
	} else if (frmBMI.b.value >= 40.0) {
		OutText.innerText = "You may be morbidly obese";
		OutText.className = "Morbidly";
		OutCell.className = "Morbidly";
	}
}

function convdec(strng) {
	if (strng == 0) {
	return "0.00";
	} else {
		var str = "" + Math.round(strng * 100);
		return(str.substring(0, str.length-2) + "." + str.substring(str.length-1, str.length));
	}
}
