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