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