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