// 3.Create Product Group // 3.1.Add All Selections (by ID) // 3.2.Add All Options (by ID) // 3.3.Product Assign Array // 3.4.Create var pgGrpOptSel_203_328 = new Selection(328,"Swivel Hook","
Swivel Hook Attachment Requires card with 4mm hole drilled.","","","",false,0.000,0,0,0); var pgGrpOptSel_203_327 = new Selection(327,"Alligator Clip","
Alligator Clip Supplied for attachment to cards with 12.7mm Slot.","","","",true,0.000,0,0,0); var pgGrpOpt_203 = new Option(203,"Lanyard Swivel or Alligator Clip","","","Select either ","","Radio","-1","","-1","","1","Table","vertical","SingleLine","","","","1","0",0,[pgGrpOptSel_203_328, pgGrpOptSel_203_327],false); var pgGrpOptSel_202_312 = new Selection(312,"Not Required","","","","",true,0.000,0,0,0); var pgGrpOptSel_202_326 = new Selection(326,"Breakaway Safety Clip","
Safety Breakaway Clip Available for 15mm, 20mm or 25mm Lanyards","","","",false,0.000,0,0,0); var pgGrpOpt_202 = new Option(202,"Lanyard Breakaway Clip","","","Optional Safety Release ","","Radio","-1","","-1","","1","Table","vertical","SingleLine","","","","1","0",0,[pgGrpOptSel_202_312, pgGrpOptSel_202_326],false); // Products var pOptSel_20424_202_312 = new Selection(312,"Not Required","","Not Required","","",true,0.0,0,0,0); var pOptSel_20424_202_326 = new Selection(326,"Breakaway Safety Clip","
Safety Breakaway Clip Available for 15mm, 20mm or 25mm Lanyards","Safety Breakaway Clip","","",false,0.0,0,0,0); var pOptSel_20424_203_327 = new Selection(327,"Alligator Clip","
Alligator Clip Supplied for attachment to cards with 12.7mm Slot.","Alligator Clip","","",false,0.0,0,0,0); var pOptSel_20424_203_328 = new Selection(328,"Swivel Hook","
Swivel Hook Attachment Requires card with 4mm hole drilled.","Swivel Hook Attachment","","",true,0.0,0,0,0); var pOptSel_20424_204_330 = new Selection(330,"Pick-up (Sydney Only)","","Pick-up (7.30 -6.00pm Mon-Fri)","","",false,0.0,0,0,0); var pOptSel_20424_223_364 = new Selection(364,"Lanyard - Black","","Black","","",true,0.0,0,0,0); var pOptSel_20424_223_365 = new Selection(365,"Lanyard - Navy","","Navy","","",false,0.0,0,0,0); var pOptSel_20424_223_367 = new Selection(367,"Lanyard - Yellow","","Yellow","","",false,0.0,0,0,0); var pOptSel_20424_223_368 = new Selection(368,"Lanyard - Red","","Red","","",false,0.0,0,0,0); var pOptSel_20424_223_370 = new Selection(370,"Lanyard - Green","","Green","","",false,0.0,0,0,0); var pOptSel_20424_223_372 = new Selection(372,"Lanyard - Light Blue","","Light Blue","","",false,0.0,0,0,0); var pOptSel_20424_204_388 = new Selection(388,"FREE DELIVERY Aust wide","
FREE DELIVERY AUSTRALIA WIDE 
We use TNT, FASTWAY & Express Post
for Free Overnight delivery to your work or home.
Please specify in the comments field if you have
a preference & please make sure someone is
there to accept the delivery.
","Overnight Free Delivery","","",true,0.0,0,0,0); var pOptSel_20424_204_389 = new Selection(389,"FREE DELIVERY Same Day Urgent","","Urgent VIP same day at additional cost","","",false,0.0,0,0,0); var pOpt_20424_202 = new Option(202,"Lanyard Breakaway Clip","","","Optional Safety Release ","","Radio","-1","","-1","","1","Table","vertical","SingleLine","","","","1","0",0,[pOptSel_20424_202_312, pOptSel_20424_202_326],true); var pOpt_20424_203 = new Option(203,"Lanyard Swivel or Alligator Clip","","","Select either ","","Radio","-1","","-1","","1","Table","vertical","SingleLine","","","","1","0",0,[pOptSel_20424_203_328, pOptSel_20424_203_327],true); var pOpt_20424_204 = new Option(204,"FREE DELIVERY Aust Wide","","","FREE DELIVERY Aust Wide ","","DropDown","-1","","-1","","1","Table","vertical","SingleLine","","","","1","0",0,[pOptSel_20424_204_388, pOptSel_20424_204_330, pOptSel_20424_204_389],true); var pOpt_20424_223 = new Option(223,"Lanyard Colours Unprinted","","","Lanyard Colours ","","DropDown","-1","","-1","","1","Table","vertical","SingleLine","","","","1","0",0,[pOptSel_20424_223_364, pOptSel_20424_223_365, pOptSel_20424_223_367, pOptSel_20424_223_368, pOptSel_20424_223_370, pOptSel_20424_223_372],true); var pq_144243_202_312 = new SelectionsPrice(202, 312, 0.000) var pq_144243_203_328 = new SelectionsPrice(203, 328, 0.000) var pq_144243_223_364 = new SelectionsPrice(223, 364, 0.000) var pq_144243_202_326 = new SelectionsPrice(202, 326, 40.000) var pq_144243_203_327 = new SelectionsPrice(203, 327, 0.000) var pq_144243_204_388 = new SelectionsPrice(204, 388, 0.000) var pq_144243_223_365 = new SelectionsPrice(223, 365, 0.000) var pq_144243_204_330 = new SelectionsPrice(204, 330, 0.000) var pq_144243_223_367 = new SelectionsPrice(223, 367, 0.000) var pq_144243_204_389 = new SelectionsPrice(204, 389, 0.000) var pq_144243_223_368 = new SelectionsPrice(223, 368, 0.000) var pq_144243_223_370 = new SelectionsPrice(223, 370, 0.000) var pq_144243_223_372 = new SelectionsPrice(223, 372, 0.000) var pq_144243 = new ProductQuantities(144243, 20424, 100, 225.0000, [pq_144243_202_312, pq_144243_203_328, pq_144243_223_364, pq_144243_202_326, pq_144243_203_327, pq_144243_204_388, pq_144243_223_365, pq_144243_204_330, pq_144243_223_367, pq_144243_204_389, pq_144243_223_368, pq_144243_223_370, pq_144243_223_372]); var pq_144244_202_312 = new SelectionsPrice(202, 312, 0.000) var pq_144244_203_328 = new SelectionsPrice(203, 328, 0.000) var pq_144244_223_364 = new SelectionsPrice(223, 364, 0.000) var pq_144244_202_326 = new SelectionsPrice(202, 326, 52.500) var pq_144244_203_327 = new SelectionsPrice(203, 327, 0.000) var pq_144244_204_388 = new SelectionsPrice(204, 388, 0.000) var pq_144244_223_365 = new SelectionsPrice(223, 365, 0.000) var pq_144244_204_330 = new SelectionsPrice(204, 330, 0.000) var pq_144244_223_367 = new SelectionsPrice(223, 367, 0.000) var pq_144244_204_389 = new SelectionsPrice(204, 389, 0.000) var pq_144244_223_368 = new SelectionsPrice(223, 368, 0.000) var pq_144244_223_370 = new SelectionsPrice(223, 370, 0.000) var pq_144244_223_372 = new SelectionsPrice(223, 372, 0.000) var pq_144244 = new ProductQuantities(144244, 20424, 250, 312.0000, [pq_144244_202_312, pq_144244_203_328, pq_144244_223_364, pq_144244_202_326, pq_144244_203_327, pq_144244_204_388, pq_144244_223_365, pq_144244_204_330, pq_144244_223_367, pq_144244_204_389, pq_144244_223_368, pq_144244_223_370, pq_144244_223_372]); var pq_144245_202_312 = new SelectionsPrice(202, 312, 0.000) var pq_144245_203_328 = new SelectionsPrice(203, 328, 0.000) var pq_144245_223_364 = new SelectionsPrice(223, 364, 0.000) var pq_144245_202_326 = new SelectionsPrice(202, 326, 105.000) var pq_144245_203_327 = new SelectionsPrice(203, 327, 0.000) var pq_144245_204_388 = new SelectionsPrice(204, 388, 0.000) var pq_144245_223_365 = new SelectionsPrice(223, 365, 0.000) var pq_144245_204_330 = new SelectionsPrice(204, 330, 0.000) var pq_144245_223_367 = new SelectionsPrice(223, 367, 0.000) var pq_144245_204_389 = new SelectionsPrice(204, 389, 0.000) var pq_144245_223_368 = new SelectionsPrice(223, 368, 0.000) var pq_144245_223_370 = new SelectionsPrice(223, 370, 0.000) var pq_144245_223_372 = new SelectionsPrice(223, 372, 0.000) var pq_144245 = new ProductQuantities(144245, 20424, 500, 440.0000, [pq_144245_202_312, pq_144245_203_328, pq_144245_223_364, pq_144245_202_326, pq_144245_203_327, pq_144245_204_388, pq_144245_223_365, pq_144245_204_330, pq_144245_223_367, pq_144245_204_389, pq_144245_223_368, pq_144245_223_370, pq_144245_223_372]); var pq_144246_202_312 = new SelectionsPrice(202, 312, 0.000) var pq_144246_203_328 = new SelectionsPrice(203, 328, 0.000) var pq_144246_223_364 = new SelectionsPrice(223, 364, 0.000) var pq_144246_202_326 = new SelectionsPrice(202, 326, 210.000) var pq_144246_203_327 = new SelectionsPrice(203, 327, 0.000) var pq_144246_204_388 = new SelectionsPrice(204, 388, 0.000) var pq_144246_223_365 = new SelectionsPrice(223, 365, 0.000) var pq_144246_204_330 = new SelectionsPrice(204, 330, 0.000) var pq_144246_223_367 = new SelectionsPrice(223, 367, 0.000) var pq_144246_204_389 = new SelectionsPrice(204, 389, 0.000) var pq_144246_223_368 = new SelectionsPrice(223, 368, 0.000) var pq_144246_223_370 = new SelectionsPrice(223, 370, 0.000) var pq_144246_223_372 = new SelectionsPrice(223, 372, 0.000) var pq_144246 = new ProductQuantities(144246, 20424, 1000, 780.0000, [pq_144246_202_312, pq_144246_203_328, pq_144246_223_364, pq_144246_202_326, pq_144246_203_327, pq_144246_204_388, pq_144246_223_365, pq_144246_204_330, pq_144246_223_367, pq_144246_204_389, pq_144246_223_368, pq_144246_223_370, pq_144246_223_372]); var pq_144247_202_312 = new SelectionsPrice(202, 312, 0.000) var pq_144247_203_328 = new SelectionsPrice(203, 328, 0.000) var pq_144247_223_364 = new SelectionsPrice(223, 364, 0.000) var pq_144247_202_326 = new SelectionsPrice(202, 326, 525.000) var pq_144247_203_327 = new SelectionsPrice(203, 327, 0.000) var pq_144247_204_388 = new SelectionsPrice(204, 388, 0.000) var pq_144247_223_365 = new SelectionsPrice(223, 365, 0.000) var pq_144247_204_330 = new SelectionsPrice(204, 330, 0.000) var pq_144247_223_367 = new SelectionsPrice(223, 367, 0.000) var pq_144247_204_389 = new SelectionsPrice(204, 389, 0.000) var pq_144247_223_368 = new SelectionsPrice(223, 368, 0.000) var pq_144247_223_370 = new SelectionsPrice(223, 370, 0.000) var pq_144247_223_372 = new SelectionsPrice(223, 372, 0.000) var pq_144247 = new ProductQuantities(144247, 20424, 2500, 1700.0000, [pq_144247_202_312, pq_144247_203_328, pq_144247_223_364, pq_144247_202_326, pq_144247_203_327, pq_144247_204_388, pq_144247_223_365, pq_144247_204_330, pq_144247_223_367, pq_144247_204_389, pq_144247_223_368, pq_144247_223_370, pq_144247_223_372]); var pq_144248_202_312 = new SelectionsPrice(202, 312, 0.000) var pq_144248_203_328 = new SelectionsPrice(203, 328, 0.000) var pq_144248_223_364 = new SelectionsPrice(223, 364, 0.000) var pq_144248_202_326 = new SelectionsPrice(202, 326, 1050.000) var pq_144248_203_327 = new SelectionsPrice(203, 327, 0.000) var pq_144248_204_388 = new SelectionsPrice(204, 388, 0.000) var pq_144248_223_365 = new SelectionsPrice(223, 365, 0.000) var pq_144248_204_330 = new SelectionsPrice(204, 330, 0.000) var pq_144248_223_367 = new SelectionsPrice(223, 367, 0.000) var pq_144248_204_389 = new SelectionsPrice(204, 389, 0.000) var pq_144248_223_368 = new SelectionsPrice(223, 368, 0.000) var pq_144248_223_370 = new SelectionsPrice(223, 370, 0.000) var pq_144248_223_372 = new SelectionsPrice(223, 372, 0.000) var pq_144248 = new ProductQuantities(144248, 20424, 5000, 3090.0000, [pq_144248_202_312, pq_144248_203_328, pq_144248_223_364, pq_144248_202_326, pq_144248_203_327, pq_144248_204_388, pq_144248_223_365, pq_144248_204_330, pq_144248_223_367, pq_144248_204_389, pq_144248_223_368, pq_144248_223_370, pq_144248_223_372]); var pq_144249_202_312 = new SelectionsPrice(202, 312, 0.000) var pq_144249_203_328 = new SelectionsPrice(203, 328, 0.000) var pq_144249_223_364 = new SelectionsPrice(223, 364, 0.000) var pq_144249_202_326 = new SelectionsPrice(202, 326, 2100.000) var pq_144249_203_327 = new SelectionsPrice(203, 327, 0.000) var pq_144249_204_388 = new SelectionsPrice(204, 388, 0.000) var pq_144249_223_365 = new SelectionsPrice(223, 365, 0.000) var pq_144249_204_330 = new SelectionsPrice(204, 330, 0.000) var pq_144249_223_367 = new SelectionsPrice(223, 367, 0.000) var pq_144249_204_389 = new SelectionsPrice(204, 389, 0.000) var pq_144249_223_368 = new SelectionsPrice(223, 368, 0.000) var pq_144249_223_370 = new SelectionsPrice(223, 370, 0.000) var pq_144249_223_372 = new SelectionsPrice(223, 372, 0.000) var pq_144249 = new ProductQuantities(144249, 20424, 10000, 5550.0000, [pq_144249_202_312, pq_144249_203_328, pq_144249_223_364, pq_144249_202_326, pq_144249_203_327, pq_144249_204_388, pq_144249_223_365, pq_144249_204_330, pq_144249_223_367, pq_144249_204_389, pq_144249_223_368, pq_144249_223_370, pq_144249_223_372]); var p_20424 = new Product(20424, "13 or 15mm Unprinted Lanyards. Our plain lanyards are very popular and come in a variety of colours. Fast turnaround and very competitive prices.", [pq_144243, pq_144244, pq_144245, pq_144246, pq_144247, pq_144248, pq_144249], [pOpt_20424_223, pOpt_20424_203, pOpt_20424_202, pOpt_20424_204], [], [],[],[false]); var prodGroup = new ProductGroup("13 or 15mm Unprinted Lanyards", [], [pgGrpOpt_203, pgGrpOpt_202], [], []); //alert(pgGrpOpt_74.selections[2].name); // 4.Create products // 4.1.Add All Selections (by ID) // 4.2.Add All Options (by ID) // 2.3. Create Selection Arrays for each product Quantity // 2.4. Create Option Constructor // 4.5. Create Array of Product Options // 4.6. Create Array of Product Option Dependencies // 4.7. Create Array of Option Qty Excludes // 4.5. Create Array of Product Quantities // 4.8. Create // 0.Create initial config Settings var ConfigSettings = new ConfigSettings(131, 20424, p_20424, 144243, pq_144243); function ConfigSettings(productGroupID, productID, objProduct, productQuantityID, productQuantity) { this.productGroupID = productGroupID; this.productID = productID; this.product = objProduct; this.productQuantityID = productQuantityID; this.productQuantity = productQuantity; // Addl Ptr to prodGroup Obj this.prodGroup = prodGroup; // Base Product Quantity ID this.baseProductQuantityID = productQuantityID; this.baseProdTimeSelectionID = 0; this.basePriceWithTurnAround = 0; } function ProductQuantities(ID, productID, quantity, basePrice, selectionsPrice) { this.ID = ID; this.productID = productID; this.quantity = quantity; this.basePrice = basePrice; this.selectionsPrice = selectionsPrice; this.PriceForSelection=function GetPriceForSelection(pqID, OptionID, SelectionID) { //alert("pq_" + pqID.toString() + "_" + OptionID.toString() + "_" + SelectionID.toString()); return eval("pq_" + pqID.toString() + "_" + OptionID.toString() + "_" + SelectionID.toString()).price; /* for (i = 0; i < this.selectionsPrice.length; i++) { alert(this.selectionsPrice[i].OptionID.toString if ((this.selectionsPrice[i].OptionID == OptionID) && (this.selectionsPrice[i].SelectionID == SelectionID)) return this.selectionsPrice[i].Price; } return null; */ } } function SelectionsPrice(OptionID,SelectionID,Price) { this.optionID=OptionID; this.selectionID=SelectionID; this.price=Price; } function Product(ID, name, quantities, options, optionDepends, optionQtyExludes,turnArounds,doNotAllowDiscount) { this.ID = ID; this.name = name; this.quantities = quantities; this.options = options; this.optionDepends = optionDepends; this.optionQtyExcludes = optionQtyExludes; this.turnArounds=turnArounds; this.doNotAllowDiscount=doNotAllowDiscount; Product.prototype.GetQuantityObj=function (Qty) { var vClosestObj = null; var vCurrentClosestDiff = 99999999; for (z=0; z < this.quantities.length; z++) { if (this.quantities[z].quantity==Qty) { return this.quantities[z] } if (vClosestObj == null) { vClosestObj = this.quantities[z]; vCurrentClosestDiff = Math.abs(vClosestObj.quantity-Qty) } else { if (Math.abs(vClosestObj.quantity-Qty) < vCurrentClosestDiff) { vClosestObj = this.quantities[z]; vCurrentClosestDiff = Math.abs(vClosestObj.quantity-Qty) } } } return vClosestObj; } } function Option(ID, name, notes, description, displayTitle, displayDescription, type, role, roleName, subRole, subRoleName, repeatColumns, repeatLayout, repeatDirection, textMode, width, height, defaultText, required, maxLength, readOnly, selections, DisplayInItemizedData) { this.ID = ID; this.name = name; this.notes = notes; this.description = description; this.displayTitle = displayTitle; this.displayDescription = displayDescription; this.type = type; this.role = role; this.roleName = roleName; this.subRole = subRole; this.subRoleName = subRoleName; this.repeatColumns = repeatColumns; this.repeatDirection = repeatDirection; this.repeatLayout = repeatLayout; this.textMode = textMode; this.width = width; this.height = height; this.defaultText = defaultText; this.required = required; this.maxLength = maxLength; this.readOnly = readOnly; this.selections = selections; this.isVisible=false; this.DisplayInItemizedData=DisplayInItemizedData; } function Selection(selectionID, name, description, title, image, suffix, isDefault, price, printedPages, width, height) { this.selectionID = selectionID; this.name = name; this.description = description; this.title = title; this.image = image; this.suffix = suffix; this.isDefault = isDefault; this.price = price; this.printedPages = printedPages; this.width = width; this.height = height; } // Product TurnAround function TurnAround(ID, name, description, type, amount, TurnAroundQtys ){ this.ID = ID; this.name = name; this.type = type; this.amount = amount; this.description = description; this.TurnAroundQtys=TurnAroundQtys; } function TurnAroundQty(ID,Cost,TurnAroundID,ExcludeTurnAround) { this.ID=ID; this.Cost=Cost; this.TurnAroundID=TurnAroundID; this.ExcludeTurnAround=ExcludeTurnAround; } // Product Group function ProductGroup(name, products, productGroupOptions, productOptionAssigns, productOptionDepends) { this.name = ""; this.products = products; this.productGroupOptions = productGroupOptions; this.productOptionAssigns = productOptionAssigns; this.productOptionDepends = productOptionDepends; } function ProductOptionAssign(ID, productID, optionID, selectionID) { this.ID = ID; this.productID = productID; this.optionID = optionID; this.selectionID = selectionID; } // Product Option Dependencies function ProductOptionDependencies(optionID, requiresOptionID, requiresSelectionID, checkboxValue) { this.optionID = optionID; this.requiresOptionID = requiresOptionID; this.requiresSelectionID = requiresSelectionID; this.checkboxValue = checkboxValue; } // Product Option Qty Dependencies function ProductOptionQtyDependencies(optionID, qtyID, qty) { this.optionID = optionID; this.qtyID = qtyID; this.qty = qty; } // Product Option Qty Dependencies function OptionQtyExcludes(productID, optionID, qty) { this.productID = productID; this.optionID = optionID; this.qty = qty; } function SelectedSelections(OptionID, SelectionID) { this.optionID=OptionID; this.selectionID=SelectionID; } /* function _CurrentGroupSelections() { this.selected = []; _CurrentGroupSelections.prototype.UpdateSelection = function SetSelection(OptionID, SelectionID) { var bFound = false; for (i = 0; i < this.selected.length; i++) { if (this.selected[i].optionID == OptionID) { this.selected[i].selectionID = SelectionID; bFound = true; } } if (bFound == false) { var vNewObj = new SelectedSelections(OptionID, SelectionID); this.selected.push(vNewObj); //this.UpdateOptionPrice(); } } // Get Selected Value for given OptionID _CurrentGroupSelections.prototype.GetSelected = function GetSelectedOptionID(OptionID) { for (var x = 0; x < this.selected.length; x++) { if (this.selected[x].optionID == OptionID) { return this.selected[x].selectionID; } } return -1; } // Get "|" Selection String _CurrentGroupSelections.prototype.SelectionString = function GetSelections() { var vStr = "|"; for (i = 0; i < this.selected.length; i++) { vStr += this.selected[i].optionID.toString() + "_" + this.selected[i].selectionID.toString() + "|" } return vStr; } } */ function _CurrentSelections() { this.selected = []; //to update check box selections _CurrentSelections.prototype.UpdateChkSelection = function SetChkSelection(OptionID, SelectionID) { var check=1; //will loop through and check if its already selected ot not if selected will make it -1 for unchecking it, if not selection does not exists for (i = 0; i < this.selected.length; i++) { if (this.selected[i].optionID == OptionID) { if(this.selected[i].selectionID == SelectionID){ //alert("here"); this.selected[i].selectionID =-1; return; check=0; } else { check=1; } } } //alert(check); //will check if first selection is -1 or not if -1 it will replace the first selection if(check==1){ for (i = 0; i < this.selected.length; i++) { if (this.selected[i].optionID == OptionID) { if(this.selected[i].selectionID == -1){ this.selected[i].selectionID =SelectionID; return; check=0; } } } } //if selection does not exist or first one is not -1 then it will add a new row. if(check==1){ var vNewObj = new SelectedSelections(OptionID, SelectionID); this.selected.push(vNewObj); } } _CurrentSelections.prototype.GetChkSelected = function GetChkSelectedOptionID(OptionID) { var vStr = "|"; for (var x = 0; x < this.selected.length; x++) { if (this.selected[x].optionID == OptionID) { vStr=vStr + this.selected[x].selectionID +"|"; } } return vStr; } _CurrentSelections.prototype.UpdateSelection = function SetSelection(OptionID, SelectionID) { var bFound = false; for (i = 0; i < this.selected.length; i++) { if (this.selected[i].optionID == OptionID) { this.selected[i].selectionID = SelectionID; for (j = 0; j < ConfigSettings.product.options.length; j++) { if((ConfigSettings.product.options[j].ID==OptionID)&&(ConfigSettings.product.options[j].type=='TextBox')) { if (ConfigSettings.product.options[j].selections[0].selectionID==SelectionID){ this.selected[i].selectionID = ' '; } } } //alert(OptionID.toString() + ":::" + SelectionID.toString()); bFound = true; } } if (bFound == false) { var vNewObj = new SelectedSelections(OptionID, SelectionID); this.selected.push(vNewObj); //this.UpdateOptionPrice(); } } // Get Selected Value for given OptionID _CurrentSelections.prototype.GetSelected = function GetSelectedOptionID(OptionID) { for (var x = 0; x < this.selected.length; x++) { if (this.selected[x].optionID == OptionID) { return this.selected[x].selectionID; } } return -1; } // Get "|" Selection String _CurrentSelections.prototype.SelectionString = function GetSelections() { var vStr = "|"; for (i = 0; i < this.selected.length; i++) { for (j = 0; j < ConfigSettings.product.options.length; j++) { if(ConfigSettings.product.options[j].ID==this.selected[i].optionID){ if(ConfigSettings.product.options[j].isVisible==true){ vStr += this.selected[i].optionID.toString() + "_" + this.selected[i].selectionID.toString() + "|" } } } } return vStr; } // Build Display Option HTML String for Selected Options _CurrentSelections.prototype.DisplayOptionsString = function GetDisplayOptionsString() { var vStr = ""; //alert(ConfigSettings.product.options.length); for (j = 0; j < ConfigSettings.product.options.length; j++) { var vSelSelectionID = this.GetSelected(ConfigSettings.product.options[j].ID); if (1==1) {//(ConfigSettings.product.options[j].role != 5) { if ((vSelSelectionID > -1) && (ConfigSettings.product.options[j].role != 2) && (ConfigSettings.product.options[j].isVisible==true)) { //alert(ConfigSettings.product.options[j].ID.toString() + ":" + this.GetSelected(ConfigSettings.product.options[j].ID).toString()); //alert("pq_"+ ConfigSettings.productQuantityID + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); var vPQ = eval("pq_"+ ConfigSettings.productQuantityID + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); var vSel = eval("pOptSel_" + ConfigSettings.productID.toString() + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); if (vPQ.price > 0) vStr += "
" + vSel.title + "
$" + CurrencyFormatted(GetPriceBySize(vPQ.price)) + "
" } } // else { // Role 5 -- Finishing OPtions // if ((vSelSelectionID > -1) && (ConfigSettings.product.options[j].isVisible==true)) { // //alert(ConfigSettings.product.options[j].role); // //alert(ConfigSettings.product.options[j].ID.toString() + ":" + this.GetSelected(ConfigSettings.product.options[j].ID).toString()); // //alert("pq_"+ ConfigSettings.productQuantityID + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); // var vPQ = eval("pq_"+ ConfigSettings.productQuantityID + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); // var vSel = eval("pOptSel_" + ConfigSettings.productID.toString() + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); // var vCalcPrice = GetBannerOptionPrice(ConfigSettings.product.options[j], vPQ.price); // if (vCalcPrice > 0) // vStr += "
" + vSel.title + "
$" + CurrencyFormatted(vCalcPrice) + "
" // } // } } return vStr; } _CurrentSelections.prototype.SetOptionPriceRows = function SetOptionPriceRowsDisplay(tbl,QtyH, CSymbol) { var vStr = ""; //alert(ConfigSettings.product.options.length); for (j = 0; j < ConfigSettings.product.options.length; j++) { var vSelSelectionID = this.GetSelected(ConfigSettings.product.options[j].ID); if (1==1) {//(ConfigSettings.product.options[j].role != 5) { if ((vSelSelectionID > -1) && (ConfigSettings.product.options[j].role != 2) && (ConfigSettings.product.options[j].isVisible==true) && (ConfigSettings.product.options[j].type!='TextBox')) { //alert(ConfigSettings.product.options[j].ID.toString() + ":" + this.GetSelected(ConfigSettings.product.options[j].ID).toString()); //alert("pq_"+ ConfigSettings.productQuantityID + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); var vPQ = eval("pq_"+ ConfigSettings.productQuantityID + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); //alert('123'); //alert("pq_"+ QtyH+ "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); if(QtyH>0) { var vPQH = eval("pq_"+ QtyH+ "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); //alert(vPQH); } //alert(vPQH); var vSel = eval("pOptSel_" + ConfigSettings.productID.toString() + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); //if (vPQ.price > 0) { //alert(vSel.DisplayInItemizedData.toString()+" "+vSelSelectionID.toString()); //alert(ConfigSettings.product.options[j].DisplayInItemizedData); if(ConfigSettings.product.options[j].DisplayInItemizedData==true ){ var row = tbl.insertRow(tbl.rows.length); var cell1 = document.createElement("TH"); var cell2 = document.createElement("TD"); var bold1 = document.createElement("B"); var textnode1a = document.createTextNode(ConfigSettings.product.options[j].displayTitle + ": "); var textnode1b = document.createTextNode(vSel.title); if(QtyH>0) { var textnode2 = document.createTextNode(CSymbol + CurrencyFormatted(GetPriceBySize(vPQ.price,vPQH.price))); } else var textnode2 = document.createTextNode(CSymbol + CurrencyFormatted(GetPriceBySize(vPQ.price,0))); bold1.appendChild(textnode1a); cell1.appendChild(bold1); cell1.appendChild(textnode1b); cell2.appendChild(textnode2); row.appendChild(cell1); row.appendChild(cell2); //vStr += "
" + vSel.title + "
$" + CurrencyFormatted(GetPriceBySize(vPQ.price)) + "
" } } else if ((vSelSelectionID > -1) && (ConfigSettings.product.options[j].role == 2) && (ConfigSettings.product.options[j].isVisible==true)) { //alert(ConfigSettings.product.options[j].ID.toString() + ":" + this.GetSelected(ConfigSettings.product.options[j].ID).toString()); //alert("pq_"+ ConfigSettings.productQuantityID + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); var vPQ = eval("pq_"+ ConfigSettings.productQuantityID + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); if(QtyH>0) { var vPQH = eval("pq_"+ QtyH+ "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); //alert(vPQH); } var vSel = eval("pOptSel_" + ConfigSettings.productID.toString() + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); //alert(vPQ.price); //if (vPQ.price > 0) { if(ConfigSettings.product.options[j].DisplayInItemizedData==true ){ var row = tbl.insertRow(tbl.rows.length); var cell1 = document.createElement("TH"); var cell2 = document.createElement("TD"); var textnode1 = document.createTextNode(ConfigSettings.product.options[j].displayTitle + ": " + vSel.title); if(QtyH>0) { var textnode2 = document.createTextNode(CSymbol + CurrencyFormatted(GetPriceBySize(vPQ.price,vPQH.price))); } else var textnode2 = document.createTextNode(CSymbol + CurrencyFormatted(GetPriceBySize(vPQ.price))); cell1.appendChild(textnode1); cell2.appendChild(textnode2); row.appendChild(cell1); row.appendChild(cell2); //vStr += "
" + vSel.title + "
$" + CurrencyFormatted(GetPriceBySize(vPQ.price)) + "
" } } } // else { // Role 5 -- Finishing OPtions // if ((vSelSelectionID > -1) && (ConfigSettings.product.options[j].isVisible==true)) { // //alert(ConfigSettings.product.options[j].role); // //alert(ConfigSettings.product.options[j].ID.toString() + ":" + this.GetSelected(ConfigSettings.product.options[j].ID).toString()); // //alert("pq_"+ ConfigSettings.productQuantityID + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); // var vPQ = eval("pq_"+ ConfigSettings.productQuantityID + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); // var vSel = eval("pOptSel_" + ConfigSettings.productID.toString() + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); // var vCalcPrice = GetBannerOptionPrice(ConfigSettings.product.options[j], vPQ.price); // if (vCalcPrice > 0) { // var row = tbl.insertRow(tbl.rows.length); // var cell1 = document.createElement("TH"); // var cell2 = document.createElement("TD"); // var textnode1 = document.createTextNode(vSel.title); // var textnode2 = document.createTextNode("$" + CurrencyFormatted(vCalcPrice)); // cell1.appendChild(textnode1); // cell2.appendChild(textnode2); // row.appendChild(cell1); // row.appendChild(cell2); // // //vStr += "
" + vSel.title + "
$" + CurrencyFormatted(vCalcPrice) + "
" // } // } // } } return vStr; } _CurrentSelections.prototype.SetOptionPriceRowsOld = function SetOptionPriceRowsDisplayOLD(tbl) { var vStr = ""; //alert(ConfigSettings.product.options.length); for (j = 0; j < ConfigSettings.product.options.length; j++) { var vSelSelectionID = this.GetSelected(ConfigSettings.product.options[j].ID); if (1==1) {//(ConfigSettings.product.options[j].role != 5) { if ((vSelSelectionID > -1) && (ConfigSettings.product.options[j].role != 2) && (ConfigSettings.product.options[j].isVisible==true)) { //alert(ConfigSettings.product.options[j].ID.toString() + ":" + this.GetSelected(ConfigSettings.product.options[j].ID).toString()); //alert("pq_"+ ConfigSettings.productQuantityID + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); var vPQ = eval("pq_"+ ConfigSettings.productQuantityID + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); var vSel = eval("pOptSel_" + ConfigSettings.productID.toString() + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); if (vPQ.price > 0) { var row = tbl.insertRow(tbl.rows.length); var cell1 = document.createElement("TH"); var cell2 = document.createElement("TD"); var textnode1 = document.createTextNode(ConfigSettings.product.options[j].displayTitle + vSel.title); var textnode2 = document.createTextNode("$" + CurrencyFormatted(GetPriceBySize(vPQ.price))); cell1.appendChild(textnode1); cell2.appendChild(textnode2); row.appendChild(cell1); row.appendChild(cell2); //vStr += "
" + vSel.title + "
$" + CurrencyFormatted(GetPriceBySize(vPQ.price)) + "
" } } else if ((vSelSelectionID > -1) && (ConfigSettings.product.options[j].role == 2) && (ConfigSettings.product.options[j].isVisible==true)) { //alert(ConfigSettings.product.options[j].ID.toString() + ":" + this.GetSelected(ConfigSettings.product.options[j].ID).toString()); //alert("pq_"+ ConfigSettings.productQuantityID + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); var vPQ = eval("pq_"+ ConfigSettings.productQuantityID + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); var vSel = eval("pOptSel_" + ConfigSettings.productID.toString() + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); //alert(vPQ.price); if (vPQ.price > 0) { var row = tbl.insertRow(tbl.rows.length); var cell1 = document.createElement("TH"); var cell2 = document.createElement("TD"); var textnode1 = document.createTextNode(ConfigSettings.product.options[j].displayTitle + ": " + vSel.title); var textnode2 = document.createTextNode("$" + CurrencyFormatted(GetPriceBySize(vPQ.price))); cell1.appendChild(textnode1); cell2.appendChild(textnode2); row.appendChild(cell1); row.appendChild(cell2); //vStr += "
" + vSel.title + "
$" + CurrencyFormatted(GetPriceBySize(vPQ.price)) + "
" } } } // else { // Role 5 -- Finishing OPtions // if ((vSelSelectionID > -1) && (ConfigSettings.product.options[j].isVisible==true)) { // //alert(ConfigSettings.product.options[j].role); // //alert(ConfigSettings.product.options[j].ID.toString() + ":" + this.GetSelected(ConfigSettings.product.options[j].ID).toString()); // //alert("pq_"+ ConfigSettings.productQuantityID + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); // var vPQ = eval("pq_"+ ConfigSettings.productQuantityID + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); // var vSel = eval("pOptSel_" + ConfigSettings.productID.toString() + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); // var vCalcPrice = GetBannerOptionPrice(ConfigSettings.product.options[j], vPQ.price); // if (vCalcPrice > 0) { // var row = tbl.insertRow(tbl.rows.length); // var cell1 = document.createElement("TH"); // var cell2 = document.createElement("TD"); // var textnode1 = document.createTextNode(vSel.title); // var textnode2 = document.createTextNode("$" + CurrencyFormatted(vCalcPrice)); // cell1.appendChild(textnode1); // cell2.appendChild(textnode2); // row.appendChild(cell1); // row.appendChild(cell2); // // //vStr += "
" + vSel.title + "
$" + CurrencyFormatted(vCalcPrice) + "
" // } // } // } } return vStr; } this.GetOptionPrice = function GetOptionPrice (QtyH) { var vOptionPrice = 0.0; for (j = 0; j < ConfigSettings.product.options.length; j++) { var vSelSelectionID = this.GetSelected(ConfigSettings.product.options[j].ID); //if ((ConfigSettings.product.options[j].role != 5) && (ConfigSettings.product.options[j].isVisible==true)) { //alert(ConfigSettings.product.options[j].ID); //alert(ConfigSettings.product.options[j].isVisible); if (vSelSelectionID == -1) { // get default var selCnt = ConfigSettings.product.options[j].selections.length; for (var selIndex = 0; selIndex < selCnt; selIndex++) { if (ConfigSettings.product.options[j].selections[selIndex].isDefault == true) { vSelSelectionID = ConfigSettings.product.options[j].selections[selIndex].selectionID; continue; } } } if ((ConfigSettings.product.options[j].isVisible==true)&& (ConfigSettings.product.options[j].type != 'TextBox') ){ if (vSelSelectionID > -1) { var vPQ = eval("pq_"+ ConfigSettings.productQuantityID + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); if(QtyH>0) { var vPQH = eval("pq_"+ QtyH+ "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); //alert(vPQH); } if(QtyH>0) vOptionPrice +=GetPriceBySize(vPQ.price,vPQH.price); else vOptionPrice += vPQ.price; } } // else if ((ConfigSettings.product.options[j].role == 5) && (ConfigSettings.product.options[j].isVisible==true)) { // Role 5 -- Finishing OPtions // // if (vSelSelectionID > -1) { // //alert(ConfigSettings.product.options[j].role); // //alert(ConfigSettings.product.options[j].ID.toString() + ":" + this.GetSelected(ConfigSettings.product.options[j].ID).toString()); // //alert("pq_"+ ConfigSettings.productQuantityID + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); // var vPQ = eval("pq_"+ ConfigSettings.productQuantityID + "_" + ConfigSettings.product.options[j].ID.toString() + "_" + vSelSelectionID.toString()); // var vCalcPrice = GetBannerOptionPrice(ConfigSettings.product.options[j], vPQ.price); // vOptionPrice += vCalcPrice; // } // } } return vOptionPrice; } } function GetBannerOptionPrice(option, unitPrice) { if (option.subRoleName == "Grommets") { //alert(GetGrommetCount()); //alert(unitPrice); return unitPrice * GetGrommetCount(); } else if (option.subRoleName == "Webbing") { return unitPrice * GetWebbingLength(); } else if (option.subRoleName == "Pole Pockets") { return unitPrice * GetPolePocketsLength(); } else if (option.subRoleName == "Rope") { return unitPrice * GetRopeLength(); } else if (option.subRoleName == "Sewing") { return unitPrice * GetSewingLength(); } else if (option.subRoleName == "3/4\" Velcro") { return unitPrice * GetVelcro3Length(); } else if (option.subRoleName == "2\" Velcro") { return unitPrice * GetVelcro2Length(); } //else //alert(option.subRoleName); } var currentSelections = new _CurrentSelections(); var currentGroupSelections = new _CurrentSelections(); function SetCurrentGroupSelections() { //alert('abc'); for (z=0; z < prodGroup.productGroupOptions.length; z++) { var OptionID = prodGroup.productGroupOptions[z].ID; var obj = document.getElementById("grpopt_" + OptionID.toString()); //alert(obj); //alert("opt_" + OptionID.toString()); if (obj) { if (prodGroup.productGroupOptions[z].type == "DropDown") { var SelectionID = obj.options[obj.selectedIndex].value; currentGroupSelections.UpdateSelection(OptionID, SelectionID); } } } //alert(currentGroupSelections.SelectionString()); } function SetCurrentSelections() { //alert(ConfigSettings.product.options.length); for (z=0; z < ConfigSettings.product.options.length; z++) { var OptionID = ConfigSettings.product.options[z].ID; //alert(OptionID.toString() + ":" + currentSelections.GetSelected(OptionID).toString()) if (currentSelections.GetSelected(OptionID) == -1) { //alert(ConfigSettings.product.options[z].selections); if (ConfigSettings.product.options[z].selections) { for (y=0; y < ConfigSettings.product.options[z].selections.length; y++) { if (ConfigSettings.product.options[z].selections[y].isDefault == true) { //alert(OptionID.toString() + ":" + ConfigSettings.product.options[z].selections[y].selectionID.toString()); currentSelections.UpdateSelection(OptionID, ConfigSettings.product.options[z].selections[y].selectionID); y=99999; } } } else { currentSelections.UpdateSelection(OptionID, ConfigSettings.product.options[z].defaultText); } } } //alert(currentSelections.SelectionString()); } function CurrencyFormatted(amount) { var i = parseFloat(amount.toString().replace("$","")); if(isNaN(i)) { i = 0.00; } var minus = ''; if(i < 0) { minus = '-'; } i = Math.abs(i); i = parseInt((i + .005) * 100); i = i / 100; s = new String(i); if(s.indexOf('.') < 0) { s += '.00'; } if(s.indexOf('.') == (s.length - 2)) { s += '0'; } s = minus + s; return CommaFormatted(s); } // end of function CurrencyFormatted() function CommaFormatted(amount) { var delimiter = ","; // replace comma if desired var a = amount.split('.',2) var d = a[1]; var i = parseInt(a[0]); if(isNaN(i)) { return ''; } var minus = ''; if(i < 0) { minus = '-'; } i = Math.abs(i); var n = new String(i); var a = []; while(n.length > 3) { var nn = n.substr(n.length-3); a.unshift(nn); n = n.substr(0,n.length-3); } if(n.length > 0) { a.unshift(n); } n = a.join(delimiter); if(d.length < 1) { amount = n; } else { amount = n + '.' + d; } amount = minus + amount; return amount; } // end of function CommaFormatted()