var pmaWidgetInstance64084eaa4218328905635a74 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=1ff6c609914f28062694afd19580e95f:3dc1cd0da757430f02facba37134ac24732d09a74dfa7d2ed4899b63c8d7e41a7539a6057dcced6561ec3e2abfb5152246c0041d30ba0db48636d4e409e8b7cdefcda45e49ab01a74823a1866f0b27075642e27e766d2c957aa714ea235d396d95f71fcbc7fdbeb33a450eb8dd36ec50d813cc321883e72d8be8b56ef5974491a2dcb15af38ef4dd89c9d4bed2f1a197802ad90e65b4d3570fad515bb914b762bfba3f34acc3a5fb4ee4308022c5251c7c04fd2ac3c231fe5522360902c0261fcb7b1b7c4261520b8478b26f8d3338c5", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "164,65 €", 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(){ pmaWidgetInstance64084eaa4218328905635a74.initWidget("64084eaa4218328905635a74"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }