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