var pmaWidgetInstance5fcdedf1d9685ed27219cd50 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2aa170305011fc6613867ac903368d6c:8ca6bfef1cece7160f605fff8ffdbfb00730143f13fd45472ee15d3004e0bf8f0ede40e186b4321df08afb5c1139ef50ece8e5a01f6104c1d500084a3e7e540f411fc6f9421ba2e888bc8d4bb06b4ec806e8dffecd5d7f37636db4c1633ba193e84f4772178809bce91a5905bce36c19d5b5c6cb7f8d50d6e38da4c2602effbc6c18e97771c72b03d93127e2aac62306c70b1edb1672180050ef54f1ef3fdd47699feb22523ae0effda11476a97697cc0563a0f58672e3420d4fec99d1c48beff576a04ea124a70e9ad57f69728c61ff", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "75,58 €", product_shipping: "1,99 €", 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(){ pmaWidgetInstance5fcdedf1d9685ed27219cd50.initWidget("5fcdedf1d9685ed27219cd50"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }