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