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