var blk1  = "https://www.paypal.com/cgi-bin/webscr?cmd=_cart";
var blk1a = "&add=1";
var blk1d = "&display=1";
var blk1u = "&upload=1";
var blk2  = "&business=";
var blk2a = "&quantity=";
var blk2q = 0;
var blk3  = "&item_name=";
var blk3n = "";
var bcode = "";
var blkcc = "";
var blkhn = "";  // item handling charges
var blksh = "";  // item shipping charges
var bmisc = "";  // stuff not supported anywhere else.
var op1n  = "";  // option name and value
var op1v  = "";
var op2n  = "";
var op2v  = "";
var blk4  = "&amount=";
var blk4a = "6.66";
var imgx  = "godless.jpg";  // place for cart thumbnail image
var winpar = "width=800,height=600,scrollbars," +
             "location,resizable,status";

var cmax  = 16;            // max items in cart
var cats  = 5;             // max number of categories allowed
var pcat  = 0;             // item product category
var ctot  = new Object (); // amt & qty totals by pcat

var stax  = 0;      // regional (state) tax percent
var ttxt  = "";     // tax text.
var ttax  = 0;
var hand;           // cart totals
var ship;
var tpkg;           // total packages
var qtyd;
var tqty = 0;       // the total quantity of items ordered
var cook;           // place for item cookie object
var tprc = 0;       // total price of items in cart
var tozs = 0;       // total ounces of order
var bozs = 0;       // subtotal for item
var gtot;           // order grand total
var insx = 0;       // insurance total

var dqty = new Array ();  // item discount qty breakpoint
var damt = new Array ();  // percent discount
var dn   = 0;             // number of discount brkpts

var aqty = new Array ();  // item quantity amt breakpoint
var aamt = new Array ();  // price at breakpoint
var an   = 0;             // number of amt brkpts

var zn   = 0;             // count of zip/zone pairs
var zzip = new Array ();  // zip code
var zone = new Array ();  // zone for that zip

var cdis = 0;             // amount of coupon discount
var coupval = "";         // coupon value user entered
var coupons = new Array ("coup1", "coup2");
var coupond = new Array (10, 15);  // discount aray
var coup = -1;            // cart discount coupon not active

// stuff for shipping support...
var zip;        // shipping zip code
var wte;        // total weight of order
var zne = 0;    // shipping zone
var amt;        // priority shipping charge
var usps = -1;  // flag for USPS priority shipping
var uspp = -1;  // flag for USPS parcel post
var ups  = -1;  // flag for UPS ground, lower 48
var insu = -1;  // flag for insurance

// cart display options...
var on  = 1;       // on and off variables
var off = 0;
 
var chkby = 0;  // status of the checkbox
 

function AddDesc (strn) {  // add to current description
var c = "";
  if (blk3n.length > 0) c = ", ";
  blk3n = blk3n + c + strn;
}

function AddMisc (strn) {  // add extra stuff to PayPal params
var s = "&";
  if (strn.substring(0,1) == "&") s = "";
  bmisc = bmisc + s + escape (strn);
}

function AddOpt1 (val) {  // add to the value in op1v
var c = "";
  if (op1n.length == 0) op1n = "opt1";
  if (op1v.length > 0) c = ", ";
  op1v = op1v + c + val;
}

function AddOpt2 (val) {  // add to the value in op2v
var c = "";
  if (op2n.length == 0) op2n = "opt2";
  if (op2v.length > 0) c = ", ";
  op2v = op2v + c + val;
}

function AddPrcnt (strn) {    // add a percent to the price
  SetPrice (blk4a * (1.0 + strn/100.0));  // add the percent
}

function AddPrice (strn) {  // add to current price
  blk4a = Dollar (blk4a*1.0 + strn*1.0);
}

function CalcInsu (amt) {  // calculate insurance on an amount
//  it equals $2.20 + $1.00 per hundred
if (amt == 0) return 0;
if (amt <= 50) return 1.30;
return (2.20 + Math.floor (amt / 100.0));
}

function CallPay () { // call the PayPal shopping cart
var strn;
  blkcc = "";                  // check default settings
  if (root.xx_cur.length > 0)  // set currency code 
    blkcc = blkcc + "&currency_code=" + root.xx_cur;
  if (root.xx_lc.length > 0)   // set country code
    blkcc = blkcc + "&lc=" + root.xx_lc;
  if (root.xx_can.length > 0)  // set cancel return path
    blkcc = blkcc + "&cancel_return=" + root.xx_can;
  if (root.xx_ret.length > 0)  // set return path 
    blkcc = blkcc + "&return=" + root.xx_ret;
  strn = blk1 + blk1u + blk2 + root.xx_id + blkcc + bmisc + Xbild ();
  ClearAll ();
  window.open (strn, "paypal", winpar);
}

function CallView () { // call the local shopping cart view
var w=window.open ("AKRcart.html", "local29", winpar);
w.focus();
}


function ChkCoup () {  // check for a discount coupon
var i;
  coup = -1;          // assume the worst
  for (i=0; i<coupons.length; i++) {
    if (coupval == coupons[i]) {
      coup = 1;              // user hit the coupon value
      cdis = coupond[i];     // remember the discount amt
      root.coup = coup;
      root.cdis = cdis;
      root.xx_coup = off;    // suppress display
      root.store ();
      alert ("Valid coupon number! \n\n" +
             cdis + "% discount now in effect.");
      document.location.reload ();  // show the latest info...
      return;
    }
  }
  alert ("'" + coupval + "'  not a valid code!");
}

function ChkFlg (temp) {     // check for special flag char
var pos;
  pos  = temp.indexOf ("@"); // is there a initial value?  
  if (pos > 0) SetPrice (temp.substring (pos + 1));
  pos  = temp.indexOf ("+"); // is there a price adjustment?  
  if (pos > 0) AddPrice (temp.substring (pos + 1));
  pos  = temp.indexOf ("%"); // is there a percent adjustment?  
  if (pos > 0) AddPrcnt (temp.substring (pos + 1));
}

function ChkOpts () {  // check if user has selected everything
  if (tprc < root.xx_mamt || tqty < root.xx_mqty) {  // check minimums
    alert ("You have not yet met the minimum order requirements!");
    return false;
  }
  if (root.xx_chkbx == on && chkby == 0) {  // agree checkbox
    alert ('You must agree to terms!');
    return false;
  } else
  if (root.xx_tax == on && ttxt.length == 0) {  // tax selection
    alert ('Select tax!');
    return false;
  } else
  if (root.xx_ship == on && root.sv0 == 0) {  // shipping selection
    alert ('Select Shipping!');
    return false;
  }
  return true;
}

function ClearAll () {  // wipe out the last entry
  blk2q = "";  // quantity
  blk3n = "";  // name
  blk4a = "0"; // price
  bcode = "";  // item number
  bmisc = "";  // extra data
  blkhn = "";  // item handling charges
  blksh = "";  // item shipping charges
  op1n  = "";  // clear options
  op1v  = "";
  op2n  = "";
  op2v  = "";
  imgx  = "";
  bozs  = 0;
  dn    = 0;
  an    = 0;
  pcat  = 0;
}

function ClearCart () {     // zap all the cookies
var i;
  for (i=1; i<cmax; i++) {  // the data cookies
    ClearEntry (i);
  }
}

function ClearEntry (i) {  // knock out a specific entry
  cook = new Cookie (document, "paycart" + i);
  InitData ();
}

function Cookie(document, name, hours, path, domain, secure) {
  this.$document = document;  // required
  this.$name = name;          // required
  if (hours) this.$expiration = 
      new Date((new Date()).getTime() + hours * 3600000);
  else this.$expiration = null;
//  if (path)   this.$path   = path;   else this.$path   = null;
this.$path = "/";  // force, for now
  if (domain) this.$domain = domain; else this.$domain = null;
  if (secure) this.$secure = true;   else this.$secure = false;
}

function _Cookie_store() {  // store method of cookie object
var cookieval = "";  // clear actual cookie value
  for(var prop in this) {  // Ignore "$" properties, and methods
    if ((prop.charAt(0) == '$') || 
        ((typeof this[prop]) == 'function')) 
        continue;
    if (cookieval != "") cookieval += '&';
    cookieval += prop + ':' + escape(this[prop]);
  }

  var cookie = this.$name + '=' + cookieval;
  if (this.$expiration)
      cookie += '; expires=' + this.$expiration.toGMTString();
  if (this.$path) cookie += '; path=' + this.$path;
  if (this.$domain) cookie += '; domain=' + this.$domain;
  if (this.$secure) cookie += '; secure';
/*
  if (root.xx_cdmp == on)           // cookie diagnostic dump
    alert(cookie.length + " chars - " + cookie);
*/
  this.$document.cookie = cookie;  // store with magic property
}

function _Cookie_load() {  // cookie load function
var i;
var allcookies = this.$document.cookie;
  if (allcookies == "") return false;

  // Now extract just the named cookie from that list.
  var start = allcookies.indexOf(this.$name + '=');
  if (start == -1) return false;   // Cookie not defined for this page.
  start += this.$name.length + 1;  // Skip name and equals sign.
  var end = allcookies.indexOf(';', start);
  if (end == -1) end = allcookies.length;
  var cookieval = allcookies.substring(start, end);

  var a = cookieval.split('&');  // array of name/value pairs.
  for(i=0; i < a.length; i++)  // Break each pair into an array.
    a[i] = a[i].split(':');

  for(i=0; i<a.length; i++)
    this[a[i][0]] = unescape(a[i][1]);

  return true;     // We're done, so return the success code.
}

function _Cookie_remove() {  // the remove method
var cookie;
  cookie = this.$name + '=';
  if (this.$path) cookie += '; path=' + this.$path;
  if (this.$domain) cookie += '; domain=' + this.$domain;
  cookie += '; expires=Fri, 02-Jan-1970 00:00:00 GMT';

  this.$document.cookie = cookie;  // magic store
}

function Dollar (val) {  // force to valid dollar amount
var str,pos,rnd=0;
  if (val < .995) rnd = 1;  // for old Netscape browsers
  str = escape (val*1.0 + 0.005001 + rnd);  // float, round, escape
  pos = str.indexOf (".");
  if (pos > 0) str = str.substring (rnd, pos + 3);
  return str;
}

function InitData () {  // zap a data cookie
  cook.pcat = 0;
  cook.qty  = 0;
  cook.cod  = "";
  cook.ihnd = 0;
  cook.des  = "";
  cook.op1n = "";  // option name and value
  cook.op1v = "";
  cook.op2n = "";
  cook.op2v = "";
  cook.prc  = 0;
  cook.ozs  = 0;
  cook.imgx = "";
  cook.store();    // stash it off
}

function InitRoot () {  // Build the base root cookie
var i;
  root.stax  = stax;     // stuff all base values
  root.ttxt  = ttxt;
  root.coup  = coup;
  root.cdis  = cdis;
  root.chkbx = chkby;
  root.usps = usps;     // USPS flag
  root.uspp = uspp;     // USPS pp flag
  root.ups  = ups;      // UPS flag
  root.insu = insu;     // insurance flag
  root.zne  = zne;      // destination zone
  root.xx_can  = "";
  root.xx_cc   = off;
  root.xx_cdmp = off;
  root.xx_chkbx= off;
  root.xx_coup = off;
  root.xx_cper = 0;
  root.xx_cur  = "USD";
  root.xx_dadd = on;
  root.xx_img  = off;
  root.xx_lc   = "US";
  root.xx_mamt = 0;
  root.xx_mqty = 0;
  root.xx_pc   = off;
  root.xx_prt  = off;
  root.xx_ret  = "";
  root.xx_ship = off;
  root.xx_sum  = off;
  root.xx_tax  = off;
  root.xx_wt   = off;

  for (i=0; i<cats; i++) {
    root["hn" + i]   = 0;             // number of handling brkpts
    root["hqty" + i] = new Array ();  // cart hndl qty breakpoints
    root["hamt" + i] = new Array ();  // amount charged

    root["qd" + i]   = 0;             // number of qty breakpoints
    root["qqty" + i] = new Array ();  // cart QD breakpoints
    root["qamt" + i] = new Array ();  // amount of discount

    root["sn" + i]   = 0;              // number of shipping brkpts
    root["sqty" + i] = new Array ();  // cart ship qty breakpoints
    root["samt" + i] = new Array ();  // amount charged
    root["stxt" + i] = "";             // text describing shipping

    root["av" + i]   = 0;             // number of bkpts
    root["aval" + i] = new Array ();  // cart amount breakpoints
    root["achg" + i] = new Array ();  // percent discount
  
    root["sv" + i]   = 0;              // number of bkpts
    root["sval" + i] = new Array ();  // cart ship val breakpoints
    root["schg" + i] = new Array ();  // amount charged
  
    root["wv" + i]   = 0;             // number of bkpts
    root["wval" + i] = new Array ();  // cart ship val breakpoints
    root["wchg" + i] = new Array ();  // amount charged
  }
  root.store();
}

function PrintCart () {  // print out entire cart, and get cart totals
var i,wt,p,tmp1,tmp2,s;
  tprc = 0;                 // total price of cart
  tozs = 0;                 // total ounces of order
  gtot = 0;                 // Grand total
  ttax = 0;                 // total cart tax
  tqty = 0;                 // total qty of items
  insx = 0;                 // insurance amount

  for (i=0; i<cats; i++) {  // init pcat totals
    ctot["a" + i] = 0;      // amount in this cat
    ctot["q" + i] = 0;      // quantity in this cat
    ctot["h" + i] = 0;      // handling in this cat
    ctot["s" + i] = 0;      // shipping in this cat
    ctot["d" + i] = 0;      // discount in this cat
  }
  for (i=1; i<cmax; i++) {  // print all entries
    cook = new Cookie (document, "paycart" + i);
    cook.load();
    if (cook.qty > 0) {
      PrintItem (i);
    }
  }

  twgt = Math.floor ((tozs*1.0 + 15.999) / 16.0);
  tprc = Dollar (tprc)*1.0;             // round, float

  hand = 0;  // line display totals
  ship = 0;
  tpkg = 1;
  qtyd = 0;   

  for (p=0; p<cats; p++) {                 // run product categories
    sh  = 0;                               // local pcat tots
    ha  = 0;
    qt  = 0;

    var q = ctot["q" + p]*1.0;             // quantity this catagory
    var a = ctot["a" + p]*1.0;             // amount this category
  
    tmp1 = root["hqty" + p].split(",");
    tmp2 = root["hamt" + p].split(",");
    for (i=root["hn" + p]-1; i>=0; i--) {  // run the table (if one)
      if (q >= tmp1[i]*1.0) {              // Check the quantity
        ha = tmp2[i]*1.0;                  // yep, set it
        break;                             // a-dios, mo-fo
      }
    }
    ctot["h" + p] = ha;
    hand = hand + ha;

    tmp1 = root["sqty" + p].split(",");
    tmp2 = root["samt" + p].split(",");
    for (i=root["sn" + p]-1; i>=0; i--) {  // run the table (if one)
      if (q >= tmp1[i]*1.0) {              // Check the price
        sh = tmp2[i]*1.0;                  // yep, set it
        break;
      }
    }
    if (sh == 0) {                         // one or the other
     tmp1 = root["sval" + p].split(",");
     tmp2 = root["schg" + p].split(",");
     for (i=root["sv" + p]-1; i>=0; i--) {  // run the table (if one)
       if (a >= tmp1[i]*1.0) {  // Check the price
         sh = tmp2[i]*1.0;      // yep, set it
         break;
       }
     }
    }
    ctot["s" + p] = sh;
    ship = ship + sh;

    tmp1 = root["qqty" + p].split(",");
    tmp2 = root["qamt" + p].split(",");
    for (i=root["qd" + p]-1; i>=0; i--) {
      if (q >= tmp1[i]*1.0) {
        qt = tmp2[i]*1.0;
        break;
      }
    }
    if (coup > 0) {
      qt = qt + a * cdis/100.0;
    }
    ctot["d" + p] = qt;
    qtyd = qtyd + qt;
  }
  s = 0;  // for special stuff...
  wte = Math.floor ((tozs + 0) / 1);
  var twte = wte;
  if (usps > 0) {  // usps priority mail
    while (twte > pz2.length) {  // multiple packages?
      tpkg = tpkg + 1;
      twte = Math.floor ((tozs / tozs + 0) / 1);
    }
    s = pzx[zne][twte] * tpkg;    // USPS charges to that zone

  } else
  if (uspp  > 0) {  // usps parcel post
    while (twte > pp2.length) {
      tpkg = tpkg + 1;
      twte = Math.floor ((tozs / tozs + 0) / 1);
    }
    s = ppx[zne][twte] * tpkg; // UPS charges

  } else
  if (ups  > 0) {  // ups ground
    while (twte > uz2.length) {
      tpkg = tpkg + 1;
      twte = Math.floor ((tozs / tozs + 0) / 1);
    }
    s = uzx[zne][twte] * tpkg; // UPS charges
  }
  ship = ship + s;  // only if wt shipping set
  if (insu > 0) insx = CalcInsu (tprc - qtyd);

  ttax = Dollar ((tprc - qtyd) * stax/100.0);
  gtot = Dollar (tprc + hand + ship + ttax*1.0 + insx - qtyd);
}

function PrintItem (i) {  // make one entry in cart
var tm,t1,t2,wt;
  document.writeln ('<tr valign = "top"');
  document.writeln ('    align = "right">');
  document.writeln ('  <td>');
  document.writeln ('    <input type  = "checkbox" ');
  document.writeln ('           value = "BOX1"');
  document.writeln ('           onclick = "ClearEntry (', i, ');');
  document.writeln ('                      location.reload ();" />');
  document.writeln ('  </td>');
  document.writeln ('  <td align = "right">',
    cook.qty,'</td>');
  if (root.xx_pc == on) {
    document.writeln ('  <td align = "right">',
      cook.pcat,'</td>');
  }
  document.writeln ('  <td align = "left">',
    cook.cod,'</td>');
  document.writeln ('  <td align = "left">',
    cook.des);
  if (cook.ihnd > 0) {  // item-specific handling charges
    document.writeln (', HND=' + Dollar (cook.ihnd));
  }
  if (cook.ishp > 0) {  // item-specific shipping charges
    document.writeln (', SHP=' + Dollar (cook.ishp));
  }
  document.writeln (', ' +
    cook.op1n + ' ' + 
    cook.op1v + ' ' +
    cook.op2n + ' ' +
    cook.op2v,'</td>');
  tm = Dollar (cook.prc);
  t1 = cook.qty*1.0;
  t2 = cook.pcat;
  document.writeln ('  <td>',
    tm,'</td>');
  tm = Dollar (t1*cook.prc);
  tprc = tprc*1.0 + tm*1.0;
  tqty = tqty + t1;
  ctot["a" + t2] = ctot["a" + t2] + tm*1.0;
  ctot["q" + t2] = ctot["q" + t2] + t1;
  document.writeln ('  <td>',
    tm,'</td>');

  wt = cook.ozs*1.0 * cook.qty;
  tozs = tozs + wt;
  if (root.xx_wt == on) {  // do we show weight?
    document.writeln ('  <td>',
      cook.ozs,'</td>');
    document.writeln ('    <td>',
      wt,'</td>');
  }
  if (root.xx_img == off) {  // display images?
    document.writeln ('  <td align = "center">',
      '<img src = "', 
      cook.imgx,
      '" border="0" width="80" height="60"',
      ' alt = "Image: Item" />',
      '</td>');
  }
  document.writeln ('</tr>');
}

function ReadForm (obj1) { //get form data for PayPal
var i,j,obj,temp,pos,val,nam3,nam4;
var qty  = 0;              // default value
var dis  = 0;              // quantity discount
  for (i=0; i<obj1.length; i++) {     // run whole form
    obj = obj1.elements[i];           // ref particular element
    nam3 = obj.name.substring (0, 3); // 3-char name (maybe)
    nam4 = obj.name.substring (3, 4); // where to store it
    if (obj.type == "select-one") {   // dropdowns
      pos = obj.selectedIndex;        // which option selected
      val = obj.options[pos].value;   // get selection
      ChkFlg (val);                   // check for flag char
      if (nam3 == "opt") {            // user says where to store
        Where (val, nam4);            // stash it
      } else {
        AddDesc (val);                // add to data
      }
    } else
    if (obj.type == "select-multiple") {     // one or more
      for (j=0; j<obj.options.length; j++) { // run all options
        if (obj.options[j].selected) {
          val = obj.options[j].value;
          ChkFlg (val);                   // flag chars?
          if (nam3 == "opt") {            // user says where to store
            Where (val, nam4);            // stash it
          } else {
            AddDesc (val);                // add to data
          }
        }
      }
    } else
    if (obj.type == "checkbox" ||    // boxes
        obj.type == "radio") {
      if (obj.checked) {             // was selected
        val = obj.value;
        ChkFlg (val);                // flag chars?
        if (nam3 == "opt") {         // user says where to store
          Where (val, nam4);         // stash it
        } else {
          AddDesc (val);             // add to data
        }
      }
    } else
    if (obj.type == "text") {  // user input fields
      val = obj.value;         // get input
      if (qty == 0) {          // this is 1st time
        qty = val;             // get user input
        if (qty == "" || qty < 1 || isNaN (qty)) {  // test
          alert ("Enter a valid integer quantity!");
          return false;
        }
      } else {
        if (nam3 == "opt") { // user says where to store
          Where (val, nam4); // stash it
        } else {
          AddDesc (val);     // add to data
        }
      }
    }
  }
  if (qty == 0) qty = 1;     // make sure we have something
  blk2q = qty;               // record for posterity

  for (i=an-1; i>=0; i--) {  // qty amount?
    if (qty >= aqty[i]) {    // qty brkpt
      SetPrice (aamt[i]);    // force it
      AddDesc ("AMT");
      break;                 // get out, now
    }
  }

  dis = 0;                   // any qty discounts?
  for (i=dn-1; i>=0; i--) {  // run backwards
    if (qty >= dqty[i]) {    // qty brkpt
      dis = damt[i];         // set qty amount
      break;                 // get out, now
    }
  }
  if (dis > 0) {             // there is an item discount, here
    AddPrcnt (-dis);         // apply the discount
    AddDesc ("DIS=" + dis + "%");  // mark it
  }
  StoreCart ();
  if (root.xx_dadd == off) return false;  // hide cart display
  return true;
}

function SetAmtDC (pcat, a1, c1) {   // set cart amt discount brkpts
var i,av;
var aval = new Array ();
var achg = new Array ();
  if (pcat >= cats) {          // check him out
    alert ("SetAmtDC cat arg too big!");
    return;
  }
  av = 0;                      // count of breakpoints
  for (i=1; i<arguments.length; i=i+2) {
    aval[av] = arguments[i];   // price breakpoint
    achg[av] = arguments[i+1]; // discount percent
    av = av + 1;               // number of bkpts
  }
  root["av" + pcat]   = av;    // stash that bad boy off
  root["aval" + pcat] = aval;
  root["achg" + pcat] = achg;
  root.store();                // remember forever...
}

function SetAmtSH (pcat, a1, c1) {   // set cart amt shp brkpts
var i,sv;
var sval = new Array ();
var schg = new Array ();
  if (pcat >= cats) {          // check him out
    alert ("SetAmtSH cat arg too big!");
    return;
  }
  sv = 0;                      // count of breakpoints
  for (i=1; i<arguments.length; i=i+2) {
    sval[sv] = arguments[i];   // price breakpoint
    schg[sv] = arguments[i+1]; // discount amount
    sv = sv + 1;               // number of bkpts
  }
  root["sv" + pcat]   = sv;    // stash that bad boy off
  root["sval" + pcat] = sval;
  root["schg" + pcat] = schg;
  root.store();                // remember forever...
}

function SetCartHN (pcat, q1, c1) {  // set cart hand breakpoints
var i,hn;
var hamt = new Array ();
var hqty = new Array ();
  if (pcat >= cats) {          // check him out
    alert ("SetCartHN cat arg too big!");
    return;
  }
  hn = 0;                      // count of breakpoints
  for (i=1; i<arguments.length; i=i+2) {
    hqty[hn] = arguments[i];   // price breakpoint
    hamt[hn] = arguments[i+1]; // discount amount
    hn = hn + 1;               // number of bkpts
  }
  root["hn" + pcat] = hn;      // stash that bad boy off
  root["hqty" + pcat] = hqty;
  root["hamt" + pcat] = hamt;
  root.store();                // remember forever...
}

function SetCartDC (pcat, q1, c1) {  // set cart qty dis breakpoints
var i,qd;
var qqty = new Array ();
var qamt = new Array ();
  if (pcat >= cats) {          // check him out
    alert ("SetCartDC cat arg too big!");
    return;
  }
  qd = 0;                      // count of breakpoints
  for (i=1; i<arguments.length; i=i+2) {
    qqty[qd] = arguments[i];   // price breakpoint
    qamt[qd] = arguments[i+1]; // discount amount
    qd = qd + 1;               // number of bkpts
  }
  root["qd" + pcat] = qd;      // stash that bad boy off
  root["qqty" + pcat] = qqty;
  root["qamt" + pcat] = qamt;
  root.store();                // remember forever...
}

function SetCartSH (pcat, q1, c1) {  // set cart shp qty breakpoints
var i,sn;
var sqty = new Array ();
var samt = new Array ();
  if (pcat >= cats) {          // check him out
    alert ("SetCartSH cat arg too big!");
    return;
  }
  sn = 0;                      // count of breakpoints
  for (i=1; i<arguments.length; i=i+2) {
    sqty[sn] = arguments[i];   // price breakpoint
    samt[sn] = arguments[i+1]; // handling charge
    sn = sn + 1;               // number of bkpts
  }
  root["sn" + pcat] = sn;      // stash that bad boy off
  root["sqty" + pcat] = sqty;
  root["samt" + pcat] = samt;
  root.store();                // remember forever...
}

function SetCartTX (obj1) {    // set cart tax value
var i,pos;
  pos  = obj1.selectedIndex;   // which item selected
  stax = obj1.options[pos].value;
  ttxt = obj1.options[pos].text;
  root.stax = stax;
  root.ttxt = ttxt;
  root.store();                // remember forever...
  document.location.reload ();  // show the latest info...
}

function SetCode (cd) { // set product code
  bcode = cd;
}

function SetDesc (strn) {  // set the desc field
  blk3n = strn;
}

function SetHN (amt) {  // set item-specific handling charges
  blkhn = amt;    // set local variable
  AddPrice (amt); // add in the price
}

function SetID (strn) {  // set the PayPal ID of this user
  blk2b = strn;
}

function SetImg (strn) {  // set the image for the cart
  imgx = strn;
}

function SetOpt1 (nam, val) {  // set the value of 1st option
  op1n = nam;
  op1v = val;
}

function SetOpt2 (nam, val) {  // set the value of 2nd option
  op2n = nam;
  op2v = val;
}

function SetPcat (val) {
  if (val >= cats) {
    alert ("Only " + cats + " product categories allowed!\n\n" +
           "Correct your HTML!");
    return;
  }
  pcat = val;
}

function SetPrice (strn) {  // set the current price
  blk4a = 0;
  AddPrice (strn);
}

function SetQA (q1, a1) {      // set qty amount breakpoints
var i;
  an = 0;                      // count of breakpoints
  for (i=0; i<arguments.length; i=i+2) {
    aqty[an] = arguments[i];   // quantity
    aamt[an] = arguments[i+1]; // amount
    an = an + 1;               // number of discount bkpts
  }
}

function SetQtyD (q1, d1) {    // set item qty discount breakpoints
var i;
  dn = 0;                      // count of breakpoints
  for (i=0; i<arguments.length; i=i+2) {
    dqty[dn] = arguments[i];   // quantity
    damt[dn] = arguments[i+1]; // percent
    dn = dn + 1;               // number of discount bkpts
  }
}

function SetSH (amt) {  // set item specific shipping amount
  blksh = amt;    // set local variable
  AddPrice (amt); // add in the price
}

function SetWgtSH (pcat, w1, c1) {   // ship by weight bkpts
var i,wv;
var wval = new Array ();
var wchg = new Array ();
  if (pcat >= cats) {          // check him out
    alert ("SetWgtSH cat arg too big!");
    return;
  }
  wv = 0;                      // count of breakpoints
  for (i=1; i<arguments.length; i=i+2) {
    wval[wv] = arguments[i];   // price breakpoint
    wchg[wv] = arguments[i+1]; // discount amount
    wv = wv + 1;               // number of bkpts
  }
  root["wv" + pcat]   = wv;    // stash that bad boy off
  root["wval" + pcat] = wval;
  root["wchg" + pcat] = wchg;
  root.store();                // remember forever...
}

function SetWt (ozs) {  // set the weight of an item
  bozs = ozs;
}

function SetZone (zi1, zn1) {  // record zip/zone info into table
var i;
  zn = 0;                      // count of breakpoints
  for (var i=0; i<arguments.length; i=i+2) {
    zzip[zn] = arguments[i];   // zip code index
    zone[zn] = arguments[i+1]; // zone
    zn = zn + 1;               // number of bkpts
  }
}

function StoreCart () {  // store data in local cart
var i;
  for (i=1; i<cmax; i++) {      //check for dup entry
    cook = new Cookie (document, "paycart" + i);  // run
    cook.load();                // get values
    if (cook.qty*1.0 > 0) {     // check it out - combine dups
      if (cook.cod == bcode &&  // check everything!!!
          cook.des == blk3n &&
          cook.prc*1.0 == blk4a*1.0 &&
          cook.op1n == op1n &&
          cook.op1v == op1v &&
          cook.op2n == op2n &&
          cook.op2v == op2v) {
        cook.qty = cook.qty*1.0 + blk2q*1.0;  // combine
        cook.store();
        ClearAll ();
        return;                 // th-th-thats all, folks
      }
    }
  }
  for (i=1; i<cmax; i++) {  // find empty entry
    cook = new Cookie (document, "paycart" + i);
    cook.load();
    if (cook.qty*1.0 == 0 ||
        isNaN (cook.qty)) {
      cook.pcat = pcat
      cook.qty  = blk2q;
      cook.cod  = bcode;
      cook.des  = blk3n;
      cook.ihnd = blkhn;
      cook.ishp = blksh;
      cook.op1n = op1n;
      cook.op1v = op1v;
      cook.op2n = op2n;
      cook.op2v = op2v;
      cook.prc  = blk4a;
      cook.imgx = imgx;
      cook.ozs  = bozs;
      cook.store();
      ClearAll ();
      if (i == cmax - 1)
        alert ("Warning - that was your last cookie!");
      return;      
    }
  }
  alert ("Error 1 - out of cookies!");
}

function Where (val, loc) {  // store val at opt[loc]
  if (loc == 1) AddOpt1 (val);
  else          AddOpt2 (val);
}

function Xbild () {         // build the PayPal string
var i,j;
var tot  = 0;               // price total
var frst = 1;               //  1st time thru marker
var str  = "";              // string to PayPal
var disc = new Array ();    // price per item to subtract for discount
var tmps = root.stxt0+" "+ttxt;  // the shipping text

  for (i=0; i<cats; i++) {  // set item discounts
    disc[i] = ctot["d" + i] / ctot["q" + i];  // discount per item
  }
  j = 0;       // starting suffix
  for (i=1; i<cmax; i++) {  // run all the data cookies
    cook = new Cookie (document, "paycart" + i);
    cook.load();         // get contents
    if (cook.qty > 0) {  // something here
      j = j + 1;         // bump suffix
      str = str + "&quantity_"    + j + "=" + cook.qty;
      str = str + "&item_name_"   + j + "=" + escape (cook.des);
      str = str + "&amount_"      + j + "=" + 
                   Dollar (cook.prc*1.0 - disc[cook.pcat]);
      if (cook.op1n.length > 0) {    // 1st option present
        str = str + "&on0_"       + j + "=" + escape (cook.op1n);
        str = str + "&os0_"       + j + "=" + 
          escape (cook.op1v + ", " + tmps);
      } else if (tmps.length > 0 && ship > 0) {
        str = str + "&on0_"       + j + "=Shipping";
        str = str + "&os0_"       + j + "=" + escape (tmps);
      }
      tmps = "";  // zap it
      if (cook.op2n.length > 0) {    // 2nd option present
        str = str + "&on1_"       + j + "=" + escape (cook.op2n);
        str = str + "&os1_"       + j + "=" + escape (cook.op2v);
      }
      if (cook.cod != "")
        str = str + "&item_number_" + j + "=" + escape (cook.cod);
      if (cook.cus != "")
        str = str + "&custom_"      + j + "=" + escape (cook.cus);
      if (frst > 0 && (hand > 0 || insx > 0 || cook.ihnd > 0)) {
        str = str + "&handling_" + j + "=" + 
          Dollar (hand*1.0 + insx*1.0 + cook.ihnd*1.0);
      } else if (frst == 0 && cook.ihnd > 0)
        str = str + "&handling_" + j + "=" + 
          Dollar (cook.ihnd);

      if (frst > 0 && ttax > 0) {
        str = str + "&tax_"      + j + "=" + 
          Dollar (ttax/cook.qty);
      } else
      if (frst == 0 && ttax > 0) // zap any preference tax
        str = str + "&tax_"      + j + "=0";

      if (frst > 0 && (ship > 0 || cook.ishp > 0)) {
        str = str + "&shipping_"  + j + "=" + 
          Dollar (ship*1.0 + cook.ishp*1.0);
      } else if (frst == 0 || cook.ishp > 0)
        str = str + "&shipping_"  + j + "=" +
          Dollar (cook.ishp);
      frst = 0;  // set to false - true only on 1st item
    }    
  }
  return str;
}


// these are the priority mail zone charge tables (1-8) to 40lbs.
var pz1  = new Array (0,  // USPS priority zone one
  2.00,  2.00,  3.00,  3.00,  3.00,  3.00,  4.00,  4.00,  4.00,  4.00,
  5.00,  5.00,  5.00,  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,
  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,
  6.00,  6.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,
  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,
  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,
  7.00,  7.00,  7.00,  7.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,
  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,
  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,
  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  9.00,  9.00,  9.00,  9.00,
  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,
  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,
  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  10.00,  10.00,
  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,
  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,
  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,
 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00,
 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 13.00, 13.00, 13.00, 13.00,
 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00,
 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00);
var pz2  = new Array (0,
  2.00,  2.00,  3.00,  3.00,  3.00,  3.00,  4.00,  4.00,  4.00,  4.00,
  5.00,  5.00,  5.00,  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,
  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,
  6.00,  6.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,
  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,
  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,
  7.00,  7.00,  7.00,  7.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,
  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,
  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,
  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  9.00,  9.00,  9.00,  9.00,
  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,
  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,
  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  10.00,  10.00,
  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,
  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,
  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,
 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00,
 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 13.00, 13.00, 13.00, 13.00,
 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00,
 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00);
var pz3  = new Array (0,
  2.00,  2.00,  3.00,  3.00,  3.00,  3.00,  4.00,  4.00,  4.00,  4.00,
  5.00,  5.00,  5.00,  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,
  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,
  6.00,  6.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,
  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,
  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,
  7.00,  7.00,  7.00,  7.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,
  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,
  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,
  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  9.00,  9.00,  9.00,  9.00,
  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,
  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,
  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  10.00,  10.00,
  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,
  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,
  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,
 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00,
 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 13.00, 13.00, 13.00, 13.00,
 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00,
 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00);
var pz4  = new Array (0, 
  2.00,  2.00,  3.00,  3.00,  3.00,  3.00,  4.00,  4.00,  4.00,  4.00,
  5.00,  5.00,  5.00,  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,
  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,  6.00,
  6.00,  6.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,
  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  9.00,  9.00,
  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,
  9.00,  9.00,  9.00,  9.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,
  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,
 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00,
 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 13.00, 13.00, 13.00, 13.00,
 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00,
 13.00, 13.00, 14.00, 14.00, 14.00, 14.00, 14.00, 14.00, 14.00, 14.00,
 14.00, 14.00, 14.00, 14.00, 14.00, 14.00, 14.00, 14.00, 15.00, 15.00,
 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00,
 15.00, 15.00, 15.00, 15.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00,
 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00,
 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00,
 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00,
 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00,
 17.00, 17.00, 18.00, 18.00, 18.00, 18.00, 18.00, 18.00, 18.00, 18.00);
var pz5  = new Array (0,
  2.00,  2.00,  3.00,  3.00,  3.00,  3.00,  4.00,  4.00,  4.00,  4.00,
  5.00,  5.00,  5.00,  6.00,  6.00,  6.00,  7.00,  7.00,  7.00,  7.00,
  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,
  7.00,  7.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,
  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  10.00,  10.00,
  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,
  10.00,  10.00,  10.00,  10.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00,
 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00,
 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00,
 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 14.00, 14.00, 14.00, 14.00,
 14.00, 14.00, 14.00, 14.00, 14.00, 14.00, 14.00, 14.00, 14.00, 14.00,
 14.00, 14.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00,
 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00,
 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00,
 15.00, 15.00, 15.00, 15.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00,
 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00,
 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00,
 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 18.00, 18.00, 18.00, 18.00,
 18.00, 18.00, 18.00, 18.00, 18.00, 18.00, 18.00, 18.00, 18.00, 18.00,
 18.00, 18.00, 18.00, 18.00, 18.00, 18.00, 18.00, 18.00, 18.00, 18.00);
var pz6  = new Array (0,
  2.00,  2.00,  3.00,  3.00,  3.00,  3.00,  4.00,  4.00,  4.00,  4.00,
  5.00,  5.00,  5.00,  6.00,  6.00,  6.00,  7.00,  7.00,  7.00,  7.00,
  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,
  7.00,  7.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,
  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  10.00,  10.00,
  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,
  10.00,  10.00,  10.00,  10.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00,
 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00,
 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00,
 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 14.00, 14.00, 14.00, 14.00,
 14.00, 14.00, 14.00, 14.00, 14.00, 14.00, 14.00, 14.00, 14.00, 14.00,
 14.00, 14.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00,
 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 17.00, 17.00,
 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00,
 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00,
 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00,
 18.00, 18.00, 18.00, 18.00, 18.00, 18.00, 18.00, 18.00, 18.00, 18.00,
 18.00, 18.00, 18.00, 18.00, 18.00, 18.00, 19.00, 19.00, 19.00, 19.00,
 19.00, 19.00, 19.00, 19.00, 19.00, 19.00, 19.00, 19.00, 19.00, 19.00,
 19.00, 19.00, 20.00, 20.00, 20.00, 20.00, 20.00, 20.00, 20.00, 20.00);
var pz7  = new Array (0,
  2.00,  2.00,  3.00,  3.00,  3.00,  3.00,  4.00,  4.00,  4.00,  4.00,
  5.00,  5.00,  5.00,  6.00,  6.00,  6.00,  7.00,  7.00,  7.00,  7.00,
  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,
  7.00,  7.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,
  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00,  10.00, 12.00, 12.00,
 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00,
 12.00, 12.00, 12.00, 12.00, 14.00, 14.00, 14.00, 14.00, 14.00, 14.00,
 14.00, 14.00, 14.00, 14.00, 14.00, 14.00, 14.00, 14.00, 14.00, 14.00,
 14.00, 14.00, 14.00, 14.00, 14.00, 14.00, 14.00, 14.00, 14.00, 14.00,
 14.00, 14.00, 14.00, 14.00, 14.00, 14.00, 17.00, 17.00, 17.00, 17.00,
 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00,
 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00,
 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 18.00, 18.00,
 18.00, 18.00, 18.00, 18.00, 18.00, 18.00, 18.00, 18.00, 18.00, 18.00,
 18.00, 18.00, 18.00, 18.00, 19.00, 19.00, 19.00, 19.00, 19.00, 19.00,
 19.00, 19.00, 19.00, 19.00, 19.00, 19.00, 19.00, 19.00, 19.00, 19.00,
 20.00, 20.00, 20.00, 20.00, 20.00, 20.00, 20.00, 20.00, 20.00, 20.00,
 20.00, 20.00, 20.00, 20.00, 20.00, 20.00, 22.00, 22.00, 22.00, 22.00,
 22.00, 22.00, 22.00, 22.00, 22.00, 22.00, 22.00, 22.00, 22.00, 22.00,
 22.00, 22.00, 23.00, 23.00, 23.00, 23.00, 23.00, 23.00, 23.00, 23.00);
var pz8  = new Array (0,
  2.00,  2.00,  3.00,  3.00,  3.00,  3.00,  4.00,  4.00,  4.00,  4.00,
  5.00,  5.00,  5.00,  6.00,  6.00,  6.00,  8.00,  8.00,  8.00,  8.00,
  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,  8.00,
 8.00,  8.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00,
 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 12.00, 13.00, 13.00,
 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00, 13.00,
 13.00, 13.00, 13.00, 13.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00,
 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00,
 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 15.00,
 15.00, 15.00, 15.00, 15.00, 15.00, 15.00, 17.00, 17.00, 17.00, 17.00,
 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00, 17.00,
 17.00, 17.00, 19.00, 19.00, 19.00, 19.00, 19.00, 19.00, 19.00, 19.00,
 19.00, 19.00, 19.00, 19.00, 19.00, 19.00, 19.00, 19.00, 20.00, 20.00,
 20.00, 20.00, 20.00, 20.00, 20.00, 20.00, 20.00, 20.00, 20.00, 20.00,
 20.00, 20.00, 20.00, 20.00, 22.00, 22.00, 22.00, 22.00, 22.00, 22.00,
 22.00, 22.00, 22.00, 22.00, 22.00, 22.00, 22.00, 22.00, 22.00, 22.00,
 24.00, 24.00, 24.00, 24.00, 24.00, 24.00, 24.00, 24.00, 24.00, 24.00,
 24.00, 24.00, 24.00, 24.00, 24.00, 24.00, 26.00, 26.00, 26.00, 26.00,
 26.00, 26.00, 26.00, 26.00, 26.00, 26.00, 26.00, 26.00, 26.00, 26.00,
 26.00, 26.00, 28.00, 28.00, 28.00, 28.00, 28.00, 28.00, 28.00, 28.00);
var pzx  = new Array (0,pz1,pz2,pz3,pz4,pz5,pz6,pz7,pz8);


// these are the parcel post mail zone charge tables (1-8) to 40lbs.
var pp1  = new Array (0,
  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,
  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.75,  2.75,  2.75,  2.75,
  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,
  2.75,  2.75,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,
  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.60,  4.60,
  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,
  4.60,  4.60,  4.60,  4.60,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,
  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,
  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,
  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.90,  5.90,  5.90,  5.90,
  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,
  5.90,  5.90,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,
  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.50,  6.50,
  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,
  6.50,  6.50,  6.50,  6.50,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,
  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,
  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,
  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.45,  7.45,  7.45,  7.45,
  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,
  7.45,  7.45,  7.75,  7.75,  7.75,  7.75,  7.75,  7.75,  7.75,  7.75);
var pp2  = new Array (0,
  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,
  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.75,  2.75,  2.75,  2.75,
  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,
  2.75,  2.75,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,
  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.60,  4.60,
  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,
  4.60,  4.60,  4.60,  4.60,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,
  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,
  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,
  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.90,  5.90,  5.90,  5.90,
  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,
  5.90,  5.90,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,
  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.50,  6.50,
  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,
  6.50,  6.50,  6.50,  6.50,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,
  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,
  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,
  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.45,  7.45,  7.45,  7.45,
  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,
  7.45,  7.45,  7.75,  7.75,  7.75,  7.75,  7.75,  7.75,  7.75,  7.75);
var pp3  = new Array (0,
  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,
  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.75,  2.75,  2.75,  2.75,
  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,
  2.75,  2.75,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,
  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.60,  4.60,
  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,
  4.60,  4.60,  4.60,  4.60,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,
  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,
  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,
  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.90,  5.90,  5.90,  5.90,
  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,
  5.90,  5.90,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,
  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.50,  6.50,
  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,
  6.50,  6.50,  6.50,  6.50,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,
  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,
  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,
  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.45,  7.45,  7.45,  7.45,
  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,
  7.45,  7.45,  7.75,  7.75,  7.75,  7.75,  7.75,  7.75,  7.75,  7.75);
var pp4  = new Array (0, 
  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,
  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.75,  2.75,  2.75,  2.75,
  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,
  2.75,  2.75,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,
  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.60,  4.60,
  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,
  4.60,  4.60,  4.60,  4.60,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,
  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,
  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,
  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.90,  5.90,  5.90,  5.90,
  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,
  5.90,  5.90,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,
  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.50,  6.50,
  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,
  6.50,  6.50,  6.50,  6.50,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,
  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,
  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,
  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.45,  7.45,  7.45,  7.45,
  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,
  7.45,  7.45,  7.75,  7.75,  7.75,  7.75,  7.75,  7.75,  7.75,  7.75);
var pp5  = new Array (0,
  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,
  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.75,  2.75,  2.75,  2.75,
  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,
  2.75,  2.75,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,
  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.60,  4.60,
  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,
  4.60,  4.60,  4.60,  4.60,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,
  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,
  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,
  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.90,  5.90,  5.90,  5.90,
  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,
  5.90,  5.90,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,
  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.50,  6.50,
  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,
  6.50,  6.50,  6.50,  6.50,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,
  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,
  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,
  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.45,  7.45,  7.45,  7.45,
  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,
  7.45,  7.45,  7.75,  7.75,  7.75,  7.75,  7.75,  7.75,  7.75,  7.75);
