var pmaWidgetInstance63e2201d4218328905dee820 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=06256b5203d92c1482682aef2ac6c95a:102481ce745fb3dc76c722e117f7e42687e24ec78d38ba3f5fa7215cc1a32657c51c29c8f08d0e8657112222868c35b712b5d507e7552c7f065e193306a3d76d9ba024b1e70f2d886f0959f38759ac3894281cbf0f3487c0f63689babd945b163ec7c1ff3498e8fa34cf5caf3fca8829629d3f77ab9a9a8fab11e4a44165df67cfb6a4e21dc9fff7953cd91bb4b3b8b706fb7637127e2eb4ac0d71f3b75edec9035f404c9e693ee86026bf4647952248495cfd241b7b99bd7339bee3f301d376f6150cf43934d936aee73fb72dc87ce4", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "334,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(){ pmaWidgetInstance63e2201d4218328905dee820.initWidget("63e2201d4218328905dee820"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }