var valuta="EUR ";var valuta2="US$ ";var exch=0.780158996;var SecVal=0;var sepmigl=".";var sepdec=",";var PutDec=1;var PutDec2=1;function MettiPunti(b){var a="";var d=b+"s";var c=d.length-1;d=d.substring(0,c);while(c>3){a=sepmigl+d.substring(c-3,c)+a;d=d.substring(0,c-3);c=d.length}a=d+a;return(a)}function alterError(value){if(PutDec!=0){if(value<=0.99){newPounds="0"}else{newPounds=parseInt(value)}newPence=Math.round((value-newPounds)*100);if(newPence==100){newPence=0;newPounds++}if(eval(newPence)<=9){newPence="0"+newPence}newString=MettiPunti(newPounds);if(eval(newPence)!=0){newString=newString+sepdec+newPence}else{newString=newString+sepdec+"00"}}else{newPounds=Math.round(value);newString=MettiPunti(newPounds)}return(newString)}function MostraCarrello(){var sfondocarrello="#E5E5E5";index=document.cookie.indexOf("eDbasket");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;totiva=0;document.writeln('<FORM NAME="updateform">');document.writeln('<div align="left">');document.writeln('<TABLE style="width:90%" align="center" BORDER=0 CELLPADDING="2">');document.writeln('<TR BGCOLOR="#FFDD00"><TD align="left"><b><FONT COLOR="#000000" FACE="Arial,Helvetica" SIZE=-1>Item description</FONT></b></TD><TD align="center"><b><FONT COLOR="#000000" FACE="Arial,Helvetica" SIZE=-1>Options</FONT></b></TD><TD align="right"><b><FONT COLOR="#000000" FACE="Arial,Helvetica" SIZE=-1>Quantity</FONT></b></TD><TD align="right"><b><FONT COLOR="#000000" FACE="Arial,Helvetica" SIZE=-1>Unit Price</FONT></b></TD><td align="right"><b><FONT COLOR="#000000" FACE="Arial,Helvetica" SIZE=-1>Total price</FONT></b></TD><TD>&nbsp;</TD></TR>');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;thequantity=fulllist.substring(itemstart,itemend);itemtotal=0;itemtotal=(eval(theprice*thequantity));itemtotaliva=0;itemtotaliva=(eval(ivaitem*thequantity));temptotal=itemtotal*100;totprice=totprice+itemtotal;totiva=totiva+itemtotaliva;itemlist=itemlist+1;document.write('<tr valign="top" BGCOLOR="'+sfondocarrello+'"><td align="left"><FONT COLOR="#000000" FACE="Arial,Helvetica" SIZE=-1>'+theitem+"</FONT></td>");option123="";if(option1!=""){option123="<sup>1</sup>&nbsp;"+option1}if(option2!=""){if(option123!=""){option123=option123+"<BR>"}option123=option123+"<sup>2</sup>&nbsp;"+option2}if(option3!=""){if(option123!=""){option123=option123+"<BR>"}option123=option123+"<sup>3</sup>&nbsp;"+option3}document.write('<td align="center"><FONT COLOR="#000000" FACE="Arial,Helvetica" SIZE=-1>'+option123+"</FONT></td>");document.write('<td valign="top" align="right"><INPUT TYPE=TEXT NAME="quant'+itemlist+'" VALUE="'+thequantity+'" SIZE=3></td><td valign="top" align="right"><FONT COLOR="#000000" FACE="Arial,Helvetica" SIZE=-1>'+alterError(eval(theprice))+'</FONT></td><td valign="top" align="right"><FONT COLOR="#000000" FACE="Arial,Helvetica" SIZE=-1>'+alterError(itemtotal)+'</FONT></td><td align="center" valign="top"><a href="javascript:EliminaArt('+itemlist+')" onMouseOver="window.status=\'\'; return true"><FONT COLOR="#000000" FACE="Arial,Helvetica" SIZE=-1>Remove</FONT></a><BR><a href="javascript:ModificaArt('+itemlist+",document.updateform.quant"+itemlist+'.value)" onMouseOver="window.status=\'\'; return true"><FONT COLOR="#000000" FACE="Arial,Helvetica" SIZE=-1>Update</FONT></a></td></tr>');if(sfondocarrello=="#E5E5E5"){sfondocarrello="#DEEFFF"}else{sfondocarrello="#E5E5E5"}}else{if(fulllist.substring(i,i+1)=="|"){if(thisitem==1){theitem=fulllist.substring(itemstart,i)}if(thisitem==2){option1=fulllist.substring(itemstart,i)}if(thisitem==3){option2=fulllist.substring(itemstart,i)}if(thisitem==4){option3=fulllist.substring(itemstart,i)}if(thisitem==5){pesoitem=fulllist.substring(itemstart,i)}if(thisitem==6){theprice=fulllist.substring(itemstart,i)}if(thisitem==7){ivaitem=fulllist.substring(itemstart,i)}thisitem++;itemstart=i+1}}}}if(itemlist==0){document.writeln('<TR BGCOLOR="#E5E5E5"><TD colspan="5" align="center"><FONT COLOR="#000000" FACE="Arial,Helvetica" SIZE=-1>(Your shopping cart is empty)</FONT></TD><TD>&nbsp;</TD></TR>')}document.writeln('<tr BGCOLOR="#FFDD00"><td colspan=4 align="right"><b><FONT COLOR="#000000" FACE="Arial,Helvetica" SIZE=-1>Total amount</FONT></b></td><td align="right" nowrap><b><FONT COLOR="#000000" FACE="Arial,Helvetica" SIZE=-1>'+valuta+alterError(totprice)+"</FONT></b></td><td>&nbsp;</td></tr>");if(1==0){document.writeln('<tr BGCOLOR="#FFDD00"><td colspan=4 align="right"><b><FONT COLOR="#000000" FACE="Arial,Helvetica" SIZE=-1>VAT</FONT></b></td><td align="right" nowrap><b><FONT COLOR="#000000" FACE="Arial,Helvetica" SIZE=-1>'+valuta+alterError(totiva)+"</FONT></b></td><td>&nbsp;</td></tr>")}document.writeln("</TABLE><cr>");document.writeln("</div>");document.writeln("</FORM>")}function ModificaArt(c,b){if(isNaN(b)){b=0}b=Math.floor(b);if(b<=0){rc=alert("Please choose a proper quantity!")}else{newItemList=null;itemlist=0;for(var a=0;a<=fulllist.length;a++){if(fulllist.substring(a,a+1)=="["){thisitem=1;itemstart=a+1;fullstart=a+1}else{if(fulllist.substring(a,a+1)=="]"){itemend=a;itemlist=itemlist+1;if(itemlist!=c){newItemList=newItemList+"["+fulllist.substring(fullstart,itemend)+"]"}else{newItemList=newItemList+"["+theitem+"|"+option1+"|"+option2+"|"+option3+"|"+pesoitem+"|"+theprice+"|"+ivaitem+"|"+b+"]"}}else{if(fulllist.substring(a,a+1)=="|"){if(thisitem==1){theitem=fulllist.substring(itemstart,a)}if(thisitem==2){option1=fulllist.substring(itemstart,a)}if(thisitem==3){option2=fulllist.substring(itemstart,a)}if(thisitem==4){option3=fulllist.substring(itemstart,a)}if(thisitem==5){pesoitem=fulllist.substring(itemstart,a)}if(thisitem==6){theprice=fulllist.substring(itemstart,a)}if(thisitem==7){ivaitem=fulllist.substring(itemstart,a)}thisitem++;itemstart=a+1}}}}index=document.cookie.indexOf("eDbasket");document.cookie="eDbasket="+newItemList+"; expires=Wed, 14-Oct-20 00:00:01 GMT;";self.location="cart_l2.html"}}function EliminaArt(b){newItemList=null;itemlist=0;for(var a=0;a<=fulllist.length;a++){if(fulllist.substring(a,a+1)=="["){itemstart=a+1}else{if(fulllist.substring(a,a+1)=="]"){itemend=a;theitem=fulllist.substring(itemstart,itemend);itemlist=itemlist+1;if(itemlist!=b){newItemList=newItemList+"["+fulllist.substring(itemstart,itemend)+"]"}}}}index=document.cookie.indexOf("eDbasket");document.cookie="eDbasket="+newItemList+"; expires=Wed, 14-Oct-20 00:00:01 GMT;";self.location="cart_l2.html"}function SvuotaCarrello(){if(confirm("Are you sure you want to empty your cart?")){index=document.cookie.indexOf("eDbasket");document.cookie="eDbasket=.";self.location="cart_l2.html"}};
