var pmaWidgetInstance6144551b0067a2ef59c18979 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0b527eedb88bac6fe8c895a06f7f0abd:ae59322c1253ac53de3b0153a79cfb590bf8ce4ffd88ddaec8ddca4c7efee53fe5637133668ad3f24afbc62fd4d8b4efc67d9971406d5c2fafc7d91478b9d4de4fb75cdfc2f02fc5f26153d54a35c3ada1f3e5f46cf158364615efd2785e239a81aa2b87f0849200592c6b39412c2be32dedca28153878ccc6bfe1b530cac0788fc57a41e4655adc4ef46c94ac9835d4bcbf2b125c262e96cc4dccd3d1a5ba10811c2fc1a077eb1bd3dbd93bd2c0c019859dc452253131ffba95ce345edeedad3ba28d4248a715f4879b39a9ab277126", shop_name: "elu.sk", shop_logo: "https://y1.sk/t/s/130x50/59355.jpg", product_price: "249,49 €", 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(){ pmaWidgetInstance6144551b0067a2ef59c18979.initWidget("6144551b0067a2ef59c18979"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }