var pmaWidgetInstance6357a2eaac365ae3744ed718 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2903a587f9cc3119c64ca253d16330ce:c750ea44e171253a73a58bb0ab788e7736d53ab0b900f315c94a129221a85ccb1a3064564820223c2a7c7889abfc597fe1b38931a00cae7412d86021f4575e213fa3580a719acc02607239f0ca146d7384d45460ebde5e83f85dee6448fd2eb875dccd9fb18072f9df9b06aae9abf2303af06d1978a6da172a1f08e3b812f1b5538d7ab4f9f123a396ab626c6163831199505658946f7558f18648c77a2366c2a9ebf21029dfec94598a973eae0d58c84356073ce6ee05cabed148cad630811c93818f32b6b9a0ab6affb6c27fbf73e9", shop_name: "knihyprekazdeho.sk", shop_logo: "https://y1.sk/t/s/130x50/56613.jpg", product_price: "9,44 €", product_shipping: "1,99 €", 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(){ pmaWidgetInstance6357a2eaac365ae3744ed718.initWidget("6357a2eaac365ae3744ed718"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }