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