var pmaWidgetInstance63466804ac365ae3749ab6cb = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b2bb97fa68d80671f5dc5c780a87c22b:695c3afcbcbfb28c885b1bc436e78d166504240ee68dfe5f0c81b64d38ad77de1602cef71c8c7785d14fb03b5acaf0dd0dfccab111135df56a4a4f50a1406e1dce8d108b68c96fca54640ca671843e587d0c70bf9b2c173a6904a13854de3823f57880731a7869645d3b53e25d7f7e2b65132bc717eb964cf344bdfbf9d32f9f4fbb6445b4522da5fe6b098f21f689bcb25143194b4d277dd60c893b131f8d62750b1bbc29e2aef523e89b142e0f7b76304f47c7121bfb96cb3fcaa3b41503b48fdb438571b3186cacf9030b0071f02e", shop_name: "lacne-nakupy.sk ", shop_logo: "https://y1.sk/t/s/130x50/6164.jpg", product_price: "819,00 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance63466804ac365ae3749ab6cb.initWidget("63466804ac365ae3749ab6cb"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }