var pmaWidgetInstance614d76510067a2ef59d8e4d9 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=fe09d7421b1b6d10406d469231833f90:053d866a87232368eb09d63850b76e3c4751e0ed086da6f799ffe5116ede7d5cc996a7c5ae0fe37d30a797850927eab9b27ed96aca0a7346333670a76b402dffc08cdb3cc1b8b6f16aa66972f532ffb1e52d6b8c5e04f9a0a856b973f309fa4c6fef6c3911ec44a5aa73d28cc57f4663c1e78980e814f9206bbd724937763ce401a3daa18c672a2c02c5cfc35221904b88b9ca9a876e8484f0b5001e53d1c61bb948b41867636a4bc747d1ce56518e73cf25308c075c1917eea30278918b1d5f54e6ebc1f096137d80cf200a5cf9a140", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "449,00 €", 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(){ pmaWidgetInstance614d76510067a2ef59d8e4d9.initWidget("614d76510067a2ef59d8e4d9"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }