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