var pp6  = new Array (0,
  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,
  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.75,  2.75,  2.75,  2.75,
  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,
  2.75,  2.75,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,
  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.60,  4.60,
  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,
  4.60,  4.60,  4.60,  4.60,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,
  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,
  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,
  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.90,  5.90,  5.90,  5.90,
  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,
  5.90,  5.90,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,
  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.50,  6.50,
  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,
  6.50,  6.50,  6.50,  6.50,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,
  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,
  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,
  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.45,  7.45,  7.45,  7.45,
  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,
  7.45,  7.45,  7.75,  7.75,  7.75,  7.75,  7.75,  7.75,  7.75,  7.75);
var pp7  = new Array (0,
  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,
  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.75,  2.75,  2.75,  2.75,
  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,
  2.75,  2.75,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,
  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.60,  4.60,
  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,
  4.60,  4.60,  4.60,  4.60,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,
  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,
  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,
  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.90,  5.90,  5.90,  5.90,
  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,
  5.90,  5.90,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,
  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.50,  6.50,
  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,
  6.50,  6.50,  6.50,  6.50,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,
  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,
  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,
  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.45,  7.45,  7.45,  7.45,
  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,
  7.45,  7.45,  7.75,  7.75,  7.75,  7.75,  7.75,  7.75,  7.75,  7.75);
var pp8  = new Array (0,
  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,
  2.35,  2.35,  2.35,  2.35,  2.35,  2.35,  2.75,  2.75,  2.75,  2.75,
  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,  2.75,
  2.75,  2.75,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,
  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.20,  4.60,  4.60,
  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,  4.60,
  4.60,  4.60,  4.60,  4.60,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,
  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,  5.05,
  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,
  5.50,  5.50,  5.50,  5.50,  5.50,  5.50,  5.90,  5.90,  5.90,  5.90,
  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,  5.90,
  5.90,  5.90,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,
  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.20,  6.50,  6.50,
  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,  6.50,
  6.50,  6.50,  6.50,  6.50,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,
  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,  6.85,
  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,
  7.15,  7.15,  7.15,  7.15,  7.15,  7.15,  7.45,  7.45,  7.45,  7.45,
  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,  7.45,
  7.45,  7.45,  7.75,  7.75,  7.75,  7.75,  7.75,  7.75,  7.75,  7.75);
var ppx  = new Array (0,pp1,pp2,pp3,pp4,pp5,pp6,pp7,pp8);


// UPS residential ground, lower 48 charges to 70 lbs. 5 Jan 2004
var uz1  = new Array (0,
  2.00,  2.00,  3.00,  3.00,  3.00,  3.00,  3.00,  5.00,  5.00,  5.00,
  5.00,  5.00,  5.00,  5.00,  5.00,  5.00,  6.00,  6.00,  6.00,  6.00,
  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  7.00,  8.00,  8.00,
  8.00,  8.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,  9.00,
 10.00, 10.00, 10.00, 10.00, 11.00, 11.00, 11.00, 11.00, 11.00, 11.00,
 11.00, 11.00, 12.00, 12.00, 12.00, 12.00, 13.00, 13.00, 13.00, 13.00,
 14.00, 14.00, 14.00, 14.00, 19.00, 19.00, 19.00, 19.00, 19.00, 19.00,
 19.00, 19.00, 19.00, 19.00, 19.00, 19.00, 19.00, 19.00, 19.00, 19.00,
 20.00, 20.00, 20.00, 20.00, 20.00, 20.00, 20.00, 20.00, 20.00, 20.00,
 20.00, 20.00, 20.00, 20.00, 20.00, 20.00, 21.00, 21.00, 21.00, 21.00,
 21.00, 21.00, 21.00, 21.00, 21.00, 21.00, 21.00, 21.00, 21.00, 21.00,
 21.00, 21.00, 22.00, 22.00, 22.00, 22.00, 22.00, 22.00, 22.00, 22.00,
 22.00, 22.00, 22.00, 22.00, 22.00, 22.00, 22.00, 22.00, 23.00, 23.00, 
 23.00, 23.00, 23.00, 23.00, 23.00, 23.00, 23.00, 23.00, 23.00, 23.00,
 23.00, 23.00, 23.00, 23.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00,
 25.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00,
 26.00, 26.00, 26.00, 26.00, 26.00, 26.00, 26.00, 26.00, 26.00, 26.00,
 26.00, 26.00, 26.00, 26.00, 26.00, 26.00, 27.00, 27.00, 27.00, 27.00,
 27.00, 27.00, 27.00, 27.00, 27.00, 27.00, 27.00, 27.00, 27.00, 27.00,
 27.00, 27.00, 28.00, 28.00, 28.00, 28.00, 28.00, 28.00, 28.00, 28.00);
var uz2  = new Array (0,
  2.00,  2.00,  3.00,  5.00,  5.00,  4.00,  4.00,  6.00,  6.00,  6.00,
  6.00,  6.00,  7.00,  7.00,  7.00,  7.00,  8.00,  8.00,  8.00,  8.00,
  9.00,  9.00,  9.00,  9.00, 10.00, 10.00, 10.00, 10.00, 12.00, 12.00,
 12.00, 12.00, 13.00, 13.00, 13.00, 13.00, 14.00, 14.00, 14.00, 14.00,
 15.00, 15.00, 15.00, 15.00, 17.00, 17.00, 17.00, 17.00, 18.00, 18.00,
 18.00, 18.00, 19.00, 19.00, 19.00, 19.00, 20.00, 20.00, 20.00, 20.00,
 22.00, 22.00, 22.00, 22.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00,
 25.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00,
 27.00, 27.00, 27.00, 27.00, 27.00, 27.00, 27.00, 27.00, 27.00, 27.00,
 27.00, 27.00, 27.00, 27.00, 27.00, 27.00, 29.00, 29.00, 29.00, 29.00,
 29.00, 29.00, 29.00, 29.00, 29.00, 29.00, 29.00, 29.00, 29.00, 29.00,
 29.00, 29.00, 32.00, 32.00, 32.00, 32.00, 32.00, 32.00, 32.00, 32.00,
 32.00, 32.00, 32.00, 32.00, 32.00, 32.00, 32.00, 32.00, 34.00, 34.00,
 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00,
 34.00, 34.00, 34.00, 34.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00,
 36.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00,
 38.00, 38.00, 38.00, 38.00, 38.00, 38.00, 38.00, 38.00, 38.00, 38.00,
 38.00, 38.00, 38.00, 38.00, 38.00, 38.00, 40.00, 40.00, 40.00, 40.00,
 40.00, 40.00, 40.00, 40.00, 40.00, 40.00, 40.00, 40.00, 40.00, 40.00,
 40.00, 40.00, 42.00, 42.00, 42.00, 42.00, 42.00, 42.00, 42.00, 42.00);
var uz3  = new Array (0,
  2.00,  3.00,  4.00,  6.00,  6.00,  6.00,  6.00,  9.00,  9.00,  9.00,
  9.00,  9.00, 10.00, 10.00, 10.00, 10.00, 12.00, 12.00, 12.00, 12.00,
 13.00, 13.00, 13.00, 13.00, 14.00, 14.00, 14.00, 14.00, 15.00, 15.00,
 15.00, 15.00, 16.00, 16.00, 16.00, 16.00, 18.00, 18.00, 18.00, 18.00,
 19.00, 19.00, 19.00, 19.00, 20.00, 20.00, 20.00, 20.00, 22.00, 22.00,
 22.00, 22.00, 23.00, 23.00, 23.00, 23.00, 24.00, 24.00, 24.00, 24.00,
 25.00, 25.00, 25.00, 25.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00,
 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00,
 38.00, 38.00, 38.00, 38.00, 38.00, 38.00, 38.00, 38.00, 38.00, 38.00,
 38.00, 38.00, 38.00, 38.00, 38.00, 38.00, 41.00, 41.00, 41.00, 41.00,
 41.00, 41.00, 41.00, 41.00, 41.00, 41.00, 41.00, 41.00, 41.00, 41.00,
 41.00, 41.00, 44.00, 44.00, 44.00, 44.00, 44.00, 44.00, 44.00, 44.00,
 44.00, 44.00, 44.00, 44.00, 44.00, 44.00, 44.00, 44.00, 47.00, 47.00,
 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00,
 47.00, 47.00, 47.00, 47.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00,
 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00,
 53.00, 53.00, 53.00, 53.00, 53.00, 53.00, 53.00, 53.00, 53.00, 53.00,
 53.00, 53.00, 53.00, 53.00, 53.00, 53.00, 56.00, 56.00, 56.00, 56.00,
 56.00, 56.00, 56.00, 56.00, 56.00, 56.00, 56.00, 56.00, 56.00, 56.00,
 56.00, 56.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00);
var uz4  = new Array (0,
  2.00,  3.00,  4.00,  6.00,  6.00,  6.00,  6.00,  9.00,  9.00,  9.00,
  9.00,  9.00, 11.00, 11.00, 11.00, 11.00, 13.00, 13.00, 13.00, 13.00,
 14.00, 14.00, 14.00, 14.00, 16.00, 16.00, 16.00, 16.00, 18.00, 18.00,
 18.00, 18.00, 19.00, 19.00, 19.00, 19.00, 21.00, 21.00, 21.00, 21.00,
 23.00, 23.00, 23.00, 23.00, 25.00, 25.00, 25.00, 25.00, 27.00, 27.00,
 27.00, 27.00, 28.00, 28.00, 28.00, 28.00, 30.00, 30.00, 30.00, 30.00,
 32.00, 32.00, 32.00, 32.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00,
 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00,
 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00,
 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 39.00, 39.00, 39.00, 39.00,
 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00,
 39.00, 39.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00,
 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 47.00, 47.00,
 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00,
 47.00, 47.00, 47.00, 47.00, 52.00, 52.00, 52.00, 52.00, 52.00, 52.00,
 52.00, 52.00, 52.00, 52.00, 52.00, 52.00, 52.00, 52.00, 52.00, 52.00,
 56.00, 56.00, 56.00, 56.00, 56.00, 56.00, 56.00, 56.00, 56.00, 56.00,
 56.00, 56.00, 56.00, 56.00, 56.00, 56.00, 60.00, 60.00, 60.00, 60.00,
 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,
 60.00, 60.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00);
var uz5  = new Array (0,
  2.00,  3.00,  4.00,  7.00,  7.00,  7.00,  7.00, 10.00, 10.00, 10.00,
 10.00, 10.00, 11.00, 11.00, 11.00, 11.00, 13.00, 13.00, 13.00, 13.00,
 14.00, 14.00, 14.00, 14.00, 16.00, 16.00, 16.00, 16.00, 17.00, 17.00,
 17.00, 17.00, 18.00, 18.00, 18.00, 18.00, 20.00, 20.00, 20.00, 20.00,
 21.00, 21.00, 21.00, 21.00, 23.00, 23.00, 23.00, 23.00, 24.00, 24.00,
 24.00, 24.00, 25.00, 25.00, 25.00, 25.00, 27.00, 27.00, 27.00, 27.00,
 28.00, 28.00, 28.00, 28.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00,
 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00,
 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00,
 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 43.00, 43.00, 43.00, 43.00,
 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00,
 43.00, 43.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00,
 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 51.00, 51.00,
 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00,
 51.00, 51.00, 51.00, 51.00, 56.00, 56.00, 56.00, 56.00, 56.00, 56.00,
 56.00, 56.00, 56.00, 56.00, 56.00, 56.00, 56.00, 56.00, 56.00, 56.00,
 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,
 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 64.00, 64.00, 64.00, 64.00,
 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00,
 64.00, 64.00, 68.00, 68.00, 68.00, 68.00, 68.00, 68.00, 68.00, 68.00);
var uz6  = new Array (0,
  2.00,  3.00,  4.00,  6.00,  6.00,  6.00,  6.00,  9.00,  9.00,  9.00,
  9.00,  9.00, 10.00, 10.00, 10.00, 10.00, 12.00, 12.00, 12.00, 12.00,
 13.00, 13.00, 13.00, 13.00, 14.00, 14.00, 14.00, 14.00, 15.00, 15.00,
 15.00, 15.00, 16.00, 16.00, 16.00, 16.00, 18.00, 18.00, 18.00, 18.00,
 19.00, 19.00, 19.00, 19.00, 20.00, 20.00, 20.00, 20.00, 22.00, 22.00,
 22.00, 22.00, 23.00, 23.00, 23.00, 23.00, 24.00, 24.00, 24.00, 24.00,
 25.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00,
 25.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00,
 28.00, 28.00, 28.00, 28.00, 28.00, 28.00, 28.00, 28.00, 28.00, 28.00,
 28.00, 28.00, 28.00, 28.00, 28.00, 28.00, 31.00, 31.00, 31.00, 31.00,
 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00,
 31.00, 31.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00,
 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 37.00, 37.00,
 37.00, 37.00, 37.00, 37.00, 37.00, 37.00, 37.00, 37.00, 37.00, 37.00,
 37.00, 37.00, 37.00, 37.00, 40.00, 40.00, 40.00, 40.00, 40.00, 40.00,
 40.00, 40.00, 40.00, 40.00, 40.00, 40.00, 40.00, 40.00, 40.00, 40.00,
 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00,
 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 46.00, 46.00, 46.00, 46.00,
 46.00, 46.00, 46.00, 46.00, 46.00, 46.00, 46.00, 46.00, 46.00, 46.00,
 46.00, 46.00, 49.00, 49.00, 49.00, 49.00, 49.00, 49.00, 49.00, 49.00);
var uz7  = new Array (0,
  2.00,  3.00,  4.00,  6.00,  6.00,  6.00,  6.00,  9.00,  9.00,  9.00,
  9.00,  9.00, 10.00, 10.00, 10.00, 10.00, 12.00, 12.00, 12.00, 12.00,
 13.00, 13.00, 13.00, 13.00, 14.00, 14.00, 14.00, 14.00, 15.00, 15.00,
 15.00, 15.00, 16.00, 16.00, 16.00, 16.00, 18.00, 18.00, 18.00, 18.00,
 19.00, 19.00, 19.00, 19.00, 20.00, 20.00, 20.00, 20.00, 22.00, 22.00,
 22.00, 22.00, 23.00, 23.00, 23.00, 23.00, 24.00, 24.00, 24.00, 24.00,
 25.00, 25.00, 25.00, 25.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,
 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,
 33.00, 33.00, 33.00, 33.00, 33.00, 33.00, 33.00, 33.00, 33.00, 33.00,
 33.00, 33.00, 33.00, 33.00, 33.00, 33.00, 36.00, 36.00, 36.00, 36.00,
 36.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00,
 36.00, 36.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00,
 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 42.00, 42.00,
 42.00, 42.00, 42.00, 42.00, 42.00, 42.00, 42.00, 42.00, 42.00, 42.00,
 42.00, 42.00, 42.00, 42.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00,
 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00,
 48.00, 48.00, 48.00, 48.00, 48.00, 48.00, 48.00, 48.00, 48.00, 48.00,
 48.00, 48.00, 48.00, 48.00, 48.00, 48.00, 52.00, 52.00, 52.00, 52.00,
 52.00, 52.00, 52.00, 52.00, 52.00, 52.00, 52.00, 52.00, 52.00, 52.00,
 52.00, 52.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00);
 var uz8  = new Array (0,
  2.00,  3.00,  4.00,  6.00,  6.00,  6.00,  6.00,  9.00,  9.00,  9.00,
  9.00,  9.00, 11.00, 11.00, 11.00, 11.00, 13.00, 13.00, 13.00, 13.00,
 14.00, 14.00, 14.00, 14.00, 16.00, 16.00, 16.00, 16.00, 18.00, 18.00,
 18.00, 18.00, 19.00, 19.00, 19.00, 19.00, 21.00, 21.00, 21.00, 21.00,
 23.00, 23.00, 23.00, 23.00, 25.00, 25.00, 25.00, 25.00, 27.00, 27.00,
 27.00, 27.00, 28.00, 28.00, 28.00, 28.00, 30.00, 30.00, 30.00, 30.00,
 32.00, 32.00, 32.00, 32.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00,
 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00,
 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00,
 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 37.00, 37.00, 37.00, 37.00,
 37.00, 37.00, 37.00, 37.00, 37.00, 37.00, 37.00, 37.00, 37.00, 37.00,
 37.00, 37.00, 41.00, 41.00, 41.00, 41.00, 41.00, 41.00, 41.00, 41.00,
 41.00, 41.00, 41.00, 41.00, 41.00, 41.00, 41.00, 41.00, 44.00, 44.00,
 44.00, 44.00, 44.00, 44.00, 44.00, 44.00, 44.00, 44.00, 44.00, 44.00,
 44.00, 44.00, 44.00, 44.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00,
 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00,
 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00,
 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 54.00, 54.00, 54.00, 54.00,
 54.00, 54.00, 54.00, 54.00, 54.00, 54.00, 54.00, 54.00, 54.00, 54.00,
 54.00, 54.00, 58.00, 58.00, 58.00, 58.00, 58.00, 58.00, 58.00, 58.00);
 var uz9  = new Array (0,
  2.00,  3.00,  4.00,  6.00,  6.00,  6.00,  6.00,  9.00,  9.00,  9.00,
  9.00,  9.00, 11.00, 11.00, 11.00, 11.00, 13.00, 13.00, 13.00, 13.00,
 14.00, 14.00, 14.00, 14.00, 16.00, 16.00, 16.00, 16.00, 18.00, 18.00,
 18.00, 18.00, 19.00, 19.00, 19.00, 19.00, 21.00, 21.00, 21.00, 21.00,
 23.00, 23.00, 23.00, 23.00, 25.00, 25.00, 25.00, 25.00, 27.00, 27.00,
 27.00, 27.00, 28.00, 28.00, 28.00, 28.00, 30.00, 30.00, 30.00, 30.00,
 32.00, 32.00, 32.00, 32.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00,
 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00,
 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00,
 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 43.00, 43.00, 43.00, 43.00,
 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00,
 43.00, 43.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00,
 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 51.00, 51.00,
 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00,
 51.00, 51.00, 51.00, 51.00, 56.00, 56.00, 56.00, 56.00, 56.00, 56.00,
 56.00, 56.00, 56.00, 56.00, 56.00, 56.00, 56.00, 56.00, 56.00, 56.00,
 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,
 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 64.00, 64.00, 64.00, 64.00,
 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00,
 64.00, 64.00, 68.00, 68.00, 68.00, 68.00, 68.00, 68.00, 68.00, 68.00);
 var uz10  = new Array (0,
  2.00,  3.00,  4.00,  7.00,  7.00,  7.00,  7.00, 10.00, 10.00, 10.00,
 10.00, 10.00, 11.00, 11.00, 11.00, 11.00, 13.00, 13.00, 13.00, 13.00,
 14.00, 14.00, 14.00, 14.00, 16.00, 16.00, 16.00, 16.00, 17.00, 17.00,
 17.00, 17.00, 18.00, 18.00, 18.00, 18.00, 20.00, 20.00, 20.00, 20.00,
 21.00, 21.00, 21.00, 21.00, 23.00, 23.00, 23.00, 23.00, 24.00, 24.00,
 24.00, 24.00, 25.00, 25.00, 25.00, 25.00, 27.00, 27.00, 27.00, 27.00,
 28.00, 28.00, 28.00, 28.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00,
 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00,
 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00,
 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 39.00, 39.00, 39.00, 39.00,
 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00,
 39.00, 39.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00,
 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 47.00, 47.00,
 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00,
 47.00, 47.00, 47.00, 47.00, 52.00, 52.00, 52.00, 52.00, 52.00, 52.00,
 52.00, 52.00, 52.00, 52.00, 52.00, 52.00, 52.00, 52.00, 52.00, 52.00,
 56.00, 56.00, 56.00, 56.00, 56.00, 56.00, 56.00, 56.00, 56.00, 56.00,
 56.00, 56.00, 56.00, 56.00, 56.00, 56.00, 60.00, 60.00, 60.00, 60.00,
 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,
 60.00, 60.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00);
 var uz11  = new Array (0,
  2.00,  3.00,  4.00,  7.00,  7.00,  7.00,  7.00, 10.00, 10.00, 10.00,
 10.00, 10.00, 11.00, 11.00, 11.00, 11.00, 13.00, 13.00, 13.00, 13.00,
 14.00, 14.00, 14.00, 14.00, 16.00, 16.00, 16.00, 16.00, 17.00, 17.00,
 17.00, 17.00, 18.00, 18.00, 18.00, 18.00, 20.00, 20.00, 20.00, 20.00,
 21.00, 21.00, 21.00, 21.00, 23.00, 23.00, 23.00, 23.00, 24.00, 24.00,
 24.00, 24.00, 25.00, 25.00, 25.00, 25.00, 27.00, 27.00, 27.00, 27.00,
 28.00, 28.00, 28.00, 28.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00,
 36.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00,
 40.00, 40.00, 40.00, 40.00, 40.00, 40.00, 40.00, 40.00, 40.00, 40.00,
 40.00, 40.00, 40.00, 40.00, 40.00, 40.00, 43.00, 43.00, 43.00, 43.00,
 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00,
 43.00, 43.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00,
 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 50.00, 50.00,
 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00,
 50.00, 50.00, 50.00, 50.00, 53.00, 53.00, 53.00, 53.00, 53.00, 53.00,
 53.00, 53.00, 53.00, 53.00, 53.00, 53.00, 53.00, 53.00, 53.00, 53.00,
 57.00, 57.00, 57.00, 57.00, 57.00, 57.00, 57.00, 57.00, 57.00, 57.00,
 57.00, 57.00, 57.00, 57.00, 57.00, 57.00, 60.00, 60.00, 60.00, 60.00,
 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,
 60.00, 60.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00);
 var uz12  = new Array (0,
  2.00,  3.00,  4.00,  6.00,  6.00,  6.00,  6.00,  9.00,  9.00,  9.00,
  9.00,  9.00, 11.00, 11.00, 11.00, 11.00, 13.00, 13.00, 13.00, 13.00,
 14.00, 14.00, 14.00, 14.00, 16.00, 16.00, 16.00, 16.00, 18.00, 18.00,
 18.00, 18.00, 19.00, 19.00, 19.00, 19.00, 21.00, 21.00, 21.00, 21.00,
 23.00, 23.00, 23.00, 23.00, 25.00, 25.00, 25.00, 25.00, 27.00, 27.00,
 27.00, 27.00, 28.00, 28.00, 28.00, 28.00, 30.00, 30.00, 30.00, 30.00,
 32.00, 32.00, 32.00, 32.00, 23.00, 23.00, 23.00, 23.00, 23.00, 23.00,
 23.00, 23.00, 23.00, 23.00, 23.00, 23.00, 23.00, 23.00, 23.00, 23.00,
 26.00, 26.00, 26.00, 26.00, 26.00, 26.00, 26.00, 26.00, 26.00, 26.00,
 26.00, 26.00, 26.00, 26.00, 26.00, 26.00, 29.00, 29.00, 29.00, 29.00,
 29.00, 29.00, 29.00, 29.00, 29.00, 29.00, 29.00, 29.00, 29.00, 29.00,
 29.00, 29.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00,
 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 34.00, 34.00,
 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00,
 34.00, 34.00, 34.00, 34.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00,
 36.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00,
 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00,
 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 42.00, 42.00, 42.00, 42.00,
 42.00, 42.00, 42.00, 42.00, 42.00, 42.00, 42.00, 42.00, 42.00, 42.00,
 42.00, 42.00, 44.00, 44.00, 44.00, 44.00, 44.00, 44.00, 44.00, 44.00);
 var uz13  = new Array (0,
  2.00,  3.00,  4.00,  6.00,  6.00,  6.00,  6.00,  9.00,  9.00,  9.00,
  9.00,  9.00, 10.00, 10.00, 10.00, 10.00, 12.00, 12.00, 12.00, 12.00,
 13.00, 13.00, 13.00, 13.00, 14.00, 14.00, 14.00, 14.00, 15.00, 15.00,
 15.00, 15.00, 16.00, 16.00, 16.00, 16.00, 18.00, 18.00, 18.00, 18.00,
 19.00, 19.00, 19.00, 19.00, 20.00, 20.00, 20.00, 20.00, 22.00, 22.00,
 22.00, 22.00, 23.00, 23.00, 23.00, 23.00, 24.00, 24.00, 24.00, 24.00,
 25.00, 25.00, 25.00, 25.00, 29.00, 29.00, 29.00, 29.00, 29.00, 29.00,
 29.00, 29.00, 29.00, 29.00, 29.00, 29.00, 29.00, 29.00, 29.00, 29.00,
 32.00, 32.00, 32.00, 32.00, 32.00, 32.00, 32.00, 32.00, 32.00, 32.00,
 32.00, 32.00, 32.00, 32.00, 32.00, 32.00, 35.00, 35.00, 35.00, 35.00,
 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00,
 35.00, 35.00, 38.00, 38.00, 38.00, 38.00, 38.00, 38.00, 38.00, 38.00,
 38.00, 38.00, 38.00, 38.00, 38.00, 38.00, 38.00, 38.00, 41.00, 41.00,
 41.00, 41.00, 41.00, 41.00, 41.00, 41.00, 41.00, 41.00, 41.00, 41.00,
 41.00, 41.00, 41.00, 41.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00,
 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00,
 48.00, 48.00, 48.00, 48.00, 48.00, 48.00, 48.00, 48.00, 48.00, 48.00,
 48.00, 48.00, 48.00, 48.00, 48.00, 48.00, 51.00, 51.00, 51.00, 51.00,
 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00,
 51.00, 51.00, 54.00, 54.00, 54.00, 54.00, 54.00, 54.00, 54.00, 54.00);
 var uz14  = new Array (0,
  2.00,  3.00,  4.00,  6.00,  6.00,  6.00,  6.00,  9.00,  9.00,  9.00,
  9.00,  9.00, 11.00, 11.00, 11.00, 11.00, 13.00, 13.00, 13.00, 13.00,
 14.00, 14.00, 14.00, 14.00, 16.00, 16.00, 16.00, 16.00, 18.00, 18.00,
 18.00, 18.00, 19.00, 19.00, 19.00, 19.00, 21.00, 21.00, 21.00, 21.00,
 23.00, 23.00, 23.00, 23.00, 25.00, 25.00, 25.00, 25.00, 27.00, 27.00,
 27.00, 27.00, 28.00, 28.00, 28.00, 28.00, 30.00, 30.00, 30.00, 30.00,
 32.00, 32.00, 32.00, 32.00, 38.00, 38.00, 38.00, 38.00, 38.00, 38.00,
 38.00, 38.00, 38.00, 38.00, 38.00, 38.00, 38.00, 38.00, 38.00, 38.00,
 42.00, 42.00, 42.00, 42.00, 42.00, 42.00, 42.00, 42.00, 42.00, 42.00,
 42.00, 42.00, 42.00, 42.00, 42.00, 42.00, 47.00, 47.00, 47.00, 47.00,
 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00,
 47.00, 47.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00,
 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 55.00, 55.00,
 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00,
 55.00, 55.00, 55.00, 55.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,
 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,
 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 64.00,
 64.00, 64.00, 64.00, 64.00, 64.00, 64.00, 69.00, 69.00, 69.00, 69.00,
 69.00, 69.00, 69.00, 69.00, 69.00, 69.00, 69.00, 69.00, 69.00, 69.00,
 69.00, 69.00, 73.00, 73.00, 73.00, 73.00, 73.00, 73.00, 73.00, 73.00);
 var uz15  = new Array (0,
  2.00,  3.00,  4.00,  6.00,  6.00,  6.00,  6.00,  9.00,  9.00,  9.00,
  9.00,  9.00, 11.00, 11.00, 11.00, 11.00, 13.00, 13.00, 13.00, 13.00,
 14.00, 14.00, 14.00, 14.00, 16.00, 16.00, 16.00, 16.00, 18.00, 18.00,
 18.00, 18.00, 19.00, 19.00, 19.00, 19.00, 21.00, 21.00, 21.00, 21.00,
 23.00, 23.00, 23.00, 23.00, 25.00, 25.00, 25.00, 25.00, 27.00, 27.00,
 27.00, 27.00, 28.00, 28.00, 28.00, 28.00, 30.00, 30.00, 30.00, 30.00,
 32.00, 32.00, 32.00, 32.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,
 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,
 33.00, 33.00, 33.00, 33.00, 33.00, 33.00, 33.00, 33.00, 33.00, 33.00,
 33.00, 33.00, 33.00, 33.00, 33.00, 33.00, 36.00, 36.00, 36.00, 36.00,
 36.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00,
 36.00, 36.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00,
 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 42.00, 42.00,
 42.00, 42.00, 42.00, 42.00, 42.00, 42.00, 42.00, 42.00, 42.00, 42.00,
 42.00, 42.00, 42.00, 42.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00,
 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00, 45.00,
 48.00, 48.00, 48.00, 48.00, 48.00, 48.00, 48.00, 48.00, 48.00, 48.00,
 48.00, 48.00, 48.00, 48.00, 48.00, 48.00, 52.00, 52.00, 52.00, 52.00,
 52.00, 52.00, 52.00, 52.00, 52.00, 52.00, 52.00, 52.00, 52.00, 52.00,
 52.00, 52.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00);
 var uz16  = new Array (0,
  2.00,  3.00,  4.00,  5.00,  5.00,  6.00,  7.00,  8.00,  9.00,  9.00,
  9.00,  9.00, 11.00,  9.00,  9.00, 11.00, 13.00, 13.00, 13.00, 13.00,
 14.00, 14.00, 14.00, 14.00, 16.00, 16.00, 16.00, 16.00, 18.00, 18.00,
 18.00, 18.00, 19.00, 19.00, 19.00, 19.00, 21.00, 21.00, 21.00, 21.00,
 23.00, 23.00, 23.00, 23.00, 25.00, 25.00, 25.00, 25.00, 26.00, 26.00,
 26.00, 26.00, 28.00, 28.00, 28.00, 28.00, 30.00, 30.00, 30.00, 30.00,
 32.00, 32.00, 32.00, 32.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00,
 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00,
 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00,
 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 39.00, 39.00, 39.00, 39.00,
 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00,
 39.00, 39.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00,
 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 47.00, 47.00,
 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00,
 47.00, 47.00, 47.00, 47.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00,
 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00, 51.00,
 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 55.00,
 55.00, 55.00, 55.00, 55.00, 55.00, 55.00, 59.00, 59.00, 59.00, 59.00,
 59.00, 59.00, 59.00, 59.00, 59.00, 59.00, 59.00, 59.00, 59.00, 59.00,
 59.00, 59.00, 63.00, 63.00, 63.00, 63.00, 63.00, 63.00, 63.00, 63.00);
 var uz17  = new Array (0,
  2.00,  3.00,  5.00,  5.00,  6.00,  6.00,  7.00,  8.00,  9.00,  9.00,
  9.00,  9.00, 10.00, 10.00, 10.00, 10.00, 12.00, 12.00, 12.00, 12.00,
 13.00, 13.00, 13.00, 13.00, 14.00, 14.00, 14.00, 14.00, 15.00, 15.00,
 15.00, 15.00, 16.00, 16.00, 16.00, 16.00, 18.00, 18.00, 18.00, 18.00,
 19.00, 19.00, 19.00, 19.00, 20.00, 20.00, 20.00, 20.00, 21.00, 21.00,
 21.00, 21.00, 23.00, 23.00, 23.00, 23.00, 24.00, 24.00, 24.00, 24.00,
 25.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00,
 25.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00, 25.00,
 28.00, 28.00, 28.00, 28.00, 28.00, 28.00, 28.00, 28.00, 28.00, 28.00,
 28.00, 28.00, 28.00, 28.00, 28.00, 28.00, 31.00, 31.00, 31.00, 31.00,
 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00,
 31.00, 31.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00,
 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 37.00, 37.00,
 37.00, 37.00, 37.00, 37.00, 37.00, 37.00, 37.00, 37.00, 37.00, 37.00,
 37.00, 37.00, 37.00, 37.00, 40.00, 40.00, 40.00, 40.00, 40.00, 40.00,
 40.00, 40.00, 40.00, 40.00, 40.00, 40.00, 40.00, 40.00, 40.00, 40.00,
 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 43.00,
 43.00, 43.00, 43.00, 43.00, 43.00, 43.00, 46.00, 46.00, 46.00, 46.00,
 46.00, 46.00, 46.00, 46.00, 46.00, 46.00, 46.00, 46.00, 46.00, 46.00,
 46.00, 46.00, 49.00, 49.00, 49.00, 49.00, 49.00, 49.00, 49.00, 49.00);
 var uz18  = new Array (0,
  2.00,  3.00,  4.00,  5.00,  5.00,  6.00,  7.00,  8.00,  9.00,  9.00,
  9.00,  9.00, 11.00,  9.00,  9.00, 11.00, 13.00, 13.00, 13.00, 13.00,
 14.00, 14.00, 14.00, 14.00, 16.00, 16.00, 16.00, 16.00, 18.00, 18.00,
 18.00, 18.00, 19.00, 19.00, 19.00, 19.00, 21.00, 21.00, 21.00, 21.00,
 23.00, 23.00, 23.00, 23.00, 25.00, 25.00, 25.00, 25.00, 26.00, 26.00,
 26.00, 26.00, 28.00, 28.00, 28.00, 28.00, 30.00, 30.00, 30.00, 30.00,
 32.00, 32.00, 32.00, 32.00, 29.00, 29.00, 29.00, 29.00, 29.00, 29.00,
 29.00, 29.00, 29.00, 29.00, 29.00, 29.00, 29.00, 29.00, 29.00, 29.00,
 32.00, 32.00, 32.00, 32.00, 32.00, 32.00, 32.00, 32.00, 32.00, 32.00,
 32.00, 32.00, 32.00, 32.00, 32.00, 32.00, 35.00, 35.00, 35.00, 35.00,
 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00, 35.00,
 35.00, 35.00, 38.00, 38.00, 38.00, 38.00, 38.00, 38.00, 38.00, 38.00,
 38.00, 38.00, 38.00, 38.00, 38.00, 38.00, 38.00, 38.00, 41.00, 41.00,
 41.00, 41.00, 41.00, 41.00, 41.00, 41.00, 41.00, 41.00, 41.00, 41.00,
 41.00, 41.00, 41.00, 41.00, 44.00, 44.00, 44.00, 44.00, 44.00, 44.00,
 44.00, 44.00, 44.00, 44.00, 44.00, 44.00, 44.00, 44.00, 44.00, 44.00,
 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00,
 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 50.00, 50.00, 50.00, 50.00,
 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00,
 50.00, 50.00, 53.00, 53.00, 53.00, 53.00, 53.00, 53.00, 53.00, 53.00);
 var uz19  = new Array (0,
  2.00,  3.00,  4.00,  5.00,  5.00,  6.00,  7.00,  8.00,  9.00,  9.00,
  9.00,  9.00, 11.00,  9.00,  9.00, 11.00, 13.00, 13.00, 13.00, 13.00,
 14.00, 14.00, 14.00, 14.00, 16.00, 16.00, 16.00, 16.00, 18.00, 18.00,
 18.00, 18.00, 19.00, 19.00, 19.00, 19.00, 21.00, 21.00, 21.00, 21.00,
 23.00, 23.00, 23.00, 23.00, 25.00, 25.00, 25.00, 25.00, 26.00, 26.00,
 26.00, 26.00, 28.00, 28.00, 28.00, 28.00, 30.00, 30.00, 30.00, 30.00,
 32.00, 32.00, 32.00, 32.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,
 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,
 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00,
 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 37.00, 37.00, 37.00, 37.00,
 37.00, 37.00, 37.00, 37.00, 37.00, 37.00, 37.00, 37.00, 37.00, 37.00,
 37.00, 37.00, 40.00, 40.00, 40.00, 40.00, 40.00, 40.00, 40.00, 40.00,
 40.00, 40.00, 40.00, 40.00, 40.00, 40.00, 40.00, 40.00, 44.00, 44.00,
 44.00, 44.00, 44.00, 44.00, 44.00, 44.00, 44.00, 44.00, 44.00, 44.00,
 44.00, 44.00, 44.00, 44.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00,
 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00, 47.00,
 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 50.00,
 50.00, 50.00, 50.00, 50.00, 50.00, 50.00, 54.00, 54.00, 54.00, 54.00,
 54.00, 54.00, 54.00, 54.00, 54.00, 54.00, 54.00, 54.00, 54.00, 54.00,
 54.00, 54.00, 57.00, 57.00, 57.00, 57.00, 57.00, 57.00, 57.00, 57.00);
 var uz20  = new Array (0,
  2.00,  3.00,  4.00,  5.00,  5.00,  6.00,  7.00,  8.00,  9.00,  9.00,
  9.00,  9.00, 11.00,  9.00,  9.00, 11.00, 13.00, 13.00, 13.00, 13.00,
 14.00, 14.00, 14.00, 14.00, 16.00, 16.00, 16.00, 16.00, 18.00, 18.00,
 18.00, 18.00, 19.00, 19.00, 19.00, 19.00, 21.00, 21.00, 21.00, 21.00,
 23.00, 23.00, 23.00, 23.00, 25.00, 25.00, 25.00, 25.00, 26.00, 26.00,
 26.00, 26.00, 28.00, 28.00, 28.00, 28.00, 30.00, 30.00, 30.00, 30.00,
 32.00, 32.00, 32.00, 32.00, 23.00, 23.00, 23.00, 23.00, 23.00, 23.00,
 23.00, 23.00, 23.00, 23.00, 23.00, 23.00, 23.00, 23.00, 23.00, 23.00,
 26.00, 26.00, 26.00, 26.00, 26.00, 26.00, 26.00, 26.00, 26.00, 26.00,
 26.00, 26.00, 26.00, 26.00, 26.00, 26.00, 28.00, 28.00, 28.00, 28.00,
 28.00, 28.00, 28.00, 28.00, 28.00, 28.00, 28.00, 28.00, 28.00, 28.00,
 28.00, 28.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00,
 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 31.00, 34.00, 34.00,
 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00, 34.00,
 34.00, 34.00, 34.00, 34.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00,
 36.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00, 36.00,
 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 39.00,
 39.00, 39.00, 39.00, 39.00, 39.00, 39.00, 41.00, 41.00, 41.00, 41.00,
 41.00, 41.00, 41.00, 41.00, 41.00, 41.00, 41.00, 41.00, 41.00, 41.00,
 41.00, 41.00, 44.00, 44.00, 44.00, 44.00, 44.00, 44.00, 44.00, 44.00);
var uzx  = new Array (0,uz1,uz2,uz3,uz4,uz5,uz6,uz7,uz8,uz9,uz10,uz11,uz12,uz13,uz14,uz15,uz16,uz17,uz18,uz19,uz20);

function CalcCost () {  // given weight and ZIP, calc cost
  wte = Math.floor ((tozs + 0) / 1);
  if (usps > 0) {   // user selected USPS Priority shipping
    SetUspsZ ();    // set up USPS Priority mail zones
  } else
  if (uspp > 0) {   // user selected USPS Parcel Post shipping
    SetUspsZ ();    // set up USPS Parcel Post mail zones
  } else
  if (ups > 0) {    // user has selected UPS ground shipping
    SetUpsZ ();     // set up UPS ground shipping zones
  }
  for (var i=zn-1; i>=0; i--) { // run table backwards
    if (zip >= zzip[i]) {       // zip value
      zne = zone[i];            // corresponding zone
      break;                    // get out, now
    }
  }
  root.stxt0 = root.stxt0 + ", zone " + zne;
  root.zne = zne;
  root.usps = usps;
  root.uspp = uspp;
  root.ups  = ups;
  root.insu = insu;
  root.store ();
}

function SetUspsZ () {  // set USPS zone chart in memory
  // built from USPS 44256 zone chart
  SetZone (000, 8,
      5, 4,   6, 8,  10, 4,  44, 5,  45, 4,
     46, 5,  48, 4,  49, 5,  50, 4, 130, 3,
    133, 4, 140, 3, 147, 2, 148, 3, 150, 2,
    155, 3, 156, 2, 157, 3, 158, 2, 159, 3,
    160, 2, 166, 3, 167, 2, 168, 3, 169, 3,
    179, 4, 182, 3, 183, 4, 184, 3, 189, 4,
    200, 3, 214, 3, 216, 4, 217, 3, 218, 4,
    219, 3, 224, 4, 226, 3, 230, 4, 240, 3,
    260, 2, 266, 3, 267, 3, 270, 4, 299, 5,
    300, 4, 313, 5, 330, 6, 334, 5, 340, 6,
    341, 5, 344, 5, 346, 5, 349, 5, 350, 4,
    354, 5, 355, 4, 360, 5, 362, 4, 363, 5,
    370, 4, 387, 5, 388, 4, 389, 5, 399, 4,
    400, 3, 407, 4, 410, 3, 420, 4, 425, 3,
    430, 2, 439, 2, 440, 1, 448, 1, 450, 3,
    453, 2, 459, 3, 475, 4, 479, 3, 480, 2,
    488, 3, 492, 2, 493, 3, 497, 4, 500, 5,
    504, 4, 505, 5, 506, 4, 508, 5, 520, 4,
    525, 5, 526, 4, 530, 4, 534, 4, 537, 4,
    540, 5, 541, 4, 550, 5, 559, 4, 560, 5,
    570, 5, 577, 6, 580, 5, 587, 6, 590, 6,
    594, 7, 600, 3, 610, 4, 622, 4, 640, 5,
    644, 5, 650, 4, 654, 5, 660, 5, 677, 6,
    678, 5, 679, 6, 680, 5, 683, 5, 693, 6,
    700, 5, 703, 5, 710, 5, 716, 5, 723, 4,
    725, 5, 733, 6, 734, 5, 739, 6, 740, 5,
    743, 5, 760, 6, 798, 7, 800, 6, 820, 6,
    829, 7, 840, 7, 850, 7, 854, 7, 855, 7,
    859, 7, 863, 7, 870, 6, 873, 7, 875, 6,
    877, 6, 878, 7, 881, 6, 885, 7, 889, 8,
    893, 7, 894, 8, 897, 8, 898, 7, 900, 8,
    910, 8, 930, 8, 979, 7, 980, 8, 988, 8,
    990, 7, 993, 8, 994, 7, 995, 8);
}

function SetUpsZ () {  // set UPS lower 48 ground Zones
  // built from UPS 44256 zone chart, lower 48
  SetZone 
   (133, 1, 140, 2, 147, 3, 148, 4, 150, 5,
    155, 6, 156, 7, 157, 8, 158, 9, 159, 10,
    160, 11, 166, 12, 167, 13, 168, 14, 169, 15,
	179, 16, 182, 17, 183, 18, 184, 19, 189, 20);
}





function Shipper (obj1) {  // use either amt or qty based shipping
var pos;
  SetAmtSH (0);  // assume the worst
  SetCartSH (0);
  pos = obj1.selectedIndex;  // which option selected
  root.stxt0 = obj1.options[pos].text;
  if (pos == 1) {    // 1st option
    usps = 1;
    uspp = -1;
    ups  = -1;
    insu = -1;
    zip = prompt("Enter destination ZIP...", "").substring (0, 3);
    if (isNaN (zip)) {  // keep them honest
      alert ("You must enter a valid ZIP code!");
      usps = -1;  // zap evferything
      insu = -1;
      return;
    }
    CalcCost ();
  } else
  if (pos == 2) {    // 2nd option
    usps = -1;
    uspp = 1;
    ups  = -1;
    insu = -1;
    zip = prompt("Enter destination ZIP...", "").substring (0, 3);
    if (isNaN (zip)) {  // keep them honest
      alert ("You must enter a valid ZIP code!");
      usps = -1;
      return;
    }
    CalcCost ();
  } else
  if (pos == 3) {    // 3rd option
    usps = -1;
    uspp = -1;
    ups  = 1;
    insu = -1;
    zip = prompt("Enter destination ZIP...", "").substring (0, 3);
    if (isNaN (zip)) {  // keep them honest
      alert ("You must enter a valid ZIP code!");
      uspp = -1;
      return;
    }
    CalcCost ();
  } else
  if (pos == 4) {    // 4th option
    usps = -1;
    uspp = -1;
    ups  = 1;
    insu = -1;
    zip = prompt("Enter destination ZIP...", "").substring (0, 3);
    if (isNaN (zip)) {  // keep them honest
      alert ("You must enter a valid ZIP code!");
      ups = -1;
      return;
    }
    CalcCost ();
  } else
  if (pos == 5) {   // 5th option
    usps = -1;
    uspp = -1;
    ups  = -1;
    insu = -1;
    root.usps = -1;
    root.uspp = -1;
    root.ups  = -1;
    root.insu = -1;
    SetCartSH (0, 0, 0);
  }
  SetAmtSH (0,0,0);  // LEAVE ALONE!!
  document.location.reload ();  // show the latest info...
}

// executed at load time
new Cookie (document, "xcxc");  // (backward compatibility)
Cookie.prototype.store  = _Cookie_store;   // load proto methods
Cookie.prototype.load   = _Cookie_load;
Cookie.prototype.remove = _Cookie_remove;

var root = new Cookie (document, "paycart0");  // special root cookie
  if (!root.load () ||
      !root.stax) {
    InitRoot ();                  // gotta create it
  } else {                        // load up globals
    stax  = root.stax;
    ttxt  = root.ttxt;
    coup  = root.coup;
    cdis  = root.cdis;
    chkby = root.chkbx;
    usps  = root.usps;
    uspp  = root.uspp;
    ups   = root.ups;
    insu  = root.insu;
    zne   = root.zne;
  }

for (var i=1; i<cmax; i++) {  // load or init data cookies
  cook = new Cookie (document, "paycart" + i);
  if (!cook.load () ||
      !cook.des) {
    InitData ();              // create it
  }
}