function calculateBM() {
var weight = document.getElementById('weight').value;
var height = document.getElementById('height').value;
var starost = document.getElementById('starost').value;
var spol = document.getElementById('spol').value;
if (height=="0.0" || weight=="0.0"|| starost=="0")
{
alert("Vnesite vsa zahtevana polja!")
}
else
{
if (spol=="M")
{
var bm = 88.362+(4.799*height)+(13.397*weight)-(5.677*starost)
document.getElementById('bazalni').value = custRound(bm,0)
}
else
{
var bm= 447.593 + (3.098 * height) + (9.247 * weight) - (4.33 * starost)
document.getElementById('bazalni').value = custRound(bm,0)
}
}
}
function clearField() {
document.getElementById('starost').value = 0;
document.getElementById('weight').value = 0;
document.getElementById('height').value = 0;
document.getElementById('bazalni').value = 0;
}
// End -->


