"; var WinDetail = OpenCentredWindow("",1,WIDTH,HEIGHT,WIN_FEATURES); WinDetail.document.open(); WinDetail.document.write(strDETAILS); WinDetail.document.close(); WinDetail = null; } for(var i = 0; i < arrCompanyHeader.length;i++){ var strCode = "var " + arrCompanyHeader[i] + " = " + i eval(strCode); } var MODE="Viewing"; var rcd = String.fromCharCode(2); var fld = String.fromCharCode(1); var Products; var Currency = arrGeneralData[0]; var strCartHeader; var strCartFooter; var strShopping = ""; var arrShopping var strCart = ""; var strDataHeader = "Order|ItemName|ShortName|Price|DiscountThreshold|DiscountedPrice|TaxApplies|ImageURL|ProductRef|Description|Sizes|Colors"; var strButtonStyle = "cursor:hand;font-family:arial;font-size:9pt;color:black;font-weight:600;border-bottom:1px solid black;border-right:1px solid black;border-top:1px solid black;border-left:1px solid black;" var BlueButtonStyle = "cursor:hand;font-family:arial;font-size:8pt;color:whitesmoke;background-color:rgb(0,48,96);border-bottom:1px solid rgb(63,103,143);border-right:1px solid rgb(63,103,143);border-top:1px solid rgb(63,103,143);border-left:1px solid rgb(63,103,143);" var strCompanyNameStyle = "font-family:arial;font-size:12pt;color:black;font-weight:600;" var strCompanyDetailsStyle = "font-family:arial;font-size:10pt;color:black;font-weight:600;" var QUANTITY = 0; var ROW_TOTAL = 1; var ITEM_NAME = 2; var ITEM_PRICE = 3; var DISCOUNT_THRESHOLD = 4; var DISCOUNTED_PRICE = 5; var TAX_APPLIES = 6; var SIZE = 8; var COLOR = 9; var ITEM_DC = 10; var ItemDelivery = 12; var TAX_LABEL = arrGeneralData[1]; var TAX_RATE = parseFloat(arrGeneralData[2]); var TAX_RULE = parseInt(arrGeneralData[3]); var DELIVERY_CHARGE = arrGeneralData[4]; var DELIVERY_CHARGE_THRESHOLD = arrGeneralData[5]; var DELIVERY_CHARGE_RULE = parseInt(arrGeneralData[6]); var DELIVERY_CHARGE_PRICE = arrGeneralData[7]; var REDUCED_DELIVERY_CHARGE = arrGeneralData[7]; var DELIVERY_CHARGE_HTML = ""; var arrDataHeader = strDataHeader.split("|"); var strSubmitForm = ""; var CR = String.fromCharCode(13) + String.fromCharCode(10); var TAB = String.fromCharCode(9); var strDescription = ""; var strHTMLDescription = ""; var strTextDescription = ""; var CartID = new String("") var mDate = new Date() mDate.getDate(); CartID += new String(mDate.getYear()); CartID += new String(mDate.getMonth()); CartID += new String(mDate.getDay()); CartID += new String(mDate.getHours()); CartID += new String(mDate.getMinutes()); CartID += new String(mDate.getSeconds()); CartID += new String(mDate.getMilliseconds()); CartID += new String(Math.floor(Math.random() * (1 + 2000000 - 1000000) + 1000000)); for(var i = 0; i < arrDataHeader.length;i++){ var strCode = "var " + arrDataHeader[i] + " = " + i; eval(strCode); } function SetADO(iIndex){ if(iIndex==0){ alert("Please Select a location"); } else{ iIndex += -1; var arrADOFields = arrADO[iIndex].split(fld); TAX_RATE = Round(arrADOFields[2]) TAX_RATE = parseFloat(TAX_RATE); if(TAX_RATE=="0"){ TAX_RATE="0.00"; } DELIVERY_CHARGE_PRICE = Round(arrADOFields[1]); if(DELIVERY_CHARGE_PRICE=="0"){ DELIVERY_CHARGE_PRICE=""; DELIVERY_CHARGE_RULE = 0; } else{ DELIVERY_CHARGE_PRICE = parseFloat(arrADOFields[1]); DELIVERY_CHARGE_RULE = 1; DELIVERY_CHARGE = DELIVERY_CHARGE_PRICE DELIVERY_CHARGE_THRESHOLD = DELIVERY_CHARGE; } } } function WriteEmpty(){ if(!IE && ! document.layers){ document.theForm.QS.style.visibility = "hidden"; } GetCartHeader(); var strEmpty = "
No Items in shopping basket" strCartHeader += strEmpty; GetFooter(); strCart = strCartHeader + strCart; parent.cart.document.open(); parent.cart.document.write(strCart); parent.cart.document.close(); } function WriteProducts(DATA){ var strProducts_HTML = ""; var strHTML = ""; strHTML += "
" var iColor = 0; DATA = ReturnChars(DATA); Products = DATA.split(rcd); GLOBAL_DATA = DATA; var Product; var strName; var strImageLocation=""; var cellspacing = 10; var strPageTitle=""; if(document.layers){ strImageLocation="Product_Images/"; cellspacing= cellspacing + 2; } else{ EmptySelect(document.theForm.QS); document.theForm.QS.options[0] = new Option("Quick Product Select",""); strImageLocation="../Product_Images/"; } var ItemCount = Products.length-1 strPageTitle += ""; strPageTitle += document.theForm.Categories.options[document.theForm.Categories.selectedIndex].text; strPageTitle += " - " + ItemCount + " items" for(var i=0;i < (Products.length-1);i++){ Products[i] += fld + fld + fld + fld + fld + fld + fld + fld; Product = Products[i].split(fld); if(Trim(Product[ShortName])!=""){ strName = Product[ShortName]; } else{ strName = Product[ItemName]; } if(arrBGColors.length==1){ cellspacing=0 } strProducts_HTML += "" + "
"; strProducts_HTML += ""; strProducts_HTML += ""; strProducts_HTML += ""; strProducts_HTML += ""; if(Trim(Product[10])!="" || Trim(Product[11]) != ""){ strProducts_HTML += ""; } if(Trim(Product[10])!=""){ var arrSizes = Product[10].split(", "); var strSizeSelect = ""; strProducts_HTML += strSizeSelect } else{ strProducts_HTML += ""; } if(Product[11]){ if(Trim(Product[11])!=""){ var arrColors = Product[11].split(", "); var strSizeSelect = ""; strProducts_HTML += strSizeSelect } else{ strProducts_HTML += ""; } } if(Trim(Product[10])!="" || Trim(Product[11]) != ""){ strProducts_HTML += ""; } strProducts_HTML += ""; strProducts_HTML += "
" + Product[1] + "    " + Product[0] + "
"; if(Trim(Product[7])!=""){ strProducts_HTML += "" var strImageCode = "var imgTemp" + i + " = new Image();"; strImageCode += "imgTemp" + i + ".src = '" + strImageLocation + Trim(Product[7]) + "';"; eval(strImageCode); } strProducts_HTML += "
" + Product[Description] + "
Sizes:  Colors:  
" + "Price: " + Currency + Product[Price] + ""; if(TAX_RULE==3){ strProducts_HTML += " exc " + TAX_LABEL + ""; } if(TAX_RULE==2 && TAX_RATE != "0.00"){ strProducts_HTML += " inc " + TAX_LABEL + ""; } var QUO = String.fromCharCode(34); var strCartData; var strItemName; if(Trim(Product[ShortName])!=""){ strItemName = Product[ShortName]; } else{ strItemName = Product[ItemName]; } while(strItemName.indexOf(""") > -1){ strItemName = strItemName.replace(""",""); } strCartData = "1" + fld + strItemName + fld + Product[Price] + fld + Product[DiscountThreshold] + fld + Product[DiscountedPrice] + fld + Product[TaxApplies] + fld + Product[ProductRef] + fld + Product[ItemDelivery] + fld + fld; strProducts_HTML += "   "; if(Round(Product[DiscountThreshold])!="0" && Round(Product[DiscountedPrice])!="0"){ strCartData = Product[DiscountThreshold] + fld + strItemName + fld + Product[Price] + fld + Product[DiscountThreshold] + fld + Product[DiscountedPrice] + fld + Product[TaxApplies] + fld + Product[ProductRef] + fld + Product[ItemDelivery] + fld; strProducts_HTML += "    Buy " + Product[DiscountThreshold] + " or more at " + Currency + Product[DiscountedPrice] + " each  " } if(Product[13]=="" && Product[14]==""){ } else{ if(Product[13].toString()!="undefined" && Product[14].toString()!="undefined"){ strProducts_HTML += "   "; } } strProducts_HTML += "
"; strProducts_HTML += "

"; iColor += 1; if(iColor==arrBGColors.length-1){ iColor = 0; } } //End For strHTML += "
" + strPageTitle + " "; if(!document.layers){ SortRecords(2,false); var strSelect = ""; for(var i=0;i < (Products.length-1);i++){ Product = Products[i].split(fld); if(Trim(Product[2])!=""){ strName = Product[2]; } else{ strName = Product[1]; } var strAName = "A" + strName; while(strName.indexOf(""") > -1){ strName = strName.replace(""",""); } while(strAName.indexOf(""") > -1){ strAName = strAName.replace(""",""); } document.theForm.QS.options[i+1] = new Option(strName, strAName) strSelect += ""; } //End For strHTML += strSelect; } //End If strHTML += "
"; strHTML = strHTML + strProducts_HTML; strHTML += ""; strHTML += "" if(Trim(Company[CompanyName])!=""){ strHTML += ""; } if(Trim(Company[Address1])!=""){ strHTML += ""; } if(Trim(Company[Address2])!=""){ strHTML += ""; } if(Trim(Company[Address3])!=""){ strHTML += ""; } if(Trim(Company[Address4])!=""){ strHTML += ""; } if(Trim(Company[PostCode])!=""){ strHTML += ""; } if(Trim(Company[Tel])!=""){ strHTML += ""; } if(Trim(Company[Fax])!=""){ strHTML += ""; } if(Trim(Company[CompanyReg])!=""){ strHTML += ""; } if(Trim(Company[TaxReg])!=""){ strHTML += ""; } strHTML += "
" + Company[CompanyName] + "
" + Company[Address1] + "
" + Company[Address2] + "
" + Company[Address3] + "
" + Company[Address4] + "
" + Company[PostCode] + "
Tel: " + Company[Tel] + "
Fax: " + Company[Fax] + "
" + Company[RegLabel] + " " + Company[CompanyReg] + "
" + Company[VatLabel] + " " + Company[TaxReg] + "
"; strHTML += "" strHTML += ""; parent.main.document.open(); parent.main.document.write(strHTML); parent.main.document.close(); } function GetProducts(URL){ if(strADO!=""){ if(parent.main.document.ProductForm.ADO){ if(parent.main.document.ProductForm.ADO.selectedIndex==0){ alert("Please select your location"); parent.main.document.ProductForm.ADO.focus(); document.theForm.Categories.selectedIndex = 0; return; } } } if(document.theForm.Categories.selectedIndex!=0){ URL = "ProductData/" + URL + ".htm"; MakeRequest(URL); } } function PopulateCategories(strDATA){ EmptySelect(document.theForm.Categories); if(strDATA!=""){ FillSelect(document.theForm.Categories,strDATA); } else{ alert("Sorry - No items available for that category!"); } } function GetCategories(){ MakeRequest("Categories.htm"); } PayPalEMail = strACode; function NumericSort(arrayName) { var length = arrayName.length-1; var thisRecord; var j, i, v, h=1, s=3, k; while(h < length) h=s*h+1; while(h > 1) { h=(h-1)/s; for (k=0; k= 0 && parseFloat(arrayName[j]) > v){ arrayName[j+h]=arrayName[j]; Products[j+h]=Products[j]; } else{ break; } arrayName[j+h]=v; Products[j+h]=thisRecord; } } return arrayName; }