
var gCurrNode;

var cur_node;
cur_node=0;

function toggle_view(what) {
  var menuo=document.getElementById(what+'_s');
  var txt=document.getElementById(what+'_t');
  if (menuo.style.display=='block') {
	col_node(what);
  }
  else {
	exp_node(what);
  }
}
function col_node(what) {
  var menuo=document.getElementById(what+'_s');
  var txt=document.getElementById(what+'_t');
  menuo.style.display='none';
  if (txt) txt.className="txp";
}

function exp_node(what) {
  var menuo=document.getElementById(what+'_s');
  var txt=document.getElementById(what+'_t');
  if (menuo) menuo.style.display='block';
  if (txt) txt.className="txm";
}

function open_node(url,what) {
  if (cur_node==what) return;
  if (cur_node) close_node(cur_node);
  var menuo=document.getElementById(what+'_s');
  if (menuo) exp_node(what);
  var img=document.getElementById(what+'_m');
	if (img) img.className="node_open";
	if (typeof reslib_show_list == "function") {
		reslib_show_list(url);
	}
	else {
		var a=document.getElementById(what+'_a');
		if (a) a.style.backgroundColor='#FFE89F';
		cur_node=what;
		a.href=url;
		a.click();
	}
}

function close_node(what) {
  var img=document.getElementById(what+'_m');
	if (img) img.className="node_close";
  var a=document.getElementById(what+'_a');
  a.style.backgroundColor='#FFFFFF';
}
