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