function togglePlus(id)
{ if(!(img=document.getElementById(id+'_bullet'))) return false;
  if(!(obj=document.getElementById(id))) return false;
  if(!obj.style) return false;
  if(obj.style.display=="none")
  { obj.style.display="";
	img.src="/theme/images/system/expand.gif";
  } 
  else 
  {	obj.style.display="none";
	img.src="/theme/images/system/collapse.gif";
  }      
  
}
function expandobj(object)
{ if(!(img=document.getElementById(object+'_bullet'))) return false;
  if(!(obj=document.getElementById(object))) return false;
  if(!obj.style) return false;
  if(obj.style.display=="none")
  { obj.style.display="";
	img.src="/theme/images/system/expand.gif";
  }  
}
function collapseobj(object)
{ if(!(img=document.getElementById(object+'_bullet'))) return false;
  if(!(obj=document.getElementById(object))) return false;
  if(!obj.style) return false;
  if(obj.style.display!="none")
  {	obj.style.display="none";
	img.src="/theme/images/system/collapse.gif";
  }
}
function togglePlusJ(id)
{ if(!(img=document.getElementById(id+'_bullet'))) return false;
  if(!(obj=document.getElementById(id))) return false;
  if(!obj.style) return false;
  if(obj.style.display=="none")
  { obj.style.display="";
	img.src="/theme/images/system/expand.gif";
    var req = new Subsys_JsHttpRequest_Js();
	message_loading(id);
    req.onreadystatechange = function()
    { if(req.readyState==4 && req.responseJS)
	  obj.innerHTML = req.responseJS.html;      
	  if(req.responseText)
      document.getElementById('debugbox').innerHTML = req.responseText;
    }	
    req.caching = true;
    req.open('POST', '/request.php?mode=admin&module='+MODULE+'&action=getbranch',true);
    req.send({ id: id });
  } 
  else 
  {	obj.style.display="none";
	img.src="/theme/images/system/collapse.gif";	
  }        
}
function expandbranch(id,finid)
{ if(id==finid) return;
  var req = new Subsys_JsHttpRequest_Js();
  req.onreadystatechange = function()
  { if(req.readyState==4 && req.responseJS)
    { id = req.responseJS.id;	
	  if(!(img=document.getElementById('dbetbj'+id+'_bullet'))) return false;
      if(!(obj=document.getElementById('dbetbj'+id))) return false;
      obj.innerHTML = req.responseJS.html;      
	  obj.style.display="";
	  img.src="/theme/images/system/expand.gif";      
	  expandbranch(id,finid);
	}  
	if(req.responseText)
    document.getElementById('debugbox').innerHTML = req.responseText;
  }	
  req.caching = true;
  req.open('POST', '/request.php?mode=admin&module='+MODULE+'&action=expandbranch',true);
  req.send({ idker: id , finid : finid});  
}
function upitem(id)
{    
  document.location=document.location+'&treeaction=up&treeid='+id;
}
function downitem(id)
{ 
  document.location=document.location+'&treeaction=down&treeid='+id; 
}

