var pmaWidgetInstance5fca565cd9685ed272d50b47 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=9d4e4d58813db66e1295d4a0d8671492:393281b98b89ab419cc07c58fc55434a5de1bb95b4d05f0be1759c43dfee3b4018262d5aa2d343f67ccd459addb69854a860afc16024fcef34d7c0e16b496217fbaac2de821a5162c4be8a83a4ca3d9fe4830902b6095184f9ee990f4ec7580f459453b440c2b9be451ef511359b9cae12628d2c93a13a833ab0b505121ebfcd158de1ba642328ea8dccc9f2d11a71a5a30f28740cb57f336f374c28dc7a0bb2bd61a481ae7f7c1bcb3cf07d03965ed95c0bb0e1fad05466c1b221f7bdd65e09", shop_name: "Xzone.sk", shop_logo: "https://y1.sk/t/s/130x50/9583.jpg", product_price: "31,50 €", 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(){ pmaWidgetInstance5fca565cd9685ed272d50b47.initWidget("5fca565cd9685ed272d50b47"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }