';
document.querySelector('#copytext').value = textContent;
modal.showModal();
});
// Modal close functionality
const modal = document.querySelector('.republish-modal');
const closeBtn = document.querySelector('.republish-modal-close');
// Close button click
closeBtn.addEventListener('click', function() {
modal.close();
});
// Close on backdrop click
modal.addEventListener('click', function(e) {
if (e.target === modal) {
modal.close();
}
});
// Close on ESC key (this is usually built-in, but adding for safety)
modal.addEventListener('keydown', function(e) {
if (e.key === 'Escape') {
modal.close();
}
});
// Copy text button functionality
document.querySelector('.copy-text-button').addEventListener('click', async function() {
const textarea = document.querySelector('#copytext');
const text = textarea.value;
try {
// Try modern Clipboard API first
if (navigator.clipboard && window.isSecureContext) {
await navigator.clipboard.writeText(text);
this.textContent = 'Copied!';
} else {
// Fallback for older browsers
textarea.select();
document.execCommand('copy');
this.textContent = 'Copied!';
}
// Reset button text after 2 seconds
setTimeout(() => {
this.textContent = 'Copy text';
}, 2000);
} catch (err) {
console.error('Failed to copy text: ', err);
// Fallback to selection if copying fails
textarea.select();
this.textContent = 'Text selected';
setTimeout(() => {
this.textContent = 'Copy text';
}, 2000);
}
});
});
See unemployment through the eyes of a 47-year-old Montana man who lives in a friend's van, part of a growing number of older state residents battered by the recession. Betsy Cohen of the Missoulian writes that the number of complaints of job-related age discrimination has grown as unemployment has risen, a trend that also has occurred nationally. Nationally, unemployment rates for persons ages 55 and over rose from 6.7 percent in May to 7 percent in June, continuing the recent trend of high rates that had not been seen since the late 1940s, said Stacia Dahl, spokesperson for AARP Montana State Office.
"I think they aren't hiring me because of my age. People want to hire younger people," says Michael Anderson, whose resume includes work as a safety contractor, shipping clerk, forklift operator and warehouseman. Anderson says that despite filling out dozens of applications a week he hasn't gotten one offer in the past six months, and he thinks it's because of his age.