// Search document for specific SPAN elements and highlights them.
// Author: Nick Day <nick@njday.com>
function resetHighlight() {
	var spanElements = document.getElementsByTagName("span");
	var regExp = new RegExp("(^|\\s)_audio.*(\\s|$)");
	for(i=0; i<spanElements.length; i++) {
		theSpan = spanElements[i];
		if(regExp.test(theSpan.id)) {
			theSpan.style.backgroundColor = "#EEEEEE";
			theSpan.style.padding = "0px";
		}
	}
}
function highlight(highlightNumber) {
	resetHighlight();
	var spanElements = document.getElementsByTagName("span");
	var regExp = new RegExp("(^|\\s)_audio" + highlightNumber + "(\\s|$)");
	for(i=0; i<spanElements.length; i++) {
		theSpan = spanElements[i];
		if(regExp.test(theSpan.id)) {
			theSpan.style.backgroundColor = "#FFD503";
			theSpan.style.padding = "2px";
		}
	}
}
function setImageOn(theButton) {
	theButton.src = "/images/icons/soundon.gif";
}
function setImageOff(theButton) {
	theButton.src = "/images/icons/soundoff.gif";
}