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