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