var pmaWidgetInstance5fc90418d9685ed272326e7a = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=cb577eea3595e72577c50b37c81eacbd:e66b18f7b03374f9797be53a9bdc10d2603ad55a132f22c2a886f147be93b4ec957694d6b959c1b2326beb23a641d5df8e211dbea4c98e0c61f846c0966986a5b7b00cc50b9fd4f3b5a076b5e288598e2d5a0b37a14c7b6c39fdd98f49bd5f5748a4a418c210f72add3bc963b3ead299c744c03ddf6d0778ad91dd23f08335a8c7e9ea0facc3c40c93862edc355ec597ec7913fbdd8c27f5b1cf429b233021cca64c6f893c72e0f8def730e25bf7c0cda4990cd74840a9221dd673ae2dd58792", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "749,00 €", product_shipping: "3,99 €", product_availability: "", 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(){ pmaWidgetInstance5fc90418d9685ed272326e7a.initWidget("5fc90418d9685ed272326e7a"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }