if (document.cookie.indexOf("Referrer") == -1) { document.cookie = "Browser=" + detectBrowser(); document.cookie = "LandingPage=" + document.location.href; if (!document.referrer){ document.cookie = "Referrer=None"; } else { document.cookie = "Referrer=" + document.referrer; } document.cookie = "TheBasket=."; document.cookie = "Postage=none"; } // Browser detection /////////////////////////////////////////////////////////////////////////////////////////////////// function checkIt(string, detect) { place = detect.indexOf(string) + 1; thestring = string; return place; } function detectBrowser() { var detect = navigator.userAgent.toLowerCase(); var OS,browser,total,thestring; var version = 0; if (checkIt('konqueror', detect)) { browser = "Konqueror"; OS = "Linux"; thestring = 'konqueror'; } else if (checkIt('safari', detect)) { browser = "Safari"; thestring = 'safari'; } else if (checkIt('omniweb', detect)) { browser = "OmniWeb"; thestring = 'omniweb'; } else if (checkIt('opera', detect)) { browser = "Opera"; thestring = 'opera'; } else if (checkIt('webtv', detect)) { browser = "WebTV"; thestring = 'webtv'; } else if (checkIt('icab', detect)) { browser = "iCab"; thestring = 'icab'; } else if (checkIt('msie', detect)) { browser = "Internet Explorer"; thestring = 'msie'; } else if (!checkIt('compatible', detect)) { browser = "Netscape Navigator" version = detect.charAt(8); thestring = 'compatible'; } else browser = "An unknown browser"; if (!version) version = detect.charAt(place + thestring.length); if (!OS) { if (checkIt('linux', detect)) OS = "Linux"; else if (checkIt('x11', detect)) OS = "Unix"; else if (checkIt('mac', detect)) OS = "Mac" else if (checkIt('win', detect)) OS = "Windows" else OS = "an unknown operating system"; } return(browser + ' ' + version + ' on ' + OS); } // alterError - fixes a rounding bug in Netscape 4 ///////////////////////////////////////////////////////////////////// function alterError(value) { if (value<=0.99) { newPounds = '0'; } else { newPounds = parseInt(value); } newPence = parseInt((value+.0008 - newPounds)* 100); if (eval(newPence) <= 9) newPence='0'+newPence; newString = newPounds + '.' + newPence; return (newString); } // buyItem - adds an item to the shopping basket /////////////////////////////////////////////////////////////////////// function buyItem(newProductID, newItem, newVariant, newPrice, newDelivery, newQuantity, newStock) { index = document.cookie.indexOf("TheBasket"); countbegin = (document.cookie.indexOf("=", index) + 1); countend = document.cookie.indexOf(";", index); if (countend == -1) { countend = document.cookie.length; } fulllist = document.cookie.substring(countbegin, countend); alreadyOrdered = false; itemlist = 0; for (var i = 0; i <= fulllist.length; i++) { if (fulllist.substring(i,i+1) == '[') { itemstart = i+1; thisitem = 1; } else if (fulllist.substring(i,i+1) == ']') { itemend = i; thestocklevel = fulllist.substring(itemstart, itemend); itemlist=itemlist+1; } else if (fulllist.substring(i,i+1) == '|') { if (thisitem==1) theitem = fulllist.substring(itemstart, i); if (thisitem==2) { theproductid = fulllist.substring(itemstart, i); if (theproductid == newProductID) { alreadyOrdered = true; } } if (thisitem==3) theprice = fulllist.substring(itemstart, i); if (thisitem==4) thedelivery = fulllist.substring(itemstart, i); if (thisitem==5) thequantity = fulllist.substring(itemstart, i); thisitem++; itemstart=i+1; } } if (alreadyOrdered) { rc = alert('You have already ordered that product!\n\nIf you want to change the quantity, please\nclick \'edit shopping cart\'.'); } else if (newQuantity <= 0) { rc = alert('The quantity entered is incorrect.'); } else if (newQuantity > newStock) { if (newStock == 0) { alertText = 'We\'re afraid that this item is currently out of stock.'; } else if (newStock == 1) { alertText = 'There is only 1 item in stock.\nPlease revise your order.'; } else { alertText = 'There are only ' + newStock + ' items in stock.\nPlease revise your order.'; } rc = alert(alertText); } else { if (newVariant == '') { itemDescription = newItem; } else { itemDescription = newItem + ' ' + '(' + newVariant + ')'; } //index = document.cookie.indexOf("TheBasket"); //countbegin = (document.cookie.indexOf("=", index) + 1); countbegin = (document.cookie.indexOf("TheBasket=") + 10); //countend = document.cookie.indexOf(";", index); countend = document.cookie.indexOf(";", countbegin); if (countend == -1) { countend = document.cookie.length; } document.cookie="TheBasket="+document.cookie.substring(countbegin, countend)+"["+itemDescription+"|"+newProductID+"|"+newPrice+"|"+newDelivery+"|"+newQuantity+"|"+newStock+"]"; window.location.href = window.location.href; } } // showItems() - displays shopping basket in a table /////////////////////////////////////////////////////////////////// function showItems() { index = document.cookie.indexOf("TheBasket"); countbegin = (document.cookie.indexOf("=", index) + 1); countend = document.cookie.indexOf(";", index); if (countend == -1) { countend = document.cookie.length; } fulllist = document.cookie.substring(countbegin, countend); totprice = 0; document.writeln('
'); document.writeln(''); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); itemlist = 0; for (var i = 0; i <= fulllist.length; i++) { if (fulllist.substring(i,i+1) == '[') { itemstart = i+1; thisitem = 1; } else if (fulllist.substring(i,i+1) == ']') { itemend = i; thestocklevel = fulllist.substring(itemstart, itemend); itemtotal = 0; theprice = eval(theprice); itemtotal = (eval(theprice*thequantity)); temptotal = itemtotal * 100; totprice = totprice + itemtotal; itemlist=itemlist+1; document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); } else if (fulllist.substring(i,i+1) == '|') { if (thisitem==1) theitem = fulllist.substring(itemstart, i); if (thisitem==2) theproductid = fulllist.substring(itemstart, i); if (thisitem==3) theprice = fulllist.substring(itemstart, i); if (thisitem==4) thedelivery = fulllist.substring(itemstart, i); if (thisitem==5) thequantity = fulllist.substring(itemstart, i); thisitem++; itemstart=i+1; } } document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln('
ItemQuantityUnit PriceTotal 
    
 '+theitem+'£'+alterError(theprice)+'£'+alterError(itemtotal)+'[Update Quantity | Remove Item] 
     
 Goods Total:£'+alterError(totprice)+'  
 
'); } // showItems() - displays shopping basket in a table /////////////////////////////////////////////////////////////////// function showBriefBasket() { index = document.cookie.indexOf("TheBasket"); countbegin = (document.cookie.indexOf("=", index) + 1); countend = document.cookie.indexOf(";", index); if (countend == -1) { countend = document.cookie.length; } fulllist = document.cookie.substring(countbegin, countend); totprice = 0; document.writeln(''); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); itemlist = 0; numitems = 0; for (var i = 0; i <= fulllist.length; i++) { if (fulllist.substring(i,i+1) == '[') { itemstart = i+1; thisitem = 1; } else if (fulllist.substring(i,i+1) == ']') { itemend = i; thestocklevel = fulllist.substring(itemstart, itemend); itemtotal = 0; theprice = eval(theprice); itemtotal = (eval(theprice*thequantity)); temptotal = itemtotal * 100; totprice = totprice + itemtotal; itemlist=itemlist+1; numitems = numitems + parseInt(thequantity); } else if (fulllist.substring(i,i+1) == '|') { if (thisitem==1) theitem = fulllist.substring(itemstart, i); if (thisitem==2) theproductid = fulllist.substring(itemstart, i); if (thisitem==3) theprice = fulllist.substring(itemstart, i); if (thisitem==4) thedelivery = fulllist.substring(itemstart, i); if (thisitem==5) thequantity = fulllist.substring(itemstart, i); thisitem++; itemstart=i+1; } } document.writeln(' '); document.writeln(' '); if (itemlist > 0) { document.writeln(' '); } else { document.writeln(' '); } document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln('
Your Shopping Basket
   
 Last Added:
'+thequantity+' x '+theitem+' @ '+alterError(theprice)+' each.
  
 Number of items: '+numitems+'Subotal: £'+alterError(totprice)+' 
 
'); } // amendItem() - amends item in shopping basket //////////////////////////////////////////////////////////////////////// function amendItem(itemno, itemname, newquant, stocklevel, oldquant) { if (newquant == 0) { removeItem(itemno, itemname); } else if (newquant > stocklevel) { if (stocklevel == 1) { alertText = 'There is only 1 item in stock.'; } else { alertText = 'There are only ' + stocklevel + ' items in stock.'; } rc = alert(alertText); eval("document.updateform.quant"+itemno+".value = "+oldquant+";"); } else { newItemList = ""; itemlist = 0; for (var i = 0; i <= fulllist.length; i++) { if (fulllist.substring(i,i+1) == '[') { thisitem = 1; itemstart = i+1; fullstart = i+1; } else if (fulllist.substring(i,i+1) == ']') { itemend = i; thestocklevel = fulllist.substring(itemstart, itemend); itemlist=itemlist+1; if (itemlist != itemno) { newItemList = newItemList+'['+fulllist.substring(fullstart, itemend)+']'; } else { newItemList = newItemList + '['+theitem+'|'+theproductid+'|'+theprice+'|'+thedelivery+'|'+newquant+'|'+thestocklevel+']'; } } else if (fulllist.substring(i,i+1) == '|') { if (thisitem==1) theitem = fulllist.substring(itemstart, i); if (thisitem==2) theproductid = fulllist.substring(itemstart, i); if (thisitem==3) theprice = fulllist.substring(itemstart, i); if (thisitem==4) thedelivery = fulllist.substring(itemstart, i); if (thisitem==5) thequantity = fulllist.substring(itemstart, i); thisitem++; itemstart=i+1; } } index = document.cookie.indexOf("TheBasket"); document.cookie="TheBasket=."+newItemList; self.location = "basket.php"; } } // removeItem() - removes an item from the shopping basket ///////////////////////////////////////////////////////////// function removeItem(itemno, itemname) { if (confirm('Are you sure you want to remove the ' + itemname + '\nfrom your shopping cart?')) { newItemList = ""; itemlist = 0; for (var i = 0; i <= fulllist.length; i++) { if (fulllist.substring(i,i+1) == '[') { itemstart = i+1; } else if (fulllist.substring(i,i+1) == ']') { itemend = i; theitem = fulllist.substring(itemstart, itemend); itemlist=itemlist+1; if (itemlist != itemno) { newItemList = newItemList+'['+fulllist.substring(itemstart, itemend)+']'; } } } index = document.cookie.indexOf("TheBasket"); document.cookie="TheBasket=."+newItemList; self.location = "basket.php"; } } // clearBasket() - removes all items from the basket /////////////////////////////////////////////////////////////////// function clearBasket() { if (confirm('Are you sure you wish to clear your shopping basket?')) { //index = document.cookie.indexOf("TheBasket"); document.cookie="TheBasket=."; document.cookie="Postage=none"; self.location = document.location.href; } } // resetShoppingBasket - resets to shopping basket to empty //function resetShoppingBasket() { //index = document.cookie.indexOf("TheBasket"); //document.cookie="TheBasket="; //} // Return a cookie value /////////////////////////////////////////////////////////////////////////////////////////////// function getCookieVal(what) { var start, end, val if (document.cookie.indexOf(what + '=') == -1) { val = 'null'; } else { start = document.cookie.indexOf(what + '=') + what.length + 1; val = document.cookie; val = val.substring(start); if (val.indexOf(";") == -1) { end = val.length; } else { end = val.indexOf(";"); } val = val.substring(0, end); } return(val); } function PostageCountriesWrite(country_cookie) { var value = ""; var allcookies = document.cookie; var pos = allcookies.indexOf(country_cookie + "Country="); if (pos != -1) { var start = pos + country_cookie.length + 8; var end = allcookies.indexOf(";", start); if (end == -1) end = allcookies.length; value = allcookies.substring(start,end); value = unescape(value); } var allcountries = new Array(1); var allcountrieslong = new Array(1); if (country_cookie == "delivery") { allcountries[0] = ""; allcountrieslong[0] = ""; allcountries.push("GB"); allcountrieslong.push("United Kingdom"); } else { allcountries[0] = ("GB"); allcountrieslong[0] = ("United Kingdom"); } allcountries.push('AL'); allcountrieslong.push('Albania'); allcountries.push('AD'); allcountrieslong.push('Andorra'); allcountries.push('AM'); allcountrieslong.push('Armenia'); allcountries.push('AT'); allcountrieslong.push('Austria'); allcountries.push('AZ'); allcountrieslong.push('Azerbaijan'); allcountries.push('PT'); allcountrieslong.push('Azores'); allcountries.push('ES'); allcountrieslong.push('Balearic Islands'); allcountries.push('BY'); allcountrieslong.push('Belarus'); allcountries.push('BE'); allcountrieslong.push('Belgium'); allcountries.push('BA'); allcountrieslong.push('Bosnia And Herzegovina'); allcountries.push('BG'); allcountrieslong.push('Bulgaria'); allcountries.push('ES'); allcountrieslong.push('Canary Islands'); allcountries.push('FR'); allcountrieslong.push('Corsica'); allcountries.push('HR'); allcountrieslong.push('Croatia'); allcountries.push('CY'); allcountrieslong.push('Cyprus'); allcountries.push('CZ'); allcountrieslong.push('Czech Republic'); allcountries.push('DK'); allcountrieslong.push('Denmark'); allcountries.push('EE'); allcountrieslong.push('Estonia'); allcountries.push('FO'); allcountrieslong.push('Faroe Islands'); allcountries.push('FI'); allcountrieslong.push('Finland'); allcountries.push('FR'); allcountrieslong.push('France'); allcountries.push('GE'); allcountrieslong.push('Georgia'); allcountries.push('DE'); allcountrieslong.push('Germany'); allcountries.push('GI'); allcountrieslong.push('Gibraltar'); allcountries.push('GR'); allcountrieslong.push('Greece'); allcountries.push('GL'); allcountrieslong.push('Greenland'); allcountries.push('HU'); allcountrieslong.push('Hungary'); allcountries.push('IS'); allcountrieslong.push('Iceland'); allcountries.push('IE'); allcountrieslong.push('Ireland'); allcountries.push('IT'); allcountrieslong.push('Italy'); allcountries.push('KZ'); allcountrieslong.push('Kazakhstan'); allcountries.push('CS'); allcountrieslong.push('Kosovo'); allcountries.push('KG'); allcountrieslong.push('Kyrgyzstan'); allcountries.push('LV'); allcountrieslong.push('Latvia'); allcountries.push('LI'); allcountrieslong.push('Liechtenstein'); allcountries.push('LT'); allcountrieslong.push('Lithuania'); allcountries.push('LU'); allcountrieslong.push('Luxembourg'); allcountries.push('MK'); allcountrieslong.push('Macedonia'); allcountries.push('PT'); allcountrieslong.push('Madeira'); allcountries.push('MD'); allcountrieslong.push('Moldova'); allcountries.push('MT'); allcountrieslong.push('Malta'); allcountries.push('MC'); allcountrieslong.push('Monaco'); allcountries.push('CS'); allcountrieslong.push('Montenegro'); allcountries.push('NL'); allcountrieslong.push('Netherlands'); allcountries.push('NO'); allcountrieslong.push('Norway'); allcountries.push('PL'); allcountrieslong.push('Poland'); allcountries.push('PT'); allcountrieslong.push('Portugal'); allcountries.push('RO'); allcountrieslong.push('Romania'); allcountries.push('RU'); allcountrieslong.push('Russian Federation'); allcountries.push('SM'); allcountrieslong.push('San Marino'); allcountries.push('CS'); allcountrieslong.push('Serbia And Montenegro'); allcountries.push('SK'); allcountrieslong.push('Slovakia'); allcountries.push('SI'); allcountrieslong.push('Slovenia'); allcountries.push('ES'); allcountrieslong.push('Spain'); allcountries.push('SE'); allcountrieslong.push('Sweden'); allcountries.push('CH'); allcountrieslong.push('Switzerland'); allcountries.push('TJ'); allcountrieslong.push('Tajikistan'); allcountries.push('TR'); allcountrieslong.push('Turkey'); allcountries.push('TM'); allcountrieslong.push('Turkmenistan'); allcountries.push('UA'); allcountrieslong.push('Ukraine'); allcountries.push('UZ'); allcountrieslong.push('Uzbekistan'); allcountries.push('VA'); allcountrieslong.push('Vatican City State'); if (country_cookie == "delivery") { document.writeln(""); } for (i=0;i"+ allcountrieslong[i] +""); } else { document.writeln(""); } } document.writeln(""); } function addPostCountries(NoOfItems, select_box) { if (select_box.name == "country") { var country_cookie = "billing"; } else { var country_cookie = "delivery"; } var country = select_box.value; document.cookie=country_cookie+"Country="+country; if (NoOfItems<=0) { sc=alert('You have nothing to buy!'); } else { // re-calc postage region if (country_cookie == "delivery" || document.ORDER.M_Alt_Del_Country.value.length == 0) { if (country_cookie == "delivery" && document.ORDER.M_Alt_Del_Country.value.length == 0) { country_cookie = "billing"; country = document.ORDER.country.value; } var delivery_region = 'world'; var ukcountries = new Array(1); ukcountries[0] = "GB"; for (x in ukcountries) { if (ukcountries[x] == country) { delivery_region = 'ukpost'; } } if (delivery_region == 'world') { var europecountries = new Array(1); europecountries[0] = "AL"; europecountries.push('AD'); europecountries.push('AM'); europecountries.push('AT'); europecountries.push('AZ'); europecountries.push('PT'); europecountries.push('ES'); europecountries.push('BY'); europecountries.push('BE'); europecountries.push('BA'); europecountries.push('BG'); europecountries.push('ES'); europecountries.push('FR'); europecountries.push('HR'); europecountries.push('CY'); europecountries.push('CZ'); europecountries.push('DK'); europecountries.push('EE'); europecountries.push('FO'); europecountries.push('FI'); europecountries.push('FR'); europecountries.push('GE'); europecountries.push('DE'); europecountries.push('GI'); europecountries.push('GR'); europecountries.push('GL'); europecountries.push('HU'); europecountries.push('IS'); europecountries.push('IE'); europecountries.push('IT'); europecountries.push('KZ'); europecountries.push('CS'); europecountries.push('KG'); europecountries.push('LV'); europecountries.push('LI'); europecountries.push('LT'); europecountries.push('LU'); europecountries.push('MK'); europecountries.push('PT'); europecountries.push('MT'); europecountries.push('MC'); europecountries.push('CS'); europecountries.push('NL'); europecountries.push('NO'); europecountries.push('PL'); europecountries.push('PT'); europecountries.push('RO'); europecountries.push('RU'); europecountries.push('SM'); europecountries.push('CS'); europecountries.push('SK'); europecountries.push('SI'); europecountries.push('ES'); europecountries.push('SE'); europecountries.push('CH'); europecountries.push('TJ'); europecountries.push('TR'); europecountries.push('TM'); europecountries.push('UA'); europecountries.push('UZ'); europecountries.push('VA'); europecountries.push('MD'); for (x in europecountries) { if (europecountries[x] == country) { delivery_region = 'europepost'; } } } if (delivery_region != 'world') { document.cookie="Postage="+delivery_region; } } document.location.href="buy.php"; } } function PopupPic(sPicURL) { window.open( "popuppic.html?"+sPicURL, "", "resizable=1,HEIGHT=300,WIDTH=200,TOP=0,Left=0"); } function InfoBox(item) { win = window.open("info.php?item="+item, "_info", "resizable=0,WIDTH=525,HEIGHT=350,Left=200,TOP=150"); win.focus(); } function orderInfoBox(item) { win = window.open("order_process_info.php?item="+item, "_info", "resizable=0,WIDTH=525,HEIGHT=500,Left=200,TOP=50"); win.focus(); } function changePrice(product_id, variantid) { var formname = "prod" + product_id; var stockfield = "stock" + eval(document.forms[formname].variant_id.value); var newstock = eval("document.forms[formname]." + stockfield + ".value"); document.forms[formname].stock.value = newstock; var buttonId = "add" + product_id; var button = document.getElementById(buttonId); if (newstock == 0) { //alert (buttonId); //alert (button.src); button.src = "images/awating_stock.gif"; button.disabled = true; } else { button.src = "images/cart_add.gif"; button.disabled = false; } } function checkStock(product_id, variantid) { var formname = "prod" + product_id; //var stock_controlfield = "stock_control" + eval(document.forms[formname].variant.value); //var stock_control = eval("document.forms[formname]." + stock_controlfield + ".value"); var stock_control = "Y"; if (stock_control == "N") { return true; } else { var stockfield = "stock" + eval(document.forms[formname].variant_id.value); var stock = parseFloat(eval("document.forms[formname]." + stockfield + ".value")); var quantity = parseFloat(document.forms[formname].quantity.value); //alert("Stock: "+stock+", Quantity: "+quantity); //return false; if (stock == 0) { alert("We\'re afraid that this item is currently out of stock."); return false; } else if (quantity > stock) { alert("We only have "+stock+" of these items in stock."); return false; } else { return true; } } } function addItThen(product_id) { var formname = "prod" + product_id; var variant_id = document.forms[formname].variant_id.value; var name = document.forms[formname].name.value; var quantity = document.forms[formname].quantity.value; var variant = eval("document.forms[formname].variant" + eval(variant_id) + ".value"); var price = eval("document.forms[formname].price" + eval(variant_id) + ".value"); var delivery = document.forms[formname].delivery.value; var stock = eval("document.forms[formname].stock" + eval(variant_id) + ".value"); var varstring = ""; varstring += "product_id="+variant_id+"\n"; varstring += "name="+name+"\n"; varstring += "variant="+variant+"\n"; varstring += "price="+price+"\n"; varstring += "delivery="+delivery+"\n"; varstring += "quantity="+quantity+"\n"; varstring += "stock="+stock+"\n"; // alert(varstring); // return false; return buyItem(variant_id, name, variant, price, delivery, quantity, stock); } function showItems2() { // get delivery area var DeliveryRegion = "ukpost"; // alert(DeliveryRegion); var postage = 0; var allcookies = document.cookie; var pos = allcookies.indexOf("Postage="); if (pos != -1) { var start = pos + 8; var end = allcookies.indexOf(";", start); if (end == -1) end = allcookies.length; DeliveryRegion = allcookies.substring(start,end); DeliveryRegion = unescape(DeliveryRegion); } if (DeliveryRegion == "none") {DeliveryRegion = 'ukpost';} // alert(DeliveryRegion); // get basket index = document.cookie.indexOf("TheBasket"); countbegin = (document.cookie.indexOf("=", index) + 1); countend = document.cookie.indexOf(";", index); if (countend == -1) { countend = document.cookie.length; } fulllist = document.cookie.substring(countbegin, countend); totprice = 0; totdelivery = 0; document.writeln(''); document.writeln(''); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); itemlist = 0; NoOfItems = 0; // total amount of items variable WorldPayDescription = "" for (var i = 0; i <= fulllist.length; i++) { if (fulllist.substring(i,i+1) == '[') { thisitem = 1; itemstart = i+1; } else if (fulllist.substring(i,i+1) == ']') { itemend = i; thestocklevel = fulllist.substring(itemstart, itemend); NoOfItems += (eval(thequantity)); // adds amount of items together itemtotal = 0; itemtotal = (eval(theprice*thequantity)); theprice = eval(theprice); temptotal = itemtotal * 100; totprice = totprice + itemtotal; if (DeliveryRegion == "world") { totdelivery = totdelivery + 1000; } else if (DeliveryRegion == "ukpost") { totdelivery = totdelivery + (eval(thedelivery*thequantity)); } else { if (thedelivery == "2.75") { totdelivery = totdelivery + (eval(7.11*thequantity)); } else if (thedelivery == "2.95") { totdelivery = totdelivery + (eval(7.11*thequantity)); } else if (thedelivery == "5.15") { totdelivery = totdelivery + (eval(11.61*thequantity)); } } itemlist=itemlist+1; WorldPayDescription = WorldPayDescription + thequantity + " " + theitem + ", "; document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); } else if (fulllist.substring(i,i+1) == '|') { if (thisitem==1) theitem = fulllist.substring(itemstart, i); if (thisitem==2) theproductid = fulllist.substring(itemstart, i); if (thisitem==3) theprice = fulllist.substring(itemstart, i); if (thisitem==4) thedelivery = fulllist.substring(itemstart, i); if (thisitem==5) thequantity = fulllist.substring(itemstart, i); thisitem++; itemstart=i+1; } } if (DeliveryRegion == "ukpost") { } var GiftWrap = 0; var allcookies = document.cookie; var pos = allcookies.indexOf("GiftWrap="); if (pos != -1) { var start = pos + 9; var end = allcookies.indexOf(";", start); if (end == -1) end = allcookies.length; var GiftValue = allcookies.substring(start,end); GiftValue = unescape(GiftValue); if (GiftValue == "YES") GiftWrap = 1.50; else GiftWrap = 0; } var max_fixed_discount = 0; var max_percentage_discount = 0; var totdiscount = 0; totdiscount = ((totprice * (max_percentage_discount/100.0)) + max_fixed_discount); if (totdiscount > totprice) totdiscount = totprice; var fintot = (totdelivery + GiftWrap + totprice - totdiscount); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); if(totdiscount > 0) { document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); } document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln('
ItemQuantityUnit PriceTotal
   
 '+theitem+''+thequantity+'£'+alterError(theprice)+'£'+alterError(itemtotal)+' 
    
 Goods Total:£'+alterError(totprice)+' 
 Discount:£'+alterError(totdiscount)+' 
 Packing & Delivery:£'+alterError(totdelivery)+' 
    
 Total Due:£'+alterError(fintot)+' 
   
 For our information: 
   
 '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln('
Where did you hear about ukhandbags.com?:'); document.writeln(' '); document.writeln('
'); document.writeln('
 
   
 
'); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); date = new Date(); day = date.getDate(); month = date.getMonth(); month = month+1; year = date.getFullYear(); hours = date.getHours(); minutes = date.getMinutes(); if (month<10) month = "0" + month; if (minutes<10) minutes = "0" + minutes; if (day<10) day = "0" + day; if (hours<10) hours = "0" + hours; document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); WorldPayDescription = WorldPayDescription.substr(0, WorldPayDescription.length-2); if (GiftWrap>0) WorldPayDescription = WorldPayDescription+", Gift Wrapping"; document.writeln(''); document.writeln(''); //document.writeln(''); } // global variable for error flag var errfound = false; // function to validate by length function ValidLength(item, len) { return (item.length >= len); } // function to validate an email address function ValidEmail(item) { if (!ValidLength(item, 5)) return false; if (item.indexOf ('@', 0) == -1) return false; return true; } // display an error alert function error(elem, text) { // abort if we already found an error if (errfound) return; window.alert(text); // elem.select();// commented out enabling select box focusing // elem.focus(); errfound = true; } // main validation function function Validate() { errfound = false; if ((alterError(totprice))==0) error(document.ORDER.CCImage,"You have nothing to buy as yet!"); if ((alterError(totprice))>=250.01) error(document.ORDER.CCImage,"You have exceeded the order limit!"); return !errfound; /* true if there are no errors */ }