var pmaWidgetInstance607e8b4bd9685ed272a65444 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=651500b5dc2a6462e0733f736368981c:61799483aa7a1b8978c39d6d346a7d2a673c92125d2d06dff35cd9ce3e92570b1a7168ca446bc9dd293a34d7bf9c0f7d48010abcdd0043603ce6911e2f40dcc6e58204d10166da038db958555cf73e63edf6c79d90e116629697c20d53c8e69b1c151665833e3d431ce7c058a1d7397c4146e96f1b1ad1b6c262b66df909b21d98d8ba91dccb85735db6525136a1ba285a42878d73738f251376f4b5c292c272f58a91c9a65b1f5c4fdb2da07889a1e762d65290493c02645a609c7a43d209e7c42eb3ec6f6b43c1cc96d36866484491", shop_name: "elu.sk", shop_logo: "https://y1.sk/t/s/130x50/59355.jpg", product_price: "249,49 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance607e8b4bd9685ed272a65444.initWidget("607e8b4bd9685ed272a65444"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }