function getNavText(elemID){
	var strNavText = '&nbsp;';
	switch(elemID){
		case 'nav_about':
			strNavText = 'read program descriptions, transcripts, credits, further reading...';
			break;
		case 'nav_resources':
			strNavText = 'find historic video, audio, newspaper accounts, images...';
			break;
		case 'nav_sources':
			strNavText = 'documents, letters, speeches, and more...';
			break;
		case 'nav_profiles':
			strNavText = 'access brief bios of people and organizations';
			break;
		case 'nav_milestones':
			strNavText = 'see a selection of important events';
			break;
		case 'nav_reflections':
			strNavText = 'explore the viewpoints of movement veterans and others';
			break;
		case 'nav_share':
			strNavText = 'send in your comments and memories';
			break;
		case 'nav_tguide':
			strNavText = 'use the TV series and this site in your classroom';
			break;
		case 'nav_amex':
			strNavText = 'American Experience home';
			break;
		case 'nav_home':
			strNavText = 'Eyes on the Prize home';
			break;
	}
	return strNavText;
}

function initNavLinks() {
	if (!document.getElementsByTagName || !document.getElementById('main_nav')) return;
	var anchors = document.getElementById('main_nav').getElementsByTagName('a');
	for (var i = 0; i < anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute('href')){  // ignores named anchors
			anchor.onmouseover = function(){ try{ setNavText(getNavText(this.id)); } catch(e) { /* catch exceptions */ } };
			anchor.onmouseout = function(){ try{ clearNavText(); } catch(e) { /* catch exceptions */ } };
		}
	}
}

function initNavMaps() {
	if (!document.getElementsByTagName || !document.getElementById('main_Map')) return;
	var areas = document.getElementById('main_Map').getElementsByTagName('area');
	for (var i = 0; i < areas.length; i++) {
		var area = areas[i];
		if (area.getAttribute('href')){  // ignores named anchors
			area.onmouseover = function(){ try{ setNavText(getNavText(this.id)); } catch(e) { /* catch exceptions */ } };
			area.onmouseout = function(){ try{ clearNavText(); } catch(e) { /* catch exceptions */ } };
		}
	}
}

function setNavText(newText){
	if(document.getElementById('nav_text')){
		document.getElementById('nav_text').innerHTML = newText;
	}
}

function clearNavText(){
	if(document.getElementById('nav_text')){
		document.getElementById('nav_text').innerHTML = '&nbsp;';
	}
}

function swap(elemID, imgSrc){ if(document.images){ document.images[elemID].src = imgSrc; } }

window.onload=function(){
	initNavLinks();
	initNavMaps();
};


function on(arg) {
	var foo = document.getElementById('highlight-' + arg);
//	foo.setAttribute('class','highlight-active');
	foo.className = 'highlight-active';
	}
	function off(arg) {
	var foo = document.getElementById('highlight-' + arg);
//	foo.setAttribute('class','highlight');
	foo.className = 'highlight';
	}
