var pmaWidgetInstance633d3c0bac365ae37466eddd = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=fcb9492ee8d5b501b416689c76cd53ba:fd80925073d445a8d884c93d418707c66511ccd7f2f0319e5ea78ec98cc4d89f21d41405f470ed4f7153b021a12a315b39c8f48263ae2b81a7650963521e84270904552529624e1e65840189d4107827558e9746df346e222b95349666da2816a69ab12aed0ae5cae3587c412460ec9b3f159d688cd964eca22af80b01d5d0d791849536f111fb3409ea51725db2bdc668eaf08cddb1990e1f872c916c8c843f2d8b55f8f22eab2ddee1ed8d20a92de7cbeb2f586454f833d5a24869bb67403a79bef3f6a89422a7b7923581f380ec9e", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "761,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(){ pmaWidgetInstance633d3c0bac365ae37466eddd.initWidget("633d3c0bac365ae37466eddd"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }