var pmaWidgetInstance609cd4490067a2ef595b4589 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ca1dc23bfd7cbe8f446b02827de4bb04:631116111836b8ca3c748ee3a2c4705acca6cc2432a07524c08d170217a95edaff2b64d2044da5e6041c9d0bfb3c5868c31207f4a0e603e293cbae4bacd4df5216badf38923fe9d5b32a387ffac12caf54483030bf6c580249bb139e9b1ee394771ef8cb00b110951992f9566757780ccf9defba7fa5c1db7dfa691ad27a49b409a5c57974e84f24776b83a704bade4d1e869f1cd59ef3b2f20d3b0be02224b38f82e6295aa88a5793528d276ed98c4c3d8eaf0e8902e6c5c48b930ae98d18b5845c35e8d9d78345de79ca823f6d21ef", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "512,39 €", 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(){ pmaWidgetInstance609cd4490067a2ef595b4589.initWidget("609cd4490067a2ef595b4589"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }