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