function verify()
{
    msg = "Are you sure that you are ready to submit this form, and have provided all of the required information?";
    return confirm(msg);
    }

function getBTUs()
{
  var OilGallons, PropaneGallons, CordsWood, Kerosenegallons, NatgasTherms, PelletsTons, BTUtotal, btusqfoot,btutotalforheat;
 
OilGallons = document.energysurvey.gallonsoilperyear.value;
PropaneGallons = document.energysurvey. gallonspropaneperyear.value;
CordsWood = document.energysurvey.cordswoodperyear.value;
Kerosenegallons = document.energysurvey.gallonskeroseneperyear.value;
NatgasTherms = document.energysurvey.thermsnatgasperyear.value;
PelletsTons = document.energysurvey.pellettonsperyear.value;

  BTUtotal  = (OilGallons*139000)+(PropaneGallons*91600)+(CordsWood*22000000)+(Kerosenegallons*136600)+(NatgasTherms*100000)+(PelletsTons*16500000);
 
BTUtotal = BTUtotal/1000000;
if(BTUtotal>0){
document.energysurvey.btutotalforheat.value = formatNumber(BTUtotal,",#");
}
  
sqftheatedspace=document.energysurvey.sqftheatedspace.value;
if(sqftheatedspace!="" && sqftheatedspace>0 && BTUtotal>0){
btusqfoot=BTUtotal/sqftheatedspace*1000000;
document.energysurvey.btusqfoot.value=formatNumber(btusqfoot,",#");}
}




function getkwh()
{
  var kwhyear, kwhmonth, kwh0604, kwh0504, kwh0404, kwh0304, kwh0204, kwh0104, kwh1203, kwh1103, kwh1003, kwh0903, kwh0803, kwh0703;
 
  kwh0703 = document.energysurvey.kwh1.value;
  kwh0803 = document.energysurvey.kwh2.value;
  kwh0903 = document.energysurvey.kwh3.value;
  kwh1003 = document.energysurvey.kwh4.value;
  kwh1103 = document.energysurvey.kwh5.value;
  kwh1203 = document.energysurvey.kwh6.value;
  kwh0104 = document.energysurvey.kwh7.value;
  kwh0204 = document.energysurvey.kwh8.value;
  kwh0304 = document.energysurvey.kwh9.value;
  kwh0404 = document.energysurvey.kwh10.value;
  kwh0504 = document.energysurvey.kwh11.value;
  kwh0604 = document.energysurvey.kwh12.value;


  if(kwh0703!="" && kwh0803!="" && kwh0903!="" && kwh1003!="" && kwh1103!="" && kwh1203!="" && kwh0104!="" && kwh0204!="" && kwh0304!="" && kwh0404!="" && kwh0504!="" && kwh0604!=""){
  kwhyear  = (1*kwh0604) + (1*kwh0504) + (1*kwh0404) + (1*kwh0304)  + (1*kwh0204) + (1*kwh0104) + (1*kwh1203) + (1*kwh1103) + (1*kwh1003) + (1*kwh0903) + (1*kwh0803) + (1*kwh0703);
 kwhmonth=(kwhyear/12);
 document.energysurvey.kwhpermonth.value = formatNumber(kwhmonth,",#");
 document.energysurvey.kwhYear.value = formatNumber(kwhyear,",#");}
  
}



function getkwh0405()
{
  var kwhyear, kwhmonth, kwh0605, kwh0505, kwh0405, kwh0305, kwh0205, kwh0105, kwh1204, kwh1104, kwh1004, kwh0904, kwh0804, kwh0704;
 
  kwh0704 = document.energysurvey.kwh1.value;
  kwh0804 = document.energysurvey.kwh2.value;
  kwh0904 = document.energysurvey.kwh3.value;
  kwh1004 = document.energysurvey.kwh4.value;
  kwh1104 = document.energysurvey.kwh5.value;
  kwh1204 = document.energysurvey.kwh6.value;
  kwh0105 = document.energysurvey.kwh7.value;
  kwh0205 = document.energysurvey.kwh8.value;
  kwh0305 = document.energysurvey.kwh9.value;
  kwh0405 = document.energysurvey.kwh10.value;
  kwh0505 = document.energysurvey.kwh11.value;
  kwh0605 = document.energysurvey. kwh12.value;


  if(kwh0704!="" && kwh0804!="" && kwh0904!="" && kwh1004!="" && kwh1104!="" && kwh1204!="" && kwh0105!="" && kwh0205!="" && kwh0305!="" && kwh0405!="" && kwh0505!="" && kwh0605!=""){
  kwhyear  = (1*kwh0605) + (1*kwh0505) + (1*kwh0405) + (1*kwh0305)  + (1*kwh0205) + (1*kwh0105) + (1*kwh1204) + (1*kwh1104) + (1*kwh1004) + (1*kwh0904) + (1*kwh0804) + (1*kwh0704);
 kwhmonth=(kwhyear/12);
 document.energysurvey.kwhpermonth.value = formatNumber(kwhmonth,",#");
 document.energysurvey.kwhYear.value = formatNumber(kwhyear,",#");}
  
}



  <!-- Hide from older browsers

   // Original JavaScript code by Duncan Crombie: dcrombie@chirp.com.au
   // Please acknowledge use of this code by including this header.

   // CONSTANTS
  var separator = ",";  // use comma as 000's separator
  var decpoint = ".";  // use period as decimal point
  var percent = "%";
  var currency = "$";  // use dollar sign for currency

  function formatNumber(number, format, print) {  // use: formatNumber(number, "format")
    if (print) document.write("formatNumber(" + number + ", \"" + format + "\")<br>");

    if (number - 0 != number) return null;  // if number is NaN return null
    var useSeparator = format.indexOf(separator) != -1;  // use separators in number
    var usePercent = format.indexOf(percent) != -1;  // convert output to percentage
    var useCurrency = format.indexOf(currency) != -1;  // use currency format
    var isNegative = (number < 0);
    number = Math.abs (number);
    if (usePercent) number *= 100;
    format = strip(format, separator + percent + currency);  // remove key characters
    number = "" + number;  // convert number input to string

     // split input value into LHS and RHS using decpoint as divider
    var dec = number.indexOf(decpoint) != -1;
    var nleftEnd = (dec) ? number.substring(0, number.indexOf(".")) : number;
    var nrightEnd = (dec) ? number.substring(number.indexOf(".") + 1) : "";

     // split format string into LHS and RHS using decpoint as divider
    dec = format.indexOf(decpoint) != -1;
    var sleftEnd = (dec) ? format.substring(0, format.indexOf(".")) : format;
    var srightEnd = (dec) ? format.substring(format.indexOf(".") + 1) : "";

     // adjust decimal places by cropping or adding zeros to LHS of number
    if (srightEnd.length < nrightEnd.length) {
      var nextChar = nrightEnd.charAt(srightEnd.length) - 0;
      nrightEnd = nrightEnd.substring(0, srightEnd.length);
      if (nextChar >= 5) nrightEnd = "" + ((nrightEnd - 0) + 1);  // round up

 // patch provided by Patti Marcoux 1999/08/06
      while (srightEnd.length > nrightEnd.length) {
        nrightEnd = "0" + nrightEnd;
      }

      if (srightEnd.length < nrightEnd.length) {
        nrightEnd = nrightEnd.substring(1);
        nleftEnd = (nleftEnd - 0) + 1;
      }
    } else {
      for (var i=nrightEnd.length; srightEnd.length > nrightEnd.length; i++) {
        if (srightEnd.charAt(i) == "0") nrightEnd += "0";  // append zero to RHS of number
        else break;
      }
    }

     // adjust leading zeros
    sleftEnd = strip(sleftEnd, "#");  // remove hashes from LHS of format
    while (sleftEnd.length > nleftEnd.length) {
      nleftEnd = "0" + nleftEnd;  // prepend zero to LHS of number
    }

    if (useSeparator) nleftEnd = separate(nleftEnd, separator);  // add separator
    var output = nleftEnd + ((nrightEnd != "") ? "." + nrightEnd : "");  // combine parts
    output = ((useCurrency) ? currency : "") + output + ((usePercent) ? percent : "");
    if (isNegative) {
      // patch suggested by Tom Denn 25/4/2001
      output = (useCurrency) ? "(" + output + ")" : "-" + output;
    }
    return output;
  }

  function strip(input, chars) {  // strip all characters in 'chars' from input
    var output = "";  // initialise output string
    for (var i=0; i < input.length; i++)
      if (chars.indexOf(input.charAt(i)) == -1)
        output += input.charAt(i);
    return output;
  }

  function separate(input, separator) {  // format input using 'separator' to mark 000's
    input = "" + input;
    var output = "";  // initialise output string
    for (var i=0; i < input.length; i++) {
      if (i != 0 && (input.length - i) % 3 == 0) output += separator;
      output += input.charAt(i);
    }
    return output;
  }

   // Stop hiding -->