var pmaWidgetInstance616413c5069a975de59b32cc = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=47ddba26ef8967637169ee8d731c8e53:7e165c864a33aab1c9b5d4d9dc3839c8b603f35f0279462e9a980ae7f645140dcc40734fa7a9f5e79fc4f35b87bc7838eb697a811b5eb623ffd6347c2bc3903c8094536002b2f03e1e29dda5e22a25fe361065b2564b84fbf602c6348ee564fffd031e6fa32b440ac8aaa3c4195c4c1486009dd22edb79b47c97c92ccefcd2e4df2f00250019f07835a851b8f600af9c23366d093ad097c065034f521363d58a4f4e9da5445f5853f3d69313f828c6922f44d300a3c75f0d85ed5f0007a55e6d50b5caa6e35ae51c359aeebd688fa075", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "610,00 €", 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(){ pmaWidgetInstance616413c5069a975de59b32cc.initWidget("616413c5069a975de59b32cc"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }