var pmaWidgetInstance609e5f960067a2ef5970dccf = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8c5b4f7ee30ed452c8caf7aeb19198d5:8db9113cd2c0c72f998f8ba4c0021974924821217a4df2081bd86fe8a3de2f06f736ce89be579d8c7f4362ddbe1a02057cd44463b271808dd005e42550a421018c648a3fdc84ae83d2fa0136d1297ecc8c3e3117f1486a723bdf7080c8a9a11aecd9a99cf54a9115fa9090b7802df1626d314ed82b472789be0bfaed0f41f8e965a84b67470bfa43d2beeccb7625a8457fe8b88c9efa88412c0e665efe52081c48681c473395056e725f7e0686d6363d9acfdde4ea475dbdb0a8631b3dd3d6993e11e229eebfd3dd52aa557c824fa2b4", shop_name: "sxt.sk", shop_logo: "https://y1.sk/t/s/130x50/58114.jpg", product_price: "440,00 €", product_shipping: "", product_availability: "", 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(){ pmaWidgetInstance609e5f960067a2ef5970dccf.initWidget("609e5f960067a2ef5970dccf"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }