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