var pmaWidgetInstance613878870067a2ef59a1deb9 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=750819ce2cc30805b4891de060cf7d73:aca48493e6552f20c096cf8141a89a2829551085abb5c768804957b64e20dee6548ab350458ba734ce9e92fa660ed0f7e5d9426658e6f84b91aed07bddedf891c0af895c2cbb1782f21c1c3564381344a7425499bbc13c15d0d9bd739b2917fcf804ca0a11d092b2130288a13c636ee83d85a606d4977b89cfebf5bd2b1c8fcd5283dd1529eabffc9c66bb00d2647e197c057c589f0b4b78e678fb17b32996bc6173a7963406c261022e589fb5e5192459b37c92eba5bb7fa8ed6d9d6360775865d7b064b19a29ff67d7a12c32a6e91a", shop_name: "madmat.sk", shop_logo: "https://y1.sk/t/s/130x50/903.jpg", product_price: "450,00 €", product_shipping: "0,00 €", product_availability: "", 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(){ pmaWidgetInstance613878870067a2ef59a1deb9.initWidget("613878870067a2ef59a1deb9"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }