var pmaWidgetInstance60ddb14b0067a2ef59dbe2cb = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=97e2cb4798f19ad3536d2630e7839fa2:2cd1fd52c83d0c1e080cfd961411cf34eba95525c60d49417ca5fdc6602b1b53a97f61c681ddbecd0ada8f0eb9dcc7fd4f39028669f0eba2c586bea8d6ed71c5d0f3b55eca6911342720fd6290034f589b2f9d01be6ba550c660308fd6c76f37fe62282ace69c75bcac036c4966617e96310a07101490ec32d336ae23581c05091bce5590d60af1a33956a76af71b6fc93ccf437ac49503d80264493bdf0f78f4ac8eb05e7823fe72c693bedd6ad6c7faa2581aa3bb4e35e2e752feffb3b330d39aa07ed740e38e2b40c52ee56c9592e", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "730,90 €", product_shipping: "", product_availability: "Skladom", initWidget: function(widgetId){ this.insertLinkToButton(widgetId); }, insertLinkToButton: function(widgetId){ const instance = this; const btns = this.findButtonWidgets(widgetId); for(var btn of btns){ instance.insertButtonVariables(btn); if(btn.tagName == "A"){ btn.href = this.exitLink; btn.target = "_blank"; btn.rel = "nofollow"; } else { btn.onclick = function(event){ event.stopPropagation(); window.open(instance.exitLink); } } } }, findButtonWidgets: function(widgetId){ var currentModalButtons = []; var modalButtons = document.getElementsByClassName(`pma-widget`); for(var modalButton of modalButtons){ if(modalButton.getAttribute('data-id') == widgetId){ currentModalButtons.push(modalButton); } } return currentModalButtons; }, insertButtonVariables: function(element){ element.innerHTML = element.innerHTML.replaceAll("{{shop_name}}",this.shop_name?this.shop_name:""); element.innerHTML = element.innerHTML.replaceAll("{{shop_logo}}",this.shop_logo?this.shop_logo:""); element.innerHTML = element.innerHTML.replaceAll("{{product_price}}",this.product_price?this.product_price:""); element.innerHTML = element.innerHTML.replaceAll("{{product_shipping}}",this.product_shipping?this.product_shipping:""); element.innerHTML = element.innerHTML.replaceAll("{{product_availability}}",this.product_availability?this.product_availability:""); } } docReady(function(){ pmaWidgetInstance60ddb14b0067a2ef59dbe2cb.initWidget("60ddb14b0067a2ef59dbe2cb"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }