var powercost; var offpeakpowercost; var yearpowercost; var lighthours; var aircon; var fridge; var pump; var washing; var showers; var taps; var computers; var laptops; var peripheral; var insulation; var drafts; var ps3; var xbox360; var hifi; var dvd; var savekWh; var savedollars; var savewater; var savewatertotal; var Totalsavedollars; var TotalsavekWh; var TotalsaveCo2; var forout; var ResultsOut; function getresults() { savekWh = 0; savedollars = 0; Totalsavedollars = 0; TotalsavekWh = 0; savewatertotal = 0; TotalsaveCo2 = 0; ResultsOut = ""; document.myForm.ResultsOut.value = ""; powercost = Math.round(document.myForm.powercost.value * 100)/100; offpeakpowercost = Math.round(document.myForm.offpeakpowercost.value * 100)/100; yearpowercost = Math.round(document.myForm.yearpowercost.value); lighthours = Math.round(document.myForm.lighthours.value); aircon = Math.round(document.myForm.aircon.value); fridge = Math.round(document.myForm.fridge.value); pump = Math.round(document.myForm.pump.value); washing = document.myForm.washing.checked; showers = Math.round(document.myForm.showers.value); taps = Math.round(document.myForm.taps.value); computers = Math.round(document.myForm.computers.value); laptops = Math.round(document.myForm.laptops.value); peripheral = document.myForm.peripheral.checked; insulation = document.myForm.insulation.checked; drafts = document.myForm.drafts.checked; ps3 = document.myForm.ps3.checked; xbox360 = document.myForm.xbox360.checked; hifi = document.myForm.hifi.checked; dvd = document.myForm.dvd.checked; ResultsOut = "Power cost " + powercost + ", Off peak Power cost " + offpeakpowercost + ", Year power cost " + yearpowercost + " \r"; document.myForm.ResultsOut.value = ResultsOut; if (lighthours > 0) { savekWh = lighthours * 0.062 * 365; savedollars = savekWh * powercost; TotalsavekWh = TotalsavekWh + savekWh; Totalsavedollars = Totalsavedollars + savedollars; ResultsOut = ResultsOut + "Lighting savings $" + Math.round(savedollars* 100)/100 + ", " + Math.round(savekWh* 100)/100 + "kWh. Calc = 62 Watts per light saved x hours x 365 days. \r"; document.myForm.ResultsOut.value = ResultsOut; } if (aircon > 0) { savekWh = 0; savedollars = aircon * 0.5 * 8 * 120 * (powercost - offpeakpowercost); TotalsavekWh = TotalsavekWh + savekWh; Totalsavedollars = Totalsavedollars + savedollars; ResultsOut = ResultsOut + "Bedroom air conditioning savings $" + Math.round(savedollars* 100)/100 + ", " + Math.round(savekWh* 100)/100 + "kWh. Calc = air con number x 50% compressor x 120 days x (full power - off peak power). \r"; document.myForm.ResultsOut.value = ResultsOut; } if (fridge > 0) { savekWh = 700 * fridge; savedollars = savekWh * powercost; TotalsavekWh = TotalsavekWh + savekWh; Totalsavedollars = Totalsavedollars + savedollars; ResultsOut = ResultsOut + "Fridge savings $" + Math.round(savedollars* 100)/100 + ", " + Math.round(savekWh* 100)/100 + "kWh. Calc = Fridges * 700kWh. \r"; document.myForm.ResultsOut.value = ResultsOut; } if (pump > 0) { savekWh = (24-pump) * 365; savedollars = savekWh * powercost; TotalsavekWh = TotalsavekWh + savekWh; Totalsavedollars = Totalsavedollars + savedollars; ResultsOut = ResultsOut + "Pump savings $" + Math.round(savedollars* 100)/100 + ", " + Math.round(savekWh* 100)/100 + "kWh. Calc = (24 - pump timer hours) x 365 days. \r"; document.myForm.ResultsOut.value = ResultsOut; } if (washing == true) { savekWh = 400 * 0.052 * 52; savedollars = savekWh * powercost; TotalsavekWh = TotalsavekWh + savekWh; Totalsavedollars = Totalsavedollars + savedollars; ResultsOut = ResultsOut + "Washing savings $" + Math.round(savedollars* 100)/100 + ", " + Math.round(savekWh* 100)/100 + "kWh. Calc = 400 litres x 0.052kWh(to heat 1 litre of water) x 52 weeks. \r"; document.myForm.ResultsOut.value = ResultsOut; } if (showers > 0) { savekWh = showers * (20-9) * 0.052 * 365 * 0.5 * 5; savedollars = savekWh * powercost; savewater = (20-9) * showers * 365 * 5; TotalsavekWh = TotalsavekWh + savekWh; savewatertotal = savewatertotal + savewater; Totalsavedollars = Totalsavedollars + savedollars; ResultsOut = ResultsOut + "Showers savings $" + Math.round(savedollars* 100)/100 + ", " + Math.round(savekWh* 100)/100 + "kWh, Water saved " + Math.round(savewater) + " litres. Calc = showers x (20old-9new)litres/min x 0.052kWh(to heat 1 litre of water) x 0.5 (50% hot water) x 5 min showers x 365 days. \r"; document.myForm.ResultsOut.value = ResultsOut; } if (taps > 0) { savekWh = taps * (20-5) * 0.052 * 365 * 0.5; savedollars = savekWh * powercost; savewater = (20-5) * taps * 365; TotalsavekWh = TotalsavekWh + savekWh; savewatertotal = savewatertotal + savewater; Totalsavedollars = Totalsavedollars + savedollars; ResultsOut = ResultsOut + "Taps savings $" + Math.round(savedollars* 100)/100 + ", " + Math.round(savekWh* 100)/100 + "kWh, Water saved " + Math.round(savewater) + " litres. Calc = taps min x (20old-5new)litres/min x 0.052kWh(to heat 1 litre of water) x 0.5 (50% hot water) x 365 days. \r"; document.myForm.ResultsOut.value = ResultsOut; } if (computers > 0) { savekWh = 0.38 * 0.2 * 24 * 365 * computers; savedollars = savekWh * powercost; TotalsavekWh = TotalsavekWh + savekWh; Totalsavedollars = Totalsavedollars + savedollars; ResultsOut = ResultsOut + "Computer savings $" + Math.round(savedollars* 100)/100 + ", " + Math.round(savekWh* 100)/100 + "kWh. Calc= 38% saving x 200 watt PC x 24 hours x 365 days. \r"; document.myForm.ResultsOut.value = ResultsOut; } if (laptops > 0) { savekWh = 0.38 * 0.05 * 24 * 365 * laptops; savedollars = savekWh * powercost; TotalsavekWh = TotalsavekWh + savekWh; Totalsavedollars = Totalsavedollars + savedollars; ResultsOut = ResultsOut + "Laptop savings $" + Math.round(savedollars* 100)/100 + ", " + Math.round(savekWh* 100)/100 + "kWh. Calc= 38% saving x 50 watt laptop x 24 hours x 365 days. \r"; document.myForm.ResultsOut.value = ResultsOut; } if (peripheral == true) { savekWh = 0.03 * 24 * 365; savedollars = savekWh * powercost; TotalsavekWh = TotalsavekWh + savekWh; Totalsavedollars = Totalsavedollars + savedollars; ResultsOut = ResultsOut + "Peripheral savings $" + Math.round(savedollars* 100)/100 + ", " + Math.round(savekWh* 100)/100 + "kWh. Calc = 30 watts x 24 hours x 365 days. \r"; document.myForm.ResultsOut.value = ResultsOut; } if (insulation == true) { savedollars = yearpowercost * 0.3 * 0.4; savekWh = savedollars/powercost; TotalsavekWh = TotalsavekWh + savekWh; Totalsavedollars = Totalsavedollars + savedollars; ResultsOut = ResultsOut + "Insulation savings $" + Math.round(savedollars* 100)/100 + ", " + Math.round(savekWh* 100)/100 + "kWh. Calc = Year cost x 40% for heat/cooling x 30% saving. \r"; document.myForm.ResultsOut.value = ResultsOut; } if (drafts == true) { savedollars = yearpowercost * 0.3 * 0.4; savekWh = savedollars/powercost; TotalsavekWh = TotalsavekWh + savekWh; Totalsavedollars = Totalsavedollars + savedollars; ResultsOut = ResultsOut + "Drafts savings $" + Math.round(savedollars* 100)/100 + ", " + Math.round(savekWh* 100)/100 + "kWh. Calc = Year cost x 40% for heat/cooling x 30% saving. \r"; document.myForm.ResultsOut.value = ResultsOut; } if (ps3 == true) { savekWh = 0.19 * 24 * 365; savedollars = savekWh * powercost; TotalsavekWh = TotalsavekWh + savekWh; Totalsavedollars = Totalsavedollars + savedollars; ResultsOut = ResultsOut + "Playstation 3 savings $" + Math.round(savedollars* 100)/100 + ", " + Math.round(savekWh* 100)/100 + "kWh. Calc = 190 watts x 24 hours x 365 days. \r"; document.myForm.ResultsOut.value = ResultsOut; } if (xbox360 == true) { savekWh = 0.15 * 24 * 365; savedollars = savekWh * powercost; TotalsavekWh = TotalsavekWh + savekWh; Totalsavedollars = Totalsavedollars + savedollars; ResultsOut = ResultsOut + "Xbox 360 savings $" + Math.round(savedollars* 100)/100 + ", " + Math.round(savekWh* 100)/100 + "kWh. Calc = 150 watts x 24 hours x 365 days. \r"; document.myForm.ResultsOut.value = ResultsOut; } if (hifi == true) { savekWh = 0.03 * 24 * 365; savedollars = savekWh * powercost; TotalsavekWh = TotalsavekWh + savekWh; Totalsavedollars = Totalsavedollars + savedollars; ResultsOut = ResultsOut + "Hifi savings $" + Math.round(savedollars* 100)/100 + ", " + Math.round(savekWh* 100)/100 + "kWh. Calc = 30 watts x 24 hours x 365 days. \r"; document.myForm.ResultsOut.value = ResultsOut; } if (dvd == true) { savekWh = 0.02 * 24 * 365; savedollars = savekWh * powercost; TotalsavekWh = TotalsavekWh + savekWh; Totalsavedollars = Totalsavedollars + savedollars; ResultsOut = ResultsOut + "DVD savings $" + Math.round(savedollars* 100)/100 + ", " + Math.round(savekWh* 100)/100 + "kWh. Calc = 20 watts x 24 hours x 365 days. \r"; document.myForm.ResultsOut.value = ResultsOut; } document.myForm.yearkwh.value = Math.round(TotalsavekWh); document.myForm.yearsaved.value = Math.round(Totalsavedollars); document.myForm.savewatertotal.value = Math.round(savewatertotal); document.myForm.yearco2saved.value = Math.round(TotalsavekWh); }