var pmaWidgetInstance64ba5a5342183289057bea1e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b9f6bc6344d08480466f84ab00b2744c:73babdc741b596bb1a881e6254dfa822bf485a4feabfa39ddd680bba8767cbb9aef704220f84a70ddaa29e6334ba74892a76ec00787acc272275d5cddcd67fee7e495d292e2cb4819b111f42b7468fdaf599e0e85a0d8ccd8d3ea16a6210828d2bdfc8f6e417b08f278f0cf609c4fdab9253e16adc56e5a3c8c11ae4bc2c53fc14e4d1eb4c187fe8f8957e38e7ef0b08f2002d573715637b124341fae9e2cdde14f007b11f83522ca186f679699c82d80c758789cf0353869c1940eed095bdeae33219577fb0262a3f59e901330975c7", shop_name: "stavbaeu.sk", shop_logo: "https://y1.sk/t/s/130x50/45871.jpg", product_price: "720,01 €", 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); } }