var pmaWidgetInstance613894380067a2ef59b41943 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0d3f9df508ea72415017b588baa7b3dd:503a4a2172ad4d135c1756c09536bb141b8c8fa712b5d9d3ab951f11a77de2677d112c8f61c8b560ea3bbfa3b40d3f267aa2ac8284e97b8ed76acfe9635887a244d7b474744493753e769b16f2eb2c6a3f0de99566369ada9b3b18f345af0f404d767152ab791cb48e9f14ad5e882a570c0c0d3db9a8e06555fa21e41e1e0d90cddba035e93e5cef0cddefd065c40d9f3b4b286bc4af14c655654018c757834baed37baf571869e5b2877ed919c925d089bab609a75f222d214b2347a92db14aead5ff64deafa2513357f73c5a6da6ee", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "712,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(){ pmaWidgetInstance613894380067a2ef59b41943.initWidget("613894380067a2ef59b41943"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }