var pmaWidgetInstance634fcaf9ac365ae374549395 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=9b6ea8846d81e4a86f504920950b3147:c0e7fbb7fbcc705a5d9c995ff4c0ec5a1e7fed8f461ea637dd4d3399e3d7b2be401c18d6cf9744f6ef50bedeb9d6ee80d4f02082355f4cc1eafd9cb1146e2296f3e61aa866ff511adf107104bff7516d41ece2c14c3544aebd00543ec59707532bef31403a1d562591d31318722918288bd9afa1f74bdc1393422b8cac95d800c03286ddc321a8bfa82c74a7764f970420060dd6958de663f2c96a035da25a467ff0e665108603a7e9b137cbfac3e28596a1186b371558b2b9e8efb1d79ad806c7fe4b8871da034ebfd32dd5e9263a61", shop_name: "stavbaeu.sk", shop_logo: "https://y1.sk/t/s/130x50/45871.jpg", product_price: "269,33 €", product_shipping: "29,90 €", 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(){ pmaWidgetInstance634fcaf9ac365ae374549395.initWidget("634fcaf9ac365ae374549395"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }