var pmaWidgetInstance6040ba39d9685ed272b80c70 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=50ce2274427b35c62614b3273638da71:02f94af179a21eee3494bd187fc00253ba9f54637dd1513e44e52440dffac5f86bdf80843ce0a10d4542dfb52ef1718594b0a168592bcb1ec82598a01c6becf3ab452c430ad7e4fb0a50506dd1314d0e244d60e6f30b00e8cea3e44e5759b67fcb2828689a6b743d1a6cd412d55052ef2d8d953370f6a5dd5ee3659a89c5e867f03129a68b9d043161daddd3e71d446079320a44607b30be7fa3dc3dea2c7f5efc64da93e206d3aa2dff43848d8830903626e0fc31331f6a8a836a0a8afae17fc13060523b99ed023317e12aa8969865", 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(){ pmaWidgetInstance6040ba39d9685ed272b80c70.initWidget("6040ba39d9685ed272b80c70"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }