function doAddPic(itemid,productid,productname) {
  var uppic = window.open("abstore_admin_pic.aspx?itemid=" + itemid + "&productid=" + productid + "&productname=" + productname,"uppic","height=200,width=450,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,top=100,left=100")
  uppic.focus()
}

function doAddNew() {
  var addnew = window.open("abstore_admin_addnew.aspx","addnew","height=250,width=320,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,top=100,left=100")
  addnew.focus()
}

function doViewCart() {
  document.getElementById("ppviewcart").submit()
}
function doAddToCart(itemnum,item,qty,amount,shipping) {
  var pp=document.getElementById("paypal")
  pp.item_number.value=itemnum
  pp.item_name.value=item
  pp.quantity.value=qty
  pp.amount.value=amount
  pp.shipping.value=shipping
  pp.submit()
}

function addsubqty(num) {
    var qtyadj = "";
    var curval = 0;
    var cur = document.getElementById('style_qty_' + num);
    if (cur) curval=cur.value;
    qtyadj=prompt("Enter the quantity to adjust by. If you want to subtract 3, enter -3; to add 2, enter 2.",curval);
    if (qtyadj) {
        if (IsNumeric(qtyadj)==false) {
            alert("Invalid entry. You must enter a number, such as -5, or 7.");
            return;
        }
        cur.value=qtyadj;
        if (qtyadj > 0) qtyadj="+" + qtyadj;
        var txt = document.getElementById('style_qoh_adj_' + num);
        txt.value=qtyadj;
    }
}

function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }