var pmaWidgetInstance64d9bd294218328905815806 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c48b1d41c267d527a391b8a163515d69:21d0f1fe363f853060fa2a54efc570c4038999a320255be4776d390e1e44e1b62a61d9c7679ac992057cd6ab38c2c1fc0c18153e4add950c8fcc80973f0cb2a67d793c238ee0b89592a7894af748bd4398d43301ed4205cd89314873669e2db6460d3118dc55c94e3e17896d5df51ea470d9aa5dc4865b076c44c70f8a2b1c990f35651a173c3e40b1bdc8abaa34e9e27ed0cf212095850583ee5bfe1a9d5cff23d023c5258606f1d998a8199b4f7843c1056fd90ecc9ee4ce6d56b315a5108563fe5d1d974a35e22497ee9c34ca4b00", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "109,99 €", product_shipping: "0,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(){ pmaWidgetInstance64d9bd294218328905815806.initWidget("64d9bd294218328905815806"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }