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