var pmaWidgetInstance634fcaf9ac365ae374549395 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=f6736257120f6da371c541a314d3ed17:bb89adfe68b8adf9f47f99841db43931f4d7783853bfc691ae43a90cd05d94aac6b5ec8d3407b16c8a3056d32235fb208235fc3ca06aaedb3e2a3157f84e38ba3f56b0019d9ab074af69c2f9c26211b3ba6190ca231ac902e3fc1f02ab4384530ee8a5c5281cf32b48634ba5be796e72473d293cd258fa1ecc3120863c6891c91205ef4a97c245b973488c97da4cc38bc29809bdf5f40334bc83e6ba88950520c543bba195411835c7b0fb8e5f329f6b86f15787ef87fb2e36d907dc4a7764c682c5b7fae02b9f97707404cd8d964f46", shop_name: "stavbaeu.sk", shop_logo: "https://y1.sk/t/s/130x50/45871.jpg", product_price: "250,62 €", product_shipping: "29,90 €", 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(){ pmaWidgetInstance634fcaf9ac365ae374549395.initWidget("634fcaf9ac365ae374549395"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }