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