var pmaWidgetInstance603e4fa4d9685ed27280d779 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=426a01898e4f24911dc5113f70c73e50:90c5f2090ad4da0e776bd4b112023d4a19a9e7aac53d86d88a7e169a2436320b597575b1a080978927a854de2c1b96a723a880829f133cace114caa31a6722e3bdca0a282df5108de92baf3db310c6fdd37b7d49f3c79392ebb2c94e927b178980d534db71d95bb97da0587809626eaa26005e1d6b5fc22948833a94aa0e33c57680e5accc226403ed0ea39667e45f247edb70218eb5d993e3b177a6d3e6f5d0ed458216918e1756fe087dad221bf2b4b7c094a677ceede02795b74732e15e8e", shop_name: "Arada.sk", shop_logo: "https://y1.sk/t/s/130x50/59720.jpg", product_price: "6,49 €", 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(){ pmaWidgetInstance603e4fa4d9685ed27280d779.initWidget("603e4fa4d9685ed27280d779"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }