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