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