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