var powercost; var lights; var hoursinuse; var daysperweekinuse; var oldwatts; var oldprice; var oldlife; var newwatts; var newprice; var newlife; var oldyearwatts; var newyearwatts; var oldyearcost; var newyearcost; var oldyear1; var newyear1; var oldyear2; var newyear2; var oldyear3; var newyear3; var result1; var result2; var result3; var result4; var result5; var result6; var result7; var result8; var result9; var result10; var lightsusedold; var lightsusednew; var hoursdone; var temp1; var temp2; function getresults() { result1 = (document.myForm.oldwatts.value * document.myForm.lights.value * document.myForm.hoursinuse.value * document.myForm.daysperweekinuse.value * 52)/1000; document.myForm.oldyearwatts.value = Math.round(result1); result2 = (document.myForm.newwatts.value * document.myForm.lights.value * document.myForm.hoursinuse.value * document.myForm.daysperweekinuse.value * 52)/1000; document.myForm.newyearwatts.value = Math.round(result2); result3 = result1 * document.myForm.powercost.value; result4 = result2 * document.myForm.powercost.value; temp1 = Math.round(result3 * 100); temp2 = Math.round(result4 * 100); document.myForm.oldyearcost.value = temp1/100; document.myForm.newyearcost.value = temp2/100; hoursdone = document.myForm.hoursinuse.value * document.myForm.daysperweekinuse.value * 52; lightsusedold = Math.floor(hoursdone/document.myForm.oldlife.value) + 1; lightsusednew = Math.floor(hoursdone/document.myForm.newlife.value) + 1; result5 = (lightsusedold * document.myForm.oldprice.value) + (result3 * 1); temp1 = Math.round(result5 * 100); document.myForm.oldyear1.value = temp1/100; result6 = (lightsusednew * document.myForm.newprice.value) + (result4 * 1); temp2 = Math.round(result6 * 100); document.myForm.newyear1.value = temp2/100; hoursdone = document.myForm.hoursinuse.value * document.myForm.daysperweekinuse.value * 52 * 2; lightsusedold = Math.floor(hoursdone/document.myForm.oldlife.value) + 1; lightsusednew = Math.floor(hoursdone/document.myForm.newlife.value) + 1; result7 = (lightsusedold * document.myForm.oldprice.value) + (result3 * 2); temp1 = Math.round(result7 * 100); document.myForm.oldyear2.value = temp1/100; result8 = (lightsusednew * document.myForm.newprice.value) + (result4 * 2); temp2 = Math.round(result8 * 100); document.myForm.newyear2.value = temp2/100; hoursdone = document.myForm.hoursinuse.value * document.myForm.daysperweekinuse.value * 52 * 3; lightsusedold = Math.floor(hoursdone/document.myForm.oldlife.value) + 1; lightsusednew = Math.floor(hoursdone/document.myForm.newlife.value) + 1; result9 = (lightsusedold * document.myForm.oldprice.value) + (result3 * 3); temp1 = Math.round(result9 * 100); document.myForm.oldyear3.value = temp1/100; result10 = (lightsusednew * document.myForm.newprice.value) + (result4 * 3); temp2 = Math.round(result10 * 100); document.myForm.newyear3.value = temp2/100; } function import1() { document.myForm.lightcost1.value = document.myForm.lights.value * document.myForm.newprice.value; document.myForm.lightkWh1.value = Math.round((document.myForm.oldyearwatts.value - document.myForm.newyearwatts.value) * 3); temp1 = Math.round((document.myForm.oldyearcost.value - document.myForm.newyearcost.value) * 300); document.myForm.lightsave1.value = temp1/100; addtotals() } function import2() { document.myForm.lightcost2.value = document.myForm.lights.value * document.myForm.newprice.value; document.myForm.lightkWh2.value = Math.round((document.myForm.oldyearwatts.value - document.myForm.newyearwatts.value) * 3); temp1 = Math.round((document.myForm.oldyearcost.value - document.myForm.newyearcost.value) * 300); document.myForm.lightsave2.value = temp1/100; addtotals() } function import3() { document.myForm.lightcost3.value = document.myForm.lights.value * document.myForm.newprice.value; document.myForm.lightkWh3.value = Math.round((document.myForm.oldyearwatts.value - document.myForm.newyearwatts.value) * 3); temp1 = Math.round((document.myForm.oldyearcost.value - document.myForm.newyearcost.value) * 300); document.myForm.lightsave3.value = temp1/100; addtotals() } function import4() { document.myForm.lightcost4.value = document.myForm.lights.value * document.myForm.newprice.value; document.myForm.lightkWh4.value = Math.round((document.myForm.oldyearwatts.value - document.myForm.newyearwatts.value) * 3); temp1 = Math.round((document.myForm.oldyearcost.value - document.myForm.newyearcost.value) * 300); document.myForm.lightsave4.value = temp1/100; addtotals() } function import5() { document.myForm.lightcost5.value = document.myForm.lights.value * document.myForm.newprice.value; document.myForm.lightkWh5.value = Math.round((document.myForm.oldyearwatts.value - document.myForm.newyearwatts.value) * 3); temp1 = Math.round((document.myForm.oldyearcost.value - document.myForm.newyearcost.value) * 300); document.myForm.lightsave5.value = temp1/100; addtotals() } function import6() { document.myForm.lightcost6.value = document.myForm.lights.value * document.myForm.newprice.value; document.myForm.lightkWh6.value = Math.round((document.myForm.oldyearwatts.value - document.myForm.newyearwatts.value) * 3); temp1 = Math.round((document.myForm.oldyearcost.value - document.myForm.newyearcost.value) * 300); document.myForm.lightsave6.value = temp1/100; addtotals() } function import7() { document.myForm.lightcost7.value = document.myForm.lights.value * document.myForm.newprice.value; document.myForm.lightkWh7.value = Math.round((document.myForm.oldyearwatts.value - document.myForm.newyearwatts.value) * 3); temp1 = Math.round((document.myForm.oldyearcost.value - document.myForm.newyearcost.value) * 300); document.myForm.lightsave7.value = temp1/100; addtotals() } function import8() { document.myForm.lightcost8.value = document.myForm.lights.value * document.myForm.newprice.value; document.myForm.lightkWh8.value = Math.round((document.myForm.oldyearwatts.value - document.myForm.newyearwatts.value) * 3); temp1 = Math.round((document.myForm.oldyearcost.value - document.myForm.newyearcost.value) * 300); document.myForm.lightsave8.value = temp1/100; addtotals() } function import9() { document.myForm.lightcost9.value = document.myForm.lights.value * document.myForm.newprice.value; document.myForm.lightkWh9.value = Math.round((document.myForm.oldyearwatts.value - document.myForm.newyearwatts.value) * 3); temp1 = Math.round((document.myForm.oldyearcost.value - document.myForm.newyearcost.value) * 300); document.myForm.lightsave9.value = temp1/100; addtotals() } function import10() { document.myForm.lightcost10.value = document.myForm.lights.value * document.myForm.newprice.value; document.myForm.lightkWh10.value = Math.round((document.myForm.oldyearwatts.value - document.myForm.newyearwatts.value) * 3); temp1 = Math.round((document.myForm.oldyearcost.value - document.myForm.newyearcost.value) * 300); document.myForm.lightsave10.value = temp1/100; addtotals() } function addtotals() { temp1 = Math.round(document.myForm.lightcost1.value * 100 + document.myForm.lightcost2.value * 100 + document.myForm.lightcost3.value * 100 + document.myForm.lightcost4.value * 100 + document.myForm.lightcost5.value * 100 + document.myForm.lightcost6.value * 100 + document.myForm.lightcost7.value * 100 + document.myForm.lightcost8.value * 100 + document.myForm.lightcost9.value * 100 + document.myForm.lightcost10.value * 100); document.myForm.totallightcost.value = temp1/100; temp1 = Math.round(document.myForm.lightkWh1.value * 100 + document.myForm.lightkWh2.value * 100 + document.myForm.lightkWh3.value * 100 + document.myForm.lightkWh4.value * 100 + document.myForm.lightkWh5.value * 100 + document.myForm.lightkWh6.value * 100 + document.myForm.lightkWh7.value * 100 + document.myForm.lightkWh8.value * 100 + document.myForm.lightkWh9.value * 100 + document.myForm.lightkWh10.value * 100); document.myForm.totallightkWh.value = temp1/100; temp1 = Math.round(document.myForm.lightsave1.value * 100 + document.myForm.lightsave2.value * 100 + document.myForm.lightsave3.value * 100 + document.myForm.lightsave4.value * 100 + document.myForm.lightsave5.value * 100 + document.myForm.lightsave6.value * 100 + document.myForm.lightsave7.value * 100 + document.myForm.lightsave8.value * 100 + document.myForm.lightsave9.value * 100 + document.myForm.lightsave10.value* 100); document.myForm.totallightsave.value = temp1/100; }