var pmaWidgetInstance6094128b0067a2ef59a332dc = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=1c78a6c3f9cc9261393c422e90e88245:b89648715706ef9aff13e458908e9bdc574876e9dd317a0be4a2f48f7b321508ce94b424cfa45fa8ba87f22b17c7eba18e49cad16e17be42a3ebd4a2557dca77f6b5838e917d5aa03a485c5befd633cb778ba895509e48bf792839ae10f97c9c750b389f0c5292e4153a99c9fb952df191f9b8977ca6b9b2706e94a1dd0ab47d20f2b88abb45484f92386b5764e433242c388dcccc747fa82973b1e393147756b35e51d14fa591d1205121f22e939214fb2edc4ca41d9cbf5a0a461c1c469eeca1d1d17e4af5a4d90a70e6a102c416dd", shop_name: "predomyazahrady.sk", shop_logo: "https://y1.sk/t/s/130x50/47035.jpg", product_price: "508,05 €", 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(){ pmaWidgetInstance6094128b0067a2ef59a332dc.initWidget("6094128b0067a2ef59a332dc"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }