var pmaWidgetInstance60c89f7b0067a2ef598b7173 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=5cfe57acdd6f49315ce1b97852e4feff:d5a48255ea554b0b18d18f7851e84e48a3c3089091808207171abc29a722d5477c9bc0a1fd3dad7d52d6d378683d953f2ae27322efab432897ae28757dfc25ca954ebfd9733358d151fe1fa764a4acddc453bf7ea03421ec76851ac2d4e8c54f73defb7f98341b86c3d5249868a11bc7e27cf7fc993aa4f0c1dd773f75a6364823b7907bfe52f9bdcc23de76b1ed248a5561d6691f42ecef8b0a55c77d6f44a32e2790fc9116cfc746edde4950f98d373dc6afa33c7c52b19a38e9a32dc6c60514db232c7335b63114c0a28e0980a8b9", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "449,00 €", 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(){ pmaWidgetInstance60c89f7b0067a2ef598b7173.initWidget("60c89f7b0067a2ef598b7173"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }