var pmaWidgetInstance64084eaa4218328905635a74 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=169ecbaa1ddda1d3ff0a4aa9216de8ea:0133ea9fe6391a361370e2f082ddedd87fb43502e317e620241d32d3134c10c16fdc03a8877df5068d5b6768f2cc13e4ac80c1d6385137f1ba99da5ac03d917a8acb8be446bcebfff4218a77a016ed4498842233292cd783c2e5f471dff64a2e32ee9e577239fed804500e07e319953e7300fbd82e825f5950dfcce88b8d963fa79f637477262af46923f28b45716b8e3f574dd3cfd569b42c2c4083d67aeba8b1b8b6a2149fa18a6a6a77f577c6e451706ffe926c5fc1afc88dc3a73bfb8ad842d6bc746eeff0d2005830650c1d6c98", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "173,03 €", 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(){ pmaWidgetInstance64084eaa4218328905635a74.initWidget("64084eaa4218328905635a74"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }