<!-- Begin
function s(num, val) {
amount = num * 1; // amount is the num or NaN
sum = (!num ? 0 : num) * val;  // the sum for that bill or coin

if (isNaN(amount)) { // if the entire is not a number

alert("Bitte überprüfen Sie Ihre Eingabe.");

return 0;
}
else
return sum; // if it is OK, send sum back
}

function money(form) {
hun = s(form.Kernoel05l.value, 8.50); // Each amount is the returned value
fif = s(form.Kernoel1l.value, 16.00);  // for the amount in the s() function
twe = s(form.Salatoel05l.value, 3.00);
ten = s(form.Salatoel1l.value, 5.00);
fiv = s(form.Kuerbiskerne025kg.value, 2.50);
one = s(form.Kuerbiskerne05kg.value, 5.00);
hlf = s(form.Kuerbiskerne1kg.value, 10.00);

// add up all the amounts
var ttl = hun + fif + twe + ten + fiv + one + hlf;

// rounds total to two decimal places

ttl = "" + ((Math.round(ttl * 100)) / 100);

dec1 = ttl.substring(ttl.length-3, ttl.length-2);
dec2 = ttl.substring(ttl.length-2, ttl.length-1);

if (dec1 != '.') { // adds trailing zeroes if necessary
if (dec2 == '.') ttl += "0";
else ttl += ".00";
}
form.Summe.value = "" + ttl; // display total amount
}
//  End -->
