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