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