var pmaWidgetInstance608a72763975337b9e788617 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=336df2b555af77fd0f4c42f02a8d692c:fd333ab220e2bee9be4cf35d833970781bd9a15848a8d9f038d93083abccd90064c87a6e05376f15e9df66f8a3df50984d3ccefec5220a1419705a62b6d51c224f771d88ec5245c67d16faeac829757020188a98e731d126da33939972a75915536cdcc81e5dd14e25e964d7251d573f6a59de7272dd415d2eba641176bdeec6a87fa8e97737198811f36f19c2e811c4a2f2c173bd74aaa67ce653ea818b79cefcf00ed1e87ba3f2f502d5c83a0735743196f3bda0770478935c04080b6e60c5d3d3a47083781308f567747dfa2923c6", shop_name: "arco.sk", shop_logo: "https://y1.sk/t/s/130x50/45797.jpg", product_price: "27,50 €", product_shipping: "2,00 €", 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(){ pmaWidgetInstance608a72763975337b9e788617.initWidget("608a72763975337b9e788617"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }