var pmaWidgetInstance64d4dc3e4218328905694782 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=949e68bbe7f7c7b3f199b24f636cfef1:e8583894312c5e213de1b5c680859a0455ad94965944d315331c46f12bffc21def7d9900dc91af905362f350f3dfbe2631aed503d996cf93ef6357b5b4d8d2b8089f02f45f6bf93efbc416e623e3ce26eacf77ffa14363902d5b0c9f6bcb907694a1b2ac2cd3f6aabd841c0e5194edca87ec7663ad4c069727bf6e03e48111176fe93c678e5f786d3cb3be705a3868f20599e8bbb8279dcde5ebd1e1bd9489063d2faac65c283d4c7d58b37e0a9ebf30f259378c1560ef6ec79a8e1418c87b2ab485e19ef81c76a1a1d1a47f4c9b46ee", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "467,10 €", 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(){ pmaWidgetInstance64d4dc3e4218328905694782.initWidget("64d4dc3e4218328905694782"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }