var pmaWidgetInstance60585939d9685ed272ad9537 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=f195f448fe61cafdb6b3240e50ade13a:d92e54d7b7edc504e46c7160c7e1e617a02f5dda3ecf5abcda74beb6431f8732247d005b8cf172c56d228cfb559f4a27a6ab1b477128cd603872778d20003a21f09695ee4e4c4c7a8db6039842c4ca1b3717430ceacda9f506e3ab0a9cccd5a59cc655d1915cad29975677f15b6c7246fea0f1676f1717b423883bc09ace1e51d633731b6551488bd177dc963007fe5a923d604e92ccb6be5d577978279636e0ff63f028339b8e555f512c42b66098e29ec23406e738292503dd314a6efcea5f2599cce5bc2f26e6b5de70661b6f6d24", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "529,00 €", 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(){ pmaWidgetInstance60585939d9685ed272ad9537.initWidget("60585939d9685ed272ad9537"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }