var pmaWidgetInstance650991a14218328905f36f30 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=37e38d067de5e2e741b3f873cc4ded3f:3eb53413fede90e1c8e74822df768db748a7b4928475e497d21664da5b8012f5153936119b1c54b47fdde5d30270cb804f102008b94894736a7ffb86027f9631259c1eaf90e7c383918415763c2eebab5801ea5da434b368ce0453be817f69633301d2c81eaed38bcf7283db72214bba29d675e2431f43b137fb357a36745c789a490f8454d6345b1d0d4934c1891cebe9bdd2624334e6ff80ee597956b44c6a47393087c5c2fc98070b7d2905cce0165b85ff586a01c1d50ab3fff875ac183358d9223cbd15538cb754e9deb20ca7a4", shop_name: "kotollacno.sk", shop_logo: "https://y1.sk/t/s/130x50/52905.jpg", product_price: "934,00 €", 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(){ pmaWidgetInstance650991a14218328905f36f30.initWidget("650991a14218328905f36f30"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }