
function fuelCalc()
{
	with (document.calc)
	{
	if (isNaN(parseFloat(miles.value)))
		alert("The distance entered is not a number");
	else if (isNaN(parseFloat(dpg.value)))
		alert("The cost of fuel entered is not a number");
	else if (isNaN(parseFloat(mpg.value)))
		alert("The mpg entered is not a number");
	else
	{
		var xxxx = parseFloat(miles.value) * parseFloat(dpg.value) / parseFloat(mpg.value);
		if (isNaN(xxxx))
			xxxx = "Error - Check Figures";
		else
			xxxx = Math.round(xxxx * 100) / 100;
			document.getElementById("tot").innerText = xxxx;
			}
		}
	}


