var pmaWidgetInstance633bef51ac365ae374c17828 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=3256e0b5d9ef2bce68e92974965fb4cb:a1ff52cf20f575a3bff0180b4d3c887c288f864633e9f1226c65ad8c84a8a07476a6377e1a02cce47b321959297615f05400c291d3a4d666a9bd4fe50ee4a47025d3db9a5a8b1f11a80e72aa969e80802ac1cd64e04194e7ef78dc176857106451e25f2f334a9f7ee45332454e284b51526fb0fdb613f62dea05402683715e14669064dc1983b987025b782bf279c16922ddc754ac38ad9912b9ca3392d2d778ad77ccf0d108089a4fc198d6ecd409116a53e852cb657e7c00d31762f5fabb21f605b8b42ab7dc6009d599b6b8e85010", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "22,90 €", 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(){ pmaWidgetInstance633bef51ac365ae374c17828.initWidget("633bef51ac365ae374c17828"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }