var pmaWidgetInstance63e4f48742183289055ee150 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=774a80beee388fb49448fdb63d43e7aa:c2066d981df6a351ea0792f892997ab94d371c9eda4ed68022d6bcb9bf8ab549197fb0c1dc169914bd941ac765463e3410fb674df8ef98ab66300975b64c869219b572f3c639526915a82bc4429c62960d04e8d750412a2b51f908eacef65bfe1093e460d6851f2938632fef56ce1537ee161b6762d1f58108d57aba9500bafb1e46bc0361fc7136e3badbec3203ac5dbd2c5d600b74fd7e7b4b57d81d0dded5b7d546c65980641c84377843e2cb074d8f1a3a4f49e750e3cdba1fe7f7ae72f4ed9bdf7f23130cd95de7fe0f0b5bb8e3", shop_name: "klarstein.sk", shop_logo: "https://y1.sk/t/s/130x50/52719.jpg", product_price: "68,23 €", product_shipping: "0,00 €", product_availability: "", 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(){ pmaWidgetInstance63e4f48742183289055ee150.initWidget("63e4f48742183289055ee150"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }