var pmaWidgetInstance63f9d9a342183289059b2540 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=e51c8824c765026bffff45409ab96dbc:7e7ad6e8da10edb0c8bb716a7cd0ae74064728af07ca41a82bb6759b1e74b16bca2b5f70d6e2cdbc048828a0df54b66f09b6c2c0afe04570d13f05c97748b5419377625ba5694e4e2081c9b569a27bd2e92388671c7423479c706298c45117ad9b5713def54108d83c834c35e19614499703ed8be0dc98da295836cb2f93671c6d86bebb6b793eee566dd652d397da328ceaae68fb7b6058fbd22b9f6e51a3f48985fa7906bf9607e9cd5e7e0fc75436287da34f08e6dea4321ccc93288dbb298e14bfd363d37a5e2679fd79a9f39faf", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "823,41 €", product_shipping: "", 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(){ pmaWidgetInstance63f9d9a342183289059b2540.initWidget("63f9d9a342183289059b2540"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }