
/**
 * Switch from one image to another
 * 
 * @param imageId the img tag id 
 * @param imagePath the image to switch to
 */
function switchImage(imageId, imagePath) {
	var image = document.getElementById(imageId);
	if (image.src != imagePath) {
		image.src = imagePath;
	}
}	
	
/**
 * Change the text color of the links
 *
 * @param linkList list of ahref id's for which to change the color
 * @param deactiveColor the color to change to 
 * @return true on completion
 */
function deactiveLinks(linkList, deactiveColor) {
	for (i = 0; i < linkList.length; i++) {
		var tempLink = document.getElementById(linkList[i]);
		tempLink.style.color = 	deactiveColor;
	}
	
	return true;
}	
	
/**
 * Change the color of the link to mark it active. Change the other links to deactive.<b> 
 * 
 * @param activeHrefId the ahref tag id for the link to mark active
 * @param allLinks list of ahref tag ids to make inactive
 * @param activeColor the color to make the active link
 * @param deactiveColor the color to make the other links
 */
function activateLink(activeHrefId, allLinks, activeColor, deactiveColor) {
	activeHref = document.getElementById(activeHrefId);
	
	if (deactiveLinks(allLinks, deactiveColor)) {	
		activeHref.style.color = activeColor;
	}
}

/**
 * Toggle the div on or off.
 *
 * @param divName the div to change
 * @param state the div state (block/none)
 */
function toggleDiv(divName, state) {
	document.getElementById(divName).style.display = state;
}

/**
 * Change the frame height. 
 *
 * @param frameName the frame to change
 * @param height the height to change to
 */
function changeFrameHeight(frameName, height) {
	document.getElementById(frameName).height = height;
}
