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