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