var pmaWidgetInstance605ef80ad9685ed2724dada9 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=7015fa8fcd08b7542ba51e113607c94a:4bfee82a242d0aedd8fbcea9f7472738e95b867fe2c34f0227756aedb0fc3351daa15f196d3f545251f1d8b28834449f1acfce22e62afdddd0dfe4e82ecb36c10dfce8fefe95a5fcdeb5bceb7d9e25f2aa202fe9c43890a38b57086165923443d92898ec626b159bdcb0e833b133eaff9bebf4f3c1abfb2c9a68b89d2528359eb84437e6a02c1b39b6f7e56b4d58f207067302faea2dcb17314e90d67be260d1eeddc763d8fd5422f3c99971e25ee0eb17d6287e5ce732d792474e3c5f1abbaa6adb61ec6b2c97cdac4f819bb97f59de", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "158,90 €", 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(){ pmaWidgetInstance605ef80ad9685ed2724dada9.initWidget("605ef80ad9685ed2724dada9"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }