';
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);
}
});
});
Jetstream Wind Inc. of New Mexico plans to build what it believes will be the first utility-scale, zero-emissions power plant to use electricity from wind, solar and other renewable energy sources to separate water into hydrogen and oxygen. The hydrogen would be stored, then used to generate enough electricity to power 6,000 homes and businesses, while the oxygen would be sold to the medical field and other secondary markets, Susan Montoya Bryan of the Associated Press reports.
Whether such a plant would ultimately be cost-effective way to produce fuel remains to be seen. "You have to start somewhere with a lot of these technologies and over time these things decline in costs," Mike Taylor, director of research and education at the Solar Electric Power Association in Washington D.C. told the Associated Press.
The privately financed 10-megawatt plant is being built in Truth or Consequences, New Mexico, and the company eventually hopes to build two more plants for American Indian pueblos and one in Hawaii.