// Obituary data from Muskogee Weekly Phoenix 1907
const obituaryData = [
{ lastName: "Bailey", firstName: "Frank", pubDate: "3-Nov", year: 1907, secPg: 1 },
{ lastName: "Bailey", firstName: "Frank", pubDate: "16-Nov", year: 1907, secPg: 6 },
{ lastName: "Bailey", firstName: "N.B., Mrs.", pubDate: "31-Dec", year: 1907, secPg: 6 },
{ lastName: "Bassler", firstName: "Thomas", pubDate: "21-Oct", year: 1907, secPg: 7 },
{ lastName: "Bates", firstName: "Albert", pubDate: "25-Dec", year: 1907, secPg: 1 },
{ lastName: "Blain", firstName: "William E.", pubDate: "13-Dec", year: 1907, secPg: 8 },
{ lastName: "Bogle", firstName: "W.B.", pubDate: "26-Dec", year: 1907, secPg: 1 },
{ lastName: "Bradley", firstName: "Maggie", pubDate: "26-Nov", year: 1907, secPg: 8 },
{ lastName: "Bradley", firstName: "Maggie", pubDate: "27-Nov", year: 1907, secPg: 3 },
{ lastName: "Callahan", firstName: "Elizabeth", pubDate: "22-Nov", year: 1907, secPg: 3 },
{ lastName: "Campbell", firstName: "M.S.", pubDate: "19-Nov", year: 1907, secPg: 3 },
{ lastName: "Campbell", firstName: "W.E.", pubDate: "21-Oct", year: 1907, secPg: 1 },
{ lastName: "Campbell", firstName: "W.E., s/o", pubDate: "21-Oct", year: 1907, secPg: 1 },
{ lastName: "Coffman", firstName: "James", pubDate: "13-Nov", year: 1907, secPg: 8 },
{ lastName: "Coffman", firstName: "James", pubDate: "14-Nov", year: 1907, secPg: "1 MWP" },
{ lastName: "Crain", firstName: "Addie", pubDate: "15-Nov", year: 1907, secPg: 3 },
{ lastName: "Cummings", firstName: "R.P., f/o", pubDate: "28-Nov", year: 1907, secPg: 3 },
{ lastName: "Dog", firstName: "White (Chief)", pubDate: "16-Nov", year: 1907, secPg: 5 },
{ lastName: "Evans", firstName: "Bob", pubDate: "28-Nov", year: 1907, secPg: 2 },
{ lastName: "Evans", firstName: "Robert", pubDate: "24-Nov", year: 1907, secPg: 1 },
{ lastName: "Fazos", firstName: "Christ", pubDate: "29-Nov", year: 1907, secPg: 1 },
{ lastName: "Ferry", firstName: "Dexter M.", pubDate: "12-Nov", year: 1907, secPg: 1 },
{ lastName: "Fouquay", firstName: "Mr.", pubDate: "16-Nov", year: 1907, secPg: 7 },
{ lastName: "Gardner", firstName: "James", pubDate: "25-Dec", year: 1907, secPg: 1 },
{ lastName: "Gates", firstName: "Lillian (Wilson)", pubDate: "20-Nov", year: 1907, secPg: 2 },
{ lastName: "Gilmore", firstName: "Alexander, Mrs.", pubDate: "17-Dec", year: 1907, secPg: 1 },
{ lastName: "Gilmour", firstName: "Alexander, Mrs.", pubDate: "17-Dec", year: 1907, secPg: 1 },
{ lastName: "Gilstrap", firstName: "Ike, Deputy", pubDate: "13-Nov", year: 1907, secPg: 1 },
{ lastName: "Glass", firstName: "Charles, Mrs.", pubDate: "24-Dec", year: 1907, secPg: 1 },
{ lastName: "Godfrey", firstName: "Thomas R.", pubDate: "27-Nov", year: 1907, secPg: 8 },
{ lastName: "Greely", firstName: "Richard", pubDate: "21-Oct", year: 1907, secPg: 7 },
{ lastName: "Green", firstName: "Thos.", pubDate: "5-Dec", year: 1907, secPg: 3 },
{ lastName: "Groves", firstName: "H.J.", pubDate: "3-Dec", year: 1907, secPg: 1 },
{ lastName: "Guerra", firstName: "Webster S.", pubDate: "3-Nov", year: 1907, secPg: 2 },
{ lastName: "Hair", firstName: "Charles", pubDate: "4-Dec", year: 1907, secPg: "1, 8" },
{ lastName: "Hair", firstName: "Charles", pubDate: "5-Dec", year: 1907, secPg: 2 },
{ lastName: "Hair", firstName: "Charles", pubDate: "6-Dec", year: 1907, secPg: "1 MWP" },
{ lastName: "Hair", firstName: "Charles", pubDate: "12-Dec", year: 1907, secPg: 5 },
{ lastName: "Halan", firstName: "Michael", pubDate: "29-Nov", year: 1907, secPg: 1 },
{ lastName: "Hanson", firstName: "George", pubDate: "11-Dec", year: 1907, secPg: 1 },
{ lastName: "Hanson", firstName: "George", pubDate: "14-Dec", year: 1907, secPg: 1 },
{ lastName: "Hearness", firstName: "Emma, Mrs.", pubDate: "26-Dec", year: 1907, secPg: 1 },
{ lastName: "Hearness", firstName: "Emma, s/o", pubDate: "26-Dec", year: 1907, secPg: 1 },
{ lastName: "Henderson", firstName: "Lon", pubDate: "14-Nov", year: 1907, secPg: 1 },
{ lastName: "Horne", firstName: "Mary", pubDate: "10-Dec", year: 1907, secPg: 3 },
{ lastName: "Huey", firstName: "John D.", pubDate: "15-Nov", year: 1907, secPg: 1 },
{ lastName: "Humphrey", firstName: "W.A.", pubDate: "21-Oct", year: 1907, secPg: 5 },
{ lastName: "Ince", firstName: "Frank", pubDate: "27-Dec", year: 1907, secPg: 1 },
{ lastName: "Ince", firstName: "Frank", pubDate: "28-Dec", year: 1907, secPg: 1 },
{ lastName: "Ince", firstName: "Frank", pubDate: "31-Dec", year: 1907, secPg: 1 },
{ lastName: "Kelley", firstName: "John", pubDate: "16-Nov", year: 1907, secPg: 6 },
{ lastName: "Kirk", firstName: "S.S.", pubDate: "16-Nov", year: 1907, secPg: 7 },
{ lastName: "Landham", firstName: "Edward", pubDate: "26-Nov", year: 1907, secPg: 1 },
{ lastName: "Lane", firstName: "Thomas", pubDate: "29-Nov", year: 1907, secPg: 1 },
{ lastName: "Lawrence", firstName: "Charles", pubDate: "5-Nov", year: 1907, secPg: 2 },
{ lastName: "Laxton", firstName: "Fate", pubDate: "1-Dec", year: 1907, secPg: 11 },
{ lastName: "Leader", firstName: "Frank", pubDate: "13-Nov", year: 1907, secPg: 1 },
{ lastName: "Lewis", firstName: "Ernest", pubDate: "21-Nov", year: 1907, secPg: "6 MWP" },
{ lastName: "Libby", firstName: "A.C.", pubDate: "10-Nov", year: 1907, secPg: 1 },
{ lastName: "Logan", firstName: "A.B., Capt.", pubDate: "26-Dec", year: 1907, secPg: 1 },
{ lastName: "Lowney", firstName: "Roy", pubDate: "5-Dec", year: 1907, secPg: 1 },
{ lastName: "Loy", firstName: "Ralph", pubDate: "26-Dec", year: 1907, secPg: 1 },
{ lastName: "Marr", firstName: "Fred", pubDate: "19-Dec", year: 1907, secPg: 1 },
{ lastName: "Martin", firstName: "Mollie", pubDate: "5-Nov", year: 1907, secPg: 8 },
{ lastName: "Martin", firstName: "Mollie", pubDate: "9-Nov", year: 1907, secPg: 1 },
{ lastName: "Martin", firstName: "Molly", pubDate: "3-Nov", year: 1907, secPg: 1 },
{ lastName: "McCullom", firstName: "W.B., Mrs.", pubDate: "3-Dec", year: 1907, secPg: 3 },
{ lastName: "McEwin", firstName: "A.R.", pubDate: "27-Nov", year: 1907, secPg: 8 },
{ lastName: "McFarland", firstName: "William", pubDate: "7-Dec", year: 1907, secPg: 1 },
{ lastName: "Miller", firstName: "Chessy", pubDate: "6-Nov", year: 1907, secPg: 1 },
{ lastName: "Miller", firstName: "George P.", pubDate: "23-Nov", year: 1907, secPg: 1 },
{ lastName: "Mosier", firstName: "John", pubDate: "28-Nov", year: 1907, secPg: 5 },
{ lastName: "Murray", firstName: "Hugh", pubDate: "29-Nov", year: 1907, secPg: 1 },
{ lastName: "O'Conner", firstName: "Dave", pubDate: "15-Dec", year: 1907, secPg: 1 },
{ lastName: "Owen", firstName: "Thomas H., Mrs.", pubDate: "13-Dec", year: 1907, secPg: 5 },
{ lastName: "Parker", firstName: "Abraham", pubDate: "16-Nov", year: 1907, secPg: 7 },
{ lastName: "Parker", firstName: "Luman F.", pubDate: "17-Dec", year: 1907, secPg: 2 },
{ lastName: "Perkins", firstName: "Chas. A.", pubDate: "9-Nov", year: 1907, secPg: 1 },
{ lastName: "Pierson", firstName: "J. Ed", pubDate: "19-Dec", year: 1907, secPg: 1 },
{ lastName: "Rankin", firstName: "D.R.", pubDate: "4-Dec", year: 1907, secPg: 1 },
{ lastName: "Rankin", firstName: "D.R.", pubDate: "6-Dec", year: 1907, secPg: "1 MWP" },
{ lastName: "Redman", firstName: "J.A.", pubDate: "16-Nov", year: 1907, secPg: 1 },
{ lastName: "Ross", firstName: "Charles, f/o", pubDate: "29-Nov", year: 1907, secPg: 3 },
{ lastName: "Rush", firstName: "Clarence L.", pubDate: "27-Nov", year: 1907, secPg: 8 },
{ lastName: "Sapp", firstName: "May", pubDate: "21-Oct", year: 1907, secPg: 5 },
{ lastName: "Scott", firstName: "Tony", pubDate: "3-Dec", year: 1907, secPg: 2 },
{ lastName: "Shannon", firstName: "John M.", pubDate: "13-Nov", year: 1907, secPg: 8 },
{ lastName: "Shea", firstName: "John", pubDate: "29-Nov", year: 1907, secPg: 1 },
{ lastName: "Sheehan", firstName: "Jack", pubDate: "29-Nov", year: 1907, secPg: 1 },
{ lastName: "Slagletary", firstName: "J.", pubDate: "16-Nov", year: 1907, secPg: 3 },
{ lastName: "Smith", firstName: "Josie, Mrs.", pubDate: "3-Nov", year: 1907, secPg: 1 },
{ lastName: "Spriggs", firstName: "W.L., Mrs.", pubDate: "27-Dec", year: 1907, secPg: 5 },
{ lastName: "Springfield", firstName: "J.K.P.", pubDate: "3-Nov", year: 1907, secPg: 5 },
{ lastName: "Stockwell", firstName: "Dr.", pubDate: "21-Oct", year: 1907, secPg: 1 },
{ lastName: "Summerbeck", firstName: "Adolph", pubDate: "29-Nov", year: 1907, secPg: 1 },
{ lastName: "Taylor", firstName: "Bob", pubDate: "28-Nov", year: 1907, secPg: 2 },
{ lastName: "Templeton", firstName: "John", pubDate: "17-Nov", year: 1907, secPg: 1 },
{ lastName: "Thayer", firstName: "J.S.", pubDate: "7-Nov", year: 1907, secPg: 1 },
{ lastName: "Thomas", firstName: "J.B.", pubDate: "16-Nov", year: 1907, secPg: 5 },
{ lastName: "Thompson", firstName: "Milton, Mrs.", pubDate: "14-Nov", year: 1907, secPg: 3 },
{ lastName: "Tooley", firstName: "Engineer", pubDate: "24-Dec", year: 1907, secPg: 4 },
{ lastName: "Tucker", firstName: "Patrick", pubDate: "29-Nov", year: 1907, secPg: 1 },
{ lastName: "Tyler", firstName: "Fred", pubDate: "10-Nov", year: 1907, secPg: 1 },
{ lastName: "Tyler", firstName: "Steve", pubDate: "21-Oct", year: 1907, secPg: 5 },
{ lastName: "Vickery", firstName: "James", pubDate: "19-Nov", year: 1907, secPg: 3 },
{ lastName: "Warth", firstName: "C.H., d/o", pubDate: "20-Nov", year: 1907, secPg: 2 },
{ lastName: "White", firstName: "Henry", pubDate: "29-Dec", year: 1907, secPg: 1 },
{ lastName: "White", firstName: "J.W.", pubDate: "10-Dec", year: 1907, secPg: 3 },
{ lastName: "White", firstName: "J.W.", pubDate: "17-Dec", year: 1907, secPg: 1 },
{ lastName: "Whitedog", firstName: "Chief", pubDate: "16-Nov", year: 1907, secPg: 5 },
{ lastName: "Williams", firstName: "George", pubDate: "21-Nov", year: 1907, secPg: "6 MWP" },
{ lastName: "Wilson", firstName: "Lillian Gates", pubDate: "20-Nov", year: 1907, secPg: 2 },
{ lastName: "Wing", firstName: "A.M.", pubDate: "10-Nov", year: 1907, secPg: 1 },
{ lastName: "Younger", firstName: "Sandy, m/o", pubDate: "12-Nov", year: 1907, secPg: 2 },
{ lastName: "Zymosale", firstName: "Frank", pubDate: "21-Oct", year: 1907, secPg: 4 }
];
// Helper function to create and update the results table
function displayResults(results) {
const resultsContainer = document.getElementById('results-container');
resultsContainer.innerHTML = '';
if (results.length === 0) {
resultsContainer.innerHTML = '<p>No results found. Please try different search criteria.</p>';
return;
}
// Create table
const table = document.createElement('table');
table.className = 'results-table';
// Add table header
const thead = document.createElement('thead');
thead.innerHTML = `
<tr>
<th>Last Name</th>
<th>First Name</th>
<th>Publication Date</th>
<th>Year</th>
<th>Section/Page</th>
</tr>
`;
table.appendChild(thead);
// Add table body with results
const tbody = document.createElement('tbody');
results.forEach(record => {
const row = document.createElement('tr');
row.innerHTML = `
<td>${record.lastName}</td>
<td>${record.firstName}</td>
<td>${record.pubDate}</td>
<td>${record.year}</td>
<td>${record.secPg}</td>
`;
tbody.appendChild(row);
});
table.appendChild(tbody);
resultsContainer.appendChild(table);
}
// Function to perform search based on form inputs
function searchObituaries() {
const lastNameInput = document.getElementById('last-name').value.trim().toLowerCase();
const firstNameInput = document.getElementById('first-name').value.trim().toLowerCase();
const monthSelect = document.getElementById('month').value;
let results = [...obituaryData]; // Create a copy to filter
// Filter by last name if provided
if (lastNameInput) {
results = results.filter(record =>
record.lastName.toLowerCase().includes(lastNameInput)
);
}
// Filter by first name if provided
if (firstNameInput) {
results = results.filter(record =>
record.firstName.toLowerCase().includes(firstNameInput)
);
}
// Filter by month if selected
if (monthSelect !== 'all') {
results = results.filter(record =>
record.pubDate.includes(monthSelect)
);
}
// Display results
displayResults(results);
// Update result count
document.getElementById('result-count').textContent = results.length;
return false; // Prevent form submission
}
// Function to reset the search form and show all records
function resetSearch() {
document.getElementById('search-form').reset();
displayResults(obituaryData);
document.getElementById('result-count').textContent = obituaryData.length;
return false; // Prevent form submission
}
// Initialize the page when DOM is loaded
document.addEventListener('DOMContentLoaded', function() {
// Set up event listeners
document.getElementById('search-form').addEventListener('submit', function(e) {
e.preventDefault();
searchObituaries();
});
document.getElementById('reset-button').addEventListener('click', resetSearch);
// Show all records on initial load
displayResults(obituaryData);
document.getElementById('result-count').textContent = obituaryData.length;
});
const obituaryData = [
{ lastName: "Bailey", firstName: "Frank", pubDate: "3-Nov", year: 1907, secPg: 1 },
{ lastName: "Bailey", firstName: "Frank", pubDate: "16-Nov", year: 1907, secPg: 6 },
{ lastName: "Bailey", firstName: "N.B., Mrs.", pubDate: "31-Dec", year: 1907, secPg: 6 },
{ lastName: "Bassler", firstName: "Thomas", pubDate: "21-Oct", year: 1907, secPg: 7 },
{ lastName: "Bates", firstName: "Albert", pubDate: "25-Dec", year: 1907, secPg: 1 },
{ lastName: "Blain", firstName: "William E.", pubDate: "13-Dec", year: 1907, secPg: 8 },
{ lastName: "Bogle", firstName: "W.B.", pubDate: "26-Dec", year: 1907, secPg: 1 },
{ lastName: "Bradley", firstName: "Maggie", pubDate: "26-Nov", year: 1907, secPg: 8 },
{ lastName: "Bradley", firstName: "Maggie", pubDate: "27-Nov", year: 1907, secPg: 3 },
{ lastName: "Callahan", firstName: "Elizabeth", pubDate: "22-Nov", year: 1907, secPg: 3 },
{ lastName: "Campbell", firstName: "M.S.", pubDate: "19-Nov", year: 1907, secPg: 3 },
{ lastName: "Campbell", firstName: "W.E.", pubDate: "21-Oct", year: 1907, secPg: 1 },
{ lastName: "Campbell", firstName: "W.E., s/o", pubDate: "21-Oct", year: 1907, secPg: 1 },
{ lastName: "Coffman", firstName: "James", pubDate: "13-Nov", year: 1907, secPg: 8 },
{ lastName: "Coffman", firstName: "James", pubDate: "14-Nov", year: 1907, secPg: "1 MWP" },
{ lastName: "Crain", firstName: "Addie", pubDate: "15-Nov", year: 1907, secPg: 3 },
{ lastName: "Cummings", firstName: "R.P., f/o", pubDate: "28-Nov", year: 1907, secPg: 3 },
{ lastName: "Dog", firstName: "White (Chief)", pubDate: "16-Nov", year: 1907, secPg: 5 },
{ lastName: "Evans", firstName: "Bob", pubDate: "28-Nov", year: 1907, secPg: 2 },
{ lastName: "Evans", firstName: "Robert", pubDate: "24-Nov", year: 1907, secPg: 1 },
{ lastName: "Fazos", firstName: "Christ", pubDate: "29-Nov", year: 1907, secPg: 1 },
{ lastName: "Ferry", firstName: "Dexter M.", pubDate: "12-Nov", year: 1907, secPg: 1 },
{ lastName: "Fouquay", firstName: "Mr.", pubDate: "16-Nov", year: 1907, secPg: 7 },
{ lastName: "Gardner", firstName: "James", pubDate: "25-Dec", year: 1907, secPg: 1 },
{ lastName: "Gates", firstName: "Lillian (Wilson)", pubDate: "20-Nov", year: 1907, secPg: 2 },
{ lastName: "Gilmore", firstName: "Alexander, Mrs.", pubDate: "17-Dec", year: 1907, secPg: 1 },
{ lastName: "Gilmour", firstName: "Alexander, Mrs.", pubDate: "17-Dec", year: 1907, secPg: 1 },
{ lastName: "Gilstrap", firstName: "Ike, Deputy", pubDate: "13-Nov", year: 1907, secPg: 1 },
{ lastName: "Glass", firstName: "Charles, Mrs.", pubDate: "24-Dec", year: 1907, secPg: 1 },
{ lastName: "Godfrey", firstName: "Thomas R.", pubDate: "27-Nov", year: 1907, secPg: 8 },
{ lastName: "Greely", firstName: "Richard", pubDate: "21-Oct", year: 1907, secPg: 7 },
{ lastName: "Green", firstName: "Thos.", pubDate: "5-Dec", year: 1907, secPg: 3 },
{ lastName: "Groves", firstName: "H.J.", pubDate: "3-Dec", year: 1907, secPg: 1 },
{ lastName: "Guerra", firstName: "Webster S.", pubDate: "3-Nov", year: 1907, secPg: 2 },
{ lastName: "Hair", firstName: "Charles", pubDate: "4-Dec", year: 1907, secPg: "1, 8" },
{ lastName: "Hair", firstName: "Charles", pubDate: "5-Dec", year: 1907, secPg: 2 },
{ lastName: "Hair", firstName: "Charles", pubDate: "6-Dec", year: 1907, secPg: "1 MWP" },
{ lastName: "Hair", firstName: "Charles", pubDate: "12-Dec", year: 1907, secPg: 5 },
{ lastName: "Halan", firstName: "Michael", pubDate: "29-Nov", year: 1907, secPg: 1 },
{ lastName: "Hanson", firstName: "George", pubDate: "11-Dec", year: 1907, secPg: 1 },
{ lastName: "Hanson", firstName: "George", pubDate: "14-Dec", year: 1907, secPg: 1 },
{ lastName: "Hearness", firstName: "Emma, Mrs.", pubDate: "26-Dec", year: 1907, secPg: 1 },
{ lastName: "Hearness", firstName: "Emma, s/o", pubDate: "26-Dec", year: 1907, secPg: 1 },
{ lastName: "Henderson", firstName: "Lon", pubDate: "14-Nov", year: 1907, secPg: 1 },
{ lastName: "Horne", firstName: "Mary", pubDate: "10-Dec", year: 1907, secPg: 3 },
{ lastName: "Huey", firstName: "John D.", pubDate: "15-Nov", year: 1907, secPg: 1 },
{ lastName: "Humphrey", firstName: "W.A.", pubDate: "21-Oct", year: 1907, secPg: 5 },
{ lastName: "Ince", firstName: "Frank", pubDate: "27-Dec", year: 1907, secPg: 1 },
{ lastName: "Ince", firstName: "Frank", pubDate: "28-Dec", year: 1907, secPg: 1 },
{ lastName: "Ince", firstName: "Frank", pubDate: "31-Dec", year: 1907, secPg: 1 },
{ lastName: "Kelley", firstName: "John", pubDate: "16-Nov", year: 1907, secPg: 6 },
{ lastName: "Kirk", firstName: "S.S.", pubDate: "16-Nov", year: 1907, secPg: 7 },
{ lastName: "Landham", firstName: "Edward", pubDate: "26-Nov", year: 1907, secPg: 1 },
{ lastName: "Lane", firstName: "Thomas", pubDate: "29-Nov", year: 1907, secPg: 1 },
{ lastName: "Lawrence", firstName: "Charles", pubDate: "5-Nov", year: 1907, secPg: 2 },
{ lastName: "Laxton", firstName: "Fate", pubDate: "1-Dec", year: 1907, secPg: 11 },
{ lastName: "Leader", firstName: "Frank", pubDate: "13-Nov", year: 1907, secPg: 1 },
{ lastName: "Lewis", firstName: "Ernest", pubDate: "21-Nov", year: 1907, secPg: "6 MWP" },
{ lastName: "Libby", firstName: "A.C.", pubDate: "10-Nov", year: 1907, secPg: 1 },
{ lastName: "Logan", firstName: "A.B., Capt.", pubDate: "26-Dec", year: 1907, secPg: 1 },
{ lastName: "Lowney", firstName: "Roy", pubDate: "5-Dec", year: 1907, secPg: 1 },
{ lastName: "Loy", firstName: "Ralph", pubDate: "26-Dec", year: 1907, secPg: 1 },
{ lastName: "Marr", firstName: "Fred", pubDate: "19-Dec", year: 1907, secPg: 1 },
{ lastName: "Martin", firstName: "Mollie", pubDate: "5-Nov", year: 1907, secPg: 8 },
{ lastName: "Martin", firstName: "Mollie", pubDate: "9-Nov", year: 1907, secPg: 1 },
{ lastName: "Martin", firstName: "Molly", pubDate: "3-Nov", year: 1907, secPg: 1 },
{ lastName: "McCullom", firstName: "W.B., Mrs.", pubDate: "3-Dec", year: 1907, secPg: 3 },
{ lastName: "McEwin", firstName: "A.R.", pubDate: "27-Nov", year: 1907, secPg: 8 },
{ lastName: "McFarland", firstName: "William", pubDate: "7-Dec", year: 1907, secPg: 1 },
{ lastName: "Miller", firstName: "Chessy", pubDate: "6-Nov", year: 1907, secPg: 1 },
{ lastName: "Miller", firstName: "George P.", pubDate: "23-Nov", year: 1907, secPg: 1 },
{ lastName: "Mosier", firstName: "John", pubDate: "28-Nov", year: 1907, secPg: 5 },
{ lastName: "Murray", firstName: "Hugh", pubDate: "29-Nov", year: 1907, secPg: 1 },
{ lastName: "O'Conner", firstName: "Dave", pubDate: "15-Dec", year: 1907, secPg: 1 },
{ lastName: "Owen", firstName: "Thomas H., Mrs.", pubDate: "13-Dec", year: 1907, secPg: 5 },
{ lastName: "Parker", firstName: "Abraham", pubDate: "16-Nov", year: 1907, secPg: 7 },
{ lastName: "Parker", firstName: "Luman F.", pubDate: "17-Dec", year: 1907, secPg: 2 },
{ lastName: "Perkins", firstName: "Chas. A.", pubDate: "9-Nov", year: 1907, secPg: 1 },
{ lastName: "Pierson", firstName: "J. Ed", pubDate: "19-Dec", year: 1907, secPg: 1 },
{ lastName: "Rankin", firstName: "D.R.", pubDate: "4-Dec", year: 1907, secPg: 1 },
{ lastName: "Rankin", firstName: "D.R.", pubDate: "6-Dec", year: 1907, secPg: "1 MWP" },
{ lastName: "Redman", firstName: "J.A.", pubDate: "16-Nov", year: 1907, secPg: 1 },
{ lastName: "Ross", firstName: "Charles, f/o", pubDate: "29-Nov", year: 1907, secPg: 3 },
{ lastName: "Rush", firstName: "Clarence L.", pubDate: "27-Nov", year: 1907, secPg: 8 },
{ lastName: "Sapp", firstName: "May", pubDate: "21-Oct", year: 1907, secPg: 5 },
{ lastName: "Scott", firstName: "Tony", pubDate: "3-Dec", year: 1907, secPg: 2 },
{ lastName: "Shannon", firstName: "John M.", pubDate: "13-Nov", year: 1907, secPg: 8 },
{ lastName: "Shea", firstName: "John", pubDate: "29-Nov", year: 1907, secPg: 1 },
{ lastName: "Sheehan", firstName: "Jack", pubDate: "29-Nov", year: 1907, secPg: 1 },
{ lastName: "Slagletary", firstName: "J.", pubDate: "16-Nov", year: 1907, secPg: 3 },
{ lastName: "Smith", firstName: "Josie, Mrs.", pubDate: "3-Nov", year: 1907, secPg: 1 },
{ lastName: "Spriggs", firstName: "W.L., Mrs.", pubDate: "27-Dec", year: 1907, secPg: 5 },
{ lastName: "Springfield", firstName: "J.K.P.", pubDate: "3-Nov", year: 1907, secPg: 5 },
{ lastName: "Stockwell", firstName: "Dr.", pubDate: "21-Oct", year: 1907, secPg: 1 },
{ lastName: "Summerbeck", firstName: "Adolph", pubDate: "29-Nov", year: 1907, secPg: 1 },
{ lastName: "Taylor", firstName: "Bob", pubDate: "28-Nov", year: 1907, secPg: 2 },
{ lastName: "Templeton", firstName: "John", pubDate: "17-Nov", year: 1907, secPg: 1 },
{ lastName: "Thayer", firstName: "J.S.", pubDate: "7-Nov", year: 1907, secPg: 1 },
{ lastName: "Thomas", firstName: "J.B.", pubDate: "16-Nov", year: 1907, secPg: 5 },
{ lastName: "Thompson", firstName: "Milton, Mrs.", pubDate: "14-Nov", year: 1907, secPg: 3 },
{ lastName: "Tooley", firstName: "Engineer", pubDate: "24-Dec", year: 1907, secPg: 4 },
{ lastName: "Tucker", firstName: "Patrick", pubDate: "29-Nov", year: 1907, secPg: 1 },
{ lastName: "Tyler", firstName: "Fred", pubDate: "10-Nov", year: 1907, secPg: 1 },
{ lastName: "Tyler", firstName: "Steve", pubDate: "21-Oct", year: 1907, secPg: 5 },
{ lastName: "Vickery", firstName: "James", pubDate: "19-Nov", year: 1907, secPg: 3 },
{ lastName: "Warth", firstName: "C.H., d/o", pubDate: "20-Nov", year: 1907, secPg: 2 },
{ lastName: "White", firstName: "Henry", pubDate: "29-Dec", year: 1907, secPg: 1 },
{ lastName: "White", firstName: "J.W.", pubDate: "10-Dec", year: 1907, secPg: 3 },
{ lastName: "White", firstName: "J.W.", pubDate: "17-Dec", year: 1907, secPg: 1 },
{ lastName: "Whitedog", firstName: "Chief", pubDate: "16-Nov", year: 1907, secPg: 5 },
{ lastName: "Williams", firstName: "George", pubDate: "21-Nov", year: 1907, secPg: "6 MWP" },
{ lastName: "Wilson", firstName: "Lillian Gates", pubDate: "20-Nov", year: 1907, secPg: 2 },
{ lastName: "Wing", firstName: "A.M.", pubDate: "10-Nov", year: 1907, secPg: 1 },
{ lastName: "Younger", firstName: "Sandy, m/o", pubDate: "12-Nov", year: 1907, secPg: 2 },
{ lastName: "Zymosale", firstName: "Frank", pubDate: "21-Oct", year: 1907, secPg: 4 }
];
// Helper function to create and update the results table
function displayResults(results) {
const resultsContainer = document.getElementById('results-container');
resultsContainer.innerHTML = '';
if (results.length === 0) {
resultsContainer.innerHTML = '<p>No results found. Please try different search criteria.</p>';
return;
}
// Create table
const table = document.createElement('table');
table.className = 'results-table';
// Add table header
const thead = document.createElement('thead');
thead.innerHTML = `
<tr>
<th>Last Name</th>
<th>First Name</th>
<th>Publication Date</th>
<th>Year</th>
<th>Section/Page</th>
</tr>
`;
table.appendChild(thead);
// Add table body with results
const tbody = document.createElement('tbody');
results.forEach(record => {
const row = document.createElement('tr');
row.innerHTML = `
<td>${record.lastName}</td>
<td>${record.firstName}</td>
<td>${record.pubDate}</td>
<td>${record.year}</td>
<td>${record.secPg}</td>
`;
tbody.appendChild(row);
});
table.appendChild(tbody);
resultsContainer.appendChild(table);
}
// Function to perform search based on form inputs
function searchObituaries() {
const lastNameInput = document.getElementById('last-name').value.trim().toLowerCase();
const firstNameInput = document.getElementById('first-name').value.trim().toLowerCase();
const monthSelect = document.getElementById('month').value;
let results = [...obituaryData]; // Create a copy to filter
// Filter by last name if provided
if (lastNameInput) {
results = results.filter(record =>
record.lastName.toLowerCase().includes(lastNameInput)
);
}
// Filter by first name if provided
if (firstNameInput) {
results = results.filter(record =>
record.firstName.toLowerCase().includes(firstNameInput)
);
}
// Filter by month if selected
if (monthSelect !== 'all') {
results = results.filter(record =>
record.pubDate.includes(monthSelect)
);
}
// Display results
displayResults(results);
// Update result count
document.getElementById('result-count').textContent = results.length;
return false; // Prevent form submission
}
// Function to reset the search form and show all records
function resetSearch() {
document.getElementById('search-form').reset();
displayResults(obituaryData);
document.getElementById('result-count').textContent = obituaryData.length;
return false; // Prevent form submission
}
// Initialize the page when DOM is loaded
document.addEventListener('DOMContentLoaded', function() {
// Set up event listeners
document.getElementById('search-form').addEventListener('submit', function(e) {
e.preventDefault();
searchObituaries();
});
document.getElementById('reset-button').addEventListener('click', resetSearch);
// Show all records on initial load
displayResults(obituaryData);
document.getElementById('result-count').textContent = obituaryData.length;
});