var pmaWidgetInstance64ba5a5342183289057bea1e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=f8717d23e1d4ef53f1ca503c5465fc14:452a37cd94193a4e4ea13fe2da9e407b306585246e4decebbfd08548e3792c153c5d194abb069a9bc4c97d2303b173a645262f76d4b518ffa523833e2b6daee76d85f8971c00428bdaf469ca651af98968a32e3190ff1148e6d500285cb0d2bb6370cc3dc8d2d6c37a6fb1cbcc3258cfaa4d5cd097c7428a6c2fdd22b22c3f131edc2a0aaf084aefe356946709db8294f66bb6449cae689dd6ff454f97823658999265b8b24ead61e6d99514cd05bd823a4abb0b21677e1107781d3c7e2f596f01e86582bd0c4208c26998988c74917c", shop_name: "stavbaeu.sk", shop_logo: "https://y1.sk/t/s/130x50/45871.jpg", product_price: "734,40 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance64ba5a5342183289057bea1e.initWidget("64ba5a5342183289057bea1e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }