var pmaWidgetInstance601271e0d9685ed2729395a2 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=36939a636a013a2f80f28d59a79c2216:6bf0e8d982b65617e3a9bb42a4ca4a856d1168c5312209bb87870850ecb0dbac83c6f683bc3994c445952fe5df0e17c7d34f365d728091b6e3fb96e843d7643a9063754ca9abe8c2fc8c3526ff5830d18bec22f5d91c31808368924f5cf4ac5acde3ca32c9991a572d00ebd9a62a515e16339e209a7843af45b99334b2b19e556df168f6cb736e8a82013265bd5404c3f1e0192e1e5581c75b80a0ce7743338f5c0590c768cab6a500887921f0c944d79a32c9e499440a4216914db552688653", shop_name: "lekarenvkocke.sk", shop_logo: "https://y1.sk/t/s/130x50/57146.jpg", product_price: "6,22 €", product_shipping: "2,19 €", 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(){ pmaWidgetInstance601271e0d9685ed2729395a2.initWidget("601271e0d9685ed2729395a2"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }