var pmaWidgetInstance634fcaf9ac365ae374549395 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6f4ea3d9cba38cf1b68a5304d4837010:367ab87f602f59be29cc46f67f8b75b267d2c60b96656084a7e61de1582088c31e24ad948403d3fc009e8e20743dac6a21f5db6be6a3aaf1ccc720cf90c00deb2cb10b476c9c48ecc7a0f900bb9196457fc13bba2c5d950c0fd64bdae3bd4a8c915dbf4d33463fe8aa7bc93dcc643a9827b0e89ebd14a1567ae884959953a3dc58a7ecb4e2e57a34e882dd2f8a81c145a9e5d1e4f396f8e35c509cc3aab8353696b252ce0f81dab46efa5afa9ca93c08a97f812b6af11a1d557ad5e8cff50f5611cabdb8ab2c8f05d1eb0dd8d267e27d", shop_name: "arco.sk", shop_logo: "https://y1.sk/t/s/130x50/45797.jpg", product_price: "280,90 €", product_shipping: "2,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(){ pmaWidgetInstance634fcaf9ac365ae374549395.initWidget("634fcaf9ac365ae374549395"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }