var pmaWidgetInstance6037b011d9685ed27260bcbb = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=169b326122e0e61b176c50107ff6557b:b4d439ddf96459fb81ea8e9ccf9221de45fd18fa97a0f584f30e15c69faa8f37b08590dfd3eb9384b59215db86c41cb97ecb13cee92a2930753ad67159782b0529f711d60a0af7bac8d3525b04bbcb9b424cdb22ad94e7bea82f5c8904036de892399407b22da2e3c6f56f96dd67ec6c3c966f5ba9ca8a0107dd9e5fcc227b80fa9aa3cf1f71657d66d6cb45530169ac0df1016c39f45c1102a730bf25c8591b5ed548b51d0a856b40a723539bc27a542c4ab82c760a7d3aa8376ea58f5a17ce37f8ebc9dae6872b9e27f5c12d918fc0", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "517,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(){ pmaWidgetInstance6037b011d9685ed27260bcbb.initWidget("6037b011d9685ed27260bcbb"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }