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