<!--
var order = new Object();                     // object to store order items in
var root  = new Object();                     // selection criteria
var on = true; var off = false; var cntr = 0; // items in object
var opts  = 6;                                // number of options to allow
var tamt=0, tqty=0;                           // totals

//*********************************************************************************
// place for user-specific options
root.xx_can  = "http://www.ascecuba.org"; // place for PayPal cancel return path
root.xx_cur  = "USD";                     // enter default currency code (or null)
root.xx_id   = "asce@ascecuba.org";       // live email address goes here <----****
root.xx_img  = "https://static.e-junkie.com/sslpic/50925.6daadb851f9bbe801748b70dbe8ca5ab.jpg"; // header image URL
root.xx_lc   = "US";                      // enter default country code (or null)
root.xx_ret  = "http://www.ascecuba.org"; // place for PayPal return path
root.xx_sty  =                            // place for PayPal page style
root.xx_xtra = "&rm=2";                   // place for other PayPal commands
//*********************************************************************************

function DispTots ()
{  // display totals on the page
  var tmp,d;
  d = document.orderf;
  d.sub.value = dollar(tamt);
  d.tot.value = dollar(tamt);
}

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 (".");                  // should be one, but OK if not
  if (pos > 0) str = str.substring(rnd, pos + 3);
  return str;                               // return valid string
}

function GetOrder(id, des)
{  // get all ordered items
var i,nr,val,qty,pos;
var op = new Array ();                      // accumulate options here
  tamt=0,tqty=0,twgt=0;                     // zero totals
  nr  = id.substring(2);                    // get number part of ID
  qty = document.orderf["qty" + nr].value;
  amt = document.orderf["amt" + nr].value;
  document.orderf["prc" + nr].value = dollar(qty * amt);
  if (cntr == 0) order = new Object ();     // zap object
  cntr = cntr + 1;                          // bump counter so no zap next time
  order[id] = new Object ();                // create new entry//
  for (i=1; i<=opts; i++)                   // load options//
  //if (op[i] != "") des = des + ", OP" + i + "=" + op[i];
  order[id].des = des;                      // load up values
  order[id].amt = dollar(amt);
  order[id].qty = qty;
  for (i in order)
  {                                         // calc totals we might use
    qty = order[i].qty*1.0;
    tamt = tamt + order[i].amt * qty;       // total amount
    tqty = tqty + qty;                      // total quantity
  }
  DispTots();                               // calc totals
}

function SendCart()
{  // send the cart to PayPal
var frst = true;  // 1st pass thru items.
var winpar = "width=960,height=800,scrollbars," + "location,resizable,status";
var strn   = "https://www.paypal.com/cgi-bin/webscr?cmd=_cart" + "&upload=1" + "&shipping=0&tax=0" + "&business=" + root.xx_id + root.xx_xtra
           + "&first_name=" + "&last_name=" + "&address1=" + "&address2=" + "&city=" + "&state=" + "&zip="
           + "&night_phone_a=" + "&night_phone_b=" + "&night_phone_c=" + "&email=";
var i,j=0,des;
if (root.xx_cur.length > 0) strn = strn + "&currency_code=" + root.xx_cur;
if (root.xx_lc.length  > 0) strn = strn + "&lc=" + root.xx_lc;
if (root.xx_can.length > 0) strn = strn + "&cancel_return=" + root.xx_can;
if (root.xx_ret.length > 0) strn = strn + "&return=" + root.xx_ret;
if (root.xx_sty.length > 0) strn = strn + "&page_style=" + root.xx_sty;
if (root.xx_img.length > 0) strn = strn + "&image_url=" + root.xx_img;
for (i in order)
  {  // send all valid data
    if (order[i].amt > 0)
    {
      j = j + 1;
      des = order[i].des;
      strn = strn + "&item_name_"   + j + "=" + escape (des) +
                    "&item_number_" + j + "=" + i +
                    "&quantity_"    + j + "=" + order[i].qty +
                    "&amount_"      + j + "=" + order[i].amt;
      frst = false;
    }
  }
  if (j > 0)
  {
  window.open (strn, "paypal", winpar);
  }
  else
  {
  alert("Please select the applicable pricing schedule and payment choices.");
  }
}

function numberblog(e){
var f=function(){this.value=this.value.replace(/(\b0|\D)/,'')};
e.onkeyup=f
e.onkeydown=f
e.onkeypress=f
e.onmousedown=f
e.onmouseup=f
e.onclick=f
e.onchange=f
e.onblur=f
}

function member()
{
var m;
m = document.orderf
m.amt1.value = 90.00;
m.amt2.value =  0;
m.amt3.value = 25;
var today   =new Date();
var deadline=new Date();
deadline.setFullYear(2012,6,16);
if (today<deadline)
   {
m.amt4.value = 75;
m.amt5.value = 45;
   }
else
   {
m.amt4.value =100;
m.amt5.value = 50;
   }
m.amt6.value = 25;
}

function nonmember()
{
var n;
n = document.orderf
n.amt1.value =  0;
n.amt2.value =  0;
n.amt3.value = 25;
var today   =new Date();
var deadline=new Date();
deadline.setFullYear(2012,6,16);
if (today<deadline)
   {
n.amt4.value =175;
n.amt5.value = 45;
   }
else
   {
n.amt4.value =200;
n.amt5.value = 50;
   }
n.amt6.value = 60;
}
//-->
