function ShoppingCart(d,c,a,l){this.BasketDivID=a;this.ShowCartOnAddItem=d;this.RootUrl="http://www.filigranes.be/";this.AttachedObj=c;this.PayPalAccount="alexis@filiagenda.com";this.Shipping=false;this.PayPalReturnUrl="http://www.filigranes.be/fr/paiement-ok/index.htm";this.NotifyUrl="http://www.filigranes.be/FiligranesShop/PaypalNotify.ashx";this.PayPalContinueText="Filigranes";this.PayPalCancelUrl="http://www.filigranes.be/fr/paiement-cancel/index.htm";this.LogoURL="";this.GetPost="0";this.Note="0";this.ListName="Achat Filigranes";this.URLcpp_header_image="https://static.e-junkie.com/sslpic/17608.9ff953ca7dd681381f396ddd2c142454.jpg";this.headerback_color="FFFFFF";this.headerborder_color="FFFFFF";this.ImageValide="http://www.filigranes.be/Images/Registration/ok.gif";this.ImageInvalid="http://www.filigranes.be/Images/Registration/attention.gif";this.LinkWishlist="http://www.filigranes.be/fr/listes/index.htm";this.Redirect=l;this.BeforeLoginEan;this.BeforeLoginUserRef;this.BeforeLoginLxt1;this.BeforeLoginLxt2;this.BeforeLoginDlytxt;this.BeforeLoginPrice;this.BeforeLoginListItemID;this.BeforeListID;this.BeforeRepetitive;this.IsCheckList=false;var j=document.getElementsByTagName("head")[0];if(j){var e=j.getElementsByTagName("script");var q=j.getElementsByTagName("link");var o=false;var g=false;var n=false;var k=false;var h=false;for(var f=0;f<e.length;f++){var m=e[f];if(m.src.indexOf("common.js")>0){o=true}if(m.src.indexOf("date.js")>0){g=true}if(m.src.indexOf("modal-message.js")>0){n=true}if(m.src.indexOf("Login.js")>0){k=true}if(m.src.toLowerCase().indexOf("string.js")>0){h=true}if(o==true&&g==true&&n==true&&k==true&&h==true){break}}if(n==false){var p=document.createElement("script");p.type="text/javascript";p.src=this.RootUrl+"js/modal-message.js";j.appendChild(p)}if(o==false){var p=document.createElement("script");p.type="text/javascript";p.src=this.RootUrl+"js/methods/common.js";j.appendChild(p)}if(g==false){var p=document.createElement("script");p.type="text/javascript";p.src=this.RootUrl+"js/methods/date.js";j.appendChild(p)}if(k==false){var p=document.createElement("script");p.type="text/javascript";p.src=this.RootUrl+"js/Login.js";j.appendChild(p)}if(h==false){var p=document.createElement("script");p.type="text/javascript";p.src=this.RootUrl+"js/methods/string.js";j.appendChild(p)}}this.shoppingCartModal=new DHTML_modalMessage();if(this.BasketDivID){var b=document.getElementById(this.BasketDivID);b.innerHTML="Panier vide";this.RefreshBasket()}}ShoppingCart.prototype.AddArticleToCart=function(f,d,g,e,b,i,h,o,l){var k=this;if(GetCookie("UID")){if(o!=null&&o!=""&&this.IsCheckList==false){this.BeforeLoginEan=f;this.BeforeLoginUserRef=d;this.BeforeLoginLxt1=g;this.BeforeLoginLxt2=e;this.BeforeLoginDlytxt=b;this.BeforeLoginPrice=i;this.BeforeLoginListItemID=h;this.BeforeListID=o;this.BeforeRepetitive=l;this.IsCheckList=false;k.shoppingCartModal=new DHTML_modalMessage();k.shoppingCartModal.setSize(400,300);var m="<div class='LoginTitle' style='width:95%;'><span style='float:left;'>Vérification de votre panier</span></div>";k.shoppingCartModal.setHtmlContent(m+"<div id='CheckContainer'>Vérification en cours...</div>");k.shoppingCartModal.setSource(false);k.shoppingCartModal.setShadowDivVisible(false);k.shoppingCartModal.display();var c="<ShoppingCart>";c+="<uid>"+GetCookie("UID")+"</uid>";c+="</ShoppingCart>";c=Base64.encode(c);new Ajax.Request(k.RootUrl+"FiligranesShop/ShowCart.ashx",{method:"POST",onSuccess:function(p){k.CheckCartSucceed(p)},onFailure:function(p){k.CheckCartFailed(p)},postBody:c})}else{if(l=="true"){k.shoppingCartModal=new DHTML_modalMessage();k.shoppingCartModal.setHtmlContent("");k.shoppingCartModal.setSize(300,150);var j="<div class='PriceTitle' style='width:95%;'><span style='float:left;'>Montant souhaité</span><a href='#' id='closeBtn' style='float:right;'><img src='"+wishListTmp.RootUrl+"Images/ImageGallery/close.gif'></img></a></div>";j+="<div id='PrixContainer'>Indiquer le montant souhaité pour le Ch&egrave;que Cadeau (en €)<BR />";j+='<div id="form-price"><p>Montant</p>';j+='<input id="txtPrice" type="text"/> € ';j+='<img src="/Images/Registration/attention.gif" id="ImgPrice" alt="Non valide" title="Non valide" class="Invalid" />';j+="</div>";j+='<div id="form-valid"><input type="button" id="btnSubmit" value="Valider" disabled="disabled" />';j+="</div>";j+="</div>";k.shoppingCartModal.setHtmlContent(j);k.shoppingCartModal.setSource(false);k.shoppingCartModal.setShadowDivVisible(false);k.shoppingCartModal.display();if(document.getElementById("closeBtn")){k.shoppingCartModal.addEvent(document.getElementById("closeBtn"),"click",function(p){k.Close()})}if(document.getElementById("txtPrice")){k.shoppingCartModal.addEvent(document.getElementById("txtPrice"),"keyup",function(p){k.OnPriceChange(p,"txtPrice","ImgPrice")});k.shoppingCartModal.addEvent(document.getElementById("txtPrice"),"keypress",function(p){k.OnValidPriceEnter(p,"txtPrice",f,h,o)});document.getElementById("txtPrice").focus()}if(document.getElementById("btnSubmit")){k.shoppingCartModal.addEvent(document.getElementById("btnSubmit"),"click",function(p){k.OnValidPrice(p,"txtPrice",f,h,o)})}}else{var c="<ShoppingCart>";c+="<uid>"+GetCookie("UID")+"</uid>";if(f&&f!=null&&f!=undefined){c+="<ean>"+f+"</ean>"}if(d&&d!=null&&d!=undefined&&(h==null||!h||h==undefined)){c+="<ref>"+d+"</ref>"}if(g&&g!=null&&g!=undefined){c+="<lxt1>"+g+"</lxt1>"}if(e&&e!=null&&e!=undefined){c+="<lxt2>"+e+"</lxt2>"}if(b&&b!=null&&b!=undefined){c+="<dlytxt>"+b+"</dlytxt>"}if(h&&h!=null&&h!=undefined&&o&&o!=null&&o!=undefined){c+="<lid>"+h+"</lid>";c+="<ref>"+o+"</ref>"}if(i&&i!=null&&i!=undefined){c+="<price>"+i+"</price>"}c+="</ShoppingCart>";c=Base64.encode(c);this.BeforeLoginEan=null;this.BeforeLoginUserRef=null;this.BeforeLoginLxt1=null;this.BeforeLoginLxt2=null;this.BeforeLoginDlytxt=null;this.BeforeLoginPrice=null;this.BeforeLoginListItemID=null;this.BeforeListID=null;this.BeforeRepetitive=null;this.IsCheckList=false;new Ajax.Request(k.RootUrl+"FiligranesShop/AddToCart.ashx",{method:"POST",onSuccess:function(p){k.AddArticleToCartSucceed(p)},onFailure:function(p){k.AddArticleToCartFailed(p)},postBody:c})}}}else{this.BeforeLoginEan=f;this.BeforeLoginUserRef=d;this.BeforeLoginLxt1=g;this.BeforeLoginLxt2=e;this.BeforeLoginDlytxt=b;this.BeforeLoginPrice=i;this.BeforeLoginListItemID=h;this.BeforeListID=o;this.BeforeRepetitive=l;this.IsCheckList=false;var k=this;k.shoppingCartModal=new DHTML_modalMessage();k.shoppingCartModal.setSize(400,300);var m="<div class='LoginTitle' style='width:95%;'><span style='float:left;'>Authentification</span><a href='#' id='closeBtn' style='float:right;'><img src='"+k.RootUrl+"Images/ImageGallery/close.gif'></img></a></div>";k.shoppingCartModal.setHtmlContent(m+"<div id='LoginContainer'></div>");k.shoppingCartModal.setSource(false);k.shoppingCartModal.setShadowDivVisible(false);k.shoppingCartModal.display();if(document.getElementById("closeBtn")){k.shoppingCartModal.addEvent(document.getElementById("closeBtn"),"click",function(p){k.Close()})}var n=document.createElement("div");n.id="login_shoppingcart";document.getElementById("LoginContainer").appendChild(n);var a=new Login("login_shoppingcart");a.Init();a.OnLoginSucceedEvent=OnLoginSucceedShoppingCart;a.LoginParentModule=k}};ShoppingCart.prototype.CheckCartSucceed=function(d){var h=this;if(d&&d.responseXML){if(h.shoppingCartModal){h.shoppingCartModal.setHtmlContent("");var c=d.responseXML.getElementsByTagName("params");var f=d.responseXML.getElementsByTagName("booklist");if(f.length>0){var k=f[0];if(k){var b=k.getElementsByTagName("book");if(b.length>0){var a="";for(var g=0;g<b.length;g++){var j=b[g];if(j.getElementsByTagName("ref")&&j.getElementsByTagName("ref").length>0&&j.getElementsByTagName("ref")[0].firstChild){a=j.getElementsByTagName("ref")[0].firstChild.nodeValue}if(a!=this.BeforeListID){break}}if(a!=this.BeforeListID){if(confirm("Tapez OK pour effacer le contenu du panier (qui contient des articles d'une autre liste) ou Annuler pour le laisser en l'état.")){var e="<ShoppingCart>";e+="<uid>"+GetCookie("UID")+"</uid>";e+="</ShoppingCart>";e=Base64.encode(e);new Ajax.Request(h.RootUrl+"FiligranesShop/ClearCart.ashx",{method:"POST",onSuccess:function(i){h.ClearCartSucceed(i)},onFailure:function(i){h.ClearCartFailed(i)},postBody:e})}else{h.ShowCart()}}else{h.IsCheckList=true;if(h.shoppingCartModal){h.shoppingCartModal.close()}h.AddArticleToCart(h.BeforeLoginEan,h.BeforeLoginUserRef,h.BeforeLoginLxt1,h.BeforeLoginLxt2,h.BeforeLoginDlytxt,h.BeforeLoginPrice,h.BeforeLoginListItemID,h.BeforeListID,h.BeforeRepetitive)}}else{h.IsCheckList=true;if(h.shoppingCartModal){h.shoppingCartModal.close()}h.AddArticleToCart(h.BeforeLoginEan,h.BeforeLoginUserRef,h.BeforeLoginLxt1,h.BeforeLoginLxt2,h.BeforeLoginDlytxt,h.BeforeLoginPrice,h.BeforeLoginListItemID,h.BeforeListID,h.BeforeRepetitive)}}else{h.IsCheckList=true;if(h.shoppingCartModal){h.shoppingCartModal.close()}h.AddArticleToCart(h.BeforeLoginEan,h.BeforeLoginUserRef,h.BeforeLoginLxt1,h.BeforeLoginLxt2,h.BeforeLoginDlytxt,h.BeforeLoginPrice,h.BeforeLoginListItemID,h.BeforeListID,h.BeforeRepetitive)}}}}};ShoppingCart.prototype.CheckCartFailed=function(b){var a=this;alert("Impossible de vérifier votre caddie");if(a.shoppingCartModal){a.shoppingCartModal.close()}if(this.AttachedObj){if(this.AttachedObj.RefreshContent){this.AttachedObj.RefreshContent()}}};ShoppingCart.prototype.ClearCartSucceed=function(b){var a=this;a.IsCheckList=true;if(a.shoppingCartModal){a.shoppingCartModal.close()}a.AddArticleToCart(a.BeforeLoginEan,a.BeforeLoginUserRef,a.BeforeLoginLxt1,a.BeforeLoginLxt2,a.BeforeLoginDlytxt,a.BeforeLoginPrice,a.BeforeLoginListItemID,a.BeforeListID,a.BeforeRepetitive)};ShoppingCart.prototype.ClearCartFailed=function(b){alert("Impossible supprimer tous les éléments de votre caddie !");var a=this;if(a.shoppingCartModal){a.shoppingCartModal.close()}if(this.AttachedObj){if(this.AttachedObj.RefreshContent){this.AttachedObj.RefreshContent()}}};ShoppingCart.prototype.AddArticleToCartSucceed=function(a){this.IsCheckList=false;if(this.ShowCartOnAddItem==true){this.ShowCart()}else{if(this.AttachedObj){if(this.AttachedObj.RefreshContent){this.AttachedObj.RefreshContent()}}}this.RefreshBasket()};ShoppingCart.prototype.AddArticleToCartFailed=function(a){this.IsCheckList=false;if(a.responseText){alert(a.responseText);if(this.AttachedObj){if(this.AttachedObj.RefreshContent){this.AttachedObj.RefreshContent()}}}this.RefreshBasket()};ShoppingCart.prototype.RemoveArticleToCart=function(d){if(!d){d=window.event}var c=undefined;if(d&&d.srcElement){c=d.srcElement}else{c=d.target}if(c!=undefined){var g="";if(c.id){var a=c.id.substr(7,c.id.length-7);var b=this;if(GetCookie("UID")){var f="<ShoppingCart>";f+="<uid>"+GetCookie("UID")+"</uid>";f+="<cit>"+a+"</cit>";f+="</ShoppingCart>";f=Base64.encode(f);new Ajax.Request(b.RootUrl+"FiligranesShop/RemoveToCart.ashx",{method:"POST",onSuccess:function(e){b.RemoveArticleToCartSucceed(e)},onFailure:function(e){b.RemoveArticleToCartFailed(e)},postBody:f})}else{alert("Impossible de retirer cet article de votre caddie, veuillez-vous reconnecter !");if(this.AttachedObj){if(this.AttachedObj.RefreshContent){this.AttachedObj.RefreshContent()}}this.RefreshBasket()}}}};ShoppingCart.prototype.EditMessage=function(d){var a=this;if(GetCookie("UID")){if(!d){d=window.event}var b=undefined;if(d&&d.srcElement){b=d.srcElement}else{b=d.target}if(b!=undefined){arIds=b.id.split("_");if(arIds.length==2){var c=arIds[1];new Ajax.Request(a.RootUrl+"FiligranesShop/ItemComment.ashx",{method:"GET",onSuccess:function(e){a.OnEditMessageSucceed(e,c)},onFailure:function(e){a.OnEditMessageSucceed(null,c)},parameters:{ms:new Date().getTime(),uid:GetCookie("UID"),cit:c}})}}}else{a.Close();alert("Veuillez-vous connecter !")}};ShoppingCart.prototype.OnEditMessageSucceed=function(d,b){var c="";if(d){c=unescape(d.responseText)}shoppingCartTmp=this;var a="<div style='width:100%;heigth:400px'><div class='MessageTitle' style='width:95%'><span style='float:left;'>Laisser votre message</span><a href='#' id='closeBtn' style='float:right;'><img src='"+shoppingCartTmp.RootUrl+"Images/ImageGallery/close.gif'></img></a></div>";a+='<textarea id="txtMessage" cols="20" name="txtMessage" rows="2" style="width:98%;height:350px">'+c+"</textarea>";a+='<div id="form-valid"><input type="button" id="btnSaveMsg_'+b+'" value="Effectuer le paiement" />';a+="</div>";a+="</div>";shoppingCartTmp.shoppingCartModal=new DHTML_modalMessage();shoppingCartTmp.shoppingCartModal.setSize(635,400);shoppingCartTmp.shoppingCartModal.setHtmlContent(a);shoppingCartTmp.shoppingCartModal.setShadowOffset(3);shoppingCartTmp.shoppingCartModal.setSource(false);shoppingCartTmp.shoppingCartModal.setShadowDivVisible(false);shoppingCartTmp.shoppingCartModal.display();if(document.getElementById("closeBtn")){shoppingCartTmp.shoppingCartModal.addEvent(document.getElementById("closeBtn"),"click",function(f){shoppingCartTmp.ShowCart()})}if(document.getElementById("btnSaveMsg_"+b)){shoppingCartTmp.shoppingCartModal.addEvent(document.getElementById("btnSaveMsg_"+b),"click",function(f){shoppingCartTmp.SaveMessage(f)})}};ShoppingCart.prototype.SaveMessage=function(d){var b=this;var f="";var a="";if(!d){d=window.event}var c=undefined;if(d&&d.srcElement){c=d.srcElement}else{c=d.target}if(c!=undefined){arIds=c.id.split("_");if(arIds.length==2){f=arIds[1]}else{if(arIds.length==3){f=arIds[1];a=arIds[2]}}}if(GetCookie("UID")){if(f!=""){new Ajax.Request(b.RootUrl+"FiligranesShop/CartUpdate.ashx",{method:"GET",onSuccess:function(e){b.OnSaveMessageSucceed(e)},onFailure:function(e){b.OnSaveMessageFailed()},parameters:{ms:new Date().getTime(),uid:GetCookie("UID"),cit:f,ref:a,lmsg:escape(document.getElementById("txtMessage").value)}})}else{if(document.forms.frmPaypal){document.forms.frmPaypal.submit()}}}};ShoppingCart.prototype.OnSaveMessageSucceed=function(b){var a="";if(document.forms.frmPaypal){document.forms.frmPaypal.submit()}};ShoppingCart.prototype.OnSaveMessageFailed=function(b){var a=this;alert("Une erreur s'est produite lors de la sauvegarde de votre message");a.ShowCart()};ShoppingCart.prototype.PreviewMessage=function(c){if(!c){c=window.event}var b=undefined;if(c&&c.srcElement){b=c.srcElement}else{b=c.target}if(b!=undefined){arIds=b.id.split("_");if(arIds.length==2){cit=arIds[1];var a=this;window.open(a.RootUrl+"/FiligranesShop/GeneratePDF.ashx?uid="+GetCookie("UID")+"&cit="+cit)}}};ShoppingCart.prototype.RemoveArticleToCartSucceed=function(a){this.ShowCart();this.RefreshBasket()};ShoppingCart.prototype.RemoveArticleToCartFailed=function(a){alert("Impossible de retirer cet article de votre caddie");this.RefreshBasket()};ShoppingCart.prototype.ShowCart=function(){var a=this;if(GetCookie("UID")){var b="<ShoppingCart>";b+="<uid>"+GetCookie("UID")+"</uid>";b+="</ShoppingCart>";b=Base64.encode(b);new Ajax.Request(a.RootUrl+"FiligranesShop/ShowCart.ashx",{method:"POST",onSuccess:function(c){a.ShowCartSucceed(c)},onFailure:function(c){a.ShowCartFailed(c)},postBody:b})}else{alert("Impossible de visualiser votre caddie, veuillez-vous connecter !")}};ShoppingCart.prototype.ShowCartSucceed=function(x){var z=this;if(x&&x.responseXML){if(z.shoppingCartModal){z.shoppingCartModal.close();z.shoppingCartModal.setHtmlContent("");var b="";var w="";var e=x.responseXML.getElementsByTagName("params");var n=x.responseXML.getElementsByTagName("booklist");if(n.length>0){var d=n[0];if(d){var h=d.getElementsByTagName("book");if(h.length>0){var a="";var l="";b="<div id='achat' style='width:100%;'><table id='TB_HonetCart' style='width:100%;'><tr id='categorie'><td>R&eacute;f&eacute;rence</td><td>Description</td><td>Quantit&eacute;</td><td>Prix</td><td>Montant</td><td>&nbsp;</td></tr>";w="<form action='https://www.paypal.com/cgi-bin/webscr' method='post' name='frmPaypal'>";w+="<input type='hidden' name='cmd' value='_cart'/>";w+="<input type='hidden' name='upload' value='1'/>";if(z.Shipping==true){w+="<input type='hidden' name='shipping' value='0'>"}else{w+="<input type='hidden' name='no_shipping' value='1'>"}w+="<input type='hidden' name='return' value='"+z.PayPalReturnUrl+"'>";w+="<input type='hidden' name='notify_url' value='"+z.NotifyUrl+"?uid="+GetCookie("UID")+"'>";w+="<input type='hidden' name='no_note' value='"+z.Note+"'>";w+="<input type='hidden' name='cn' value='"+z.ListName+"'>";w+="<input type='hidden' name='cancel_return' value='"+z.PayPalCancelUrl+"'>";if(z.URLcpp_header_image!=""){w+="<input type='hidden' name='cpp_header_image' value='"+z.URLcpp_header_image+"'>"}w+="<input type='hidden' name='cpp_headerback_color' value='"+z.headerback_color+"'>";w+="<input type='hidden' name='cpp_headerborder_color' value='"+z.headerborder_color+"'>";w+="<input type='hidden' name='cbt' value='"+z.PayPalContinueText+"'>";w+="<input type='hidden' name='image_url' value='"+z.LogoURL+"'>";w+="<input type='hidden' name='rm' value='"+z.GetPost+"'>";w+="<input type='hidden' name='business' value='"+z.PayPalAccount+"'/>";for(var v=0;v<h.length;v++){var m="";var u="";var g="";var s="";var B="";var p="";var k="";var f="";var c="";var y=h[v];if(y.getElementsByTagName("ean")&&y.getElementsByTagName("ean").length>0&&y.getElementsByTagName("ean")[0].firstChild){m=y.getElementsByTagName("ean")[0].firstChild.nodeValue}if(y.getElementsByTagName("title")&&y.getElementsByTagName("title").length>0&&y.getElementsByTagName("title")[0].firstChild){u=y.getElementsByTagName("title")[0].firstChild.nodeValue}if(y.getElementsByTagName("author")&&y.getElementsByTagName("author").length>0&&y.getElementsByTagName("author")[0].firstChild){if(u!=""&&y.getElementsByTagName("author")[0].firstChild.nodeValue!=""){u+=" - "+y.getElementsByTagName("author")[0].firstChild.nodeValue}}if(y.getElementsByTagName("qty")&&y.getElementsByTagName("qty").length>0&&y.getElementsByTagName("qty")[0].firstChild){g=y.getElementsByTagName("qty")[0].firstChild.nodeValue}if(y.getElementsByTagName("price")&&y.getElementsByTagName("price").length>0&&y.getElementsByTagName("price")[0].firstChild){s=y.getElementsByTagName("price")[0].firstChild.nodeValue}if(y.getElementsByTagName("totalprice")&&y.getElementsByTagName("totalprice").length>0&&y.getElementsByTagName("totalprice")[0].firstChild){B=y.getElementsByTagName("totalprice")[0].firstChild.nodeValue}if(y.getElementsByTagName("pkey")&&y.getElementsByTagName("pkey").length>0&&y.getElementsByTagName("pkey")[0].firstChild){p=y.getElementsByTagName("pkey")[0].firstChild.nodeValue;if(v==0){a=p}}if(y.getElementsByTagName("listitemid")&&y.getElementsByTagName("listitemid").length>0&&y.getElementsByTagName("listitemid")[0].firstChild){k=y.getElementsByTagName("listitemid")[0].firstChild.nodeValue}if(y.getElementsByTagName("listmessage")&&y.getElementsByTagName("listmessage").length>0&&y.getElementsByTagName("listmessage")[0].firstChild){f=y.getElementsByTagName("listmessage")[0].firstChild.nodeValue}if(y.getElementsByTagName("ref")&&y.getElementsByTagName("ref").length>0&&y.getElementsByTagName("ref")[0].firstChild){c=y.getElementsByTagName("ref")[0].firstChild.nodeValue;if(v==0){l=c}}var o=u;for(var t=1;t<=u.length;t++){if(u.charCodeAt(t)==128){u=u.substr(0,t-1)+"€"+u.substr(t+1,u.length-t-1);o=o.substr(0,t-1)+"E"+o.substr(t+1,o.length-t-1)}}b+="<tr>";b+="<td>"+m+"</td>";b+="<td>"+u+"</td>";b+="<td>"+g+"</td>";b+="<td>"+s+"</td>";b+="<td>"+B+"</td>";b+="<td>";b+="<a href='#' id='Delete_"+p+"'><img id='ImgDel_"+p+"' alt='Supprimer'  title='Supprimer' style='border:0' src='"+z.RootUrl+"Images/Shopping/delete.gif' /></a> ";b+="</td>";b+="</tr>";w+="<input type='hidden' name='item_name_"+(v+1)+"' value='"+m+" | "+u+"'/>";w+="<input type='hidden' name='quantity_"+(v+1)+"' value='"+g+"'/>";w+="<input type='hidden' name='amount_"+(v+1)+"' value='"+replaceAll(B,",",".")+"'/>"}var r=0;if(e.length>0){var A=e[0];if(A.getElementsByTagName("totalvalue")&&A.getElementsByTagName("totalvalue").length>0&&A.getElementsByTagName("totalvalue")[0].firstChild){r=replaceAll(A.getElementsByTagName("totalvalue")[0].firstChild.nodeValue,",",".")}}w+="<input type='hidden' name='currency_code' value='EUR'/>";w+="</form>";b+="<tr id='total'><td colspan='3'>&nbsp;</td><td>Total</td><td colspan='2'>";b+=replaceAll(r+" &euro;",".",",");b+="</td></tr></table></div>";b+="<div id='Close'><a href='#' id='CloseCart'>Poursuivre mes achats</a></div>";if(parseFloat(r)>=15){b+="<div id='Payment'><a href='#' id='FinishCart'>Terminer mes achats</a></div>"}else{b+="<div id='Payment' ><span id='FinishCartSpan' disabled='disabled'>Terminer mes achats</span></div>";b+="<div id='ShoppingAlert'>Le montant minimum de commande est de 15€.</div>"}}else{b="<div id='achat' style='width:100%;'>Aucun élément dans votre panier</div>";b+="<div id='Close'><a href='#' id='CloseCart'>Poursuivre mes achats</a></div>"}}else{b="<div id='achat' style='width:100%;'>Aucun élément dans votre panier</div>";b+="<div id='Close'><a href='#' id='CloseCart'>Poursuivre mes achats</a></div>"}}z.shoppingCartModal.setSize(635,400);z.shoppingCartModal.setHtmlContent(b);z.shoppingCartModal.setShadowOffset(3);z.shoppingCartModal.setSource(false);z.shoppingCartModal.setShadowDivVisible(false);z.shoppingCartModal.display();if(document.getElementById("achat")&&document.getElementById("Close")){if((document.getElementById("achat").scrollHeight+document.getElementById("Close").scrollHeight+40)<400){z.shoppingCartModal.setSize(635,document.getElementById("achat").scrollHeight+document.getElementById("Close").scrollHeight+60)}}if(document.getElementById("CloseCart")){z.shoppingCartModal.addEvent(document.getElementById("CloseCart"),"click",function(i){if(z.Redirect){z.RedirectList(l)}else{z.Close()}})}if(document.getElementById("FinishCart")){z.shoppingCartModal.addEvent(document.getElementById("FinishCart"),"click",function(i){z.FinishCart(a,l,w)})}if(document.getElementById("achat")){var q=document.getElementById("achat").getElementsByTagName("a");for(var v=0;v<q.length;v++){if(q[v].id.startsWith("Delete_")){z.shoppingCartModal.addEvent(document.getElementById(q[v].id),"click",function(i){z.RemoveArticleToCart(i)})}if(q[v].id.startsWith("Edit_")){z.shoppingCartModal.addEvent(document.getElementById(q[v].id),"click",function(i){z.EditMessage(i)})}if(q[v].id.startsWith("Print_")){z.shoppingCartModal.addEvent(document.getElementById(q[v].id),"click",function(i){z.PreviewMessage(i)})}}}}}};ShoppingCart.prototype.FinishCart=function(a,c,b){this.EditEndMessage(a,c,b)};ShoppingCart.prototype.ShowCartFailed=function(a){if(this.messageObj){this.messageObj.close()}};ShoppingCart.prototype.Close=function(){if(this.shoppingCartModal){this.shoppingCartModal.close()}if(this.AttachedObj){if(this.AttachedObj.RefreshContent){this.AttachedObj.RefreshContent()}}if(this.BasketDivID){this.RefreshBasket()}};ShoppingCart.prototype.RedirectList=function(a){window.location=this.LinkWishlist+"?orderid="+a};OnLoginSucceedShoppingCart=function(a){if(a.shoppingCartModal){a.shoppingCartModal.close()}a.AddArticleToCart(a.BeforeLoginEan,a.BeforeLoginUserRef,a.BeforeLoginLxt1,a.BeforeLoginLxt2,a.BeforeLoginDlytxt,a.BeforeLoginPrice,a.BeforeLoginListItemID,a.BeforeListID,a.BeforeRepetitive)};ViewCart=function(c,b,d){var a=undefined;if(c){if(typeof(c)=="object"){if(c.RefreshContent){a=new ShoppingCart(true,c,b,d)}}}if(!a){a=new ShoppingCart(true,null,b,d)}a.ShowCart()};ShoppingCart.prototype.EditEndMessage=function(e,a,c){var b=this;var d="<wishlistsearch>";d=d+"<orderid>"+a+"</orderid>";d=d+"<uid>"+GetCookie("UID")+"</uid>";d=d+"</wishlistsearch>";new Ajax.Request(b.RootUrl+"WishList.ashx",{method:"post",onSuccess:function(f){b.OnShoppingCartWishListSearchSucceed(f,c,e,a)},onFailure:function(f){b.EditEndMessageCallBack(e,a,c,"")},postBody:d})};ShoppingCart.prototype.RefreshBasket=function(){var a=this;if(GetCookie("UID")&&a.BasketDivID){var b="<ShoppingCart>";b+="<uid>"+GetCookie("UID")+"</uid>";b+="</ShoppingCart>";b=Base64.encode(b);new Ajax.Request(a.RootUrl+"FiligranesShop/ShowCart.ashx",{method:"POST",onSuccess:function(c){a.OnRefreshBasketSucceed(c)},onFailure:function(){a.OnRefreshBasketError()},postBody:b})}else{a.OnRefreshBasketError()}};ShoppingCart.prototype.OnRefreshBasketSucceed=function(g){var c=this;if(g&&g.responseXML&&c.BasketDivID){var f=document.getElementById(c.BasketDivID);var d=g.responseXML.getElementsByTagName("params");var e=0;var b=0;if(d.length>0){var a=d[0];if(a.getElementsByTagName("totalvalue")&&a.getElementsByTagName("totalvalue").length>0&&a.getElementsByTagName("totalvalue")[0].firstChild){e=replaceAll(a.getElementsByTagName("totalvalue")[0].firstChild.nodeValue,",",".")}if(a.getElementsByTagName("totalex")&&a.getElementsByTagName("totalex").length>0&&a.getElementsByTagName("totalex")[0].firstChild){b=replaceAll(a.getElementsByTagName("totalex")[0].firstChild.nodeValue,",",".")}b=parseInt(b)}if(b>0){if(b==1){f.innerHTML=b+" article dans votre panier."}else{f.innerHTML=b+" articles dans votre panier."}f.innerHTML+="<BR />Total du panier : "+e+" &euro;"}else{f.innerHTML="Panier vide."}}};ShoppingCart.prototype.OnRefreshBasketError=function(){if(this.BasketDivID){var a=document.getElementById(this.BasketDivID);a.innerHTML="Panier vide"}};ShoppingCart.prototype.OnShoppingCartWishListSearchSucceed=function(a,f,e,i){var g=this;var d="";var c="";if(a&&a.responseXML){var b=a.responseXML.getElementsByTagName("OrderList");if(b.length>0){var h=b[0];if(h.getElementsByTagName("WebUserFirstName")&&h.getElementsByTagName("WebUserFirstName").length>0&&h.getElementsByTagName("WebUserFirstName")[0].firstChild){c=h.getElementsByTagName("WebUserFirstName")[0].firstChild.nodeValue}if(h.getElementsByTagName("WebuserName")&&h.getElementsByTagName("WebuserName").length>0&&h.getElementsByTagName("WebuserName")[0].firstChild){d=h.getElementsByTagName("WebuserName")[0].firstChild.nodeValue}}}g.EditEndMessageCallBack(e,i,f,c+" "+d)};ShoppingCart.prototype.EditEndMessageCallBack=function(g,b,e,f){var d=this;var a="Avant de cl&ocirc;turer votre liste, nous vous invitons à laisser une d&eacute;dicace";if(f!=""){a+=" à "+f}a+=". Ce message lui sera remis avec votre cadeau. Il appara&icirc;tra aussi dans le mail de confirmation qui sera envoy&eacute; d&egrave;s validation et paiement de votre commande. Merci !";var c="<div style='width:100%;heigth:400px'><a href='#' id='closeBtn' style='float:right;'><img src='"+d.RootUrl+"Images/ImageGallery/close.gif'></img></a><div class='MessageTitle' style='width:95%'><span style='float:left;'>"+a+"</span></div>";c+='<textarea id="txtMessage" cols="20" name="txtMessage" rows="2" style="width:98%;height:320px"></textarea>';c+='<div id="form-valid">';c+="<a href='#' id='cartBtn' style='float:left;'>Afficher le panier</a>";c+='<input type="button" id="btnSaveMsg_'+g+"_"+b+'" value="Effectuer le paiement" />';c+="</div>";c+="</div>";c+=e;d.shoppingCartModal=new DHTML_modalMessage();d.shoppingCartModal.setSize(650,450);d.shoppingCartModal.setHtmlContent(c);d.shoppingCartModal.setShadowOffset(3);d.shoppingCartModal.setSource(false);d.shoppingCartModal.setShadowDivVisible(false);d.shoppingCartModal.display();if(document.getElementById("btnSaveMsg_"+g+"_"+b)){d.shoppingCartModal.addEvent(document.getElementById("btnSaveMsg_"+g+"_"+b),"click",function(h){d.SaveMessage(h)})}if(document.getElementById("closeBtn")){d.shoppingCartModal.addEvent(document.getElementById("closeBtn"),"click",function(h){d.Close()})}if(document.getElementById("cartBtn")){d.shoppingCartModal.addEvent(document.getElementById("cartBtn"),"click",function(h){d.ShowCart()})}};ShoppingCart.prototype.OnPriceChange=function(f,d,c){if(document.getElementById(d)&&document.getElementById(c)){if(document.getElementById(d).value.length>=1&&CurrencyValidation(document.getElementById(d).value)){var a=parseFloat(document.getElementById(d).value.replace(",","."));if(a>0){var b=document.getElementById(c);b.className="Valide";b.src=this.ImageValide;b.alt="Valide";b.title="Valide";if(document.getElementById("btnSubmit")){document.getElementById("btnSubmit").disabled=""}}else{var b=document.getElementById(c);b.className="Invalid";b.src=this.ImageInvalid;b.alt="Non Valide";b.title="Non Valide";if(document.getElementById("btnSubmit")){document.getElementById("btnSubmit").disabled="disabled"}}}else{var b=document.getElementById(c);b.className="Invalid";b.src=this.ImageInvalid;b.alt="Non Valide";b.title="Non Valide";if(document.getElementById("btnSubmit")){document.getElementById("btnSubmit").disabled="disabled"}}}};ShoppingCart.prototype.OnValidPriceEnter=function(g,f,b,h,a){var d;if(g&&g.which){g=g;d=g.which}else{g=event;d=g.keyCode}if(d==13){if(document.getElementById(f)){price=document.getElementById(f).value;this.Close();var c=this;c.AddArticleToCart(b,null,null,null,null,price,h,a,"false")}return false}else{return true}};ShoppingCart.prototype.OnValidPrice=function(f,d,b,g,a){if(document.getElementById(d)){price=document.getElementById(d).value;this.Close();var c=this;c.AddArticleToCart(b,null,null,null,null,price,g,a,"false")}};