var pmaWidgetInstance63ff4be242183289057e5459 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=9511ace1d4b9228e4d901e1fcd6b0095:99d84c73169105a77fec6f86d46200d780d1426ad5f48d9ef95b29e8ac6333c4e35b350397711eb72b4d96c6a01e88c018386d75514b6ed003fd04d2d5cceba51952878dc70a0dceb6d2d138129f425a68c23548059dd7fa411ba60462b821e6b529f196fc37b6fc0e2e73ce9c31069c54f87f615f3e0d5ddb78c8078dfb83b60781a593498607eec6020be9f49b5c92ebcdd9944f415bce21ee55f95716a01008f9152ee530a0cf3d75be848ea50712a4f1608538750c420595675a448325df93ee9a1ac5bd735bf5c1977aead83168", shop_name: "arco.sk", shop_logo: "https://y1.sk/t/s/130x50/45797.jpg", product_price: "66,99 €", product_shipping: "2,00 €", 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(){ pmaWidgetInstance63ff4be242183289057e5459.initWidget("63ff4be242183289057e5459"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }