var pmaWidgetInstance612346c00067a2ef59fa66bd = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0ef83d401648e0b65dc3ff825dd65261:ae008b3066009736b9ffbf6915282f94102a20523d499f7d22d42359a9d376fd1defd9a259fb82f4865c6fcf80836511f3d571c87486b46b2d11e837caa853010de6525e4e4a750d01ab18fb9678a0547b478ee6abab78086a7c0336e89615d97abbb6235673f40dd3dfef3eb9043755e234b829cb369a9324b4b7bfdf8ee867c51c1f97fa07e3048c477a5a41a833f63101de16ed44a9a5c1f0eb1f20a6561ab63cac283fa196bbaee4a18a51b62ea260667dcf3373ddd25568b69e26bdd928177cbf78affac4cda43289f809def83c", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "1000 €", 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(){ pmaWidgetInstance612346c00067a2ef59fa66bd.initWidget("612346c00067a2ef59fa66bd"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }