var pmaWidgetInstance6143767c0067a2ef598485c8 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=3830277973d888386c0712e29b4db4d1:45e5572aabd23f20782dd24df88a3f6a67f7082f69222f6ecdd47e6225da71396d637afb803f9af06622540fdac90307d45b9ebfe755a6a5366770f2a8b3d672a58c8b49fd7eb8556525d208d577f1b475a784dfea120d2a67e0f7f6937eca3f98b0c3a80aa4411823cc163084b42d8b18d82a4a58591643f8261876caafecf65e989a71469de88e4fae5d4ef3b98b065f94e4637741c81397c7ee7c59f7b0777a231c99b23508ce04bcb8a9c6a1aef3aaa8c7066d8ca88d7d8fa54147323fb0dbd18b754c542876cfabb6113ff899dd", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "299,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(){ pmaWidgetInstance6143767c0067a2ef598485c8.initWidget("6143767c0067a2ef598485c8"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }