var att_cal;
var att_kcal;
var min;
var kcal;
var minutes;

function dispnum(x) {
	x = Math.floor(x*10)/10; // rounded off to one decimal digit
	return(x);
}



function initialise() { // initialise the variables
	if (document.energy.att_cal.value == '') {
		document.energy.att_cal.value = 0;
	}

	if (document.energy.min.value == '') {
		document.energy.min.value = 0;
	}

	if (document.energy.kcal.value='') {
		document.energy.kcal.value = 0;
	}

}	

function calcola() { // the main routine

	initialise();

	att_cal = parseFloat(document.energy.att_cal.value);

	att_kcal = att_cal;
	
	min = parseFloat(document.energy.min.value);

	minutes = min;

	x = att_kcal * minutes;

document.energy.kcal.value = dispnum(x);
}
