var pmaWidgetInstance60c7528d0067a2ef59ac5659 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=07d8338e193eb7d87c7c9f2289df4ff6:3296630a79dd0bd7fe64a890016f8315b52591743c199d8cb4f6dda021da958f19a0a359bca8ba996ed9a971ee42706603a9b2660a00c91d53d4bcb7aef26df9ce1f9787d375b766fded24e478ee16094439fe099f941776800a3e07578fbc9b760c6847bb359d11f2e9e6e3065216af1b9315f31bcc8c32d8f3e82020b587fb077b93941a60ce2bd4e198c390cf3ae937e8ffcfb8a60e6ccb514bcde416f1c9498d7764a25e8d5426f721e2b33492d55f474c985fb1294f0d4e29ab379e5ea74dff865613988a3753387ffa86e9b5cf", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "332,37 €", 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(){ pmaWidgetInstance60c7528d0067a2ef59ac5659.initWidget("60c7528d0067a2ef59ac5659"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }