var pmaWidgetInstance6357dac6ac365ae374bd6e30 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=085ea0de9071b15343ad9192167fb823:1dc43b94c945eae7774d64c288270cb1ccadc16fc5de1ed9c2ef20406199b350437ff9ed21d63dd0a2189bfe5488e5c662db280fda9c2c1d690d77f7822fb5fe73f8a9fac7d298d7617c01878e93b354f654bcd7b3d7e006bdc77c14c4062eb0deddc284a84e61b44e7e90ecf513d8ec717f3173481eab9e431fd91abee2db84d30cad76a0c10885b990842e7191937fd21e084c0b4737ad480d8c39fb279468456a027f2dcaf4231e94ede5891a50d40f96fa31e008041fce9b3db401f2a2c8992958a210012e529af22cb7224c2532", shop_name: "Arada.sk", shop_logo: "https://y1.sk/t/s/130x50/59720.jpg", product_price: "11,18 €", product_shipping: "2,29 €", 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(){ pmaWidgetInstance6357dac6ac365ae374bd6e30.initWidget("6357dac6ac365ae374bd6e30"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }