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