var pmaWidgetInstance6357c41fac365ae374453ef8 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=491fca07ffdb5a76d495e1d5cd6e5b12:8c5f4f03b4be663c007143ae956836fa89850cac8ee94a995a10de65965487cf65b75fe4627cf5b5d9818bc93c1caf7a457551bd338c4257be134bf591a56c529bf1845b4e84248e1b9d3913b5c69dd0df5efabb07b89cb7c224d6406fd03051cec580bedf27c385f81a7e851fe29d68a84bdfb350e222941a3a81119119b4a13aee94449b4fa9dffc4f8cc2c7b8438f79e63334d603de05c195bee6c59437d7ed60ec1937a36c52174d96f7d3de5719db64d1af7fc756d313c8c8f89db59d70339f708e2da7bc5cd4fa111f6b91d62a", shop_name: "bux.sk", shop_logo: "https://y1.sk/t/s/130x50/528.jpg", product_price: "8,99 €", product_shipping: "", 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(){ pmaWidgetInstance6357c41fac365ae374453ef8.initWidget("6357c41fac365ae374453ef8"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }