var objs_cache=new Array;
var objs=new Array;
function hidetree(_1,id){
for(var i=0;i<_1.length;i++){
if(_1[i].getAttribute("parent")==id){
_1[i].style.display="none";
hidetree(_1,i);
}
}
};
function showtree(_4,id){
for(var i=0;i<_4.length;i++){
if(_4[i].getAttribute("parent")==id){
_4[i].style.display="";
if(!_4[i].getAttribute("shrinked")){
showtree(_4,i);
}
}
}
};
function has_sons(_7,id){
for(var i=0;i<objs.length;i++){
if(objs[i].getAttribute("parent")==id){
return true;
}
}
return false;
};
function menu(_a){
eval("var curimg = document.all."+_a.getAttribute("table")+_a.id+";");
var _b=0;
if(objs_cache[_a.getAttribute("table")]){
objs=objs_cache[_a.getAttribute("table")];
}else{
objs=new Array;
}
if(!objs.length){
objs=new Array;
for(var i=0;i<document.all.length;i++){
if(document.all[i].getAttribute("table")==_a.getAttribute("table")){
objs[_b]=document.all[i];
_b++;
}
}
}
if(_a.getAttribute("shrinked")){
showtree(objs,_a.id);
sons=has_sons(objs,_a.id);
if(sons){
if(_a.getAttribute("parent")==-1){
for(var j=0;j<objs.length;j++){
if((objs[j].id!=_a.id)&&(objs[j].getAttribute("parent")==-1)&&(!objs[j].getAttribute("shrinked"))){
hidetree(objs,j);
objs[j].setAttribute("shrinked","true");
eval("if (document.all."+_a.getAttribute("table")+j+") document.all."+_a.getAttribute("table")+j+".src=document.all."+_a.getAttribute("table")+j+".getAttribute('imgclose');");
}
}
}else{
for(var j=0;j<objs.length;j++){
if((objs[j].id!=_a.id)&&(objs[j].getAttribute("parent")==_a.getAttribute("parent"))&&(!objs[j].getAttribute("shrinked"))){
hidetree(objs,j);
objs[j].setAttribute("shrinked","true");
eval("if (document.all."+_a.getAttribute("table")+j+") document.all."+_a.getAttribute("table")+j+".src=document.all."+_a.getAttribute("table")+j+".getAttribute('imgclose');");
}
}
}
}
_a.setAttribute("shrinked","");
if(curimg){
curimg.src=curimg.getAttribute("imgopen");
}
}else{
hidetree(objs,_a.id);
_a.setAttribute("shrinked",true);
if(curimg){
curimg.src=curimg.getAttribute("imgclose");
}
}
objs_cache[_a.getAttribute("table")]=objs;
};

