function vdsb(ft) {
  if(blnk_e.test(ft.value)) {
    location.href = location.href;
    alert("Oops!\nYou left a quantity field in your shopping bag empty!\nNo problem. It's previous value was restored.");
  }
}

function dspsb() {
  var nib1 = 0;
  var gt = 0;
  var str_total = "";
  var o = "";
  setCookie("accomplice_cookie_test", "accomplice_cookie_test", null, "/"); 
  if (document.cookie.indexOf('accomplice_cookie_test') == -1) { 
    cookiesenabled = false; 
  } 
  else {
    cookiesenabled = true;
  }
  delCookie("accomplice_cookie_test", "/"); 
  if (!cookiesenabled) {
    o = "<center><span class=\"redtext\"><b> Woops!...</b></span> The shopping bag uses a temporary cookie file to save your selections.<br /><b> Please make sure that cookies aren't disabled in your browser's preferences. </b><img src=\"accomplice/accomplice-design-silver-collar-pendant.jpg\" alt=\"accomplice design silver collar and pendant\" title=\"accomplice design leather and sterling silver dog collar buckle and pendant\" height=\"256\" width=\"620\" /> <span class=\"font13\"><b>Please note:</b> Our cookies are automatically deleted when you leave our webpage. In any case, they are only used to remember your shopping bag contents while you browse our pages, and are in no way used to track any personal information. You can view our cookies' contents in your browser's options, they are all labeled with the prefix 'accomplice_'. More info on http cookies here: <a href=\"http://en.wikipedia.org/wiki/http_cookie\" target=\"_blank\"> Http_cookie on wikipedia </a></span></center>";
  }
  else {
    nib1 = getCookie("accomplice_itemsInBag");
    if (nib1 == null) nib1 = 0;
    if (nib1 == 0) {
      o = "<br /><b> Your shopping bag is empty! </b><br /><div class=\"lb8\"></div>" +
          "Please visit our <a href=\"boutique.htm\" class=\"link16\" title=\"purchase fine quality hand made leather and silver accessories at accomplice design's boutique\"> boutique </a> or pick a category from above.<br /><br />" +
          "<a href=\"boutique.htm\" class=\"link16\"><img src=\"accomplice/accomplice-design-silver-collar-pendant.jpg\" alt=\"accomplice design silver collar and pendant\" title=\"go to boutique to order accomplice design's hand made leather and sterling silver dog collars and pendants\" height=\"256\" width=\"620\" /></a>";
    }
    else {
      o = "<form action=\"checkout.htm\" name=\"sbform\">" +
          "The items listed below are currently in your shopping bag.<br /> You can edit an item's quantity, or remove it from the bag by clicking the X next to it." +
          "<div class=\"lb8\"></div>" +
          "<table><thead><tr>" +
          "<td>"+"name - description (item number)"+"</td>" +
          "<td>"+"price"+"</td>" +
          "<td class=\"itemquantitycell\">"+"qty."+"</td>" +
          "<td class=\"itemtotalcell\">"+"total"+"</td>" +
          "</tr></thead><tbody>";
      for (i = 1; i <= nib1; i++) {
        n_it = "accomplice_item." + i;
        are = "";
        are = getCookie(n_it);
        nt0 = are.indexOf("|", 0);
        nt1 = are.indexOf("|", nt0+1);
        nt2 = are.indexOf("|", nt1+1);
        nt3 = are.indexOf("|", nt2+1);
        lmn = new Array;
        lmn[0] = are.substring(0, nt0);
        lmn[1] = are.substring(nt0+1, nt1);
        lmn[2] = are.substring(nt1+1, nt2);
        lmn[3] = are.substring(nt2+1, nt3);
        lmn[4] = are.substring(nt3+1, are.length);
        item_stotal  = (parseInt(lmn[1]) * parseInt(lmn[2]));
        gt += (parseInt(lmn[1]) * parseInt(lmn[2]));
        str_stotal = item_stotal;
        str_total = gt;
        o += "<tr><td>" + lmn[0] + " - " + lmn[3] + "<br />" + lmn[4] + "</td>" +
             "<td>"+ "$" + lmn[2] + "</td>" +
             "<td><input type=text title=\"you can change this value\" size=1 maxlength=2 value=\"" + lmn[1] + "\" onKeyUp=\"chiq(" + i + ", this);\" onblur=\"vdsb(this);\"></td>" +
             "<td>" + "$" + str_stotal + "</td>" +
             "<td class=\"removefrombagcell\"><button name=\"remove\" type=\"button\" title=\"remove from bag\" value=\"remove\" class=\"buttonaslink\" onmouseover=\"this.className='buttonaslink_hover';\" onmouseout=\"this.className='buttonaslink';\" onClick=\"rfsb("+i+")\"> X </button></td></tr>";
      }
      o += "<tr><td colspan=3><strong> Total before taxes and shipping </strong></td>" +
           "<td><strong> $" + str_total + "</strong></td></tr></tbody></table>" +
           "<div class=\"lb8\"></div><div class=\"lb8\"></div>" +
           "<button name=\"continueshopping\" class=\"buttonaslink\" onmouseover=\"this.className='buttonaslink_hover';\" onmouseout=\"this.className='buttonaslink';\" onClick=\"go_back()\" type=\"button\">continue shopping</button>" +
           "<span class=\"midvalign\">or</span>" +
           "<button name=\"tocheckout\" class=\"buttonaslink\" onmouseover=\"this.className='buttonaslink_hover';\" onmouseout=\"this.className='buttonaslink';\" type=\"submit\">proceed to checkout</button>" +
           "</form><br /><br /><br />";
    }
  }
  document.write(o);
  document.close();
}
