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