if ( !Number.prototype.toFixed ) Number.prototype.toFixed = function(fractionDigits)
{
  var m = Math.pow(10,fractionDigits);
  return Math.round(this*m,0)/m;
}

function localCheck(elm, frm) {
  var zip = elm.value;
  zipForm = frm;
  if (checkZIP(zip)) {
    ajaxCheckZIP(zip);
    return false;
  } else {
    wrongZIP();
    return false;
  }
}

function resZIP (originalRequest, json) {
  var feed = originalRequest.responseText.evalJSON();
  if (feed.valid) {
    zipForm.submit();
    return true;
  } else {
    wrongZIP();
    return false;
  }
}

function wrongZIP() {
  alert('Please enter a valid U.S. ZIP code to continue.');
  zipForm.zipcode.value = "ZIP";
}
