var pmaWidgetInstance64084eaa4218328905635a74 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=bda8b7e6587926328cd829d57e7772b5:99dbdad26bfdba9477e81d3961d9d2be695c8724c59008b83c3d564251cd04e62d4fd6a7f41c6979a7f75ab049521a0bbea54c197b72fb5f8a1f23d5c877e373be633d32e2746a19b8af3a268941bd438e9e8471e47eb4cd18c2ee98f79cd1f7a5755775bffaa2bd9947d43ec7cd6dba0fbaae49e17e287911588690351e484f1133403e2cbf8ef8110b20b856bafbbe56365669e6903c23d0d7b4c3fae762c8f725604c2f3fdf721c71e14d843dd42ac0f8e10677751f3ce3f6d4aaca3495b00a3d82a945177ef8449a66a74e8a25a3", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "142,04 €", 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); } }