var pmaWidgetInstance635796d7ac365ae374e565d8 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=181bd34639af87c7d6d099cae14896f8:e83f375d1e69e509581db30c3155ac8599af22813110c138733add662c5eb249a3ef84e17dbecfc209759c1e028bd06abff8a0a80626d7a4a6f677492fe12f64ff3bbffd3081f590546595cf739b027fe2ffeb40377a93456890a8aeedac1a0669eecd72d3d7cd626acc2a1f396de5bd396c09643c66db0556b3db3c95b1704f8df35f5d7b70bb782d463b659b3e284d5cff192ef8fc64276fbb1661969b48317898d7f13e23e29b47b83ce6daca606c636c765d5fe47eef3305fb8d95f934a7e51699d89dcd023b942d4c105189bbfe", shop_name: "Arada.sk", shop_logo: "https://y1.sk/t/s/130x50/59720.jpg", product_price: "14,17 €", product_shipping: "2,29 €", 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(){ pmaWidgetInstance635796d7ac365ae374e565d8.initWidget("635796d7ac365ae374e565d8"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }