var pmaWidgetInstance61387de90067a2ef59d48660 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=356ef428595e1a68c2ee100512e04246:50bbe10e20e0bb9bf14cb8696c64cf6429c2912eb1441fb940ab022c5d9bd281fab55b3f89e3d1538f5434da6f3f882bc6c2f11f9f43c89841f71839dba818aa2a6c732e952d3d274efb960bab9780776cafd8226a4f3c33f88b608662becfa2168c7add7ac1ad39e778bf38d865f2155e29bb9f204e04431d139859716b87831396abbdea32f98a2a5c2ce3899559a1016b37434d3adacf9a1e41d6b552c4d28fdd43938afe1d81e0b8426916c680579b28ac27a5b2e000df76476a1ed341c15d7a1d917e8c3a87778c938fb6bb98cd", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "193,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(){ pmaWidgetInstance61387de90067a2ef59d48660.initWidget("61387de90067a2ef59d48660"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }