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