var pmaWidgetInstance63625fc6ac365ae374a380b0 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=cfdec8ce690814eebf8ef7cf5378dfde:612250575742d48cf39b4486be8924f2e275040db885fc9f88847f61447a47050a5446697f3cbed39a593af8bc9015af0488aee6f8bb5fab66715769ea9dc44c64ca9d2753529e2a241c8c3263d5576bc704b840f659a58694ea5ff209a1cbcb16e527cd487fbe152654b10fd4a8ecf36372ff183bb585ef5c085f6ee72b236d5e71c90a29627dcf0c0caefb9d5bf2c081c6c680deb9aefbe54b2787f8a6e509edeeb77b4d95e4b98a1911b9010e92d670f94878699dd2bad2a3a451b7b2fadbaacb5a8f60c52482d201d7d373f53b72", shop_name: "pneunaj.com", shop_logo: "https://y1.sk/t/s/130x50/52071.jpg", product_price: "622,40 €", product_shipping: "", product_availability: "", 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(){ pmaWidgetInstance63625fc6ac365ae374a380b0.initWidget("63625fc6ac365ae374a380b0"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }