var pmaWidgetInstance63f9d9a342183289059b2540 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=78fb74404fd6f660f8d8687a8730d819:404bb56ed948b0b61c318f4b42c8853d240732ba7043282a4dae9aa26384c6307d775c2a38b0f286a39cb562c2d01942f3457c8614098519305d8ee7096e0e00ea8dabf1306cc4aa5c790ada25fbb41e3852d0a0290db3cd4917bec58c242038525299ac34a29bc0022d2bd34dae9a474489450c4ac8c378e66f23ccd22e8564f5f7c36244a03950500cabbf8a4356a954cf9a9b97f93d91431bfe8dcf598d6631f2e12c023888dcdbac8f7b4cc28d3fdcf0f2d349f337416d438a7164f73d3f8edf4f93a09c882c852beb170ea18627", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "823,41 €", 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(){ pmaWidgetInstance63f9d9a342183289059b2540.initWidget("63f9d9a342183289059b2540"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }