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