function bmi()
{
    var w = parseFloat(document.frm.txtWeight.value);
    var h = parseInt(document.frm.txtHeight.value);
    var errors='';
    if (document.frm.opHeight.value == "Inch") {h = h * 2.54;}
	if (document.frm.opWeight.value == "Lb") {w = w * 0.4536;}
	if ((w < 10)||(w > 500)||isNaN(w)){errors+='Enter correct weight.n';}
    if ((h < 50) || (h > 300)||isNaN(h)){errors+='Enter correct height.n';}
    if (errors){
    alert('The following error(s) occurred:n'+errors);
    return 0;}
    document.getElementById('feedback').innerHTML = 'Your BMI is ' + Math.round(10*((w * 10000 / (h * h))))/10;
}
function resetAll(){
document.getElementById('feedback').innerHTML="";
return true;
}
