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