var pmaWidgetInstance6033c49ad9685ed2720c53d1 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=993bb5a06b08714906d2075b527b97b4:30c46cac248f7b3117844b6607dcd0277371ed7353843ed2274bcdf91854d36d053115249c7e06ed4eccf27c8a93b5fd9aa30adeb5d0afe1e3db5866411b51b4716a9bd676e431f379ad32c56f900a65668c557d49cf74216fa8a953e2352b3768b66abe03033c0f746e056b3f40ed89124f44ab9347ad72ffe1c09113257d6689272b8ea0d335669cb4ad63e49616592443c445b92c6e6e4cf78dcd6dec89cb3b0f9b97d602360a23635367901811dc7b259e706393b4fee82dcf49fd1baed0549e545d8fbbba5728bf78f4bd418320", shop_name: "arco.sk", shop_logo: "https://y1.sk/t/s/130x50/45797.jpg", product_price: "236,09 €", product_shipping: "2,00 €", 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(){ pmaWidgetInstance6033c49ad9685ed2720c53d1.initWidget("6033c49ad9685ed2720c53d1"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }