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