var pmaWidgetInstance5fcdedf1d9685ed27219cd50 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a2b54482b0e4b3e502d8c99a00af6d03:6896a07132638028433923e9a26b44e3efaa62ef465d96e3f0c69e9b43f91a4267c54638d988123ba30039d7fb010748c25c5354fd404af6bb8eaa0f89bc8abefa6b22a4c9be955e6e0481c9168489bb713a0956de02e99da65ffea4974dec3f8b7de6f6c31584f00babb0ae5e4b71e4008a876e10a43b77b5ef62d0ad87c6ef108997550b8e5d4a42218f6e39668cfe3a69c0b895d66b42044e72cacd685e920fcacaa7d063f9642732b33852d46e157754c4fc8b982fb9eaf00721847530ebfad720b4a5d3d27e18f0c3f8c9c46ab1", 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); } }