var pmaWidgetInstance6102ad4c0067a2ef598f4a2b = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=48b64a274f131d5693bfc7e1de1d4f54:1bc6838405d2fd051c4ddc2cfcf9f771e07d7e6c328a4d049cf7407bc0b68c5c6adf9f9d25429ef8452c359dcf2a2e96f4bfd0a230225dd3263bd016753d03163783653c6e4165c2c6b13b42ad9be7b88bcdcb6f0dd7fa8fa7ed9ee227843c54bb953a165a2cf75922a645f2b5c02614e38583effb6f40e7541ecb94bf528d28f0bf0c7928f50d7d2d9433f2fd8d22639d3ea8fcb56022e82d361a29cde0486ea93b265a647e83635a8ee95aec55805ebc9f1086d82f32e0ff43650fc1c1a55363a82e5cb1dcf57cd1bd5e46f5aa4a36", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "754,90 €", 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(){ pmaWidgetInstance6102ad4c0067a2ef598f4a2b.initWidget("6102ad4c0067a2ef598f4a2b"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }