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