
CGIURL=SiteURL+'/cgi-bin';HelpURL=SiteURL+'/help';ImagesURL=SiteURL+'/images';ScriptsURL=SiteURL;var Items=new Array();var CookieName='ANDCartCookieV2';var DivName='ANDCart';var TO1;var DollarRate;var RegionSI=-1;var TC;var TCS;var DelInfo="";var LogMessage;var OLFs=new Array();var AjaxRequest;var AjaxCallback;var DefaultMaximumPostageGBP=30;var DefaultMaximumPostageEUGBP=30;var DefaultMaximumPostageROWGBP=50;function listItem(Work,Category,Medium,Code,Qty,Limit,DeliveryMethod,ShipFact,Price,HeightM,WidthM,DepthM,WeightKg,DF){this.Work=Work;this.Category=Category;this.Medium=Medium;this.Code=Code;this.Qty=parseInt(Qty);this.Limit=parseInt(Limit);this.ShipFact=parseInt(ShipFact);this.Price=parseFloat(Price);this.DeliveryMethod=DeliveryMethod;this.HeightM=parseFloat(HeightM);this.WidthM=parseFloat(WidthM);this.DepthM=parseFloat(DepthM);this.WeightKg=parseFloat(WeightKg);if(!DF){DF=0;};this.DF=parseFloat(DF);};function addtoList(Work,Category,Medium,Code,Qty,Limit,DeliveryMethod,ShipFact,Price,HeightM,WidthM,DepthM,WeightKg){var L=unpackCookie();if(L<2900){Work=Work.replace(/['"]/g,'`');i=findItem(Work);if(i==-1){appendItem(Work,Category,Medium,Code,Qty,Limit,DeliveryMethod,ShipFact,Price,HeightM,WidthM,DepthM,WeightKg);}else if(Items[i].Qty<=0)Items[i].Qty=1;}else{var S=getRef('and-cart-full').innerHTML;alert(S);};refreshDisplay();};function incQty(Work){unpackCookie();i=findItem(Work);Items[i].Qty+=1;if(Items[i].Limit>0&&Items[i].Qty==Items[i].Limit+1){if(Items[i].Category=='book.stitchcraft'){var S=getRef('and-cart-absolute-item-limit').innerHTML;S=S.replace(/XABSITEMSINSTOCK/g,Items[i].Limit+" "+Items[i].Work);S=S.replace(/<br>/ig,"\n\n");alert(S);Items[i].Qty=Items[i].Limit;}else{var S=getRef('and-cart-item-limit').innerHTML;S=S.replace(/XITEMSINSTOCK/g,Items[i].Limit+" "+Items[i].Work);S=S.replace(/<br>/ig,"\n\n");alert(S);}};refreshDisplay();};function decQty(Work){unpackCookie();i=findItem(Work);isRem=true;if(Items[i].Qty==1){isRem=confirmRemove();};if(isRem){Items[i].Qty-=1;if(Items[i].Qty<0){deleteItem(i);}};refreshDisplay();};function clearItem(Work){unpackCookie();i=findItem(Work);if(confirmRemove()){deleteItem(i);};refreshDisplay();};function deleteItem(i){Items.splice(i,1);};function confirmRemove(){var S=getRef('and-cart-confirm-remove').innerHTML;S=removeGXFormatting(S);return confirm(S);};function findItem(Work){for(i=0;i<Items.length;i++){if(Items[i].Work==Work){return i;}};return -1;};function appendItem(Work,Category,Medium,Code,Qty,Limit,DeliveryMethod,ShipFact,Price,HeightM,WidthM,DepthM,WeightKg){Items[Items.length]=new listItem(Work,Category,Medium,Code,Qty,Limit,DeliveryMethod,ShipFact,Price,HeightM,WidthM,DepthM,WeightKg,0);};function packCookie(){var S='';if(Items!=null){for(i=0;i<Items.length;i++){S+=escape(Items[i].Work)+'|'+escape(Items[i].Category)+'|'+escape(Items[i].Medium)+'|'+Items[i].Code+'|'+Items[i].Qty+'|'+Items[i].Limit+'|'+Items[i].DeliveryMethod+'|'+Items[i].ShipFact+'|'+Items[i].Price+'|'+Items[i].HeightM+'|'+Items[i].WidthM+'|'+Items[i].DepthM+'|'+Items[i].WeightKg+'||';};S+=RegionSI+'|'+CurrencySI;};var ExpiresOn=new Date();ExpiresOn.setHours(parseInt(ExpiresOn.getHours())+6);document.cookie=CookieName+'='+S+'; expires='+ExpiresOn.toGMTString();};function unpackCookie(){Items.length=0;var S=document.cookie;if(S!=null){P1=S.indexOf(CookieName);if(P1!=-1){P1=S.indexOf('=',P1)+1;P2=S.indexOf(';',P1);if(P2==-1)P2=S.length;S=unescape(S.substr(P1,P2-P1));A=S.split('||');if(A!=null){AL=A.length;for(i=0;i<AL-1;i++){L=A[i].split('|');Items[i]=new listItem(L[0],L[1],L[2],L[3],L[4],L[5],L[6],L[7],L[8],L[9],L[10],L[11],L[12],L[13]);};L=A[AL-1].split('|');RegionSI=L[0];CurrencySI=L[1];}};return S.length;}};function moneyFormat(amount){if(CCs[CurrencySI][0]=="JPY")return Math.round(amount);var raw=Math.round(amount*100)/100+"";raw=(raw.charAt(0)=='.'?'0'+raw:raw);if(raw.charAt(raw.length-3)=='.'){return raw;}else if(raw.charAt(raw.length-2)=='.'){return raw+'0';}else{return raw+'.00';}};function checkTotal(){var ItemCount=0;for(var i=0;i<Items.length;i++){if(Items[i].Qty>0){ItemCount+=Items[i].Qty;}};if(ItemCount==0){TO1=setTimeout("hideCart();",5000);}else{clearTimeout(TO1);};return ItemCount;};function refreshDisplay(){packCookie();convertUSD(0);var D=getRef(DivName);D.innerHTML='';D.innerHTML=formatList();var Ot=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;D.style.top=parseInt(Ot)+"px";var Ol=document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft;D.style.left=parseInt(Ol)+"px";var IC=checkTotal();setSelected();hideSelects();showObject(DivName);if(IC>0&&IC<10){window.location=CGIURL+'/logCart.pl?message='+LogMessage;}};function setSelected(){O=getRef("region");if(O)O.selectedIndex=RegionSI;O=getRef("currencycode");if(O)O.selectedIndex=CurrencySI;};function calculateShipping(isComplete){DollarRate=1./CCs[1][2];ShippingCost=0;MaxH=0;MaxW=0;TotD=0;TotWt=0;TotP=0;TotQ=0;TopDM='PP';isFragile=false;R=RegionSI;if(R==-1){if(CurrencySI==1){R=0;}else if(CurrencySI==5){R=2;}else{R=1;}};for(i=0;i<Items.length;i++){if(Items[i].Qty>0){Q=Items[i].Qty;TotQ+=Q;H=Items[i].HeightM;W=Items[i].WidthM;D=Items[i].DepthM*Q;Wt=Items[i].WeightKg*Q;P=Items[i].Price*Q;DM=Items[i].DeliveryMethod;if(W>=H){Y=W;X=H;}else{Y=H;X=W;};if(Items[i].ShipFact>0||isComplete){MaxW=X>MaxW?X:MaxW;MaxH=Y>MaxH?Y:MaxH;if(Wt==0){Wt=.09;};TotWt+=Wt;TotD+=D;TotP+=P;};if(DM=='letter'){TopDM='SP';};if(DM=='ship'){isFragile=true;TopDM='SP';}}};if(MaxH>0&&MaxW>0){if(isFragile){TotWt*=1.1;ShippingCost+=0;}else{TotWt+=.04;ShippingCost+=0;};if(R==0||R==-1){ShippingCost+=getMin(calcUKLetter(MaxH,MaxW,TotD,TotWt),calcUKParcel(TotWt));}else{ShippingCost+=getMin(calcAirmailPacket(R,TopDM,MaxH,MaxW,TotD,TotWt),calcOverseasCourier(R,MaxH,MaxW,TotD,TotWt));}};if(isComplete){if(((R==0||R==-1)&&ShippingCost==DefaultMaximumPostageGBP)||(R==1&&ShippingCost==DefaultMaximumPostageROWGBP)||(R==2&&ShippingCost==DefaultMaximumPostageEUGBP)){var TooMuch;if(TotQ>1){TooMuch='This order will exceed the shipping size and/or weight limits.\n\nTo avoid excessive shipping costs please move some of the items to a separate order.';};if(TotQ==1){TooMuch='This order exceeds the airmail size and/or weight limits. Sorry!';};alert(TooMuch);}};ShippingCost*=DollarRate;return ShippingCost;};function calcUKLetter(H,W,D,Wt){GBP=0;if(H<.24&&W<.165&&D<.005&&Wt<.1)GBP=.61;if(GBP==0&&H<.353&&W<.25&&D<.025){if(Wt<.1)GBP=.61;else if(Wt<.25)GBP=.90;else if(Wt<.5)GBP=1.24;else if(Wt<.75)GBP=1.77;};if(GBP==0){if((H<.610&&W<.46&&D<.46)||(H<.9&&(H+W+D)<1.04)){if(Wt<.1)GBP=1.28;else if(Wt<.25)GBP=1.62;else if(Wt<.5)GBP=2.14;else if(Wt<.75)GBP=2.65;else if(Wt<1.0)GBP=3.25;else if(Wt<1.25)GBP=4.45;else if(Wt<1.5)GBP=5.15;else if(Wt<1.75)GBP=5.85;else if(Wt<2)GBP=6.55;else if(Wt<4)GBP=8.22;};if(GBP==0)GBP=8.22+2.80*(parseInt((Wt-4)/2)+1);};if(GBP==0)GBP=DefaultMaximumPostageGBP;return GBP;};function calcUKParcel(Wt){GBP=0;if(Wt<2)GBP=4.41;else if(Wt<4)GBP=7.06;else if(Wt<6)GBP=9.58;else if(Wt<8)GBP=11.74;else if(Wt<10)GBP=12.61;else if(Wt<20)GBP=14.69;if(GBP==0)GBP=DefaultMaximumPostageGBP;return GBP;};function calcUKCourier(H,W,D,Wt){VWt=(H*W*D*1.0e+6)/6000;Wt=Wt>VWt?Wt:VWt;if(W<5){return 8.95;}else{return DefaultMaximumPostageGBP;}};function calcAirmailPacket(R,DM,H,W,D,Wt){GBP=0;if((H+W+D<.9&&getMax(H,W,D)<.6)||(H>=.6&&H<=.9&&(H+W+D)<=1.04)){if(DM=="SP"||DM=="PP"){if(R==1||R==3){if(Wt<=.100){GBP=1.68;}else if(Wt<=.120){GBP=1.93;}else if(Wt<=.140){GBP=2.19;}else if(Wt<=.160){GBP=2.44;}else if(Wt<=.180){GBP=2.70;}else if(Wt<=.200){GBP=2.94;}else if(Wt<=.220){GBP=3.18;}else if(Wt<=.240){GBP=3.41;}else if(Wt<=.260){GBP=3.64;}else if(Wt<=.280){GBP=3.88;}else if(Wt<=.300){GBP=4.11;}else if(Wt<.500){GBP=4.11+(0.24*(1+parseInt((Wt-.300)/.020)));}else if(Wt<1.000){GBP=6.51+(0.23*(1+parseInt((Wt-.500)/.020)));}else if(Wt<2.000){GBP=12.26+(0.22*(1+parseInt((Wt-1.000)/.020)));}};if(R==2){if(Wt<=.100){GBP=1.21;}else if(Wt<=.120){GBP=1.31;}else if(Wt<=.140){GBP=1.45;}else if(Wt<=.160){GBP=1.57;}else if(Wt<=.180){GBP=1.70;}else if(Wt<=.200){GBP=1.82;}else if(Wt<=.220){GBP=1.95;}else if(Wt<=.240){GBP=2.06;}else if(Wt<=.260){GBP=2.18;}else if(Wt<=.280){GBP=2.31;}else if(Wt<=.300){GBP=2.44;}else if(Wt<.500){GBP=2.44+(0.11*(1+parseInt((Wt-.300)/.020)));}else if(Wt<1.000){GBP=3.54+(0.11*(1+parseInt((Wt-.500)/.020)));}else if(Wt<2.000){GBP=6.29+(0.10*(1+parseInt((Wt-1.000)/.020)));}}}};if(GBP==0){if(R==1||R==3){GBP=DefaultMaximumPostageROWGBP;}else{GBP=DefaultMaximumPostageEUGBP;}};return GBP;};function calcOverseasCourier(R,H,W,D,Wt){if(R==1||R==3){return DefaultMaximumPostageROWGBP;};if(R==2){return DefaultMaximumPostageEUGBP;}};function getMin(args){var A=new Array();for(i=0;i<arguments.length;i++){A[i]=arguments[i];};A.sort(function(a,b){return a-b;});return A[0];};function getMax(args){var A=new Array();for(i=0;i<arguments.length;i++){A[i]=arguments[i];};A.sort(function(a,b){return b-a;});return A[0];};function postDesign(){for(i=0;i<Items.length;i++){if(Items[i].Qty>0){if(Items[i].DeliveryMethod=="download")Items[i].DeliveryMethod="postOrder";Items[i].WeightKg=0.01;}};refreshDisplay();};function downloadDesign(){for(i=0;i<Items.length;i++){if(Items[i].Qty>0){if(Items[i].DeliveryMethod=="postOrder")Items[i].DeliveryMethod="download";}};refreshDisplay();};function convertUSD(FA){TC=CCs[CurrencySI][0];TCS=CCs[CurrencySI][1];X=FA*CCs[CurrencySI][2];return X;};function removeGXFormatting(S){S=S.replace(/<span.*?\/span>/i,'');S=S.replace(/<\/span>/i,'');return S;};function setChequeCheckout(){logCheckout('Cheque-checkout');var S=getRef('and-cart-cheque-redirect').innerHTML.replace(/<br>/ig,"\n\n");if(S){S=removeGXFormatting(S);alert(S);};O=getRef("cartpurchaseform");O.action=CGIURL+'/processChequeSale.pl';O.innerHTML+='<input type=hidden name="action" value="display">';O.submit();};function setPPCheckout(){logCheckout('PayPal-checkout');var S=getRef('and-cart-paypal-redirect').innerHTML.replace(/<br>/ig,"\n\n");S=removeGXFormatting(S);alert(S);O=getRef("cartpurchaseform");O.action="https://www.paypal.com/cgi-bin/webscr";O.submit();};function setGCCheckout(){logCheckout('Google-checkout');var S=getRef('and-cart-google-redirect').innerHTML.replace(/<br>/ig,"\n\n");S=removeGXFormatting(S);alert(S);O=getRef("cartpurchaseform");O.action="https://checkout.google.com/cws/v2/Merchant/221835621637789/checkoutForm";O.submit();};function setSelectPaymentMethod(){logCheckout('select-method');O=getRef("cartpurchaseform");O.action=CGIURL+'/PPSaleManager.pl';O.innerHTML+='<input type=hidden name="action" value="showselectcm">';O.submit();};function logCheckout(Dest){window.location=CGIURL+'/logCart.pl?message='+Dest;};function isOfficeHours(){var Now=new Date();var DOW=Now.getUTCDay();var UTC=Now.getUTCHours();if((DOW>0&&DOW<6&&UTC>=9&&UTC<21)||(DOW==6&&UTC>=9&&UTC<12)){return true;}else{return false;}};function formatList(){var TotalPrice=0;var TotalShipping=0;var ActualShipping=0;var TotalDiscount=0;var ItemCount=0;var List="";var PPItems="";var GCItems="";var isShip=false;var isDownload=false;var isDownloadOnly=false;var containsDownloadOnly=false;var isLetter=false;var isPostOrder=false;var LogItemList="";var ItemsList="";var HiddenList="";var VisibleList="";var CutFabricList="";var ChartShip="";TotalQty=0;for(i=0;i<Items.length;i++){if(Items[i].Qty>0){TotalQty+=Items[i].Qty;}};if(TotalQty>0){for(i=0;i<Items.length;i++){if(Items[i].Qty>0){ItemPrice=parseFloat(moneyFormat(convertUSD(Items[i].Price)));LinePrice=ItemPrice*Items[i].Qty;if(Items[i].DF>0){LineDiscount=parseFloat(moneyFormat(LinePrice*Items[i].DF));}else{LineDiscount=0;};LinePrice-=LineDiscount;TotalPrice+=LinePrice;TotalDiscount+=LineDiscount;if(LineDiscount>0){var LDAmount=TCS+moneyFormat(LineDiscount);LineDiscount=getRef('and-cart-line-discount').innerHTML;LineDiscount=LineDiscount.replace(/XLINEDISCOUNT/,LDAmount);}else{LineDiscount='';};ItemsList+="<tr><td>"+Items[i].Qty+"</td><td>"+Items[i].Work+"</td><td>"+Items[i].Medium+"</td><td align=right>"+TCS+moneyFormat(ItemPrice)+"</td> <td align=right>"+TCS+moneyFormat(LinePrice)+LineDiscount+"</td> <td><table cellpadding=3 cellspacing=0><tr><td><a href=\"javascript:incQty('" + Items[i].Work + "');\" title=\"increase quantity\" class=andbutton>+</a></td><td><a href=\"javascript:decQty('" + Items[i].Work + "');\" title=\"decrease quantity\" class=andbutton>-</a></td><td><a href=\"javascript:clearItem('" + Items[i].Work + "');\" title=\"remove item\" class=andbutton>x</a></td></tr></table></td></tr>";ItemCount+=Items[i].Qty;LogItemList+=Items[i].Code+'|';DM=Items[i].DeliveryMethod;if(DM=="download")isDownload=true;if(DM=="downloadonly")isDownloadOnly=true;if(DM=="ship")isShip=true;if(DM=="letter"||DM=="printedpaper")isLetter=true;if(DM=="postOrder")isPostOrder=true;if(Items[i].Category=='stitchcraft.supplies'&&Items[i].Medium=='fabric'){var CTS=(Items[i].Work).match(/\([0-9]+?\s*by\s*[0-9]+?\s*[a-z]*?\)/i);if(CTS){CutFabricList='cts='+Items[i].Code+':'+CTS+';';}}}};if(isShip){isDownload=false;isLetter=false;isPostOrder=false;};if(isLetter){isDownload=false;isPostOrder=false;};if(isPostOrder){isDownload=false;};if(isDownloadOnly){containsDownloadOnly=true;};TotalShipping=parseFloat(moneyFormat(convertUSD(calculateShipping())));ActualShipping=moneyFormat(convertUSD(calculateShipping(true)));PostIt='&nbsp;';DelInfo='';if(isDownloadOnly||containsDownloadOnly){DelInfo=getRef('and-cart-delinfo-download-some').innerHTML;}else if(isDownload){PostIt=getRef('and-cart-postit-post').innerHTML;DelInfo=getRef('and-cart-delinfo-download-chosen').innerHTML;}else if(isPostOrder){PostIt=getRef('and-cart-postit-download').innerHTML;DelInfo=getRef('and-cart-delinfo-post-chosen').innerHTML;};var TotalDiscountScript='';if(TotalDiscount>0){TotalDiscountScript=getRef('and-cart-total-discount').innerHTML;TotalDiscountScript=TotalDiscountScript.replace(/XTOTALDISCOUNT/,TCS+moneyFormat(TotalDiscount));};var PPix=1;for(var i=0;i<Items.length;i++){if(Items[i].Qty>0){PPItems+="<input type=hidden name=\"item_name_" + PPix + "\" value=\"" + Items[i].Work + "\">\n";PPItems+="<input type=hidden name=\"item_number_" + PPix + "\" value=\"" + Items[i].Code + "\">\n";PPItems+="<input type=hidden name=\"quantity_" + PPix + "\" value=\"" + Items[i].Qty + "\">\n";ItemPrice=parseFloat(moneyFormat(convertUSD(Items[i].Price)));ItemDiscount=parseFloat(moneyFormat(ItemPrice*Items[i].DF));PPItems+="<input type=hidden name=\"amount_" + PPix + "\" value=\"" + moneyFormat(ItemPrice-ItemDiscount) + "\">\n";PPix++;}};PPix=1;for(var i=0;i<Items.length;i++){if(Items[i].Qty>0){GCItems+="<input type=hidden name=\"shopping-cart.items.item-" + PPix + ".merchant-item-id\" value=\"" + Items[i].Code + "\">\n";GCItems+="<input type=hidden name=\"item_description_" + PPix + "\" value=\"" + Items[i].Medium + ' (Item code: ' + Items[i].Code + ')' + "\">\n";GCItems+="<input type=hidden name=\"item_quantity_" + PPix + "\" value=\"" + Items[i].Qty + "\">\n";ItemPrice=parseFloat(moneyFormat(convertUSD(Items[i].Price)));ItemDiscount=parseFloat(moneyFormat(ItemPrice*Items[i].DF));GCItems+="<input type=hidden name=\"item_price_" + PPix + "\" value=\"" + moneyFormat(ItemPrice-ItemDiscount) + "\">\n";GCItems+='<input type=hidden name="item_currency_'+PPix+'" value="'+TC+'">\n';PPix++;}};if(TotalShipping>0){GCItems+="<input type=hidden name=checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-1.name value=\"Royal Mail\">";GCItems+="<input type=hidden name=checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-1.price value="+moneyFormat(TotalShipping)+">";GCItems+="<input type=hidden name=checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-1.price.currency value=GBP>";};HiddenList+=''+'<form name=cartpurchaseform id=cartpurchaseform method="post">\n'+'<input type=hidden name="act" value="display">\n'+'<input type=hidden name="cmd" value="_cart">\n'+'<input type=hidden name="upload" value="1">\n'+'<input type=hidden name="business" value="sales@artsanddesigns.com">\n'+'<input type=hidden name="item_name" value="ANDCart">\n'+'<input type=hidden name="amount" value="'+moneyFormat(TotalPrice)+'">\n'+'<input type=hidden name="currency_code" value="'+TC+'">\n'+'<input type=hidden name="return" value="'+CGIURL+'/makePostPaymentPP.pl">\n'+'<input type=hidden name="rm" value="2">\n'+'<input type=hidden name="shipping_1" value="'+moneyFormat(TotalShipping)+'">\n';if(isShip||isPostOrder||isLetter){HiddenList+="<input type=hidden name=\"no_shipping\" value=\"2\">\n";}else{HiddenList+="<input type=hidden name=\"no_shipping\" value=\"1\">\n";};if(CutFabricList){CutFabricList='|'+CutFabricList;};if(isDownload){ChartShip='|chartship=d';};if(isPostOrder){ChartShip='|chartship=p';};var Custom='csi='+CurrencySI+'|discount='+moneyFormat(TotalDiscount)+'|ship='+moneyFormat(ActualShipping)+CutFabricList+ChartShip;HiddenList+='<input type=hidden name="custom" value="'+Custom+'">\n';HiddenList+='<input type=hidden name="shopping-cart.items.item-1.merchant-private-item-data" value="'+Custom+'">\n';HiddenList+=PPItems;HiddenList+=GCItems;HiddenList+="</form>";VisibleList+=getRef('and-cart-body').innerHTML;VisibleList=VisibleList.replace(/<tr>[\n\r]*<td>[\n\r]*\s*XITEMSLIST\s*[\n\r]*<\/td>[\n\r]*<\/tr>/ig,ItemsList);VisibleList=VisibleList.replace(/XSUBTOTAL/g,TCS+moneyFormat(TotalPrice));VisibleList=VisibleList.replace(/XTOTALSHIPPING/g,TCS+moneyFormat(TotalShipping));VisibleList=VisibleList.replace(/XTOTALDISCOUNT/g,TotalDiscountScript);VisibleList=VisibleList.replace(/XTOTALAMOUNT/g,TCS+moneyFormat(TotalPrice+TotalShipping));VisibleList=VisibleList.replace(/XPOSTIT/g,PostIt);VisibleList=VisibleList.replace(/XDELINFO/g,DelInfo);VisibleList=VisibleList.replace(/<\/tr>/ig,'</tr>\n');if(TotalShipping>0){VisibleList=VisibleList.replace(/<tr[^>].*select-delivery-region.*?>/i,'<tr>');};if(isDownload||isDownloadOnly||((isLetter||isPostOrder)&&TotalShipping==0)||((isLetter||isPostOrder||isShip)&&RegionSI>=0)){VisibleList=VisibleList.replace(/<tr[^>].*select-checkout-method.*?>/i,'<tr>');VisibleList=VisibleList.replace(/<tr[^>].*select-checkout-paypal.*?>/i,'<tr>');if(TC=='GBP'){VisibleList=VisibleList.replace(/<tr[^>].*select-checkout-google.*?>/i,'<tr>');};TotUSD=(TotalPrice+TotalShipping)/CCs[CurrencySI][2];if((TC=='GBP'&&TotUSD>4)||TotUSD>200){VisibleList=VisibleList.replace(/<tr[^>].*select-checkout-cheque.*?>/i,'<tr>');};if(isOfficeHours()){var PhoneNo=INTPHONENO;if(CurrencySI==0||CurrencySI==2){PhoneNo=USPHONENO;};if(CurrencySI==1){PhoneNo=UKPHONENO;};VisibleList=VisibleList.replace(/<tr[^>].*show-phone-no.*?>/i,'<tr>');VisibleList=VisibleList.replace(/PHONENO/g,PhoneNo);}}}else{VisibleList+=getRef('and-cart-no-items').innerHTML;RegionSI=-1;};List+="<script language=\"JavaScript\">unpackCookie();</script>";List+=VisibleList+HiddenList;LogMessage=RegionSI+','+ItemCount+','+LogItemList+','+moneyFormat(TotalPrice)+','+TC;return List;};function showStatus(Msg){window.status=Msg;};function clearStatus(){showStatus(' ');};function getRef(ID){if(document.getElementById){return document.getElementById(ID);}else if(document.layers){return document.layers[ID];}else{return null;}};function showObject(ID){O=getRef(ID);if(O==null)return;if(document.getElementById){O.style.visibility="visible";O.style.display="";}else if(document.layers){O.visibility="show";}};function hideObject(ID){O=getRef(ID);if(O==null)return;if(document.getElementById){O.style.visibility="hidden";O.style.display="none";}else if(document.layers){O.visibility="hide";}};function hideCart(){showSelects();hideObject(DivName);if(init())init();};function showCart(){unpackCookie();refreshDisplay();};function showPic(URL){var W=window.open(URL,'display','width=500,height=500,status=no,resizable=yes');};function showDescription(Title,Text){var W=window.open('','Dialog','width=400,height=300,status=no,resizable=yes,scrollbars=yes');W.document.write('<html><head><title>Arts And Designs</title><link rel="stylesheet" href="http://www.artsanddesigns.com/and1.css" type="text/css"></head><body style="margin:10px; background:url(\'../images/mainbg1.jpg\');">');W.document.write('<h1>'+Title+'</h1>');W.document.write('<p>'+Text);W.document.write('</body></html>');W.document.close();W.focus();};function displayImage(U,T){F='status=no,resizable=yes,scrollbars=no,height='+150+',width='+50;W=window.open('','ImageDisplay',F);W.document.write('<html><head><title>'+T+'</title><link rel="stylesheet" href="'+SiteURL+'/and1.css" type="text/css" media="screen"><link rel="stylesheet" type="text/css" href="'+ScriptsURL+'/andprint.css" media="print"><script type="text/javascript" language="Javascript">function szWin() { var I = document.getElementById("fig"); window.resizeTo(parseInt(Math.max(parseInt(I.width)+50,250)), parseInt(Math.max(parseInt(I.height)+250,350))); }; </scr'+'ipt></head><body style="background:url(\'' + ImagesURL + '/mainbg1.jpg\') repeat; padding-left:10px; padding-right:10px;">');W.document.write('<img src="'+ImagesURL+'/banner.gif" height=30>');W.document.write('<h1>'+T+'</h1>');W.document.write('<img id="fig" src="'+U+'" onload="szWin();">');W.document.write('<p style="padding:3px;"><a href="javascript:print();" class=andbutton>Print</a>&nbsp;<a href="javascript:close();" class=andbutton>Close&nbsp;Window</a></p>');W.document.write('</body></html>');W.document.close();W.focus();};function showHelp(File,Offset){URL=HelpURL+'/'+File+'#'+Offset;var W=window.open(URL,'Help','width=400,height=300,status=no,resizable=yes,scrollbars=yes');W.focus();};function init(X){};function hideSelects(){var O=document.getElementsByTagName("select");for(i=0;i<O.length;i++){if(O[i].id!='region'&&O[i].id!='currencycode'){O[i].style.visibility='hidden';}};hideObject("qf");};function showSelects(){var O=document.getElementsByTagName("select");for(i=0;i<O.length;i++){O[i].style.visibility='visible';};showObject("qf");};function disableSelect(ID){var E=getRef(ID);E.onselectstart=function(){return false;};E.unselectable="on";E.style.MozUserSelect="none";E.style.cursor="default";};function addOLF(F){OLFs[OLFs.length]=F;};function doOLFs(){for(var i=0;i<OLFs.length;i++){eval(OLFs[i]);}};function bookmarkPage(){var PageURL=document.location.href;var PageTitle=document.title;if(window.sidebar){window.sidebar.addPanel(PageTitle,PageURL,"");}else if(window.external){window.external.AddFavorite(PageURL,PageTitle);}else if(window.opera&&window.print){var O=document.createElement('a');O.setAttribute('href',PageURL);O.setAttribute('title',PageTitle);O.setAttribute('rel','sidebar');O.click();}else{var S=getRef('and-cart-bookmark').innerHTML.replace(/<br>/ig,"\n\n");S=removeGXFormatting(S);alert(S);}};function getWindowSize(){var W=0,H=0;if(typeof(window.innerWidth)=='number'){W=window.innerWidth;H=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){W=document.documentElement.clientWidth;H=document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){W=document.body.clientWidth;H=document.body.clientHeight;};return[W,H];};function getScrollOffset(){var ScrLeft=0,ScrTop=0;if(typeof(window.pageYOffset)=='number'){ScrLeft=window.pageXOffset;ScrTop=window.pageYOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){ScrLeft=document.body.scrollLeft;ScrTop=document.body.scrollTop;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){ScrLeft=document.documentElement.scrollLeft;ScrTop=document.documentElement.scrollTop;};return[ScrLeft,ScrTop];};function findPos(obj){var curleft=curtop=0;if(obj.offsetParent){curleft=obj.offsetLeft;curtop=obj.offsetTop;while(obj=obj.offsetParent){curleft+=obj.offsetLeft;curtop+=obj.offsetTop;}};return[curleft,curtop];};function showPopup(ID){var WDims=getWindowSize();var ScrOfs=getScrollOffset();getRef(ID).style.left=(ScrOfs[0]+parseInt(WDims[0]/3))+"px";getRef(ID).style.top=(ScrOfs[1]+parseInt(WDims[1]/3))+"px";showObject(ID);};function getAjax(AjaxURL){showPopup("waitpopup");AjaxRequest=null;if(window.XMLHttpRequest){AjaxRequest=new XMLHttpRequest();}else{AjaxRequest=new ActiveXObject("Microsoft.XMLHTTP");};if(AjaxRequest!=null){AjaxRequest.onreadystatechange=receiveAjax;AjaxRequest.open("GET",AjaxURL,true);AjaxRequest.send(null);}};function receiveAjax(){if(AjaxRequest.readyState==4){hideObject("waitpopup");if(AjaxRequest.status==200){if(AjaxCallback){AjaxCallback(AjaxRequest.responseText);}}else{alert("Problem retrieving data:"+AjaxRequest.statusText);}}};function fixSelectInnerHTML(SelObject,innerHTML){SelObject.innerHTML="";var SelTemp=document.createElement("div");var OptObject;SelTemp.id="andselect1";document.body.appendChild(SelTemp);SelTemp=document.getElementById("andselect1");SelTemp.style.display="none";if(innerHTML.toLowerCase().indexOf("<option")<0){innerHTML="<option>"+innerHTML+"</option>";};innerHTML=innerHTML.replace(/<option/ig,"<span").replace(/<\/option/ig,"</span");SelTemp.innerHTML=innerHTML;for(var i=0;i<SelTemp.childNodes.length;i++){var SpanObject=SelTemp.childNodes[i];if(SpanObject.tagName){OptObject=document.createElement("OPTION");if(document.all){SelObject.add(OptObject);}else{SelObject.appendChild(OptObject);};OptObject.value=SpanObject.getAttribute("value");OptObject.text=SpanObject.innerHTML;OptObject.selected=SpanObject.getAttribute('selected');}};document.body.removeChild(SelTemp);SelTemp=null;};function tidyXURL(Params,EncodedURL){var XURL;if(EncodedURL){XURL=EncodedURL;}else{XURL=document.location.href;};XURL=unescape(XURL);XURL=XURL.replace(/[&?]csi=[0-9]|[&?]hl=[a-z]{2};?|[&?]ie=\\w{4}|[&?]sl=[a-z]{2};?|[&?]tl=[a-z]{2};?|[&?]langcode=[a-z]{2};?|[&?]usg=[^&]*/ig,"");if(Params){var RE=new RegExp('\/$','');if(XURL.match(RE)){XURL=SiteURL;}else{XURL+='&'+Params;if(Params=='langcode=en'){XURL=XURL.replace(/.*?artsanddesigns/,"http://www.artsanddesigns");}}};return XURL;};function m1(MO){var j=getChildUL(MO);if(j){MO.childNodes[j].style.display='block';};MO.style.backgroundImage="url("+ImagesURL+"/bg_button2.jpg)";MO.style.cursor='default';};function m2(MO){var j=getChildUL(MO);if(j){MO.childNodes[j].style.display='none';};MO.style.backgroundImage="url("+ImagesURL+"/bg_button1.jpg)";};function getChildUL(MO){var j;for(var i=0;i<MO.childNodes.length;i++){if((MO.childNodes[i].nodeName).toUpperCase()=='UL'){j=i;break;}};return j;};var QFI;function showQF(){clearTimeout(QFI);getRef("qf").style.height="20em";if(parseInt(getRef("qf1").offsetWidth)>parseInt(getRef("qf").offsetWidth)+100){getRef("qf").style.width="30em";};getRef("qf").style.overflow="auto";showObject("qf1");};function hideQF(){QFI=setTimeout('hideQFAfterDelay()',500);};function hideQFAfterDelay(){getRef("qf").style.height="1em";getRef("qf").style.width="20em";getRef("qf").style.overflow="";hideObject("qf1");};function toggleQFMenuSub(MO){MO=getFirstParentUL(MO);var j=getChildUL(MO);if(j){var isShowing=(MO.childNodes[j].style.display=='block');if(isShowing){MO.childNodes[j].style.display='none';MO.innerHTML=MO.innerHTML.replace(/\-/,"+").replace(/collapse/,"expand");}else{MO.childNodes[j].style.display='block';MO.innerHTML=MO.innerHTML.replace(/\+/,"-").replace(/expand/,"collapse");}}};function getFirstParentUL(MO){while(MO.parentNode.nodeName.toUpperCase()!='UL'){MO=MO.parentNode;};if(MO&&MO.parentNode){return MO;}};function encodeList(SelectID,ListID){var S=getRef(SelectID);var L=getRef(ListID);var N=S.options.length;L.value='';for(var i=0;i<N;i++){var OV=S.options[i].value;if(S.options[i].selected&&L.value.indexOf(OV)<0&&OV!="Any"){L.value+=OV+',';}};L.value=L.value.substring(0,L.value.length-1);};function decodeList(SelectID,ListID){S=getRef(SelectID);L=getRef(ListID);if(L)LV=L.value;if(!LV)LV="Any";if(S)N=S.options.length;else N=0;for(var i=0;i<N;i++){OV=S.options[i].value;if(LV.indexOf(OV)>=0){S.options[i].selected=true;}else{S.options[i].selected=false;}}};var ImageSubDir;function initControls(){var TFC=getRef('textformattingcontrols');if(window.getSelection||document.getSelection){TFC.innerHTML='<p>Sorry - no formatting controls available for this type of browser';return;};S=TFC.innerHTML;ImageSubDir=S.match(/subdir=([\w\/]*)\;/)[1];if(ImageSubDir==null)ImageSubDir='';isAdvanced=S.match(/advanced=(\w*)\;/)[1];isAdvanced=(isAdvanced=="true");if(ImageSubDir!='')ImageSubDir+='/';if(TFC){TFC.innerHTML="<table class=workplate><tr><td><table cellpadding=3><tr>"+"<td><a href=\"javascript:setFormatting('bold');\" class=andbutton title=\"bold/un-bold the selected text\">Bold</a></td>"+"<td><a href=\"javascript:setFormatting('italic');\" class=andbutton title=\"italicise/un-italicise the selected text\">Italic</a></td>"+"<td><a href=\"javascript:setFormatting('quote');\" class=andbutton title=\"enclose the selected text in quotes\">Quote</a></td>"+"<td><a href=\"javascript:setFormatting('big');\" class=andbutton title=\"make the selected text bigger\">Big</a></td>"+"<td><a href=\"javascript:setFormatting('paragraph');\" class=andbutton title=\"make the selected text into a separate paragraph\">Paragraph</a></td>"+"<td><a href=\"javascript:setFormatting('list');\" class=andbutton title=\"Use the selected text to form a list-one element for each line\">List</a></td>"+"<td><a href=\"javascript:checkSpelling();\" class=andbutton title=\"Check the spelling of the selected text\">Spell</a></td>"+"<td id=advancedoption><a href=\"javascript:showObject('advancedcontrols')\" class=andbutton title=\"show the advanced controls\">Advanced</a></td>"+"</tr></table></td></tr><tr id=advancedcontrols><td><table cellpadding=3><tr>"+"<td><a href=\"javascript:setFormatting('url');\" class=andbutton title=\"Use the selected text as the title for a URL\">URL</a></td>"+"<td><a href=\"javascript:setFormatting('image');\" class=andbutton title=\"Use the selected text as the title for an image\">Image</a></td>"+"<td><input type=file name=tffilename id=tffilename></td>"+"<td colspan=10>Style:&nbsp;<input type=text name=customstyle id=customstyle></td>"+"</tr></table></td>"+"</tr></table>"+"<input type=hidden name=imagename id=imagename>"+"<input type=hidden name=imagesubdir id=imagesubdir>";};if(!isAdvanced)hideObject('advancedoption');hideObject('advancedcontrols');};function checkSpelling(){SelText=document.selection.createRange();if(SelText.parentElement().tagName=='TEXTAREA'){S=SelText.text;}else{S='';};if(S==''){alert('Please highlight the text you want spell checked.');}else{U='http://www.artsanddesigns.com/cgi-bin/showSpelling.pl?text='+escape(S);W=window.open(U,'spellcheck','width=500, height=300, status=no, resizable=yes, scrollbars=yes','');if(window.focus)W.focus();}};function setFormatting(Format){var LB='\{';var RB='\x7D';var HTTP='http://';var S='';var URL='';var ImageURL='';var CustomStyle='';var TaggedText;SelText=document.selection.createRange();if(SelText.parentElement().tagName=='TEXTAREA'){S=SelText.text;}else{S='';};if(S==''){alert('Please highlight some text first');}else{Format1=LB+'\/?'+Format+'.*?'+RB;Format2='';if(Format=='list')Format2=LB+'item'+RB;REFormat=Format1;if(Format2!='')REFormat+='|'+Format2;RE=new RegExp(REFormat,'ig');Matches=S.match(RE);S=S.replace(RE,'');if(Format=="url")URL=prompt('Enter URL',HTTP);if(URL!=''&&URL.indexOf(HTTP)!=0){alert('URL must begin with \"'+HTTP+'\"');return;};if(URL!=''&&URL.lastIndexOf(HTTP)!=0){alert('URL must look like \"'+HTTP+'...\"');return;};if(URL==HTTP)URL='';if(Format=="image"){ImageFile=getRef('tffilename').value;if(ImageFile!=''){ImageName=S.replace(/\W+/g,'-');ImageExtension=ImageFile.substring(ImageFile.length-4,ImageFile.length);ImageURL=SiteURL+'/images/'+ImageSubDir+ImageName+ImageExtension;getRef('imagename').value=ImageName+ImageExtension;getRef('imagesubdir').value=ImageSubDir;}else{alert('Please specify an image file in the adjacent box before using the image control');return;}};if(getRef('customstyle').value!=''){CustomStyle=' style="'+getRef('customstyle').value+'"';}else{if(Format=="image"){CustomStyle=' style="margin:10px;"';}};if(Matches){TaggedText=S;}else{if(Format=="image"){TaggedText=LB+Format+'='+'"'+ImageURL+'"'+' alt="'+S+'"'+CustomStyle+RB+LB+'\/'+Format+RB;}else if(Format=="url"){TaggedText=LB+Format+'='+'"'+URL+'"'+' title="'+S+'"'+RB+S+LB+'\/'+Format+RB;}else if(Format=="list"){RE=new RegExp("\n",'ig');S=S.replace(RE,"\n{item\x7D");S='{item\x7D'+S;TaggedText=LB+Format+CustomStyle+RB+S+LB+'\/'+Format+RB;}else{TaggedText=LB+Format+CustomStyle+RB+S+LB+'\/'+Format+RB;};getRef('customstyle').value='';};if(window.getSelection){window.getSelection()=TaggedText;}else if(document.getSelection){document.getSelection()=TaggedText;}else SelText.text=TaggedText;}};function _tipon(o){};function _tipoff(){};


