
var title;

function replaceTitle(){
	replaceText(document.getElementById("titleText"),"Scroll over an image for more information...");
	document.getElementById("title").style.display = '';
	//document.getElementById("titleText").style.display = 'none';
	document.getElementById("menuText").style.display = 'none';
}

function showTitleText(txt){
	replaceText(document.getElementById("titleText"),txt);
	document.getElementById("titleText").style.display = '';
	//document.getElementById("title").style.display = 'none';
	document.getElementById("menuText").style.display = 'none';
}

function highlightCell(obj){
	obj.className = "highlighted";
	showTitleText(obj.id);
}
function unhighlightCell(obj){
	obj.className = "unhighlighted";
	replaceTitle();
}

function replaceText(el, text) {
  if (el != null) {
    clearText(el);
    var newNode = document.createTextNode(text);
    el.appendChild(newNode);
  }
}

function clearText(el) {
  if (el != null) {
    if (el.childNodes) {
      for (var i = 0; i < el.childNodes.length; i++) {
        var childNode = el.childNodes[i];
        el.removeChild(childNode);
      }
    }
  }
}

function getText(el) {
  var text = "";
  if (el != null) {
    if (el.childNodes) {
      for (var i = 0; i < el.childNodes.length; i++) {
        var childNode = el.childNodes[i];
        if (childNode.nodeValue != null) {
          text = text + childNode.nodeValue;
        }
      }
    }
  }
  return text;
}
