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