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