var pmaWidgetInstance63f9d9e542183289059c824f = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=62c95ec4b40b03778a6b57f22826ab12:a011e798b1ef1ebe872965a854d4d1cde6d8962ed371591863d1e9b3dcd0ffed9c94c90ba0c26a2047907dc444d6bcf58d81bbfbb322204922457168dc274ca20dd3dea53e7d633adf321c9c10a32a9771358b359074837578524f90bdcefed3169989c110f5fe5900719b3049517b1b2c64690c7efeb0a5d204c7aa5e90b0d3069cc2875e00fbdfc3ed3cbba5e55fb366919248ca73bf35f2e1672c7f3a514957013c3f6761277111c595e0321a10c8801e59dc113d200f6aa8471e3bf01eed9d01ff28226e6823ec8f84d3fe6efbc6", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "87,16 €", 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(){ pmaWidgetInstance63f9d9e542183289059c824f.initWidget("63f9d9e542183289059c824f"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }