var getutm = () => { var search = new URLSearchParams(window.location.search); return `${search.get('utm_source')??''},${search.get('utm_medium')??''},${search.get('utm_campaign')??''},${search.get('utm_content')??''},${search.get('utm_term')??''}`; } var geturl = () => window.location; function getScriptTag(apikey) { const tags = document.querySelectorAll("script[src*=invoke]"); return Array.from(tags).find(p => p.src.includes(apikey)); } function draw(serverUrl, apikey, container, w, o, url) { const iframe = document.createElement('iframe'); iframe.id = `cnet-frame-${apikey}`; iframe.src = `${serverUrl}cotizador?codigo=${apikey}&utm=${getutm()}&o=${o}&uo=${encodeURIComponent(url)}`; iframe.frameborder = 0; iframe.height = 547; if (w >= 769 && w <= 1279) iframe.height = 310; if (w >= 1280 && w <= 1919) iframe.height = 249; if (w >= 1920) iframe.height = 188; iframe.width = w ?? '100%'; iframe.scrolling = 'no'; iframe.title = 'Cotizador'; iframe.style.margin = 0; iframe.style.border = 0; iframe.style['max-width'] = w ?? '100%'; container.appendChild(iframe); } document.addEventListener('DOMContentLoaded', function() { let serverUrl = 'https://www.sistemacnet.com'; if (!serverUrl.endsWith('/')) serverUrl += '/'; const apikey = 'a348a98d-1382-476f-8a5a-38f6a1ce405b'; const tag = getScriptTag(apikey); const query = new URLSearchParams(tag.src.split('?')[1]); draw(serverUrl, apikey, tag.parentNode, query.get('w'), query.get('o'), window.location.href); });