var pmaWidgetInstance600af078d9685ed2725a4ef5 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=1b73599a7d3a7f20a52d5c4a34a1d71e:4b9c2b51718142606e79d8c0eb0a6d34bcad114c76eecd4dcb6dbd3ea6305afb577e56d22f5a2f4d3a2f4e9a50701726f6afd0b53dc411977242d02ec7bbd5d733bb6f5120059efff04b48cbd486370b33ba5261269b6763065027e9b73a356458931ee3eb305cc17313c6448ac9e0a24651f9dc12ced3b3285d7aa6fa7ca65c728dcef36e65d1fb6d1d1186ee58ed9c7e1d9d40346b5eba9b0ebf2e4a12c579ed24bac9547353f28e348be586b725c2e5884e4c0309c39c82044298f2cb82ea", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "399,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(){ pmaWidgetInstance600af078d9685ed2725a4ef5.initWidget("600af078d9685ed2725a4ef5"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }