var pmaWidgetInstance5fcbe9ded9685ed272ed4337 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=30f4f3b74c6bc375d4ee928d97cfa19c:07bf98c58841f2ce7492f6b8f83a6af46d6feab47fc609e2151e6426963aa1095794d689f1b1d42658a3fe42c4df9a762dd4c11c2e4907c5408ce2e2532b831c7e8e691a6cae49af595a0f23bae8d3d5c722eaa4796ea0c05395bc6c3fd4fc3ee066710ff1b64549400616cad546d40839c4cb02679a01ff3e3705e2d4150da24e4269a66accbfb783c34e1d8cea93184146e431dc20f39fffa239bba3663fb8a556b0edd0797c10734e1199dd4396d4e5253d415b7988f433ddc8855e5d81da", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "45,90 €", 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(){ pmaWidgetInstance5fcbe9ded9685ed272ed4337.initWidget("5fcbe9ded9685ed272ed4337"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }