var pmaWidgetInstance6037a248d9685ed272530882 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=f39e9d6c285986be76b84d7e7cad4f07:eac0b4b3a1a3c2cd077205641af66da0d5b18790cae99ad6e38305ba5fd21051dc7b7040bf22082f44c9e63d76b79f22759bc04d046a527657dd9cf6813107179094637fa9fa935dae104a9ebb2f423442d33d72edae074c791e58d2de3b39bb8c8521f79b87a71851a64eeb2e4924f6e2c0bc2208ad9f60e185e2db8864fece231a9f7ebf08ff7dd7cbb373495b7bac2e4ace540eff43677e326a3f857f946f0e55230bcf949df410f7ba25dd99d2f682588051f9633744cfe569c2faa34d4bc88f3f4efc2f39c41bf85ad4a6912dcb", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "339,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(){ pmaWidgetInstance6037a248d9685ed272530882.initWidget("6037a248d9685ed272530882"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }