var pmaWidgetInstance608a6a013975337b9e4ccec9 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=24c436dfc03955d1c7b7b3b5c2a7ec8f:b4e2e75b1410f061b2f73150762a1556622aca790b2d4f298c5a10eac8827a4ad36d0e076b9905e800b1595f53889110d6e090ccfc6d45617e88a3684836365cf60a10d32b209b68e39ea063e3558734dfb02dcb0661eb93c78b50510f6476553bd9b223cd8a5357968711ba534044b7f8c7a8443fd0989fa306f16e5a75dd16660db7dd0acf1888a2afc8f6b021ccd403ce14d7bbed6ae4f487aea34d4839a1a5a7a8ce3d73acae5cd74986f333c8d83908cb5b5217e8274a9d5282e0ec12777a8ed9173c0ba6bf294038be32846dc4", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "167,10 €", 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(){ pmaWidgetInstance608a6a013975337b9e4ccec9.initWidget("608a6a013975337b9e4ccec9"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }