var pmaWidgetInstance6144fdfe0067a2ef599f91e0 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=65dde695c6a0a3aa98bcf5b0289ed856:5cc97b12a619bef5b0f7138af2afbedf595bbd74e0497de15b07eb8e1ff31a2aac9ff59c4b85695c1a776de3a53b606f59288d4fa96c70e21c2e867f3919c0469e093c21ab42d601a89d1d2f1663250293d97dac162500965db19495d915a7f2642bae058303bd6fd9ae45aae1312516cadfd2112189021a70a327916ed159f9ae8ac3bf507d7aa9a14e1f871519dfe1419131a4274f20cef69823badc2fc5b9e477b39abf54c1696c3dd708b751a18cb2d8dac121f965a06ab237ac7c96f80444816e6f7074a18b45a2cda6477bc1d3", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "1000 €", product_shipping: "", 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(){ pmaWidgetInstance6144fdfe0067a2ef599f91e0.initWidget("6144fdfe0067a2ef599f91e0"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }