Federal & State Law Alignment Checker

Federal & State Law Alignment Checker

Compare federal law against state regulations on key legal topics.

Configure Your Comparison

Please select an area of law and a state on the first tab to view the analysis.

Comparison Summary

Please run an analysis to see a summary.

${value}

`).join('')}

${stateName} Law

${Object.entries(stateLaw).map(([key, value]) => `

${key}

${value}

`).join('')}
`; analysisView.innerHTML = analysisHTML; renderSummaryTable(); } function renderSummaryTable() { const { comparison, stateName } = state.analysisResult; let tableHTML = `
`; Object.entries(comparison).forEach(([key, value]) => { tableHTML += ``; }); tableHTML += '
Provision Alignment Status Notes
${key} ${value.status} ${value.note}
'; document.getElementById('summary-table-container').innerHTML = tableHTML; } // --- CORE FUNCTIONS --- window.showTab = function(tabIndex) { if (tabIndex < 0 || tabIndex >= tabButtons.length) return; state.currentTab = tabIndex; tabButtons.forEach((btn, i) => btn.classList.toggle('active', i === state.currentTab)); tabContents.forEach((content, i) => content.classList.toggle('active', i === state.currentTab)); updateNavButtons(); }; function updateNavButtons() { prevBtn.disabled = state.currentTab === 0; nextBtn.disabled = state.currentTab === tabButtons.length - 1; } function performAnalysis() { const topic = topicSelect.value; const stateName = stateSelect.value; const federal = legalData[topic]['Federal']; const stateLaw = legalData[topic][stateName] || legalData[topic]['Federal']; // Default to federal if state not specified const isStateSpecified = !!legalData[topic][stateName]; let comparison = {}; Object.keys(federal).forEach(key => { const fedVal = federal[key]; const stateVal = stateLaw[key]; let status, note, color; if (fedVal === stateVal) { status = 'Aligned'; note = `${stateName} follows the Federal standard for this provision.`; color = 'text-green-600'; } else if (typeof fedVal === 'number' && typeof stateVal === 'number') { if (stateVal > fedVal) { status = 'State Law is Stricter/Higher'; note = `${stateName} provides a higher standard than the Federal requirement.`; color = 'text-blue-600'; } else { status = 'State Law is Less Strict'; note = `The Federal standard likely applies over the state's lower standard.`; color = 'text-orange-600'; } } else { status = 'Differs from Federal'; note = isStateSpecified ? `${stateName} has a specific regulation that differs from the Federal standard.` : `${stateName} follows the Federal standard as it has no specific state law.`; color = 'text-gray-700'; } if (!isStateSpecified && fedVal === stateVal) { note = `${stateName} does not have a specific state law and thus defaults to the Federal standard.` } comparison[key] = { status, note, color }; }); state.analysisResult = { topic, stateName, federal, stateLaw, comparison }; renderAnalysis(); showTab(1); } function downloadPDF() { if (!state.analysisResult) return; const { topic, stateName, federal, stateLaw, comparison } = state.analysisResult; const { jsPDF } = jspdf; const doc = new jsPDF(); doc.setFontSize(20); doc.setFont("helvetica", "bold"); doc.text("Law Alignment Report", 105, 20, { align: 'center' }); doc.setFontSize(14); doc.text(`${topic}: Federal vs. ${stateName}`, 105, 30, { align: 'center' }); const summaryData = Object.entries(comparison).map(([key, value]) => [key, value.status, value.note]); doc.autoTable({ startY: 40, head: [['Provision', 'Alignment Status', 'Notes']], body: summaryData, theme: 'grid', headStyles: { fillColor: [30, 58, 138] } // Dark Blue }); doc.save(`Law_Alignment_${topic}_${stateName}.pdf`); } // --- EVENT LISTENERS --- document.getElementById('analyze-btn').addEventListener('click', performAnalysis); nextBtn.addEventListener('click', () => showTab(state.currentTab + 1)); prevBtn.addEventListener('click', () => showTab(state.currentTab - 1)); document.getElementById('pdf-download-btn').addEventListener('click', downloadPDF); // --- INITIALIZATION --- function initialize() { populateDropdowns(); renderAnalysis(); showTab(0); } initialize(); });
Scroll to Top