var pmaWidgetInstance603e4ecfd9685ed2727e5864 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=f44cc49ba100e4ca02ea2561df359cf9:1f49225c1c6f8a7e86ed62c2f3e45fa0e2202a21ee2629d77a38c1cc291cc0410e3a78b595d402079d6d8ed59d5e9bec9b7851ddb139ff69358957db67efa56787e92ea0d8a55a04a2e4188fccdc1c596781f4319f46ee0afeb322586a30fb58b2ca67e68fa1cff007af94d420ae42b84cc7ad372d47f93df15c34d5a425def65f3319067dc455232391106d32d9c2e2173eadb7fc61de9085683df41feb0414a698aa3f0f169bb7ab885f00b0d15e8ca7c103f21705b572f023d1e719b728ec", shop_name: "Arada.sk", shop_logo: "https://y1.sk/t/s/130x50/59720.jpg", product_price: "9,09 €", 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(){ pmaWidgetInstance603e4ecfd9685ed2727e5864.initWidget("603e4ecfd9685ed2727e5864"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }