var Cost = 0.194; // the cost of kWh var SummerCost = 0.2 var WinterCost = 0.187 var GasTherm = 1.133 var AppWatts = new Array(16) //GENERAL APPLIANCES (ELECTRIC) { AppWatts[0] = 35; //CD, DVD or VCR player AppWatts[1] = 4; //Clock Radio AppWatts[2] = 40; //Curling Iron AppWatts[3] = 150; //Electric Blanket AppWatts[4] = 15; //Electric Shaver AppWatts[5] = 1200; //Hair Dryer AppWatts[6] = 60; //Heating Pad AppWatts[7] = 1000; //Iron AppWatts[8] = 1000; //Lawn Mower AppWatts[9] = 100; //Stereo with tape and/or CD player AppWatts[10] = 100; //TV - Small Color AppWatts[11] = 200; //TV - Large Color AppWatts[12] = 700; //Vacuum Cleaner AppWatts[13] = 350; //Water Bed (Any Size) } var AppWattsKitchen = new Array(33) //KITCHEN APPLIANCES (ELECTRIC) { AppWattsKitchen[0] = 350; //Blender AppWattsKitchen[1] = 900; //Coffee Maker AppWattsKitchen[2] = "N/A"; //Dishwasher AppWattsKitchen[3] = 1200; //Electric Frying Pan AppWattsKitchen[4] = 1200; //Microwave Oven AppWattsKitchen[5] = 125; //Mixer AppWattsKitchen[6] = 1250; //Range, small burner AppWattsKitchen[7] = 3500; //Range, oven AppWattsKitchen[8] = "N/A"; //Refrig. & Freezers AppWattsKitchen[9] = 1100; //Toaster AppWattsKitchen[10] = 1200; //Toaster Oven AppWattsKitchen[11] = 400; //Trash Compactor AppWattsKitchen[12] = 1200; //Waffle Iron } var HomOffWatts = new Array(7) { HomOffWatts[0] = "270,60"; //CPU with Monitor HomOffWatts[1] = "40,11"; //Ink Jet Small HomOffWatts[2] = "50,12"; //Ink Jet Med HomOffWatts[3] = "340,70"; //Laser Small HomOffWatts[4] = "530,70"; //Laser Med HomOffWatts[5] = "38,6"; //Multifunction Small HomOffWatts[6] = "50,10"; //Multifunction Med } var light = new Array(7) { light[0]= 1.0; light[1]=1.0; light[2]=1.15; light[3]=1.125; light[4] =1.1; light[5] =1.0; light[6] =1.0; } var G2REFRIGE_AGE_LESS_THAN_10_YEARS = 0; var G2REFRIGE_AGE_GREATER_THAN_9_YEARS = 1; var G2REFRIGE_AGE_GREATER_THAN_15_YEARS = 2; var G2REFRIGE_AGE_GREATER_THAN_80_YEARS = 3; var G2REFRIGE_SIZE_SMALL_REFRIGE = 0; var G2REFRIGE_SIZE_LARGE_REFRIGE = 1; var G2REFRIGE_SIZE_SMALL_STAND_ALONE_FREEZER_CHEST = 2; var G2REFRIGE_SIZE_SMALL_STAND_ALONE_FREEZER_UPRIGHT = 3; var G2REFRIGE_SIZE_LARGE_STAND_ALONE_FREEZER_CHEST = 4; var G2REFRIGE_SIZE_LARGE_STAND_ALONE_FREEZER_UPRIGHT = 5; var RefrigeFactor = new Array(4) { RefrigeFactor[0] = new Array(6); { RefrigeFactor[G2REFRIGE_AGE_LESS_THAN_10_YEARS][G2REFRIGE_SIZE_SMALL_REFRIGE] = 57; RefrigeFactor[G2REFRIGE_AGE_LESS_THAN_10_YEARS][G2REFRIGE_SIZE_LARGE_REFRIGE] = 69; RefrigeFactor[G2REFRIGE_AGE_LESS_THAN_10_YEARS][G2REFRIGE_SIZE_SMALL_STAND_ALONE_FREEZER_CHEST] = 31; RefrigeFactor[G2REFRIGE_AGE_LESS_THAN_10_YEARS][G2REFRIGE_SIZE_SMALL_STAND_ALONE_FREEZER_UPRIGHT] = 42; RefrigeFactor[G2REFRIGE_AGE_LESS_THAN_10_YEARS][G2REFRIGE_SIZE_LARGE_STAND_ALONE_FREEZER_CHEST] = 48; RefrigeFactor[G2REFRIGE_AGE_LESS_THAN_10_YEARS][G2REFRIGE_SIZE_LARGE_STAND_ALONE_FREEZER_UPRIGHT] = 69; } RefrigeFactor[1] = new Array(6); { RefrigeFactor[G2REFRIGE_AGE_GREATER_THAN_9_YEARS][G2REFRIGE_SIZE_SMALL_REFRIGE] = 80; RefrigeFactor[G2REFRIGE_AGE_GREATER_THAN_9_YEARS][G2REFRIGE_SIZE_LARGE_REFRIGE] = 103; RefrigeFactor[G2REFRIGE_AGE_GREATER_THAN_9_YEARS][G2REFRIGE_SIZE_SMALL_STAND_ALONE_FREEZER_CHEST] = 38; RefrigeFactor[G2REFRIGE_AGE_GREATER_THAN_9_YEARS][G2REFRIGE_SIZE_SMALL_STAND_ALONE_FREEZER_UPRIGHT] = 51; RefrigeFactor[G2REFRIGE_AGE_GREATER_THAN_9_YEARS][G2REFRIGE_SIZE_LARGE_STAND_ALONE_FREEZER_CHEST] = 58; RefrigeFactor[G2REFRIGE_AGE_GREATER_THAN_9_YEARS][G2REFRIGE_SIZE_LARGE_STAND_ALONE_FREEZER_UPRIGHT] = 84; } RefrigeFactor[2] = new Array(6); { RefrigeFactor[G2REFRIGE_AGE_GREATER_THAN_15_YEARS][G2REFRIGE_SIZE_SMALL_REFRIGE] = 109; RefrigeFactor[G2REFRIGE_AGE_GREATER_THAN_15_YEARS][G2REFRIGE_SIZE_LARGE_REFRIGE] = 132; RefrigeFactor[G2REFRIGE_AGE_GREATER_THAN_15_YEARS][G2REFRIGE_SIZE_SMALL_STAND_ALONE_FREEZER_CHEST] = 48; RefrigeFactor[G2REFRIGE_AGE_GREATER_THAN_15_YEARS][G2REFRIGE_SIZE_SMALL_STAND_ALONE_FREEZER_UPRIGHT] = 65; RefrigeFactor[G2REFRIGE_AGE_GREATER_THAN_15_YEARS][G2REFRIGE_SIZE_LARGE_STAND_ALONE_FREEZER_CHEST] = 74; RefrigeFactor[G2REFRIGE_AGE_GREATER_THAN_15_YEARS][G2REFRIGE_SIZE_LARGE_STAND_ALONE_FREEZER_UPRIGHT] = 107; } RefrigeFactor[3] = new Array(6); { RefrigeFactor[G2REFRIGE_AGE_GREATER_THAN_80_YEARS][G2REFRIGE_SIZE_SMALL_REFRIGE] = 125; RefrigeFactor[G2REFRIGE_AGE_GREATER_THAN_80_YEARS][G2REFRIGE_SIZE_LARGE_REFRIGE] = 152; RefrigeFactor[G2REFRIGE_AGE_GREATER_THAN_80_YEARS][G2REFRIGE_SIZE_SMALL_STAND_ALONE_FREEZER_CHEST] = 58; RefrigeFactor[G2REFRIGE_AGE_GREATER_THAN_80_YEARS][G2REFRIGE_SIZE_SMALL_STAND_ALONE_FREEZER_UPRIGHT] = 79; RefrigeFactor[G2REFRIGE_AGE_GREATER_THAN_80_YEARS][G2REFRIGE_SIZE_LARGE_STAND_ALONE_FREEZER_CHEST] = 91; RefrigeFactor[G2REFRIGE_AGE_GREATER_THAN_80_YEARS][G2REFRIGE_SIZE_LARGE_STAND_ALONE_FREEZER_UPRIGHT] = 130; } } ///EDH 4.0 NEW REFRIG & FREEZER KWH ARRAYS var RFless10 = new Array(7) // kWh per year for R&F less than 10 yr old { RFless10[0] = 420; //Small less than 11 cu ft RFless10[1] = 660; //Med 11 to 18 cu ft RFless10[2] = 760; //Lg more than 18 cu ft RFless10[3] = 400; //Sm stand-alone chest freezer RFless10[4] = 540; //Sm stand-alone upright freezer RFless10[5] = 780; //Lg stand-alone chest freezer RFless10[6] = 830; //Lg stand-alone upright freezer } var RFmore10 = new Array(7) // kWh per year for R&F more than 10 yr old { RFmore10[0] = 672; //Small less than 11 cu ft RFmore10[1] = 1026; //Med 11 to 18 cu ft RFmore10[2] = 1380; //Lg more than 18 cu ft RFmore10[3] = 612; //Sm stand-alone chest freezer RFmore10[4] = 672; //Sm stand-alone upright freezer RFmore10[5] = 1236; //Lg stand-alone chest freezer RFmore10[6] = 1296; //Lg stand-alone upright freezer } //------------------------------------- Group 3 --------------------- var G3DISHWASHER = 0 var G35WASHER = 1 var G35DRYER = 2 var AppFactors = new Array(3) { AppFactors[0] = 0.75 //KWH/load factors for washing machines AppFactors[1] = 0.33 AppFactors[2] = 2.55 } var temp = new Array(3) { temp[0]=0.5; temp[1]=0.52; temp[2]=0.56; } var AgeWaterHeat = new Array(3) { AgeWaterHeat[0]=115; AgeWaterHeat[1]=125; AgeWaterHeat[2]=140; } //------------------------------------- Group 4 --------------------- var G5SIZE_SMALL = 0; var G5SIZE_MEDIUM = 1; var G5SIZE_LARGE = 2 var G5SIZE_EXTRA_LARGE = 3 var G5TEMP_LOW = 0 var G5TEMP_MEDIUM = 1 var G5TEMP_HIGH = 2 var G5AGE_GREATER_THAN_9_YEARS = 0 var G5AGE_5_TO_10_YEARS = 1 var G5AGE_LESS_THAN_5_YEARS = 2 var StandByLoss = new Array(4) { StandByLoss[0] = new Array(3) { StandByLoss[0][0] = 575; StandByLoss[0][1] = 720; StandByLoss[0][2] = 912; } StandByLoss[1] = new Array(3) { StandByLoss[1][0] = 847; StandByLoss[1][1] = 1059; StandByLoss[1][2] = 1341; } StandByLoss[2] = new Array(3) { StandByLoss[2][0] = 1088 StandByLoss[2][1] = 1360 StandByLoss[2][2] = 1723 } StandByLoss[3] = new Array(3) { StandByLoss[3][0] = 1398 StandByLoss[3][1] = 1748 StandByLoss[3][2] = 2208 } } var HeatLoss = new Array(5) { HeatLoss[0] = new Array(3) { HeatLoss[0][0] = 15; HeatLoss[0][1] = 17; HeatLoss[0][2] = 19; } HeatLoss[1] = new Array(3) { HeatLoss[1][0] = 17; HeatLoss[1][1] = 19; HeatLoss[1][2] = 21; } HeatLoss[2] = new Array(3) { HeatLoss[2][0] = 19; HeatLoss[2][1] = 21; HeatLoss[2][2] = 24; } HeatLoss[3] = new Array(3) { HeatLoss[3][0] = 21; HeatLoss[3][1] = 23; HeatLoss[3][2] = 26; } HeatLoss[4] = new Array(3) { HeatLoss[4][0] = 23; HeatLoss[4][1] = 25; HeatLoss[4][2] = 29; } } var HeatGain = new Array(5) { HeatGain[0] = new Array(3) { HeatGain[0][0] = 21; HeatGain[0][1] = 23; HeatGain[0][2] = 26; } HeatGain[1] = new Array(3) { HeatGain[1][0] = 19; HeatGain[1][1] = 21; HeatGain[1][2] = 24; } HeatGain[2] = new Array(3) { HeatGain[2][0] = 17; HeatGain[2][1] = 19; HeatGain[2][2] = 21; } HeatGain[3] = new Array(3) { HeatGain[3][0] = 16; HeatGain[3][1] = 18; HeatGain[3][2] = 20; } HeatGain[4] = new Array(3) { HeatGain[4][0] = 15; HeatGain[4][1] = 17; HeatGain[4][2] = 19; } } var HeatLoad = new Array(5) { HeatLoad[0] = 1600; HeatLoad[1] = 1800; HeatLoad[2] = 2150; HeatLoad[3] = 2500; HeatLoad[4] = 2900; } var CoolLoad = new Array(5) { CoolLoad[0] = 2500; CoolLoad[1] = 2000; CoolLoad[2] = 1200; CoolLoad[3] = 700; CoolLoad[4] = 500; } var TemperatureValue = new Array(3) { TemperatureValue[0] = 115 TemperatureValue[1] = 125 TemperatureValue[2] = 140 } var Efficiency = new Array(4) { Efficiency[0] = new Array(4) { Efficiency[0][0] = 0.85 Efficiency[0][1] = 0.87 Efficiency[0][2] = 0.89 Efficiency[0][3] = 0.91 } Efficiency[1] = new Array(4) { Efficiency[1][0] = 0.84 Efficiency[1][1] = 0.86 Efficiency[1][2] = 0.88 Efficiency[1][3] = 0.90 } Efficiency[2] = new Array(4) { Efficiency[2][0] = 0.80 Efficiency[2][1] = 0.82 Efficiency[2][2] = 0.84 Efficiency[2][3] = 0.86 } Efficiency[3] = new Array(4) { Efficiency[3][0] = 0.78 Efficiency[3][1] = 0.80 Efficiency[3][2] = 0.82 Efficiency[3][3] = 0.84 } } //------------------------------------- Group 5 --------------------- var HeatCoolWatts = new Array(14) { HeatCoolWatts[0] = "N/A"; //Electric furnace HeatCoolWatts[1] = "N/A"; //Heat pump (Cooling) HeatCoolWatts[2] = "N/A"; //Heat pump (Heating) HeatCoolWatts[3] = "N/A"; //Electric central air conditioner HeatCoolWatts[4] = "N/A"; //Window air conditioner HeatCoolWatts[5] = 50; //Central air cleaner HeatCoolWatts[6] = 115; //Central humidifier HeatCoolWatts[7] = 88; //Portable humidifier HeatCoolWatts[8] = 785; //Dehumidifier HeatCoolWatts[9] = 375; //Attic fan HeatCoolWatts[10] = 100; //Ceiling fan HeatCoolWatts[11] = 150; //Portable fan HeatCoolWatts[12] = 1500; //Portable electric heater HeatCoolWatts[13] = 400; //Furnace fan blower, std eff } var HeatCoolRates = new Array(14) { HeatCoolRates[0] = WinterCost //Electric furnace HeatCoolRates[1] = WinterCost //Heat pump (Cooling) HeatCoolRates[2] = SummerCost //Heat pump (Heating) HeatCoolRates[3] = SummerCost //Electric central air conditioner HeatCoolRates[4] = SummerCost //Window air conditioner HeatCoolRates[5] = Cost //Central air cleaner HeatCoolRates[6] = WinterCost //Central humidifier HeatCoolRates[7] = WinterCost //Portable humidifier HeatCoolRates[8] = SummerCost //Dehumidifier HeatCoolRates[9] = SummerCost //Attic fan HeatCoolRates[10] = SummerCost //Ceiling fan HeatCoolRates[11] = SummerCost //Portable fan HeatCoolRates[12] = WinterCost //Portable electric heater HeatCoolRates[13] = WinterCost //Electric blanket } var G5AGE_GREATER_THAN_15_YEARS = 0 var G5AGE_10_TO_5_YEARS = 1 var G5AGE_5_TO_10_YEARS = 2 var G5AGE_LESS_THAN_5_YEARS = 3 var SEER = new Array(4) { SEER[G5AGE_GREATER_THAN_15_YEARS] = 6 SEER[G5AGE_10_TO_5_YEARS] = 7 SEER[G5AGE_5_TO_10_YEARS] = 8 SEER[G5AGE_LESS_THAN_5_YEARS] = 9 } var HSPF = new Array(4) { HSPF[G5AGE_GREATER_THAN_15_YEARS] = 5 HSPF[G5AGE_10_TO_5_YEARS] = 6 HSPF[G5AGE_5_TO_10_YEARS] = 6.5 HSPF[G5AGE_LESS_THAN_5_YEARS] = 7 } var EER = new Array(4) { EER[G5AGE_GREATER_THAN_15_YEARS] = 6 EER[G5AGE_10_TO_5_YEARS] = 7 EER[G5AGE_5_TO_10_YEARS] = 8.5 EER[G5AGE_LESS_THAN_5_YEARS] = 10 } //------------------------------------- Group 6 --------------------- var LightWatts = new Array(5) { LightWatts[0] = 1.0; //Incandescent LightWatts[1] = 1.10; //Flourescent Standard Ballast LightWatts[2] = 1.125; //Flourescent High Efficiency Ballast LightWatts[3] = 1.15; //Flourescent Electronic Ballast LightWatts[4] = 1.0; //Halogen } /////////////////////////////////////////////////////////////////////////////// // Functions ////////////////////////////////////////////////////////////////////////////// function isWhiteSpace(sInput) { var whiteSpace = " \t\n\r"; if (sInput==null||sInput.length==0) return true; for(i=0; i "9") { return false; } } return true; } function isPositiveInteger(inputVal) { var inputStr = inputVal.toString(); if (isWhiteSpace(inputVal)) return false; for (var i=0; i < inputStr.length; i++) { var oneChar = inputStr.charAt(i) if (oneChar <"0" || oneChar > "9") { return false; } } return true; } function GetCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j);i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } function getCookieVal (offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } /////////////////////////////////////////////////////////////////////////////// //function G1Calatate /////////////////////////////////////////////////////////////////////////////////////////////// function G1ChangeValue() { document.frm1.txtG1Wattage.value = AppWatts[document.frm1.sel1G1App.selectedIndex] if (document.frm1.sel1G1App.selectedIndex != -1) { document.frm1.txtG1Dollars.value="" document.frm1.txtG1kWh.value="" } } /////////////////////////////////////////////////////////////////////////////////////////////// function G1Calculate() { if (document.frm1.sel1G1App.selectedIndex == 0) CycFact = 0.35 else if (document.frm1.sel1G1App.selectedIndex == 1) CycFact = 0.35 else CycFact = 1 if (!(isPositiveNumber(document.frm1.txtG1Wattage.value) && (document.frm1.txtG1Wattage.value >= 1 )&&(document.frm1.txtG1Wattage.value <10001 ))) { alert("\"Assumed Wattage\" must be a number from 1 to 10000 "); document.frm1.txtG1Wattage.focus(); document.frm1.txtG1Wattage.select(); return false; } if (!(isPositiveNumber(document.frm1.txtG1Qty.value) && (document.frm1.txtG1Qty.value >=1 )&& (document.frm1.txtG1Qty.value <31 ))) { alert("\"Quantity\" must be a number from 1 to 30" ); document.frm1.txtG1Qty.focus(); document.frm1.txtG1Qty.select(); return false; } if (!(isPositiveNumber(document.frm1.txtG1Hours.value) && (document.frm1.txtG1Hours.value >=1 )&&(document.frm1.txtG1Hours.value <169 ))) { alert("\"Average hours per week\" must be a number from 1 to 168"); document.frm1.txtG1Hours.focus(); document.frm1.txtG1Hours.select(); return false; } document.frm1.hid1.value=document.frm1.sel1G1App.selectedIndex; kWhs = document.frm1.txtG1Qty.value *document.frm1.txtG1Wattage.value * CycFact *document.frm1.txtG1Hours.value * 52 / 1000 Dollars = parseFloat(kWhs) * Cost document.frm1.txtG1kWh.value = parseInt(kWhs) document.frm1.txtG1Dollars.value =(Dollars>=1)? parseInt(Dollars): "< $1" document.frm1.submit(); return true; } /////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// function G2ChangeValue() { if (document.frm2.sel1G2Size.selectedIndex != -1 ) { document.frm2.txtG2Dollars.value="" document.frm2.txtG2kWh.value="" } } function G2Calculate() { if (document.frm2.sel2G2Age.selectedIndex == 0) { kWhs = RFless10[document.frm2.sel1G2Size.selectedIndex]; } if (document.frm2.sel2G2Age.selectedIndex == 1) { kWhs = RFmore10[document.frm2.sel1G2Size.selectedIndex]; } Dollars = kWhs * Cost document.frm2.txtG2kWh.value = parseInt(kWhs) document.frm2.txtG2Dollars.value =(Dollars>=1)? parseInt(Dollars): "< $1" return true; } /////////////////////////////////////////////////////////////////////////////// function G3ChangeValue() { if (document.frm3.sel1G3App.selectedIndex != -1 ) { document.frm3.txtG3Dollars.value="" document.frm3.txtG3kWh.value="" } document.frm3.txtG3Loads.value=1; document.frm3.txtG3Loads.focus(); document.frm3.txtG3Loads.select(); } /////////////////////////////////////////////////////////////////////////////// function G3Calculate() { if (!(isPositiveNumber(document.frm3.txtG3Loads.value) && document.frm3.txtG3Loads.value >=0 && document.frm3.txtG3Loads.value <31 )) { alert("\"Loads Per Week\" must be a number from 0 to 30"); document.frm3.txtG3Loads.focus(); document.frm3.txtG3Loads.select(); return false; } document.frm3.hid1.value = document.frm3.sel1G3App.selectedIndex; kWhs = (parseFloat(document.frm3.txtG3Loads.value) * AppFactors[document.frm3.sel1G3App.selectedIndex] * 52) Dollars = kWhs * Cost document.frm3.txtG3kWh.value = parseInt(kWhs) document.frm3.txtG3Dollars.value =(Dollars>=1)? parseInt(Dollars): "< $1" document.frm3.submit(); return true; } ////////////////////////////////////////// function G4ChangeValue() { if (document.frm4.sel1G4App.selectedIndex != -1 ) { document.frm4.txtG4Dollars.value="" document.frm4.txtG4kWh.value="" } if (document.frm4.sel1G4App.selectedIndex != 1) { document.frm4.txtG4Percent.value = "N/A" document.frm4.txtG4Loads.value=1; document.frm4.txtG4Loads.focus(); document.frm4.txtG4Loads.select(); } else { document.frm4.txtG4Loads.value=1; document.frm4.txtG4Loads.focus(); document.frm4.txtG4Loads.select(); document.frm4.txtG4Percent.value = "" } } /////////////////////////////////////////////////////////////////////////////// function G4Calculate() { if (document.frm4.sel1G4App.selectedIndex !=1 ) { if (!(isPositiveNumber(document.frm4.txtG4Loads.value) && document.frm4.txtG4Loads.value >=0 && document.frm4.txtG4Loads.value <31 )) { alert("\"Loads Per Week\" must be a number from 0 to 30"); document.frm4.txtG4Loads.focus(); document.frm4.txtG4Loads.select(); return false; } } else { if (!(isPositiveNumber(document.frm4.txtG4Loads.value) && document.frm4.txtG4Loads.value >=0 && document.frm4.txtG4Loads.value <31 )) { alert("\"Loads Per Week\" must be a number from 0 to 30"); document.frm4.txtG4Loads.focus(); document.frm4.txtG4Loads.select(); return false; } if (!(isPositiveNumber(document.frm4.txtG4Percent.value) && document.frm4.txtG4Percent.value >=0 && document.frm4.txtG4Percent.value <101 )) { alert("\"Percentage of line-dried clothes in the summer\" must be a number from 0 to 100"); document.frm4.txtG4Percent.focus(); document.frm4.txtG4Percent.select(); return false; } } document.frm4.hid1.value = document.frm4.sel1G4App.selectedIndex; if (document.frm4.sel1G4App.selectedIndex==1 ) kWhs = (parseFloat(document.frm4.txtG4Loads.value) * 2.50 * 52) - (document.frm4.txtG4Loads.value * 2.50 * (document.frm4.txtG4Percent.value / 100) * 13) else kWhs = (parseFloat(document.frm4.txtG4Loads.value) * .38 * 52) Dollars = kWhs * Cost document.frm4.txtG4kWh.value = parseInt(kWhs) document.frm4.txtG4Dollars.value =(Dollars>=1)? parseInt(Dollars): "< $1" document.frm4.submit(); return true; } /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// function G5ChangeValue() { if (document.frm5.sel2G5Size.selectedIndex != -1 || document.frm5.sel3G5Temperature.selectedIndex != -1 || document.frm5.sel1G5Age.selectedIndex != -1) { document.frm5.txtG5Dollars.value="" document.frm5.txtG5kWh.value="" } } function G5Calculate() { if (!(isPositiveInteger(document.frm5.txtG5Occupants.value) && document.frm5.txtG5Occupants.value >= 1 && document.frm5.txtG5Occupants.value <15)) { alert("\"Number of Occupants\" must be from 0 to 15"); document.frm5.txtG5Occupants.focus(); document.frm5.txtG5Occupants.select(); return false; } if (document.frm5.sel4G5Insulation.selectedIndex == 1) { temp1 = 20 + parseInt(document.frm5.txtG5Occupants.value) * 12.5; temp2 = temp1 * 8.33 * 365 * (TemperatureValue[document.frm5.sel3G5Temperature.selectedIndex] - 61); kWhs = temp2 / 3413 * .95; } else { //kWhs = (StandByLoss[document.frm5.sel2G5Size.selectedIndex][document.frm5.sel3G5Temperature.selectedIndex]) + ((20 + (parseInt(document.frm5.txtG5Occupants.value) * 12.5) * 8.33 * 365 * (TemperatureValue[document.frm5.sel3G5Temperature.selectedIndex] - 61)) / (3413 * Efficiency[document.frm5.sel1G5Age.selectedIndex][document.frm5.sel2G5Size.selectedIndex])) tmp1 = 20 + (parseInt(document.frm5.txtG5Occupants.value) * 12.5); tmp2 = 8.33 * 365 * (TemperatureValue[document.frm5.sel3G5Temperature.selectedIndex] - 61); tmp3 = 3413 * Efficiency[document.frm5.sel1G5Age.selectedIndex][document.frm5.sel2G5Size.selectedIndex]; kWhs = tmp1 * tmp2 / tmp3; } Dollars = kWhs * Cost document.frm5.hid1.value=document.frm5.sel1G5Age.selectedIndex; document.frm5.hid2.value=document.frm5.sel2G5Size.selectedIndex document.frm5.hid3.value=document.frm5.sel3G5Temperature.selectedIndex; document.frm5.hid4.value=document.frm5.sel4G5Insulation.selectedIndex; document.frm5.txtG5kWh.value = parseInt(kWhs) document.frm5.txtG5Dollars.value =(Dollars>=1)? parseInt(Dollars): "< $1" document.frm5.submit(); return true; } /////////////////////////////////////////////////////////////////////////////// function G6ChangeValue() { document.frm6.txtG6Wattage.value = HeatCoolWatts[document.frm6.sel1G6App.selectedIndex]; if (document.frm6.sel1G6App.selectedIndex != -1 ) { document.frm6.txtG6Dollars.value="" document.frm6.txtG6kWh.value="" } //For electric furnace, heat pump (heating), heat pump (cooling), electric central AC if ((document.frm6.sel1G6App.selectedIndex > -1) && (document.frm6.sel1G6App.selectedIndex < 4)) { if ( document.frm6.sel1G6App.selectedIndex ==0 ) document.frm6.sel2G6Age.selectedIndex=4; else document.frm6.sel2G6Age.selectedIndex=0; document.frm6.txtG6BTU.value = "N/A" document.frm6.txtG6SQFootage.value = "2000" document.frm6.txtG6Hours.value = "N/A" document.frm6.txtG6Weeks.value = "N/A" document.frm6.sel4G6Insul.selectedIndex=0; document.frm6.sel3G6Loc.selectedIndex= 0; } //For window AC else if (document.frm6.sel1G6App.selectedIndex == 4) { document.frm6.sel2G6Age.selectedIndex = 0; document.frm6.txtG6SQFootage.value = "N/A"; document.frm6.txtG6BTU.value = 12000; document.frm6.txtG6Hours.value = "0"; document.frm6.txtG6Hours.focus(); document.frm6.txtG6Hours.select(); document.frm6.txtG6Weeks.value = "0" document.frm6.sel3G6Loc.selectedIndex= 5; document.frm6.sel4G6Insul.selectedIndex=3; } //For central air cleaner, central humidifier else if ((document.frm6.sel1G6App.selectedIndex == 5) || (document.frm6.sel1G6App.selectedIndex == 6)) { document.frm6.sel2G6Age.selectedIndex = 4; document.frm6.txtG6SQFootage.value = "N/A"; document.frm6.txtG6Hours.value = "N/A"; document.frm6.txtG6Weeks.value = "N/A"; document.frm6.txtG6BTU.value = "N/A"; document.frm6.sel4G6Insul.selectedIndex=3; if (document.frm6.sel1G6App.selectedIndex == 6) document.frm6.sel3G6Loc.selectedIndex= 0; else document.frm6.sel3G6Loc.selectedIndex= 5; } //For portable electric heater and everything else else { document.frm6.sel2G6Age.selectedIndex = 4 document.frm6.txtG6SQFootage.value = "N/A" document.frm6.txtG6Hours.value = "0" document.frm6.txtG6Hours.focus(); document.frm6.txtG6Hours.select(); document.frm6.txtG6Weeks.value = "0" document.frm6.txtG6BTU.value = "N/A" document.frm6.sel4G6Insul.selectedIndex=3; document.frm6.sel3G6Loc.selectedIndex= 5; } } /////////////////////////////////////////////////////////////////////////////// function G6Calculate() { //document.frm6.txtG6Wattage.value= HeatCoolWatts[document.frm6.sel1G6App.selectedIndex]; if ((document.frm6.sel1G6App.selectedIndex > -1) && (document.frm6.sel1G6App.selectedIndex < 4)) { if (!(isPositiveNumber(document.frm6.txtG6SQFootage.value) && (document.frm6.txtG6SQFootage.value >=1 )&& (document.frm6.txtG6SQFootage.value <6001 ))) { alert("\"Square feet of conditioned space\" must be a number from 1 to 6000" ); document.frm6.txtG6SQFootage.focus(); document.frm6.txtG6SQFootage.select(); return false; } } //if (document.frm6.sel1G6App.selectedIndex == 4 || document.frm6.sel1G6App.selectedIndex >4 ) //{ if (document.frm6.sel1G6App.selectedIndex == 4) { if (!(isPositiveNumber(document.frm6.txtG6BTU.value) && (document.frm6.txtG6BTU.value >=1 )&& (document.frm6.txtG6BTU.value <1000000 ))) { alert("\"BTU Per Hour\" must be a number from 1 to 1000000 " ); document.frm6.txtG6BTU.focus(); document.frm6.txtG6BTU.select(); return false; } } if (document.frm6.sel1G6App.selectedIndex ==6 ) { if (document.frm6.sel3G6Loc.selectedIndex==5) { alert("Please Select valid \"Location\"") document.frm6.sel3G6Loc.selectedIndex= 0; return false; } } if ((document.frm6.sel1G6App.selectedIndex ==0)||(document.frm6.sel1G6App.selectedIndex ==1)||(document.frm6.sel1G6App.selectedIndex ==2)||(document.frm6.sel1G6App.selectedIndex ==3)) { if (document.frm6.sel3G6Loc.selectedIndex==5) { alert("Please Select Valid \"Location\"") document.frm6.sel3G6Loc.selectedIndex= 0; return false; } } if (document.frm6.sel1G6App.selectedIndex ==0 || document.frm6.sel1G6App.selectedIndex ==1 || document.frm6.sel1G6App.selectedIndex ==2 || document.frm6.sel1G6App.selectedIndex ==3) { if (document.frm6.sel4G6Insul.selectedIndex==3) { alert("Please Select Valid \"Insulation\"") document.frm6.sel4G6Insul.selectedIndex= 0; return false; } } if ((document.frm6.sel1G6App.selectedIndex ==1 )||(document.frm6.sel1G6App.selectedIndex ==2 )||(document.frm6.sel1G6App.selectedIndex ==3 )||(document.frm6.sel1G6App.selectedIndex ==4)) { if (document.frm6.sel2G6Age.selectedIndex==4) { alert("Please Select Valid \"Age of System\"") document.frm6.sel2G6Age.selectedIndex = 0; return false; } } if (document.frm6.sel1G6App.selectedIndex==4) { if (!(isPositiveNumber(document.frm6.txtG6Hours.value) && (document.frm6.txtG6Hours.value >=1 )&& (document.frm6.txtG6Hours.value <169 ))) { alert("\"Average hours per week\" must be a number from 1 to 168" ); document.frm6.txtG6Hours.focus(); document.frm6.txtG6Hours.select(); return false; } if (!(isPositiveNumber(document.frm6.txtG6Weeks.value) && (document.frm6.txtG6Weeks.value >=1 )&& (document.frm6.txtG6Weeks.value <53 ))) { alert("\"Weeks per Year\" must be a number from 1 to 52" ); document.frm6.txtG6Weeks.focus(); document.frm6.txtG6Weeks.select(); return false; } } if (document.frm6.sel1G6App.selectedIndex >6 ) { if (!(isPositiveNumber(document.frm6.txtG6Hours.value) && (document.frm6.txtG6Hours.value >=1 )&& (document.frm6.txtG6Hours.value <169 ))) { alert("\"Average hours per week\" must be a number from 1 to 168" ); document.frm6.txtG6Hours.focus(); document.frm6.txtG6Hours.select(); return false; } if (!(isPositiveNumber(document.frm6.txtG6Weeks.value) && (document.frm6.txtG6Weeks.value >=1 )&& (document.frm6.txtG6Weeks.value <53 ))) { alert("\"Weeks per Year\" must be a number from 1 to 52" ); document.frm6.txtG6Weeks.focus(); document.frm6.txtG6Weeks.select(); return false; } if (!(isPositiveNumber(document.frm6.txtG6Wattage.value) && (document.frm6.txtG6Wattage.value >=1 )&& (document.frm6.txtG6Wattage.value <100000 ))) { alert("\"Wattage\" must be a positive number " ); document.frm6.txtG6Wattage.focus(); document.frm6.txtG6Wattage.select(); return false; } } // } // Electric furnace if (document.frm6.sel1G6App.selectedIndex == 0) kWhs = 0.77 * document.frm6.txtG6SQFootage.value * HeatLoss[document.frm6.sel3G6Loc.selectedIndex][document.frm6.sel4G6Insul.selectedIndex] * HeatLoad[document.frm6.sel3G6Loc.selectedIndex]/3413 // Heat Pump (Heating) else if (document.frm6.sel1G6App.selectedIndex == 1) { kWhs = 0.77*(document.frm6.txtG6SQFootage.value * HeatLoss[document.frm6.sel3G6Loc.selectedIndex][document.frm6.sel4G6Insul.selectedIndex]* HeatLoad[document.frm6.sel3G6Loc.selectedIndex])/(HSPF[document.frm6.sel2G6Age.selectedIndex]*1000) //fan costs kWhs = kWhs + (HeatLoad[document.frm6.sel3G6Loc.selectedIndex] * 250 / 1000); } // Electric Central air cond and Heat Pump cooling) else if (document.frm6.sel1G6App.selectedIndex == 2|| document.frm6.sel1G6App.selectedIndex == 3 ) { kWhs = (document.frm6.txtG6SQFootage.value * HeatGain[document.frm6.sel3G6Loc.selectedIndex][document.frm6.sel4G6Insul.selectedIndex]*CoolLoad[document.frm6.sel3G6Loc.selectedIndex])/(SEER[document.frm6.sel2G6Age.selectedIndex]*1000) kWhs = kWhs + (CoolLoad[document.frm6.sel3G6Loc.selectedIndex] * 250 / 1000); } // Window air conditioner else if (document.frm6.sel1G6App.selectedIndex == 4) kWhs = (document.frm6.txtG6BTU.value/EER[document.frm6.sel2G6Age.selectedIndex]) * document.frm6.txtG6Hours.value * document.frm6.txtG6Weeks.value / 1000 // Central air cleaner else if (document.frm6.sel1G6App.selectedIndex == 5) kWhs = document.frm6.txtG6Wattage.value * 2000 / 1000 // Central humidifier else if (document.frm6.sel1G6App.selectedIndex == 6) kWhs = document.frm6.txtG6Wattage.value * HeatLoad[document.frm6.sel3G6Loc.selectedIndex] / 1000 // Everything else else //greater than 6 kWhs = document.frm6.txtG6Wattage.value * document.frm6.txtG6Hours.value * document.frm6.txtG6Weeks.value / 1000 Dollars = kWhs * HeatCoolRates[document.frm6.sel1G6App.selectedIndex] if (kWhs <1) kWhs =1; document.frm6.hid1.value=document.frm6.sel1G6App.selectedIndex; document.frm6.hid2.value=document.frm6.sel2G6Age.selectedIndex; document.frm6.hid3.value=document.frm6.sel3G6Loc.selectedIndex; document.frm6.hid4.value=document.frm6.sel4G6Insul.selectedIndex; document.frm6.txtG6kWh.value = parseInt(kWhs) document.frm6.txtG6Dollars.value =(Dollars>=1)? parseInt(Dollars): "< $1" document.frm6.submit(); return true; } /////////////////////////////////////////////////////////////////////////////// function G7changeValue() //reset the initial value for the user input { if (document.frm7.sel1G7Light.selectedIndex != -1 ) { document.frm7.txtG7Dollars.value="" document.frm7.txtG7kWh.value="" } if (document.frm7.sel1G7Light.selectedIndex == 5) //halogen, torchiere document.frm7.txtG7Wattage.value= 300; else if (document.frm7.sel1G7Light.selectedIndex == 0) //compact florescent document.frm7.txtG7Wattage.value= 20; else if (document.frm7.sel1G7Light.selectedIndex == 2) //florescent standard ballast document.frm7.txtG7Wattage.value= 46; else if (document.frm7.sel1G7Light.selectedIndex == 3) //florescent HEFF ballast document.frm7.txtG7Wattage.value= 42; else if (document.frm7.sel1G7Light.selectedIndex == 4) //florescent electronic ballast document.frm7.txtG7Wattage.value= 36; else if (document.frm7.sel1G7Light.selectedIndex == 6) //halogen, low voltage document.frm7.txtG7Wattage.value= 50; else document.frm7.txtG7Wattage.value= 75; //all others } function G7Calculate() { if (!(isPositiveNumber(document.frm7.txtG7Wattage.value)&& (document.frm7.txtG7Wattage.value >= 0) && (document.frm7.txtG7Wattage.value <=600 ))) { alert("\"Bulb Wattage\" must be a number from 0 to 600" ); document.frm7.txtG7Wattage.focus(); document.frm7.txtG7Wattage.select(); return false; } if (!(isPositiveNumber(document.frm7.txtG7Qty.value)&& (document.frm7.txtG7Qty.value >= 0) && (document.frm7.txtG7Qty.value <=30))) { alert("\"Quantity\" must be a number from 0 to 30"); document.frm7.txtG7Qty.focus(); document.frm7.txtG7Qty.select(); return false; } if (!(isPositiveNumber(document.frm7.txtG7Hours.value)&& (document.frm7.txtG7Hours.value >= 0) && (document.frm7.txtG7Hours.value <=168))) { alert("\"Average hours per week\" must be a number from 0 to 168"); document.frm7.txtG7Hours.focus(); document.frm7.txtG7Hours.select(); return false; } kWhs = document.frm7.txtG7Qty.value * document.frm7.txtG7Wattage.value * document.frm7.txtG7Hours.value * light[document.frm7.sel1G7Light.selectedIndex] * 0.052; Dollars = kWhs * Cost; document.frm7.hid1.value=document.frm7.sel1G7Light.selectedIndex; document.frm7.txtG7kWh.value = (isNaN(kWhs))? "< $1": parseInt(kWhs); document.frm7.txtG7Dollars.value =(Dollars>=1)? parseInt(Dollars): "< $1" document.frm7.submit() return true; } ///////////// function G8ChangeValue() { if (document.frm8.sel1G8App.selectedIndex != -1 ) { document.frm8.txtG8Dollars.value="" document.frm8.txtG8Therms.value ="" } if (document.frm8.sel1G8App.selectedIndex != 1) document.frm8.txtG8BTU.value = 20000 else document.frm8.txtG8BTU.value = 9100 } /////////////////////////////////////////////////////////////////////////////// function G8Calculate() { if (!(isPositiveNumber(document.frm8.txtG8BTU.value)&& (document.frm8.txtG8BTU.value >= 5000) && (document.frm8.txtG8BTU.value <50001 ))) { alert("\"Assumed BTU/hour\" must be a number from 5000 to 50000" ); document.frm8.txtG8BTU.focus(); document.frm8.txtG8BTU.select(); return false; } if (!(isPositiveNumber(document.frm8.txtG8Hrs.value)&& (document.frm8.txtG8Hrs.value >= 0) && (document.frm8.txtG8Hrs.value <61))) { alert("\"Average hours per week\" must be a number from 0 to 60"); document.frm8.txtG8Hrs.focus(); document.frm8.txtG8Hrs.select(); return false; } Therms = (document.frm8.txtG8BTU.value * document.frm8.txtG8Hrs.value * 52)/100000 Dollars = Therms * GasTherm document.frm8.hid1.value = document.frm8.sel1G8App.selectedIndex; document.frm8.txtG8Therms.value = parseInt(Therms); document.frm8.txtG8Dollars.value =(Dollars>=1)? parseInt(Dollars): "< $1" document.frm8.submit(); return true; } //////////// function G9Calculate() { if (!(isPositiveNumber(document.frm9.txtG9Loads.value) && (document.frm9.txtG9Loads.value >= 0) && (document.frm9.txtG9Loads.value <37 ))) { alert("\"Loads per week\" must be a number from 0 to 36" ); document.frm9.txtG9Loads.focus(); document.frm9.txtG9Loads.select(); return false; } if (!(isPositiveNumber(document.frm9.txtG9Perc.value )&& (document.frm9.txtG9Perc.value >= 0) && (document.frm9.txtG9Perc.value <101))) { alert("\"Percent of line-dried clothes in summer\" must be a number from 0 to 100"); document.frm9.txtG9Perc.focus(); document.frm9.txtG9Perc.select(); return false; } Therms = ((document.frm9.txtG9Loads.value * 11000 * 52)-(document.frm9.txtG9Loads.value * 11000 * (document.frm9.txtG9Perc.value)/100 * 13))/100000 Dollars = Therms * GasTherm //document.frm9.hid1.value = document.frm9.sel1G9App.selectedIndex; document.frm9.txtG9Therms.value = parseInt(Therms) document.frm9.txtG9Dollars.value =(Dollars>=1)? parseInt(Dollars): "< $1" document.frm9.submit(); return true; } ////////// function G10ChangeValue() { if (document.frm10.sel2G10Age.selectedIndex != -1 ||document.frm10.sel3G10Size.selectedIndex != -1||document.frm10.sel4G10Temp.selectedIndex != -1) { document.frm10.txtG10Dollars.value="" document.frm10.txtG10Therms.value ="" } } ////////////// function G10Calculate() { var Effic = parseFloat(AgeWaterHeat[document.frm10.sel2G10Age.selectedIndex]); var StandBy = new Array(4) { StandBy[0] = new Array(3) { StandBy[0][0] = 17; StandBy[0][1] = 21; StandBy[0][2] = 27; } StandBy[1] = new Array(3) { StandBy[1][0] = 27; StandBy[1][1] = 39; StandBy[1][2] = 42; } StandBy[2] = new Array(3) { StandBy[2][0] = 35 StandBy[2][1] = 43 StandBy[2][2] = 55 } StandBy[3] = new Array(3) { StandBy[3][0] = 45 StandBy[3][1] = 56 StandBy[3][2] = 72 } } var tmp = new Array(3) { tmp[0]= 115; tmp[1]= 125; tmp[2]= 140; } var Effi = new Array(4) { Effi[0]= new Array(4); { Effi[0][0] = 0.51; Effi[0][1] = 0.49; Effi[0][2] = 0.47; Effi[0][3] = 0.45; } Effi[1]= new Array(4); { Effi[1][0] = 0.56; Effi[1][1] = 0.54; Effi[1][2] = 0.52; Effi[1][3] = 0.50; } Effi[2]= new Array(4); { Effi[2][0] = 0.57; Effi[2][1] = 0.55; Effi[2][2] = 0.53; Effi[2][3] = 0.51; } Effi[3]= new Array(4); { Effi[3][0] = 0.59; Effi[3][1] = 0.57; Effi[3][2] = 0.55; Effi[3][3] = 0.53; } } if (!(isPositiveInteger(document.frm10.txtG10Occs.value)&& (document.frm10.txtG10Occs.value >= 0) && (document.frm10.txtG10Occs.value <16))) { alert("Number of Occupants must be from 0 to 15"); document.frm10.txtG10Occs.focus(); document.frm10.txtG10Occs.select(); return false; } var GallonsPerDay = (20 + (document.frm10.txtG10Occs.value * 12.5)); Therms = (GallonsPerDay * 365 * 8.33 * (tmp[document.frm10.sel4G10Temp.selectedIndex]-61))/(Effi[document.frm10.sel2G10Age.selectedIndex][document.frm10.sel3G10Size.selectedIndex] * 100000 ) Dollars = Therms * GasTherm //document.frm10.hid1.value=document.frm10.sel1G10App.selectedIndex; document.frm10.hid2.value=document.frm10.sel2G10Age.selectedIndex; document.frm10.hid3.value=document.frm10.sel3G10Size.selectedIndex; document.frm10.hid4.value=document.frm10.sel4G10Temp.selectedIndex; document.frm10.txtG10Therms.value = parseInt(Therms); document.frm10.txtG10Dollars.value =(Dollars>=1)? parseInt(Dollars): "< $1" document.frm10.submit(); return true; } /////////////////////////////////////////////////////////////////////////////// function G11ChangeValue() //reset the initial value for the user input { if (document.frm11.sel1G11App.selectedIndex != -1 ) { document.frm11.txtG11Dollars.value="" document.frm11.txtG11Therms.value ="" } if (document.frm11.sel1G11App.selectedIndex == 0) { document.frm11.txtG11BTU.value="N/A" // we don't need the "N/A" field to document.frm11.txtG11Hrs.value="N/A" // calculate the therms for "gas or boiler" document.frm11.txtG11Wks.value="N/A" // document.frm11.sel2G11Age.selectedIndex=0 document.frm11.sel4G11Insul.selectedIndex=0 document.frm11.sel3G11Loc.selectedIndex=0 document.frm11.txtG11SqFt.value="" document.frm11.txtG11SqFt.focus(); } else { if (document.frm11.sel1G11App.selectedIndex == 1) document.frm11.txtG11BTU.value = "30000" else document.frm11.txtG11BTU.value = "24000" document.frm11.sel2G11Age.selectedIndex=4 document.frm11.sel4G11Insul.selectedIndex=3 document.frm11.sel3G11Loc.selectedIndex=5 document.frm11.txtG11SqFt.value = "N/A" document.frm11.txtG11Hrs.value="" document.frm11.txtG11Wks.value="" document.frm11.txtG11Hrs.focus(); //reset the value for GAS FIRE LOGS } } function G11Calculate() { var HeatLoad, HeadLoss, Therms, Dollars, Effic; if (document.frm11.sel1G11App.selectedIndex==0) { if (!(isPositiveNumber(document.frm11.txtG11SqFt.value) && (document.frm11.txtG11SqFt.value >= 500) && (document.frm11.txtG11SqFt.value <6001 ))) { alert("\"Square feet of conditioned space\" must be a number from 500 to 6000" ); document.frm11.txtG11SqFt.focus(); document.frm11.txtG11SqFt.select(); return false; } if (document.frm11.sel4G11Insul.selectedIndex==3 ) { alert ("please select level of insulation") document.frm11.sel4G11Insul.selectedIndex=0; return false; } if (document.frm11.sel3G11Loc.selectedIndex==5) { alert ("please select valid\"location\"") document.frm11.sel3G11Loc.selectedIndex=0; return false; } if (document.frm11.sel2G11Age.selectedIndex==4) { alert ("please select valid \"Age of System\"") document.frm11.sel2G11Age.selectedIndex=0; return false; } } else { if (!(isPositiveNumber(document.frm11.txtG11BTU.value) && (document.frm11.txtG11BTU.value >= 500) && (document.frm11.txtG11BTU.value <100001 ))) { alert("\"Assumed BTU/hour\" must be a number from 5000 to 100000" ); document.frm11.txtG11BTU.focus(); document.frm11.txtG11BTU.select(); return false; } if (!(isPositiveNumber(document.frm11.txtG11Hrs.value) && (document.frm11.txtG11Hrs.value >= 0) && (document.frm11.txtG11Hrs.value <169 ))) { alert("\"Average hours per week\" must be a number from 0 to 168" ); document.frm11.txtG11Hrs.focus(); document.frm11.txtG11Hrs.select(); return false; } if (!(isPositiveNumber(document.frm11.txtG11Wks.value) && (document.frm11.txtG11Wks.value >= 0) && (document.frm11.txtG11Wks.value <53 ))) { alert("\"Weeks per year\" must be a number from 0 to 52" ); document.frm11.txtG11Wks.focus(); document.frm11.txtG11Wks.select(); return false; } } switch (document.frm11.sel1G11App.selectedIndex) //select appliance type { case 0: //Gas Furnance or Boiler switch (document.frm11.sel3G11Loc.selectedIndex) // select location { case 0:// hot climate // GET THE HEATLOSS AND HEAT LOAD FROM PROVIDED TABLE if (document.frm11.sel4G11Insul.selectedIndex== 0) HeatLoss = 15; if (document.frm11.sel4G11Insul.selectedIndex== 1) HeatLoss = 17; if (document.frm11.sel4G11Insul.selectedIndex== 2) HeatLoss = 19; HeatLoad = 1600; break; case 1:// warm/moderate climate // GET THE HEATLOSS AND HEAT LOAD FROM PROVIDED TABLE if (document.frm11.sel4G11Insul.selectedIndex== 0) HeatLoss = 15; if (document.frm11.sel4G11Insul.selectedIndex== 1) HeatLoss = 17; if (document.frm11.sel4G11Insul.selectedIndex== 2) HeatLoss = 19; HeatLoad = 1800; break; case 2:// cool/moderate climate // GET THE HEATLOSS AND HEAT LOAD FROM PROVIDED TABLE if (document.frm11.sel4G11Insul.selectedIndex== 0) HeatLoss = 17; if (document.frm11.sel4G11Insul.selectedIndex== 1) HeatLoss = 19; if (document.frm11.sel4G11Insul.selectedIndex== 2) HeatLoss = 21; HeatLoad = 2150; break; case 3:// cold climate // GET THE HEATLOSS AND HEAT LOAD FROM PROVIDED TABLE if (document.frm11.sel4G11Insul.selectedIndex== 0) HeatLoss = 19; if (document.frm11.sel4G11Insul.selectedIndex== 1) HeatLoss = 21; if (document.frm11.sel4G11Insul.selectedIndex== 2) HeatLoss = 24; HeatLoad = 2500; break; case 4:// very cold climate // GET THE HEATLOSS AND HEAT LOAD FROM PROVIDED TABLE if (document.frm11.sel4G11Insul.selectedIndex== 0) HeatLoss = 23; if (document.frm11.sel4G11Insul.selectedIndex== 1) HeatLoss = 25; if (document.frm11.sel4G11Insul.selectedIndex== 2) HeatLoss = 29; HeatLoad = 2900; break; } //GET THE EFFICIENT NUMBERS FROM PROVIDED TABLE if (document.frm11.sel2G11Age.selectedIndex == 0) Effic = .70; if (document.frm11.sel2G11Age.selectedIndex == 1) Effic = .73; if (document.frm11.sel2G11Age.selectedIndex == 2) Effic = .75; if (document.frm11.sel2G11Age.selectedIndex == 3) Effic = .78; Therms = 0.77 *(((parseFloat(document.frm11.txtG11SqFt.value) * HeatLoss) * HeatLoad)/(Effic * 100000)); break; case 1: //Space heater case 2: //Gas Fire Log if (document.frm11.sel2G11Age.selectedIndex == 0) Effic = .70; if (document.frm11.sel2G11Age.selectedIndex == 1) Effic = .73; if (document.frm11.sel2G11Age.selectedIndex == 2) Effic = .75; if (document.frm11.sel2G11Age.selectedIndex == 3) Effic = .78; //Therms = parseFloat(document.frm11.txtG11BTU.value) * parseFloat(document.frm11.txtG11Hrs.value) * parseFloat(document.frm11.txtG11Wks.value)/(100000*Effic);//We are not using Effic for Gas Space heater and Gas Fire Logs. Therms = parseFloat(document.frm11.txtG11BTU.value) * parseFloat(document.frm11.txtG11Hrs.value) * parseFloat(document.frm11.txtG11Wks.value)/100000; break; } Dollars = Therms * GasTherm; document.frm11.hid1.value=document.frm11.sel1G11App.selectedIndex; document.frm11.hid2.value=document.frm11.sel2G11Age.selectedIndex; document.frm11.hid3.value=document.frm11.sel3G11Loc.selectedIndex; document.frm11.hid4.value=document.frm11.sel4G11Insul.selectedIndex; document.frm11.txtG11Therms.value = parseInt(Therms); document.frm11.txtG11Dollars.value =(Dollars>=1)? parseInt(Dollars): "< $1" document.frm11.submit(); return true; } /////////// ////////////////// function G12ChangeValue() { if (document.frm12.sel1G12App.selectedIndex != -1 ) { document.frm12.txtG12Dollars.value="" document.frm12.txtG12Therms.value ="" } if (document.frm12.sel1G12App.selectedIndex == 0) document.frm12.txtG12BTU.value = "40000"; else if (document.frm12.sel1G12App.selectedIndex == 1) document.frm12.txtG12BTU.value = "2500"; else document.frm12.txtG12BTU.value = "50000"; document.frm12.txtG12Quant.value=""; document.frm12.txtG12Hrs.value=""; document.frm12.txtG12Wks.value="" } function G12Calculate() { if (!(isPositiveNumber(document.frm12.txtG12BTU.value)&& (document.frm12.txtG12BTU.value >= 1000) && (document.frm12.txtG12BTU.value <60001))) { alert("\"Assumed BTU per hour\" must be a number from 1000 to 60000"); document.frm12.txtG12BTU.focus(); document.frm12.txtG12BTU.select(); return false; } if (!(isPositiveNumber(document.frm12.txtG12Quant.value)&& (document.frm12.txtG12Quant.value >= 0) && (document.frm12.txtG12Quant.value <11))) { alert("\"Quantity\" must be a number from 0 to 10"); document.frm12.txtG12Quant.focus(); document.frm12.txtG12Quant.select(); return false; } if (!(isPositiveNumber(document.frm12.txtG12Hrs.value)&& (document.frm12.txtG12Hrs.value >=0) && (document.frm12.txtG12Hrs.value <169))) { alert("\"Average hours per week\" must be a number from 0 to 168"); document.frm12.txtG12Hrs.focus(); document.frm12.txtG12Hrs.select(); return false; } if (!(isPositiveNumber(document.frm12.txtG12Wks.value)&& (document.frm12.txtG12Wks.value >=0) && (document.frm12.txtG12Wks.value <53))) { alert("\"Weeks per year\" must be a number from 0 to 52"); document.frm12.txtG12Wks.focus(); document.frm12.txtG12Wks.select(); return false; } var Therms, Dollars; Therms = (document.frm12.txtG12Quant.value * document.frm12.txtG12BTU.value * document.frm12.txtG12Hrs.value * document.frm12.txtG12Wks.value)/100000; Dollars = Therms * GasTherm; document.frm12.hid1.value=document.frm12.sel1G12App.selectedIndex; document.frm12.txtG12Therms.value = parseInt(Therms); document.frm12.txtG12Dollars.value =(Dollars>=1)? parseInt(Dollars): "< $1" document.frm12.submit(); return true; } /////////////////////////////////////////////////////////////////////////////////////////////// // HOME OFFICE CALCULATOR FUNCTIONS function G14ChangeValue() { // document.frm14.txtG14Wattage.value = HomOffWatts[document.frm14.sel1G14App.selectedIndex] jsWatts = HomOffWatts[document.frm14.sel1G14App.selectedIndex] jsWatts = jsWatts.split(","); document.frm14.txtG14Wattage.value = jsWatts[0]; document.frm14.txtG14Wattage2.value = jsWatts[1]; if (document.frm14.sel1G14App.selectedIndex != -1) { document.frm14.txtG14Dollars1.value="" document.frm14.txtG14kWh1.value="" document.frm14.txtG14Dollars2.value="" document.frm14.txtG14kWh2.value="" document.frm14.txtG14Dollars3.value="" document.frm14.txtG14kWh3.value="" } } /////////////////////////////////////////////////////////////////////////////////////////////// function G14Calculate() { if (document.frm14.sel1G14App.selectedIndex == 0) CycFact = 1 else if (document.frm14.sel1G14App.selectedIndex == 1) CycFact = 1 else CycFact = 1 if (!(isPositiveNumber(document.frm14.txtG14Wattage.value) && (document.frm14.txtG14Wattage.value >= 1 )&&(document.frm14.txtG14Wattage.value <10001 ))) { alert("\"Assumed Wattage\" must be a number from 1 to 10000 "); document.frm14.txtG14Wattage.focus(); document.frm14.txtG14Wattage.select(); return false; } if (!(isPositiveNumber(document.frm14.txtG14Qty.value) && (document.frm14.txtG14Qty.value >=1 )&& (document.frm14.txtG14Qty.value <31 ))) { alert("\"Quantity\" must be a number from 1 to 30" ); document.frm14.txtG14Qty.focus(); document.frm14.txtG14Qty.select(); return false; } if (!(isPositiveNumber(document.frm14.txtG14Hours.value) && (document.frm14.txtG14Hours.value >=1 )&&(document.frm14.txtG14Hours.value <169 ))) { alert("\"Average hours per week\" must be a number from 1 to 168"); document.frm14.txtG14Hours.focus(); document.frm14.txtG14Hours.select(); return false; } document.frm14.hid1.value=document.frm14.sel1G14App.selectedIndex; kWhs = document.frm14.txtG14Qty.value * document.frm14.txtG14Wattage.value * CycFact * document.frm14.txtG14Hours.value * 52 / 1000 Dollars = parseFloat(kWhs) * Cost document.frm14.txtG14kWh1.value = parseInt(kWhs) document.frm14.txtG14Dollars1.value =(Dollars>=1)? parseInt(Dollars): "< $1" kWhs2 = document.frm14.txtG14Qty.value *document.frm14.txtG14Wattage2.value * CycFact *document.frm14.txtG14Hours2.value * 52 / 1000 Dollars2 = parseFloat(kWhs2) * Cost document.frm14.txtG14kWh2.value = parseInt(kWhs2) document.frm14.txtG14Dollars2.value =(Dollars2>=1)? parseInt(Dollars2): "< $1" document.frm14.txtG14kWh3.value = parseInt(document.frm14.txtG14kWh1.value) + parseInt(document.frm14.txtG14kWh2.value) if (document.frm14.txtG14Dollars2.value == "< $1") { if (document.frm14.txtG14Dollars1.value == "< $1") document.frm14.txtG14Dollars3.value = "< $1"; else document.frm14.txtG14Dollars3.value = parseInt(document.frm14.txtG14Dollars1.value); } else { if (document.frm14.txtG14Dollars1.value == "< $1") document.frm14.txtG14Dollars3.value = parseInt(document.frm14.txtG14Dollars2.value); else document.frm14.txtG14Dollars3.value = parseInt(document.frm14.txtG14Dollars1.value) + parseInt(document.frm14.txtG14Dollars2.value); } document.frm14.txtG14kWh.value = document.frm14.txtG14kWh3.value document.frm14.txtG14Dollars.value = document.frm14.txtG14Dollars3.value document.frm14.submit(); return true; } /////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////// function G15ChangeValue() { document.frm15.txtG15Wattage.value = AppWattsKitchen[document.frm15.sel1G15App.selectedIndex]; switch(document.frm15.sel1G15App.selectedIndex) { //DISHWASHER case 2 : document.frm15.txtG15Qty.value = "N/A"; document.frm15.txtG15Hours.value = "N/A"; document.frm15.txtG15Loads.value = 1; document.frm15.sel2G15Size.selectedIndex = 6; document.frm15.sel3G15Age.selectedIndex = 4; break; //REFRIG & FREEZER case 8 : document.frm15.txtG15Qty.value = "N/A"; document.frm15.txtG15Hours.value = "N/A"; document.frm15.txtG15Loads.value = "N/A"; document.frm15.sel2G15Size.selectedIndex = 0; document.frm15.sel3G15Age.selectedIndex = 0; break; //ALL OTHERS default : document.frm15.txtG15Loads.value = "N/A"; document.frm15.txtG15Qty.value = 1; document.frm15.txtG15Hours.value = 5; document.frm15.sel2G15Size.selectedIndex = 6; document.frm15.sel3G15Age.selectedIndex = 4; break; } if (document.frm15.sel1G15App.selectedIndex != -1) { document.frm15.txtG15Dollars.value="" document.frm15.txtG15kWh.value="" } } /////////////////////////////////////////////////////////////////////////////////////////////// function G15Calculate() { if (document.frm15.sel1G15App.selectedIndex == 0) CycFact = 0.35 else if (document.frm15.sel1G15App.selectedIndex == 1) CycFact = 0.35 else CycFact = 1 switch (document.frm15.sel1G15App.selectedIndex) { //DISHWASHER case 2 : // alert("dw"); if (!(isPositiveNumber(document.frm15.txtG15Loads.value) && document.frm15.txtG15Loads.value >=0 && document.frm15.txtG15Loads.value <31 )) { alert("\"Loads Per Week\" must be a number from 0 to 30"); document.frm15.txtG15Loads.focus(); document.frm15.txtG15Loads.select(); return false; } document.frm15.hid1.value = document.frm15.sel1G15App.selectedIndex; kWhs = (parseFloat(document.frm15.txtG15Loads.value) * AppFactors[0] * 52) Dollars = kWhs * Cost document.frm15.txtG15kWh.value = parseInt(kWhs) document.frm15.txtG15Dollars.value =(Dollars>=1)? parseInt(Dollars): "< $1" // document.frm15.submit(); return true; break; //REFRIGERATORS & FREEZERS case 8 : // alert("freeze"); if (document.frm15.sel3G15Age.selectedIndex == 0) { kWhs = RFless10[document.frm15.sel2G15Size.selectedIndex]; } if (document.frm15.sel3G15Age.selectedIndex > 0 && document.frm15.sel3G15Age.selectedIndex < 4 ) { kWhs = RFmore10[document.frm15.sel2G15Size.selectedIndex]; } Dollars = kWhs * Cost document.frm15.txtG15kWh.value = parseInt(kWhs) document.frm15.txtG15Dollars.value =(Dollars>=1)? parseInt(Dollars): "< $1" return true; break; //ALL OTHERS default : // alert("anythingelse"); if (!(isPositiveNumber(document.frm15.txtG15Wattage.value) && (document.frm15.txtG15Wattage.value >= 1 )&&(document.frm15.txtG15Wattage.value <10001 ))) { alert("\"Assumed Wattage\" must be a number from 1 to 10000 "); document.frm15.txtG15Wattage.focus(); document.frm15.txtG15Wattage.select(); return false; } if (!(isPositiveNumber(document.frm15.txtG15Qty.value) && (document.frm15.txtG15Qty.value >=1 )&& (document.frm15.txtG15Qty.value <31 ))) { alert("\"Quantity\" must be a number from 1 to 30" ); document.frm15.txtG15Qty.focus(); document.frm15.txtG15Qty.select(); return false; } if (!(isPositiveNumber(document.frm15.txtG15Hours.value) && (document.frm15.txtG15Hours.value >=1 )&&(document.frm15.txtG15Hours.value <169 ))) { alert("\"Average hours per week\" must be a number from 1 to 168"); document.frm15.txtG15Hours.focus(); document.frm15.txtG15Hours.select(); return false; } document.frm15.hid1.value=document.frm15.sel1G15App.selectedIndex; document.frm15.hid2.value=document.frm15.sel2G15Size.selectedIndex; document.frm15.hid3.value=document.frm15.sel3G15Age.selectedIndex; kWhs = document.frm15.txtG15Qty.value *document.frm15.txtG15Wattage.value * CycFact *document.frm15.txtG15Hours.value * 52 / 1000 Dollars = parseFloat(kWhs) * Cost document.frm15.txtG15kWh.value = parseInt(kWhs) document.frm15.txtG15Dollars.value =(Dollars>=1)? parseInt(Dollars): "< $1" document.frm15.submit(); return true; break; } } function old_G16Calculate() { if (document.frm15.sel1G15App.selectedIndex == 0) CycFact = 0.35 else if (document.frm15.sel1G15App.selectedIndex == 1) CycFact = 0.35 else CycFact = 1 //DISHWASHER SELECTED if(document.frm15.sel1G15App.selectedIndex == 2) { alert("dw"); if (!(isPositiveNumber(document.frm15.txtG15Loads.value) && document.frm15.txtG15Loads.value >=0 && document.frm15.txtG15Loads.value <31 )) { alert("\"Loads Per Week\" must be a number from 0 to 30"); document.frm15.txtG15Loads.focus(); document.frm15.txtG15Loads.select(); return false; } document.frm15.hid15.value = document.frm15.sel1G15App.selectedIndex; kWhs = (parseFloat(document.frm15.txtG15Loads.value) * AppFactors[document.frm15.sel1G15App.selectedIndex] * 52) Dollars = kWhs * Cost document.frm15.txtG15kWh.value = parseInt(kWhs) document.frm15.txtG15Dollars.value =(Dollars>=1)? parseInt(Dollars): "< $1" document.frm15.submit(); return true; //REFRIGERATOR & FREEZERS SELECTED } else if (document.frm15.sel1G15App.selectedIndex == 8) { alert("freeze"); } else { alert("other"); if (!(isPositiveNumber(document.frm1.txtG1Wattage.value) && (document.frm1.txtG1Wattage.value >= 1 )&&(document.frm1.txtG1Wattage.value <10001 ))) { alert("\"Assumed Wattage\" must be a number from 1 to 10000 "); document.frm1.txtG1Wattage.focus(); document.frm1.txtG1Wattage.select(); return false; } if (!(isPositiveNumber(document.frm1.txtG1Qty.value) && (document.frm1.txtG1Qty.value >=1 )&& (document.frm1.txtG1Qty.value <31 ))) { alert("\"Quantity\" must be a number from 1 to 30" ); document.frm1.txtG1Qty.focus(); document.frm1.txtG1Qty.select(); return false; } if (!(isPositiveNumber(document.frm1.txtG1Hours.value) && (document.frm1.txtG1Hours.value >=1 )&&(document.frm1.txtG1Hours.value <169 ))) { alert("\"Average hours per week\" must be a number from 1 to 168"); document.frm1.txtG1Hours.focus(); document.frm1.txtG1Hours.select(); return false; } document.frm1.hid1.value=document.frm1.sel1G1App.selectedIndex; kWhs = document.frm1.txtG1Qty.value *document.frm1.txtG1Wattage.value * CycFact *document.frm1.txtG1Hours.value * 52 / 1000 Dollars = parseFloat(kWhs) * Cost document.frm1.txtG1kWh.value = parseInt(kWhs) document.frm1.txtG1Dollars.value =(Dollars>=1)? parseInt(Dollars): "< $1" document.frm1.submit(); return true; } } ///////////////////////////////////////////////////////////////////////////////////////////////