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