var pmaWidgetInstance633bef51ac365ae374c17828 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8442bcdbf0cd6dbdfe363b7d3eb88380:42b02f2e438d6a1de416d163e5cbea0cf239b96e3a62977d787cb5fb67a2fca8c5bb42767f30181e4f385dcb6293673091553c33f779bf3d90bfc7806e09fa0f2340d1702f8ea50fb88008d63677f597ec139acca825b92ef22c4e52a6d7d2d0f8201bf037c14479a9cc07702feb3656acf7af940d570b638af68b655e9721a773fae68dbd6d5812f58ba6ab2120b1fb7144672f918bbc19472af756ba6b71deceb21822ef861b5618783f4435aeb57937a311ea4eb2fdf14448c085ca939f3593fac0240d50f78bbe840c2a146199f4", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "18,60 €", 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); } }