Employee Benefits Compliance Checker

Employee Benefits Compliance Checker

Assess your company's alignment with major US federal benefits laws.

Company Information

Report generated on ${new Date().toLocaleDateString()}

${resultsHtml}
Federal Law Status Key Considerations

This checker provides a high-level summary based on your inputs and is for informational purposes only. It is not a substitute for legal advice. Consult with a qualified professional for specific compliance guidance.

`; } function showTab(n) { if (!tabs || !tabButtons) return; tabs.forEach((tab, index) => { tab.style.display = (index === n) ? 'block' : 'none'; }); tabButtons.forEach((btn, index) => { btn.classList.toggle('active', index === n); }); if (prevBtn) prevBtn.disabled = (n === 0); if (nextBtn) nextBtn.style.display = (n === (tabs.length - 1)) ? 'none' : 'inline-block'; if (n === tabs.length - 1) { generateComplianceSummary(); } currentTab = n; } function navigateTabs(n) { if(!tabs || !tabs[currentTab]) return; currentTab += n; if (currentTab >= tabs.length) { currentTab = tabs.length - 1; } else if (currentTab < 0) { currentTab = 0; } showTab(currentTab); } // --- DOMContentLoaded Initializer --- document.addEventListener('DOMContentLoaded', function() { // Assign elements tabs = document.querySelectorAll('.tab-content'); tabButtons = document.querySelectorAll('.tab-button'); prevBtn = document.getElementById('prevBtn'); nextBtn = document.getElementById('nextBtn'); const downloadPdfBtn = document.getElementById('downloadPdfBtn'); const offersHealthPlanCheckbox = document.getElementById('offersHealthPlan'); const offers401kCheckbox = document.getElementById('offers401k'); // --- LOCAL HELPER FUNCTIONS --- function toggleDetailsSection(checkbox, detailsId) { const detailsSection = document.getElementById(detailsId); if (!detailsSection) return; detailsSection.classList.toggle('hidden', !checkbox.checked); } async function generatePdf() { const loader = document.getElementById('pdf-loader'); if (!loader || !downloadPdfBtn) return; loader.classList.remove('hidden'); downloadPdfBtn.disabled = true; const content = document.getElementById('pdf-content-area'); try { const canvas = await html2canvas(content, { scale: 2, useCORS: true, logging: false }); const imgData = canvas.toDataURL('image/png'); const { jsPDF } = window.jspdf; const pdf = new jsPDF({ orientation: 'portrait', unit: 'pt', format: 'letter' }); const pdfWidth = pdf.internal.pageSize.getWidth(); const margin = 40; const imgProps = pdf.getImageProperties(imgData); const imgWidth = pdfWidth - (margin * 2); const imgHeight = (imgProps.height * imgWidth) / imgProps.width; pdf.addImage(imgData, 'PNG', margin, margin, imgWidth, imgHeight); pdf.save('Employee-Benefits-Compliance-Summary.pdf'); } catch (error) { console.error("Error generating PDF:", error); } finally { loader.classList.add('hidden'); downloadPdfBtn.disabled = false; } } // --- EVENT LISTENERS --- if(offersHealthPlanCheckbox) { offersHealthPlanCheckbox.addEventListener('change', () => toggleDetailsSection(offersHealthPlanCheckbox, 'healthPlanDetails')); } if(offers401kCheckbox) { offers401kCheckbox.addEventListener('change', () => toggleDetailsSection(offers401kCheckbox, 'retirementPlanDetails')); } if (downloadPdfBtn) { downloadPdfBtn.addEventListener('click', generatePdf); } // --- INITIALIZATION --- showTab(currentTab); });
Scroll to Top