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