var pmaWidgetInstance6040c7d5d9685ed272edea88 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=e2aabbe53f7d6667fb01bc6c6cba819d:1bf5f53f530e4921961ec9c8226278c3aaf3b83aad71a3bfad72914c1d9f6b4a6e612b432c7c4ab7d6168c28e4fb980963046058a1395b4a6e7355f08a4ea556d32e265fa4c9099a9bb61a27d8cb1f6cd313bd9746386f075d3f60a87f18e7d0169a0e0c1a4ea25d88c1d2b74900afe45cb3cb36ceed0623e430046ebf17d63101c85610b100ef5d9bde4223f4c7208ff522439b0b469d256cd231b9a6edec3b9042552f07ac43a3560a4a85e071919cc6f0a33ff8aa8510dfcbac557e481a339c8118ecee676ca98282a39597a532ec", shop_name: "arco.sk", shop_logo: "https://y1.sk/t/s/130x50/45797.jpg", product_price: "61,14 €", 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(){ pmaWidgetInstance6040c7d5d9685ed272edea88.initWidget("6040c7d5d9685ed272edea88"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }