var pmaWidgetInstance63579791ac365ae374e9fc9f = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2722495fefd4edd19db62e864ad8fe87:6157a328bb380d470ed4023c76440380fc528b441d9d665355986217d9d3acee483aa64133519511d43c351f4703ce885cff59b0123ae09daec6a8caeb9755345ad01729235277f89a6299e45d33b2a46646a29a4e97bbaa3c9ba133b4d6444dcfa86bbb05ed6235831a8d5de5079ea43856e25b0588aed9f32b975e3160ce910f85bc7efd5738da4ebcb5c7c429a6b1f801ff59d2f7d8bd3b093a5e5551dafb1839829fbc928312abaae4461b46e8f18365679e5a93904bcae785aa7408268894bc3f2e50ddb0ae7f48106e3615ea8a", shop_name: "Arada.sk", shop_logo: "https://y1.sk/t/s/130x50/59720.jpg", product_price: "14,21 €", 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(){ pmaWidgetInstance63579791ac365ae374e9fc9f.initWidget("63579791ac365ae374e9fc9f"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }