function getresults() { var powercost; var dailysolar; var time1; var proportion1; var litrespermin1; var efficientlitrespermin1; var time2; var proportion2; var litrespermin2; var efficientlitrespermin2; var proportion3; var totallitres1; var proportion4; var totallitres2; var totallitresyear; var yearkwh; var bathnumber; var dishnumber; var yearcost; var showertotal; var handwashtotal; var dishwashertotal; var bathtotal; var grandtotal; var efficienttotallitresyear; powercost = document.myForm.powercost.value; dailysolar = Math.round(document.myForm.dailysolar.value * 100)/100; time1 = document.myForm.time1.value; proportion1 = document.myForm.proportion1.value; litrespermin1 = 20; efficientlitrespermin1=9; time2 = document.myForm.time2.value; proportion2 = document.myForm.proportion2.value; litrespermin2 = 20; efficientlitrespermin2=5; proportion3 = document.myForm.proportion3.value; totallitres1 = document.myForm.totallitres1.value; proportion4 = document.myForm.proportion4.value; totallitres2 = document.myForm.totallitres2.value; bathnumber = document.myForm.bathnumber.value; dishnumber = document.myForm.dishnumber.value; showertotal = time1 * proportion1 * litrespermin1 *365; handwashtotal = time2 * proportion2 * litrespermin2 *365; dishwashertotal = dishnumber * proportion3 * totallitres1 * 365; bathtotal = bathnumber * proportion4 * totallitres2 * 365; grandtotal = showertotal + handwashtotal + dishwashertotal + bathtotal; document.myForm.totallitresday.value = Math.round(grandtotal/365); document.myForm.totallitresyear.value = grandtotal; document.myForm.yearkwh.value = Math.round(grandtotal * 0.052); document.myForm.yearcost.value = Math.round(grandtotal * 0.052 * powercost); document.myForm.yearcosttwenty.value = Math.round(grandtotal * 0.052 * powercost * 20); document.myForm.yearkwh20.value = Math.round(grandtotal * 0.052 * 20 * 0.15 * dailysolar); document.myForm.yearcost20.value = Math.round(grandtotal * 0.052 * powercost * 20 * 0.15 * dailysolar); showertotal = time1 * proportion1 * 9 *365; handwashtotal = time2 * proportion2 * 5 *365; grandtotal = showertotal + handwashtotal + dishwashertotal + bathtotal; document.myForm.efficienttotallitresday.value = Math.round(grandtotal/365); document.myForm.efficienttotallitresyear.value = grandtotal; document.myForm.efficientyearkwh.value = Math.round(grandtotal * 0.052); document.myForm.efficientyearcost.value = Math.round(grandtotal * 0.052 * powercost); document.myForm.efficientyearcosttwenty.value = Math.round(grandtotal * 0.052 * powercost * 20); document.myForm.efficientyearkwh20.value = Math.round(grandtotal * 0.052 * 20 * 0.15 * dailysolar); document.myForm.efficientyearcost20.value = Math.round(grandtotal * 0.052 * powercost * 20 * 0.15 * dailysolar); document.myForm.efficienttotallitresdaysavings.value = document.myForm.totallitresday.value - document.myForm.efficienttotallitresday.value; document.myForm.efficienttotallitresyearsavings.value = document.myForm.totallitresyear.value - document.myForm.efficienttotallitresyear.value; document.myForm.efficientyearkwhsavings.value = document.myForm.yearkwh.value - document.myForm.efficientyearkwh.value; document.myForm.efficientyearcostsavings.value = document.myForm.yearcost.value - document.myForm.efficientyearcost.value; document.myForm.efficientyearcostsavingstwenty.value = document.myForm.yearcosttwenty.value - document.myForm.efficientyearcosttwenty.value; document.myForm.efficientyearkwh20savings.value = document.myForm.yearkwh20.value - document.myForm.efficientyearkwh20.value; document.myForm.efficientyearcost20savings.value = document.myForm.yearcost20.value - document.myForm.efficientyearcost20.value; }