var pmaWidgetInstance60cc460a0067a2ef59a13134 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=9eca9615faac572aaf1eafc63d183d39:7c32e6a882ce0d0fc3be4ee7f120a2f8590e4f646c040ba40aa8103636a1cfcaaa9101d13f648d37f33791aeb23dc20beeaf5cda298bcb8a231bfed67906c4dfda507a1d6f2664688fef114b9def1217695a0edb230a50e94d81586c9214b184d10c8176cc0a79e532f472241880703632efbecf8e830735632451e940d6e315e2bbd59a09edb80962ef7377ed99207fa4a489d1c043780ec4eee049a00e2166584066aeea5140f842f00d80cb5d7fc993cc3aac0bb7cbe36a98a0ecac4aca04", shop_name: "Best2Buy.eu", shop_logo: "https://y1.sk/t/s/130x50/60439.jpg", product_price: "48,96 €", product_shipping: "3,50 €", 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(){ pmaWidgetInstance60cc460a0067a2ef59a13134.initWidget("60cc460a0067a2ef59a13134"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }