var pmaWidgetInstance603e24f7d9685ed27222c4bf = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6e99e22c7a8d281ff03b256b36a4f0b0:9e8b8d1c3a7e2722fd6883f3765aea77541e4cc6e5d416d3f449acc470286f152a3721793e9e46da231a7bf708dccaec2a1bd9235cacbea674c51bb4d6311fcd9fedcd5b40910f62cb61d7d23981c283bb951e6810385dbf599787a143c4e3ee9c9fcffba41c42e8b588cf1a7597f78c4fb1c85bfd54dd7277201b1e6d9aa52bff4a82c1f27afa3a1d5a58254866028d114153620735d68cc5d8eb60b26abd283720bbe06c25d6a9557621662df19a7dc8e386c5c97be4b4876d3523a9e4a055", shop_name: "KNIHCENTRUM.sk", shop_logo: "https://y1.sk/t/s/130x50/6810.jpg", product_price: "14,36 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance603e24f7d9685ed27222c4bf.initWidget("603e24f7d9685ed27222c4bf"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }