<!--

// list of zip-codes
var zipcodes = new Array("97009", "97070", "97119", "97140", "97062", "97027", "97034", "97035", "97045", "97056", "97086", "97222", "97267", "97268", "97269", "97068", "97201", "97202", "97203", "97204", "97205", "97206", "97207", "97208", "97209", "97210", "97211", "97212", "97213", "97214", "97215", "97216", "97217", "97218", "97219", "97220", "97221", "97227", "97228", "97230", "97231", "97232", "97233", "97236", "97238", "97240", "97242", "97251", "97253", "97254", "97255", "97256", "97258", "97259", "97266", "97271", "97272", "97280", "97282", "97283", "97286", "97290", "97292", "97293", "97294", "97296", "97299", "97005", "97006", "97007", "97008", "97075", "97076", "97077", "97078", "97085", "97123", "97124", "97223", "97224", "97225", "97229", "97281", "97291", "97298", "97015", "97030", "97080", "97230", "97024", "97222", "97267", "97133", "97116", "97106", "97109", "97125");

// the page where user will be redirected on known zip-code
var truepage = "zip_eligible.htm";
// the same, but for unknown zip-code
var falsepage = "zip_not_eligible.htm";

function newzip(zip) {
  setCookie("zipvalue", zip);
  f = 0;
  for (i = 0; i < zipcodes.length; i++) {
    if (zipcodes[i] == zip) {
      document.location.href = truepage;
      return;
    }
  }
  document.location.href = falsepage;
}

function getzip() {
  return getCookie("zipvalue");
}

function getCookie(name) {
  dc = document.cookie;
  s = dc.indexOf(name + '=') + 1;
  if (s) {
    s += name.length;
    c = dc.substring(s, dc.length);
    e = c.indexOf(';');
    if (e >= 0)
      c = c.substring(0, e);
    return unescape(c);
  } else
    return "";
}

function setCookie(name, value, seconds, path) {
  var expires = new Date();
  expires.setTime(expires.getTime() + seconds*1000);
  document.cookie = name + "=" + escape(value)
  + "; path=/"
  + (seconds ? "; expires=" + expires.toGMTString() : "")
  ;
}

//-->
