var pmaWidgetInstance654ccd2a4218328905193861 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=3c2920f3ac5259b7141b28abcdf9591b:0c891d22569d253808bd3be40e4b68b4297c54d9506919d5e9ff5e0d6222e5eb976771351b0d2331ff48591d3ea30830c6c1b9899dde9de5cb81f22e17f223b66a15180422d30645080e7de0254142bd9fc56867ec08a4130008e1e6f45a011ab8dfb5eb79d166edb231d341777505f2fa3caa7acf13a7dab42c91dbfe2d5a09b77efdfd52e47fcc3d265123fcac22810cd2083a3d6196658377779916c4e7cc0c52ec6617f405858c71ef9ea0d36f532176ffffd6f883a4af59943467e8ae2932631afcff8decc8d3784f30c5fd7221", shop_name: "KNIHCENTRUM.sk", shop_logo: "https://y1.sk/t/s/130x50/6810.jpg", product_price: "11,96 €", product_shipping: "0,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(){ pmaWidgetInstance654ccd2a4218328905193861.initWidget("654ccd2a4218328905193861"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }