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