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