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