var pmaWidgetInstance6038e7cfd9685ed2724f6b18 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b23b96d5a98c02e0a435aa938cc139cc:a3ab0d4d80e6c14dfe9062efbffe1b09911acf51cdccd679c03a73bc15d4cb07cca02e97e198f32035c8e096b4057b03b32dd72915a8a8f2c5cf433a43ad4c63c541ae6f9a6c6a2d64c627b29ee7a718c8e283a4d245b1d617402132d4aa068121a244208431d1454f77b576c4be27629d8ab03fb7412356aae999659a9a56df3ea527c0ac8b505410c2f0f567ae3c6bc507a5acbd715ad7b310155b8bb2c8d80e4d9b61e9e8480840fe1623f235418dc48f5406f650a967f1e2e7752d9778a74a4e6f00e30266eee732ae62d337d3a4", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "111,90 €", product_shipping: "", 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(){ pmaWidgetInstance6038e7cfd9685ed2724f6b18.initWidget("6038e7cfd9685ed2724f6b18"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }