var pmaWidgetInstance6155ccd80067a2ef591fcd99 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=49dea3b1cd7318c807f8a4f9fe154918:8b2c550c464a5b3c75e851d4a4edb80126fc9e414bfc82e5bc4737e4e44aa7c90ecd60c066fe6d8a3f4c85c9ad5e9efa019ec7dbe6f3f530d3a86da2aadc497c34cac32a337770ae1fca4aae367406de933deb1aaba204b107150a9641822c6424d7f9997867b999aa48d82bcee65f5e10f70f1f841eaa5be91a5c1abb08b7d1b51bfe97fa3678434ed1f685130263c4f99176c0e50e8975be54eee2a9ec8cee121cdab975345d4f88e7b4d51b6a5798d221c7cfa376e4ae926a986a924fd13b06edfeff4a2ff262cc6060e0a4a1888f", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "158,90 €", product_shipping: "", 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(){ pmaWidgetInstance6155ccd80067a2ef591fcd99.initWidget("6155ccd80067a2ef591fcd99"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }