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