var topicOn;
var flag=false;

function hideTopic( _topicId) {
	var thisTopic = document.getElementById( _topicId );
	thisTopic.style.display = "none";
}
	
function hideAll() {
}

function toggleMainTopic(_topicId) {
	toggleImage("img_" + _topicId)
	toggleTopic(_topicId);
}

function toggleImage(_imageId) {
	var thisImage = MM_findObj(_imageId);
	var path = thisImage.src.substr(0, thisImage.src.lastIndexOf("_") + 1);
	if(thisImage.src == path + "right.gif")
		thisImage.src = path + "down.gif";
	else if(thisImage.src == path + "down.gif")
		thisImage.src = path + "right.gif";
}

function toggleTopic( _topicId) {
	var thisTopic = document.getElementById( _topicId );
	if ( (thisTopic.style.display == "none") || (thisTopic.style.display == "")) {
		thisTopic.style.display = "block";
	}
	else {
		hideTopic( _topicId);
	}
}

function showTopic( _topicId) {
	var thisTopic = document.getElementById( _topicId );
	if ( (thisTopic.style.display == "none") || ( thisTopic.style.display == "")) {
		thisTopic.style.display = "block";
	}
}

function highlightTopic( _topicId) {
	var thisTopic = MM_findObj( _topicId );
	if (flag) {
	    topicOn.style.color = "#000000";
	    topicOn.style.textDecoration = "none";
		thisTopic.style.color = "#800000";
	    thisTopic.style.textDecoration = "underline";
		topicOn = thisTopic;
	}
	else {
	    flag=true;
		thisTopic.style.color = "#800000";
	    thisTopic.style.textDecoration = "underline";
		topicOn = thisTopic;
	}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}
