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