var pmaWidgetInstance60c3264f0067a2ef59f43f14 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=5dbbda3e8db0593c2447e421a897c3c0:44d742e3b22f81cdcaf2237b7c11809b690e698e9a7f948d9cac7e8f095053ba2147e7082b183a4a11aa83d794a1f0f9ed9192945b3b953156b41d907b560cceee63c5ad8cbaa4db8b2c4e2cb905b57f3122de92827b2b6ba9fa55963754c339d93885dd720cb5aae8830423971da4dea1d74473be2eb082740dfd5c03ed0d0eb952f4f75f6b7710a216ac4e76613d776392d72eece462075eca92b10eaadce320f41fbf605e59d51aa53323f05a8fd53c3b6cfd16be8bc4590b1ac03c86d5b99ae2c8b349631f8477079e56a322bdea", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "82,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(){ pmaWidgetInstance60c3264f0067a2ef59f43f14.initWidget("60c3264f0067a2ef59f43f14"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }