var pmaWidgetInstance603c9481d9685ed272e4f506 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=bd23dbfb9568f7aaa79f2479b6938b55:e4933dfd5aa32a9f9f2c36ac47abc6162a1f5533c17516c89f7052e298d8abd1c05a956f2f5e7464280d26ab72f0d38acbb15cfd0c41d251e8aab99627d410324cd7e98c087fcba542026af9bcb95d762e727eb27df846794e2a0d99fa005eac23132cb695bea6206d75b67180a87b8480683ef81e7c96360322d070635ebdd543602edffb3e170339e58a5e3d07abdc0656d045ba037f6daf70e0359b572fd6584c3ee4a064165562ae9e127826ae34a7976ab60a888d0df83b9056ea26da433ca9209b4e5e6f4392fdffd8fd3cfbb7", shop_name: "bi-xenony.sk", shop_logo: "https://y1.sk/t/s/130x50/52841.jpg", product_price: "17,40 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance603c9481d9685ed272e4f506.initWidget("603c9481d9685ed272e4f506"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }