var pmaWidgetInstance60b723960067a2ef59b2474b = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=54b2a8ce0a2370c6e0a76e143e5e4dfc:352c10b4414d9759683bcde3c5ac75031162e883cd903b2454e3f88f92d540406c5f47d738c83e617ac689a9841c1f2e574aa3cc2c12d35e3b914966416a738bdcea9a8ff7774aadb465d7d3a56f030e93841cedeedfa3f14d88fe88a7602a88feaac161244778879e67207bacf117c16a4a836255193b43c77a957dfedc9504bdacd4bc3461e8796cd9676b717246141e483f128f502d5c6fad961b3a93fc0914684730b7e09fdaadfa7a28e726561159f3a1e35af408ad281ee0ba0c5d3e19a8404794a161b2bf2adfca50ce5ada35", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "689,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(){ pmaWidgetInstance60b723960067a2ef59b2474b.initWidget("60b723960067a2ef59b2474b"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }