var pmaWidgetInstance650970284218328905615673 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=29578951445248bfb97b3602cf87e1ec:02e8f28f140b9641a69733072de5f85b75abe175d2e954aeaf3b022aa2c537b0b64fc124c401c46d89a349ac52ea15a47bf90c014ef5030970cc889bc97e29259f7268b18d407a5d45af4ff4d95a3a1c5a40b63afc7997e77368af5381d5188958ff00e8a18450bf812a17da2676cb0781342ad11597a907b33fc0fe499b42f675f8cb9abc9de96f86cff58fe2bba9a9183215cc6d977fb54d205da7ad9394f5a7d001f7e066c62b90fbc45c8088ae87a70c606b1f8b5de75906e53992071fc55f2eab1c194fd47fbb933498b96bedca", shop_name: "stavbaeu.sk", shop_logo: "https://y1.sk/t/s/130x50/45871.jpg", product_price: "390,56 €", 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(){ pmaWidgetInstance650970284218328905615673.initWidget("650970284218328905615673"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }