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