
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  = 5;             // number of options to allow
var shpr  = function (wt) {return 0;} // what to charge for shipping;
var stxt  = "";            // shipping text
var spos  = -1;            // shipping position selector
var ttax  = 1;             // percent for taxes
var ttxt  = "Insurance";           // tax text
var insu  = 0;           // Insurance amount
var tpos  = -1;            // tax position selector
var tamt=0,tqty=0,twgt=0,wgt=0,thnd=0;  // totals

function CalcRoot () {  // calc root stuff
  if (root.shp) spos=0; 
  if (root.tax) tpos=0;
}

function DispTots () {  // display totals on the page
var tmp,d;
  d = document.orderf;
  d.sub.value = Dollar (tamt);
  d.twgt.value = twgt;
  if (root.shp) d.shp.value = Dollar (shpr (twgt));
//  tmp = tamt * ttax/100;
  if (spos == 1) if (tamt == 0) tmp = 0;
  if (spos == 1) if (tamt <= 100) tmp = .85;
  if (spos == 1) tmp = .85 + .85 * Math.floor (tamt / 100.0);

  if (spos >= 2) if (tamt == 0) tmp = 0;
  if (spos >= 2) if (tamt <= 100) tmp = 1.50;
  if (spos >= 2) tmp = 1.60 + 1.60 * Math.floor (tamt / 100.0);

if (spos == 86) tmp = 0;	//set none for code 42

  if (root.tax) d.tax.value = Dollar (tmp);
  thnd = 0;                    // assume the worst;
  if (d.hnd) d.hnd.value = "0.00";
  if (tamt*1.0 < root.hamt) {  // calculate handling charge
      thnd = root.hand;        // figure it out
      if (d.hnd) d.hnd.value = Dollar (thnd);
  }
  d.tot.value = Dollar (tamt + shpr (twgt) + tmp + thnd);
insu = tmp
}


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, amt, wgt) {  // 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;  // get qty
  if (isNaN (qty)) {      // test entry
    alert ("That is not a valid number!  Try again.");
    return;
  }
  for (i=1; i<=opts; i++) {     // see if any options
    if (document.orderf["op" + i + nr]) {
      val = document.orderf["op" + i + nr].value;  // get option
      op[i] = val;
      pos  = val.indexOf ("+"); // price increment?
      if (pos > 0) amt = amt + val.substring (pos + 1)*1.0;
      pos  = val.indexOf ("%"); // percent change?
      if (pos > 0) amt = amt + (amt * val.substring (pos + 1)/100.0);
    }
    else op[i] = "";
  }
  document.orderf["prc" + nr].value = Dollar (qty * amt);
  document.orderf["toz" + nr].value = qty * wgt;
  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;
  if (wgt) order[id].wgt = wgt;
    else order[id].wgt = 0;
  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
    twgt = twgt + order[i].wgt * qty;  // total ounces
  }
  twgt = Math.floor(twgt + 7.00);  // get ounces add 7 for packing
  DispTots ();                         // calc totals
}

function SendCart () {  // send the cart to PayPal
var frst = true;  // 1st pass thru items.
var winpar = "width=800,height=550,scrollbars," +
             "location,resizable,status";
var strn   = "https://www.paypal.com/cgi-bin/webscr?cmd=_cart" +
             "&upload=1" +
             "&business=" + root.busi +
             "&currency_code=" + root.ccod +
             "&lc=" + root.lc;
var i,j=0,des;
  for (i in order) {  // send all valid data
    if (order[i].qty > 0) {
      j = j + 1;
      des = order[i].des;
      if (j == 1) {  // put in descriptions for 1st item
        des = des + ", SHP=" + stxt;
        strn = strn + "&handling_cart=" + Dollar (thnd);
      }
      strn = strn + "&item_name_"    + j + "=" + escape (des) +
                    "&item_number_"  + j + "=" + i +
                    "&quantity_"     + j + "=" + order[i].qty +
                    "&amount_"       + j + "=" + order[i].amt;
      if (spos >= 0) {  // there is some shipping activity
        if (frst) {     // first time thru
          strn = strn + "&shipping_" + j + "=" + Dollar (insu + shpr(twgt));
        } else {        // every other time thru
          strn = strn + "&shipping_" + j + "=0";
        }
      }
      if (tpos >= 0) {   // there is some tax activity
        if (frst) {     // first time thru edited to give zero tax to paypal
          strn = strn + "&tax_"      + j + "=0";
        } else {        // every other time thru
          strn = strn + "&tax_"      + j + "=0";
        }
      }
      frst = false;
    }
  }
  if (j > 0) window.open (strn, "paypal", winpar);
}

function SetShp (obj) {  // set shipping on user selection
  shpr = function (wt) {return 0;}  // zap it
  spos = obj.selectedIndex;  // which option selected
  stxt = obj.options[spos].text;
  // set various shipping functions.

if (spos == 1) shpr = function (wt) {	//US Priority-2008-
  	if (wt <= 16) {return 4.80;}			// to 1
  	if (wt > 16 & wt < 32) {return 4.80;}	// 1-2
  	if (wt >= 32 & wt < 48) {return 4.80;}	// 2-3
  	if (wt >= 48 & wt < 64) {return 4.80;}	// 3-4
  	if (wt >= 64 & wt < 80) {return 4.80;}}	// 4-5

if (spos == 2) shpr = function (wt) {	//Anguilla FCMI Grp 9-2008-
  	if (wt <= 7) {return 5.90;}				// to 7
  	if (wt == 8) {return 6.65;}				// 8
  	if (wt > 8 & wt < 12) {return 8.25;}	// 9-11
  	if (wt >= 12 & wt < 16) {return 9.85;}	// 12-15
  	if (wt >= 16 & wt < 20) {return 11.45;} // 16-19
  	if (wt >= 20 & wt < 24) {return 13.05;} // 20-23
  	if (wt >= 24 & wt < 28) {return 14.65;} // 24-27
  	if (wt >= 28 & wt < 32) {return 16.25;}	// 28-31
  	if (wt >= 32 & wt < 36) {return 17.85;}	// 32-35
  	if (wt >= 36 & wt < 40) {return 19.45;}	// 36-39
  	if (wt >= 40 & wt < 44) {return 21.05;}	// 40-43
  	if (wt >= 44 & wt < 48) {return 22.65;}	// 44-47
  	if (wt >= 48 & wt < 52) {return 24.25;}	// 48-51
  	if (wt >= 52 & wt < 56) {return 25.85;}	// 52-55
  	if (wt >= 56 & wt < 60) {return 27.45;}	// 56-59
  	if (wt >= 60 & wt < 65) {return 29.05;}}	// 60-64

if (spos == 3) shpr = function (wt) {	//Anguilla EMI Grp 9--2008-- online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 4) shpr = function (wt) {	//Argentina EMI Grp 9 --2008-- online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 5) shpr = function (wt) {	//Australia FCMI Grp 3 --2008--
  	if (wt <= 7) {return 6.20;}				// up to 7
  	if (wt == 8) {return 7.00;}				// 8
  	if (wt > 8 & wt < 12) {return 8.65;}	// 9 to 11
  	if (wt >= 12 & wt < 16) {return 10.30;}	// 12 to 15
  	if (wt >= 16 & wt < 20) {return 11.95;} // 16 to 19
  	if (wt >= 20 & wt < 24) {return 13.60;} // 20 to 23
  	if (wt >= 24 & wt < 28) {return 15.25;} // 24 to 27
  	if (wt >= 28 & wt < 32) {return 16.90;}	// 28 to 31
  	if (wt >= 32 & wt < 36) {return 18.55;}	// 32 to 35
  	if (wt >= 36 & wt < 40) {return 20.20;}	// 36 to 39
  	if (wt >= 40 & wt < 44) {return 21.85;}	// 40 to 43
  	if (wt >= 44 & wt < 48) {return 23.50;}	// 44 to 47
  	if (wt >= 48 & wt < 52) {return 25.15;}	// 48 to 51
  	if (wt >= 52 & wt < 56) {return 26.80;}	// 52 to 55
  	if (wt >= 56 & wt < 60) {return 28.45;}	// 56 to 59
  	if (wt >= 60 & wt < 65) {return 30.10;}}	// 60 to 64

if (spos == 6) shpr = function (wt) {	//Australia EMI Grp 3 --2008-- online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 7) shpr = function (wt) {	//Austria FCMI Grp 5 --2008--
  	if (wt <= 7) {return 6.20;}				// up to 7
  	if (wt == 8) {return 7.00;}				// 8
  	if (wt > 8 & wt < 12) {return 8.65;}	// 9 to 11
  	if (wt >= 12 & wt < 16) {return 10.30;}	// 12 to 15
  	if (wt >= 16 & wt < 20) {return 11.95;} // 16 to 19
  	if (wt >= 20 & wt < 24) {return 13.60;} // 20 to 23
  	if (wt >= 24 & wt < 28) {return 15.25;} // 24 to 27
  	if (wt >= 28 & wt < 32) {return 16.90;}	// 28 to 31
  	if (wt >= 32 & wt < 36) {return 18.55;}	// 32 to 35
  	if (wt >= 36 & wt < 40) {return 20.20;}	// 36 to 39
  	if (wt >= 40 & wt < 44) {return 21.85;}	// 40 to 43
  	if (wt >= 44 & wt < 48) {return 23.50;}	// 44 to 47
  	if (wt >= 48 & wt < 52) {return 25.15;}	// 48 to 51
  	if (wt >= 52 & wt < 56) {return 26.80;}	// 52 to 55
  	if (wt >= 56 & wt < 60) {return 28.45;}	// 56 to 59
  	if (wt >= 60 & wt < 65) {return 30.10;}}	// 60 to 64

if (spos == 8) shpr = function (wt) {	//Austria EMI Grp 5 --2008-- Online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 9) shpr = function (wt) {	//Belgium EMI Grp 5 --2008-- online rates
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 10) shpr = function (wt) {	//Canada FCMI Grp 1 --2008--
  	if (wt <= 7) {return 2.62;}				// up to 7
  	if (wt == 8) {return 2.86;}				// 8
  	if (wt > 8 & wt < 12) {return 3.81;}	// 9 to 11
  	if (wt >= 12 & wt < 16) {return 4.76;}	// 12 to 15
  	if (wt >= 16 & wt < 20) {return 5.71;} 	// 16 to 19
  	if (wt >= 20 & wt < 24) {return 6.66;} 	// 20 to 23
  	if (wt >= 24 & wt < 28) {return 7.61;} 	// 24 to 27
  	if (wt >= 28 & wt < 32) {return 8.56;}	// 28 to 31
  	if (wt >= 32 & wt < 36) {return 9.51;}	// 32 to 35
  	if (wt >= 36 & wt < 40) {return 10.46;}	// 36 to 39
  	if (wt >= 40 & wt < 44) {return 11.41;}	// 40 to 43
  	if (wt >= 44 & wt < 48) {return 12.36;}	// 44 to 47
  	if (wt >= 48 & wt < 52) {return 13.31;}	// 48 to 51
  	if (wt >= 52 & wt < 56) {return 14.26;}	// 52 to 55
  	if (wt >= 56 & wt < 60) {return 15.21;}	// 56 to 59
  	if (wt >= 60 & wt < 65) {return 16.16;}}	// 60 to 64

if (spos == 11) shpr = function (wt) {	//Canada EMI Grp 1 --2008-- online rate
  	if (wt <= 16) {return 22.03;}
  	if (wt > 16 & wt < 32) {return 22.03;}
  	if (wt >= 32 & wt < 48) {return 22.03;}
  	if (wt >= 48 & wt < 64) {return 22.03;}}

if (spos == 12) shpr = function (wt) {	//Chile EMI Grp 9 --2008-- online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 13) shpr = function (wt) {	//Costa Rica EMI Grp 9 --2008-- online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 14) shpr = function (wt) {	//Cyprus FCMI Grp 4 --2008--
  	if (wt <= 7) {return 6.20;}				// up to 7
  	if (wt == 8) {return 7.00;}				// 8
  	if (wt > 8 & wt < 12) {return 8.65;}	// 9 to 11
  	if (wt >= 12 & wt < 16) {return 10.30;}	// 12 to 15
  	if (wt >= 16 & wt < 20) {return 11.95;} // 16 to 19
  	if (wt >= 20 & wt < 24) {return 13.60;} // 20 to 23
  	if (wt >= 24 & wt < 28) {return 15.25;} // 24 to 27
  	if (wt >= 28 & wt < 32) {return 16.90;}	// 28 to 31
  	if (wt >= 32 & wt < 36) {return 18.55;}	// 32 to 35
  	if (wt >= 36 & wt < 40) {return 20.20;}	// 36 to 39
  	if (wt >= 40 & wt < 44) {return 21.85;}	// 40 to 43
  	if (wt >= 44 & wt < 48) {return 23.50;}	// 44 to 47
  	if (wt >= 48 & wt < 52) {return 25.15;}	// 48 to 51
  	if (wt >= 52 & wt < 56) {return 26.80;}	// 52 to 55
  	if (wt >= 56 & wt < 60) {return 28.45;}	// 56 to 59
  	if (wt >= 60 & wt < 65) {return 30.10;}}	// 60 to 64

if (spos == 15) shpr = function (wt) {	//Cyprus EMI Grp 4 --2008-- online rates
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 16) shpr = function (wt) {	//Czech Republic EMI Grp 4 --2008-- online rates
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 17) shpr = function (wt) {	//Denmark FCMI Grp 5 --2008--
  	if (wt <= 7) {return 6.20;}				// up to 7
  	if (wt == 8) {return 7.00;}				// 8
  	if (wt > 8 & wt < 12) {return 8.65;}	// 9 to 11
  	if (wt >= 12 & wt < 16) {return 10.30;}	// 12 to 15
  	if (wt >= 16 & wt < 20) {return 11.95;} // 16 to 19
  	if (wt >= 20 & wt < 24) {return 13.60;} // 20 to 23
  	if (wt >= 24 & wt < 28) {return 15.25;} // 24 to 27
  	if (wt >= 28 & wt < 32) {return 16.90;}	// 28 to 31
  	if (wt >= 32 & wt < 36) {return 18.55;}	// 32 to 35
  	if (wt >= 36 & wt < 40) {return 20.20;}	// 36 to 39
  	if (wt >= 40 & wt < 44) {return 21.85;}	// 40 to 43
  	if (wt >= 44 & wt < 48) {return 23.50;}	// 44 to 47
  	if (wt >= 48 & wt < 52) {return 25.15;}	// 48 to 51
  	if (wt >= 52 & wt < 56) {return 26.80;}	// 52 to 55
  	if (wt >= 56 & wt < 60) {return 28.45;}	// 56 to 59
  	if (wt >= 60 & wt < 65) {return 30.10;}}	// 60 to 64

if (spos == 18) shpr = function (wt) {	//Denmark EMI Grp 5 --2008-- Online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 19) shpr = function (wt) {	//Estonia EMI Grp 4 --2008-- online rates
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 20) shpr = function (wt) {	//Finland FCMI Grp 5 --2008--
  	if (wt <= 7) {return 6.20;}				// up to 7
  	if (wt == 8) {return 7.00;}				// 8
  	if (wt > 8 & wt < 12) {return 8.65;}	// 9 to 11
  	if (wt >= 12 & wt < 16) {return 10.30;}	// 12 to 15
  	if (wt >= 16 & wt < 20) {return 11.95;} // 16 to 19
  	if (wt >= 20 & wt < 24) {return 13.60;} // 20 to 23
  	if (wt >= 24 & wt < 28) {return 15.25;} // 24 to 27
  	if (wt >= 28 & wt < 32) {return 16.90;}	// 28 to 31
  	if (wt >= 32 & wt < 36) {return 18.55;}	// 32 to 35
  	if (wt >= 36 & wt < 40) {return 20.20;}	// 36 to 39
  	if (wt >= 40 & wt < 44) {return 21.85;}	// 40 to 43
  	if (wt >= 44 & wt < 48) {return 23.50;}	// 44 to 47
  	if (wt >= 48 & wt < 52) {return 25.15;}	// 48 to 51
  	if (wt >= 52 & wt < 56) {return 26.80;}	// 52 to 55
  	if (wt >= 56 & wt < 60) {return 28.45;}	// 56 to 59
  	if (wt >= 60 & wt < 65) {return 30.10;}}	// 60 to 64

if (spos == 21) shpr = function (wt) {	//Finland EMI Grp 5 --2008-- Online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 22) shpr = function (wt) {	//France EMI Grp 5 --2008-- Online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 23) shpr = function (wt) {	//Germany EMI Grp 5 --2008-- Online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 24) shpr = function (wt) {	//Greece EMI Grp 5 --2008-- Online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 25) shpr = function (wt) {	//Hong Kong FCMI Grp 3 --2008--
  	if (wt <= 7) {return 6.20;}				// up to 7
  	if (wt == 8) {return 7.00;}				// 8
  	if (wt > 8 & wt < 12) {return 8.65;}	// 9 to 11
  	if (wt >= 12 & wt < 16) {return 10.30;}	// 12 to 15
  	if (wt >= 16 & wt < 20) {return 11.95;} // 16 to 19
  	if (wt >= 20 & wt < 24) {return 13.60;} // 20 to 23
  	if (wt >= 24 & wt < 28) {return 15.25;} // 24 to 27
  	if (wt >= 28 & wt < 32) {return 16.90;}	// 28 to 31
  	if (wt >= 32 & wt < 36) {return 18.55;}	// 32 to 35
  	if (wt >= 36 & wt < 40) {return 20.20;}	// 36 to 39
  	if (wt >= 40 & wt < 44) {return 21.85;}	// 40 to 43
  	if (wt >= 44 & wt < 48) {return 23.50;}	// 44 to 47
  	if (wt >= 48 & wt < 52) {return 25.15;}	// 48 to 51
  	if (wt >= 52 & wt < 56) {return 26.80;}	// 52 to 55
  	if (wt >= 56 & wt < 60) {return 28.45;}	// 56 to 59
  	if (wt >= 60 & wt < 65) {return 30.10;}}	// 60 to 64

if (spos == 26) shpr = function (wt) {	//Hong Kong EMI Grp 3 --2008-- online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 27) shpr = function (wt) {	//Hungary EMI Grp 4 --2008-- online rates
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}
 
if (spos == 28) shpr = function (wt) {	//Iceland FCMI Grp 5 --2008--
  	if (wt <= 7) {return 6.20;}				// up to 7
  	if (wt == 8) {return 7.00;}				// 8
  	if (wt > 8 & wt < 12) {return 8.65;}	// 9 to 11
  	if (wt >= 12 & wt < 16) {return 10.30;}	// 12 to 15
  	if (wt >= 16 & wt < 20) {return 11.95;} // 16 to 19
  	if (wt >= 20 & wt < 24) {return 13.60;} // 20 to 23
  	if (wt >= 24 & wt < 28) {return 15.25;} // 24 to 27
  	if (wt >= 28 & wt < 32) {return 16.90;}	// 28 to 31
  	if (wt >= 32 & wt < 36) {return 18.55;}	// 32 to 35
  	if (wt >= 36 & wt < 40) {return 20.20;}	// 36 to 39
  	if (wt >= 40 & wt < 44) {return 21.85;}	// 40 to 43
  	if (wt >= 44 & wt < 48) {return 23.50;}	// 44 to 47
  	if (wt >= 48 & wt < 52) {return 25.15;}	// 48 to 51
  	if (wt >= 52 & wt < 56) {return 26.80;}	// 52 to 55
  	if (wt >= 56 & wt < 60) {return 28.45;}	// 56 to 59
  	if (wt >= 60 & wt < 65) {return 30.10;}}	// 60 to 64

if (spos == 29) shpr = function (wt) {	//Iceland EMI Grp 5 --2008-- Online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 30) shpr = function (wt) {	//Ireland FCMI Grp 5 --2008--
  	if (wt <= 7) {return 6.20;}				// up to 7
  	if (wt == 8) {return 7.00;}				// 8
  	if (wt > 8 & wt < 12) {return 8.65;}	// 9 to 11
  	if (wt >= 12 & wt < 16) {return 10.30;}	// 12 to 15
  	if (wt >= 16 & wt < 20) {return 11.95;} // 16 to 19
  	if (wt >= 20 & wt < 24) {return 13.60;} // 20 to 23
  	if (wt >= 24 & wt < 28) {return 15.25;} // 24 to 27
  	if (wt >= 28 & wt < 32) {return 16.90;}	// 28 to 31
  	if (wt >= 32 & wt < 36) {return 18.55;}	// 32 to 35
  	if (wt >= 36 & wt < 40) {return 20.20;}	// 36 to 39
  	if (wt >= 40 & wt < 44) {return 21.85;}	// 40 to 43
  	if (wt >= 44 & wt < 48) {return 23.50;}	// 44 to 47
  	if (wt >= 48 & wt < 52) {return 25.15;}	// 48 to 51
  	if (wt >= 52 & wt < 56) {return 26.80;}	// 52 to 55
  	if (wt >= 56 & wt < 60) {return 28.45;}	// 56 to 59
  	if (wt >= 60 & wt < 65) {return 30.10;}}	// 60 to 64

if (spos == 31) shpr = function (wt) {	//Ireland EMI Grp 5 --2008-- Online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 32) shpr = function (wt) {	//Israel FCMI Grp 8 --2008--
  	if (wt <= 7) {return 5.90;}				// up to 7
  	if (wt == 8) {return 6.65;}				// 8
  	if (wt > 8 & wt < 12) {return 8.25;}	// 9 to 11
  	if (wt >= 12 & wt < 16) {return 9.85;}	// 12 to 15
  	if (wt >= 16 & wt < 20) {return 11.45;} // 16 to 19
  	if (wt >= 20 & wt < 24) {return 13.05;} // 20 to 23
  	if (wt >= 24 & wt < 28) {return 14.65;} // 24 to 27
  	if (wt >= 28 & wt < 32) {return 16.25;}	// 28 to 31
  	if (wt >= 32 & wt < 36) {return 17.85;}	// 32 to 35
  	if (wt >= 36 & wt < 40) {return 19.45;}	// 36 to 39
  	if (wt >= 40 & wt < 44) {return 21.05;}	// 40 to 43
  	if (wt >= 44 & wt < 48) {return 22.65;}	// 44 to 47
  	if (wt >= 48 & wt < 52) {return 24.25;}	// 48 to 51
  	if (wt >= 52 & wt < 56) {return 25.85;}	// 52 to 55
  	if (wt >= 56 & wt < 60) {return 27.45;}	// 56 to 59
  	if (wt >= 60 & wt < 65) {return 29.05;}}	// 60 to 64

if (spos == 33) shpr = function (wt) {	//Israel EMI Grp 8 --2008-- online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}
  	
if (spos == 34) shpr = function (wt) {	//Italy EMI Grp 5 --2008-- Online rates
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 35) shpr = function (wt) {	//Jamaica FCMI Grp 9 --2008--
  	if (wt <= 7) {return 5.90;}				// up to 7
  	if (wt == 8) {return 6.65;}				// 8
  	if (wt > 8 & wt < 12) {return 8.25;}	// 9 to 11
  	if (wt >= 12 & wt < 16) {return 9.85;}	// 12 to 15
  	if (wt >= 16 & wt < 20) {return 11.45;} // 16 to 19
  	if (wt >= 20 & wt < 24) {return 13.05;} // 20 to 23
  	if (wt >= 24 & wt < 28) {return 14.65;} // 24 to 27
  	if (wt >= 28 & wt < 32) {return 16.25;}	// 28 to 31
  	if (wt >= 32 & wt < 36) {return 17.85;}	// 32 to 35
  	if (wt >= 36 & wt < 40) {return 19.45;}	// 36 to 39
  	if (wt >= 40 & wt < 44) {return 21.05;}	// 40 to 43
  	if (wt >= 44 & wt < 48) {return 22.65;}	// 44 to 47
  	if (wt >= 48 & wt < 52) {return 24.25;}	// 48 to 51
  	if (wt >= 52 & wt < 56) {return 25.85;}	// 52 to 55
  	if (wt >= 56 & wt < 60) {return 27.45;}	// 56 to 59
  	if (wt >= 60 & wt < 65) {return 29.05;}}	// 60 to 64

if (spos == 36) shpr = function (wt) {	//Jamaica EMI Grp 9 --2008-- online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 37) shpr = function (wt) {	//Japan FCMI Grp 3 --2008--
  	if (wt <= 7) {return 6.20;}				// up to 7
  	if (wt == 8) {return 7.00;}				// 8
  	if (wt > 8 & wt < 12) {return 8.65;}	// 9 to 11
  	if (wt >= 12 & wt < 16) {return 10.30;}	// 12 to 15
  	if (wt >= 16 & wt < 20) {return 11.95;} // 16 to 19
  	if (wt >= 20 & wt < 24) {return 13.60;} // 20 to 23
  	if (wt >= 24 & wt < 28) {return 15.25;} // 24 to 27
  	if (wt >= 28 & wt < 32) {return 16.90;}	// 28 to 31
  	if (wt >= 32 & wt < 36) {return 18.55;}	// 32 to 35
  	if (wt >= 36 & wt < 40) {return 20.20;}	// 36 to 39
  	if (wt >= 40 & wt < 44) {return 21.85;}	// 40 to 43
  	if (wt >= 44 & wt < 48) {return 23.50;}	// 44 to 47
  	if (wt >= 48 & wt < 52) {return 25.15;}	// 48 to 51
  	if (wt >= 52 & wt < 56) {return 26.80;}	// 52 to 55
  	if (wt >= 56 & wt < 60) {return 28.45;}	// 56 to 59
  	if (wt >= 60 & wt < 65) {return 30.10;}}	// 60 to 64

if (spos == 38) shpr = function (wt) {	//Japan EMI Grp 3 --2008-- online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 39) shpr = function (wt) {	//Latvia EMI Grp 4 --2008-- online rates
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 40) shpr = function (wt) {	//Lithuania EMI Grp 4 --2008-- online rates
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 41) shpr = function (wt) {	//Luxembourg EMI Grp 5 --2008-- Online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 42) shpr = function (wt) {	//Malta EMI Grp 5 --2008-- Online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 43) shpr = function (wt) {	//Mexico EMI Grp 2-limited areas-2008-online rate
  	if (wt <= 16) {return 23.95;}
  	if (wt > 16 & wt < 32) {return 23.95;}
  	if (wt >= 32 & wt < 48) {return 23.95;}
  	if (wt >= 48 & wt < 64) {return 23.95;}}

if (spos == 44) shpr = function (wt) {	//Netherlands EMI Grp 5 --2008-- Online rates
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}
	
if (spos == 45) shpr = function (wt) {	//New Zealand FCMI Grp 6 --2008--
  	if (wt <= 7) {return 5.90;}				// up to 7
  	if (wt == 8) {return 6.65;}				// 8
  	if (wt > 8 & wt < 12) {return 8.25;}	// 9 to 11
  	if (wt >= 12 & wt < 16) {return 9.85;}	// 12 to 15
  	if (wt >= 16 & wt < 20) {return 11.45;} // 16 to 19
  	if (wt >= 20 & wt < 24) {return 13.05;} // 20 to 23
  	if (wt >= 24 & wt < 28) {return 14.65;} // 24 to 27
  	if (wt >= 28 & wt < 32) {return 16.25;}	// 28 to 31
  	if (wt >= 32 & wt < 36) {return 17.85;}	// 32 to 35
  	if (wt >= 36 & wt < 40) {return 19.45;}	// 36 to 39
  	if (wt >= 40 & wt < 44) {return 21.05;}	// 40 to 43
  	if (wt >= 44 & wt < 48) {return 22.65;}	// 44 to 47
  	if (wt >= 48 & wt < 52) {return 24.25;}	// 48 to 51
  	if (wt >= 52 & wt < 56) {return 25.85;}	// 52 to 55
  	if (wt >= 56 & wt < 60) {return 27.45;}	// 56 to 59
  	if (wt >= 60 & wt < 65) {return 29.05;}}	// 60 to 64

if (spos == 46) shpr = function (wt) {	//New Zealand EMI Grp 6 --2008-- online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 47) shpr = function (wt) {	//Norway FCMI Grp 5 --2008--
  	if (wt <= 7) {return 6.20;}				// up to 7
  	if (wt == 8) {return 7.00;}				// 8
  	if (wt > 8 & wt < 12) {return 8.65;}	// 9 to 11
  	if (wt >= 12 & wt < 16) {return 10.30;}	// 12 to 15
  	if (wt >= 16 & wt < 20) {return 11.95;} // 16 to 19
  	if (wt >= 20 & wt < 24) {return 13.60;} // 20 to 23
  	if (wt >= 24 & wt < 28) {return 15.25;} // 24 to 27
  	if (wt >= 28 & wt < 32) {return 16.90;}	// 28 to 31
  	if (wt >= 32 & wt < 36) {return 18.55;}	// 32 to 35
  	if (wt >= 36 & wt < 40) {return 20.20;}	// 36 to 39
  	if (wt >= 40 & wt < 44) {return 21.85;}	// 40 to 43
  	if (wt >= 44 & wt < 48) {return 23.50;}	// 44 to 47
  	if (wt >= 48 & wt < 52) {return 25.15;}	// 48 to 51
  	if (wt >= 52 & wt < 56) {return 26.80;}	// 52 to 55
  	if (wt >= 56 & wt < 60) {return 28.45;}	// 56 to 59
  	if (wt >= 60 & wt < 65) {return 30.10;}}	// 60 to 64

if (spos == 48) shpr = function (wt) {	//Norway EMI Grp 5 --2008-- Online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 49) shpr = function (wt) {	//Portugal EMI Grp 5 --2008-- Online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 50) shpr = function (wt) {	//Singapore EMI Grp 6 --2008-- online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 51) shpr = function (wt) {	//South Korea EMI Grp 3 --2008-- online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 52) shpr = function (wt) {	//Spain EMI Grp 5 --2008-- Online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 53) shpr = function (wt) {	//Sweden FCMI Grp 5 --2008--
  	if (wt <= 7) {return 6.20;}				// up to 7
  	if (wt == 8) {return 7.00;}				// 8
  	if (wt > 8 & wt < 12) {return 8.65;}	// 9 to 11
  	if (wt >= 12 & wt < 16) {return 10.30;}	// 12 to 15
  	if (wt >= 16 & wt < 20) {return 11.95;} // 16 to 19
  	if (wt >= 20 & wt < 24) {return 13.60;} // 20 to 23
  	if (wt >= 24 & wt < 28) {return 15.25;} // 24 to 27
  	if (wt >= 28 & wt < 32) {return 16.90;}	// 28 to 31
  	if (wt >= 32 & wt < 36) {return 18.55;}	// 32 to 35
  	if (wt >= 36 & wt < 40) {return 20.20;}	// 36 to 39
  	if (wt >= 40 & wt < 44) {return 21.85;}	// 40 to 43
  	if (wt >= 44 & wt < 48) {return 23.50;}	// 44 to 47
  	if (wt >= 48 & wt < 52) {return 25.15;}	// 48 to 51
  	if (wt >= 52 & wt < 56) {return 26.80;}	// 52 to 55
  	if (wt >= 56 & wt < 60) {return 28.45;}	// 56 to 59
  	if (wt >= 60 & wt < 65) {return 30.10;}}	// 60 to 64

if (spos == 54) shpr = function (wt) {	//Sweden EMI Grp 5 --2008-- Online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 55) shpr = function (wt) {	//Switzerland FCMI Grp 5 --2008--
  	if (wt <= 7) {return 6.20;}				// up to 7
  	if (wt == 8) {return 7.00;}				// 8
  	if (wt > 8 & wt < 12) {return 8.65;}	// 9 to 11
  	if (wt >= 12 & wt < 16) {return 10.30;}	// 12 to 15
  	if (wt >= 16 & wt < 20) {return 11.95;} // 16 to 19
  	if (wt >= 20 & wt < 24) {return 13.60;} // 20 to 23
  	if (wt >= 24 & wt < 28) {return 15.25;} // 24 to 27
  	if (wt >= 28 & wt < 32) {return 16.90;}	// 28 to 31
  	if (wt >= 32 & wt < 36) {return 18.55;}	// 32 to 35
  	if (wt >= 36 & wt < 40) {return 20.20;}	// 36 to 39
  	if (wt >= 40 & wt < 44) {return 21.85;}	// 40 to 43
  	if (wt >= 44 & wt < 48) {return 23.50;}	// 44 to 47
  	if (wt >= 48 & wt < 52) {return 25.15;}	// 48 to 51
  	if (wt >= 52 & wt < 56) {return 26.80;}	// 52 to 55
  	if (wt >= 56 & wt < 60) {return 28.45;}	// 56 to 59
  	if (wt >= 60 & wt < 65) {return 30.10;}}	// 60 to 64

if (spos == 56) shpr = function (wt) {	//Switzerland EMI Grp 5 --2008-- Online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 57) shpr = function (wt) {	//Taiwan FCMI Grp 6 --2008--
  	if (wt <= 7) {return 5.90;}				// up to 7
  	if (wt == 8) {return 6.65;}				// 8
  	if (wt > 8 & wt < 12) {return 8.25;}	// 9 to 11
  	if (wt >= 12 & wt < 16) {return 9.85;}	// 12 to 15
  	if (wt >= 16 & wt < 20) {return 11.45;} // 16 to 19
  	if (wt >= 20 & wt < 24) {return 13.05;} // 20 to 23
  	if (wt >= 24 & wt < 28) {return 14.65;} // 24 to 27
  	if (wt >= 28 & wt < 32) {return 16.25;}	// 28 to 31
  	if (wt >= 32 & wt < 36) {return 17.85;}	// 32 to 35
  	if (wt >= 36 & wt < 40) {return 19.45;}	// 36 to 39
  	if (wt >= 40 & wt < 44) {return 21.05;}	// 40 to 43
  	if (wt >= 44 & wt < 48) {return 22.65;}	// 44 to 47
  	if (wt >= 48 & wt < 52) {return 24.25;}	// 48 to 51
  	if (wt >= 52 & wt < 56) {return 25.85;}	// 52 to 55
  	if (wt >= 56 & wt < 60) {return 27.45;}	// 56 to 59
  	if (wt >= 60 & wt < 65) {return 29.05;}}	// 60 to 64

if (spos == 58) shpr = function (wt) {	//Taiwan EMI Grp 6 --2008-- online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 59) shpr = function (wt) {	//Thailand EMI Grp 6 --2008-- online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 60) shpr = function (wt) {	//United Kingdom FCMI Grp 5 --2008--
  	if (wt <= 7) {return 6.20;}				// up to 7
  	if (wt == 8) {return 7.00;}				// 8
  	if (wt > 8 & wt < 12) {return 8.65;}	// 9 to 11
  	if (wt >= 12 & wt < 16) {return 10.30;}	// 12 to 15
  	if (wt >= 16 & wt < 20) {return 11.95;} // 16 to 19
  	if (wt >= 20 & wt < 24) {return 13.60;} // 20 to 23
  	if (wt >= 24 & wt < 28) {return 15.25;} // 24 to 27
  	if (wt >= 28 & wt < 32) {return 16.90;}	// 28 to 31
  	if (wt >= 32 & wt < 36) {return 18.55;}	// 32 to 35
  	if (wt >= 36 & wt < 40) {return 20.20;}	// 36 to 39
  	if (wt >= 40 & wt < 44) {return 21.85;}	// 40 to 43
  	if (wt >= 44 & wt < 48) {return 23.50;}	// 44 to 47
  	if (wt >= 48 & wt < 52) {return 25.15;}	// 48 to 51
  	if (wt >= 52 & wt < 56) {return 26.80;}	// 52 to 55
  	if (wt >= 56 & wt < 60) {return 28.45;}	// 56 to 59
  	if (wt >= 60 & wt < 65) {return 30.10;}}	// 60 to 64

if (spos == 61) shpr = function (wt) {	//United Kingdom EMI Grp 5 --2008-- Online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}

if (spos == 62) shpr = function (wt) {	//Venezuela EMI Grp 9 --2008-- online rate
  	if (wt <= 16) {return 23.87;}
  	if (wt > 16 & wt < 32) {return 23.87;}
  	if (wt >= 32 & wt < 48) {return 23.87;}
  	if (wt >= 48 & wt < 64) {return 23.87;}}
 	
if (spos == 63) shpr = function (wt) {//Order add on No shipping
  	if (wt == 1) {return 0.00;}
  	if (wt == 2) {return 0.00;}
  	if (wt == 3) {return 0.00;}
  	if (wt == 4) {return 0.00;} }

  DispTots ();
}

function SetTax (obj) {
  tpos = obj.selectedIndex;  // which option selected
  ttxt = obj.options[tpos].text;
  ttax = obj.options[tpos].value*1.0;
  DispTots ();
}
