var pmaWidgetInstance5fd0c284d9685ed27297fcc9 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=3609f2007ce5a599743ec6e47bc56782:2fd5a12179c1e28ddab762112e3beaee4226414cbd4dc5da63c1d46fb7516c7ca004fc7b391065987463514e1e595eb3c8a90cfe7888e3e0c206e9323776fd9d82736bb67363a6bb8952a2331bf14c3d7d00b5909ff140713a0e538dbfb1ea4b506388a8cb510dfe06cbc0553388e295aff123fb108f0cd877154084c2fa1c2e93656fc2c343355562f92b8cf485c90e8f4de73ed67d1b1598b0c64decf8a69371eeb24e6525da932ed1e83b4bf7ee4cbda70a6897dd3bb2382323e0c0f178e1", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "141,74 €", 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(){ pmaWidgetInstance5fd0c284d9685ed27297fcc9.initWidget("5fd0c284d9685ed27297fcc9"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }