Loading Please Wait...

Security Alert
Your login rights are not sufficient enough to view the content on this page.
Please Sign In as a different user or go back to the previous screen.
If you believe the above is an error, your current session could have timed out.
Please click the Sign In button to restart your session.

If this error persists, please contact our support team.

   
function UpdateStatus(ProductID){ var Div=GetTag('ProductAvailable' + ProductID.toString()); var PriceDiv = GetTag('ProductPrice' + ProductID.toString()); var ItemDiv = GetTag('ProductItemCode' + ProductID.toString()); var QtyReq = parseInt(eval('document.commerce.QTY' + ProductID.toString()).value,10); var Inv = GetInventoryEntry(MultiItemDatas.ItemDatas[ProductID], ProductID); var QtyField = GetTag('QTY' + ProductID.toString()); var AddlPrice = 0; var Sels = GetTags('ProductProp' + ProductID) var PID = ProductID; var qty = 0; var cBreak = null; var myPrice = 0; var subtotal = 0; var BaseDetails = arrTotalProducts[ProductID]; myPrice = parseFloat(MultiItemDatas.ItemDatas[ProductID]['BasePrice'], 10); if(ItemsForProduct[ProductID]) { } else { ItemsForProduct[ProductID] = new Array(); } ItemsForProduct[ProductID].push(PID); ItemsForProduct[ProductID][PID] = myPrice; for(var i=0;i'; } if(DivTwo){ DivTwo.innerHTML = 'Items Subtotal: ' + formatCurrency(sum) + ''; } } var aryProductIds = []; var aryIndexIds = []; function SubmitKit(){ var Inv, qty; var Tag, ID; var partNo; var QtyBox = document.getElementsByTagName('input'); var pass = true; for(i=0; i-1) { var obj = document.getElementsByName(QtyBox[i].name)[0] if(obj) { if((navigator.appName.toUpperCase()=='MICROSOFT INTERNET EXPLORER' && obj.className=='Errored') || (navigator.appName.toUpperCase()!='MICROSOFT INTERNET EXPLORER' && obj.className=='Errored')) { alert('Please update highlighted quantity boxes'); pass = false; break; } } } } var QtyDD = document.getElementsByTagName('select'); for(i=0; i-1) { var obj = document.getElementsByName(QtyDD[i].name)[0] if(obj) { if((navigator.appName.toUpperCase()=='MICROSOFT INTERNET EXPLORER' && obj.className=='Errored') || (navigator.appName.toUpperCase()!='MICROSOFT INTERNET EXPLORER' && obj.className=='Errored')) { alert('Please update highlighted quantity boxes'); pass = false; break; } } } } if(!pass)return false; var aryProdIds = []; for(var i=0;i 0) { if(qty < OrderReq[ID].Min) { alert('Your qty amount does not satisfy the minimum order amount of ' + OrderReq[ID].Min + ' for product ' + partNo + '.\n\nPlease adjust this before adding it to your cart.'); GetTag('QTY'+ID).focus(); return; } if(OrderReq[ID].Max != 0 && qty > OrderReq[ID].Max) { alert('Your qty amount does not satisfy the maximum order amount of ' + OrderReq[ID].Max + ' for product ' + partNo + '.\n\nPlease adjust this before adding it to your cart.'); GetTag('QTY'+ID).focus(); return; } if((qty - OrderReq[ID].Min) % OrderReq[ID].Inc != 0) { var high, low, rem; rem = qty - OrderReq[ID].Min; low = qty - (rem % OrderReq[ID].Inc); high = low + OrderReq[ID].Inc; alert('Your qty amount is not a valid ordering amount for product ' + partNo + '.\n\nPlease adjust this before adding it to your cart.\n\nTry ordering ' + low + ' or ' + high + '.'); GetTag('QTY'+ID).focus(); return; } aryProdIds.push(ID.replace('prod','')); } Inv = GetInventoryEntry(MultiItemDatas.ItemDatas[ID], ID); if(Inv == null) { Inv = eval(ID); } if(Inv != null && !Inv.Active) { alert('Item ' + Inv.ItemCode + ' is currently unavailable. Either make another selection or reset the quantity to 0.'); GetTag('QTY'+ID).focus(); return; } Tag = eval('document.commerce.ProductItem' + ID); Tag.value = (Inv==null)? partNo : Inv.ItemCode; } $("#addtocartcheck").val("true") aryProductIds = aryProdIds; if(aryProductIds.length) { $.getJSON("../../DSN/wwwgsssafetycom/Content/ASP/2017_CommerceCategoryQuickOrder.asp", {IsAjax: "getCartElements", pids: aryProductIds.join(",")}, function(r) { $("form#addToCartForm").remove(); //var _i = $('#tblAppendGrid').appendGrid('getAllValue'); var _d = {}; var _index = 0; _d.elements = []; for(var tt=0; tt").attr("id","addToCartForm").attr("method","POST") .attr("action","../../30/cart.htm")) $("#itemCartTemplate").tmpl(_d).appendTo("#addToCartForm"); var iitems = []; for(var ff = 0; ff<_d.elements.length; ff++) { var cc = {}; cc.BasePrice = 0; cc.CategoryId = 19; cc.Extra = ""; cc.ItemId = _d.elements[ff].id; cc.Key = ""; cc.LocationId = 0; cc.Name = _escapeJS(_d.elements[ff].name); cc.PartNumbber = _d.elements[ff].sku; cc.ProductId = _d.elements[ff].pid; cc.Quantity = parseInt(_d.elements[ff].qty,10); cc.Modifiers = getModifiersObj(_d.elements[ff].sku, cc.ProductId); iitems.push(cc); } //$("form#addToCartForm").submit(); //return; var c = {}; c.Items = iitems; c.Extra = ""; c.ExtraType = ""; $.post("/st/723/cart/PutComplexCartItems", c, function(ret){ $("form#addToCartForm").submit(); }); }); } //document.commerce.submit(); } function getModifiers(sku, iID) { var mod = []; var s = String.fromCharCode(28); var modIDdd = $("select[name='ProductPropprod" + iID + "']"); var modSelect = ''; if(modIDdd.length) { modSelect = modIDdd.val().split(s)[1]; } for(var dd=0; dd<_items.length; dd++) { if(_items[dd].sku.toLowerCase() == sku.toLowerCase() && _items[dd].mods.length) { var m = _items[dd].mods.split(','); for(var g=0; g 0) { var _m = m[g].split('**'); if(modSelect == _m[0] || !iID) { var mmm = {}; mmm.Input = ""; mmm.ModifierId = parseInt(_m[0],10); mmm.Name = _escapeJS(_m[1]); mmm.OneTime = false; mmm.Price = 0; mmm.TypeName = _escapeJS(_m[2]); mod.push(mmm); } } } return mod; } } return []; } function _escapeJS(s) { return s.replace(/(['"])/g, "\\$1"); } function getItemName(sku) { for(var dd=0; dd<_items.length; dd++) { if(_items[dd].sku.toLowerCase() == sku.toLowerCase()) { return _items[dd].prodname; } } } function getItemId(sku) { for(var dd=0; dd<_items.length; dd++) { if(_items[dd].sku.toLowerCase() == sku.toLowerCase()) { return _items[dd].id; } } } //////////////////////////////////////////////////////// //PRICE BREAK //////////////////////////////////////////////////////// QtyPriceStruct.prototype.toString = function(BasePrice){ var out = ''; var isEven = true; var sClass; var BreakNumber; this.Breaks.sort(sortQtyPriceBreaks); try{ if(this.Qtys.length > 0) { var cellwidth = (1 / (this.Breaks.length+1))*100; out += '
Pricing Information
' out += '
Qty
'; for(var i=0; i=this.Breaks.length) { BreakNumber = '+'; } window.status += 'a' + this.Breaks.length; out += '
' + this.Breaks[i].Qty + ' ' + BreakNumber + '
'; } out += '
Price
' for(var i=0; i
'; } out += '
'; } } catch(e){} return out; } QtyPriceStruct.prototype.getBreak = function(Qty){ if(this.Breaks.length == 0) return null; var i = 0; //if(Qty == 1000) throw 'holla!'; while((i < this.Breaks.length) && (this.Breaks[i].Qty <= Qty)){ i++; } if(i == this.Breaks.length && this.Breaks[i-1].Qty <= Qty) return this.Qtys[this.Breaks[i-1].Qty]; if ((i == 0)|| i == this.Breaks.length) return null; //no discount found i--; //alert(this.Breaks[i].Qty); return this.Qtys[this.Breaks[i].Qty]; } QtyPriceBreak.prototype.toString = function(BasePrice){ if (BasePrice){ } else { BasePrice = 0; } var tmpStr = "$"; if(!this.IsPercent) { //tmpStr += (BasePrice - this.Delta).toFixed(2); tmpStr += stRound(BasePrice - this.Delta,2); tmpStr += ""; } else { //tmpStr += (BasePrice - (BasePrice * (this.Delta * .01))).toFixed(2); tmpStr += stRound(BasePrice - (BasePrice * (this.Delta * .01)),2); tmpStr += " (" + this.Delta + "% off)"; } return tmpStr; } QtyPriceBreak.prototype.getDiscountedPrice = function(Price){ if(this.IsPercent){ return Price - (Price * (this.Delta * .01)); } else { return Price - this.Delta; } } function checkForNumber(inputid) { if (isNaN( $("#" + inputid).val() )) { alert("You can only enter numbers"); $('#' + inputid).val("") $('#' + inputid).focus(); } } function checkQty(inputid, check) { if($('#' + inputid).val() == '0') { $('#' + inputid).val("") } if($('#' + inputid).val().length == 0 && check == true) { $('#' + inputid).val('0') } }