function getresults() { var yearkm; var electriccarbuy; var electricitybuy; var electricitystorage; var electricityrange; var electricityperkm; var electricityrise; var petrolcarbuy; var petrolbuy; var petroldistance; var petrolperkm; var petrolmpgtemp1; var petrolmpgtemp2; var petrolrise; var petrolusedinyear; var petrolcostinyear; var electricityusedinyear; var electricitycostinyear; var petrol1; var petrol2; var petrol3; var petrol4; var petrol5; var electric1; var electric2; var electric3; var electric4; var electric5; var q1; var q2; var q3; var q4; yearkm = document.myForm.yearkm.value; if (document.myForm.q1[1].checked == true) { yearkm = yearkm * 1.609; } electriccarbuy = document.myForm.electriccarbuy.value; electricitybuy = document.myForm.electricitybuy.value; electricitystorage = document.myForm.electricitystorage.value; electricityrange = document.myForm.electricityrange.value; if (document.myForm.q2[1].checked == true) { electricityrange = electricityrange * 1.609; } electricityperkm = electricitystorage / electricityrange; electricityrise = document.myForm.electricityrise.value; petrolcarbuy = document.myForm.petrolcarbuy.value; petrolbuy = document.myForm.petrolbuy.value; if (document.myForm.q3[1].checked == true) { petrolbuy = petrolbuy / 3.78; } if (document.myForm.q3[2].checked == true) { petrolbuy = petrolbuy / 4.54; } petroldistance = document.myForm.petroldistance.value; if (document.myForm.q4[0].checked == true) { petrolperkm = petroldistance / 100; } if (document.myForm.q4[1].checked == true) { petrolmpgtemp1 = 235.2 / petroldistance; petrolperkm = petrolmpgtemp1 / 100; } if (document.myForm.q4[2].checked == true) { petrolmpgtemp1 = 282.5 / petroldistance; petrolperkm = petrolmpgtemp1 / 100; } petrolrise = document.myForm.petrolrise.value; petrolrise = ++petrolrise; petrolusedinyear = petrolperkm * yearkm; petrolcostinyear = petrolusedinyear * petrolbuy; petrol1 = Math.round(petrolcarbuy) + Math.round(petrolcostinyear); document.myForm.petrol1.value = petrol1; petrolbuy = petrolbuy * petrolrise; petrolcostinyear = petrolusedinyear * petrolbuy; petrol2 = Math.round(petrol1) + Math.round(petrolcostinyear); document.myForm.petrol2.value = petrol2; petrolbuy = petrolbuy * petrolrise; petrolcostinyear = petrolusedinyear * petrolbuy; petrol3 = Math.round(petrol2) + Math.round(petrolcostinyear); document.myForm.petrol3.value = petrol3; petrolbuy = petrolbuy * petrolrise; petrolcostinyear = petrolusedinyear * petrolbuy; petrol4 = Math.round(petrol3) + Math.round(petrolcostinyear); document.myForm.petrol4.value = petrol4; petrolbuy = petrolbuy * petrolrise; petrolcostinyear = petrolusedinyear * petrolbuy; petrol5 = Math.round(petrol4) + Math.round(petrolcostinyear); document.myForm.petrol5.value = petrol5; electricityrise = ++electricityrise; electricityusedinyear = electricityperkm * yearkm * 1.15; electricitycostinyear = electricityusedinyear * electricitybuy; electric1 = Math.round(electriccarbuy) + Math.round(electricitycostinyear); document.myForm.electric1.value = electric1; electricitybuy = electricitybuy * electricityrise; electricitycostinyear = electricityusedinyear * electricitybuy; electric2 = Math.round(electric1) + Math.round(electricitycostinyear); document.myForm.electric2.value = electric2; electricitybuy = electricitybuy * electricityrise; electricitycostinyear = electricityusedinyear * electricitybuy; electric3 = Math.round(electric2) + Math.round(electricitycostinyear); document.myForm.electric3.value = electric3; electricitybuy = electricitybuy * electricityrise; electricitycostinyear = electricityusedinyear * electricitybuy; electric4 = Math.round(electric3) + Math.round(electricitycostinyear); document.myForm.electric4.value = electric4; electricitybuy = electricitybuy * electricityrise; electricitycostinyear = electricityusedinyear * electricitybuy; electric5 = Math.round(electric4) + Math.round(electricitycostinyear); document.myForm.electric5.value = electric5; }