/*
//* tree.js: Funcao para criar expansao simulando um tree view.
//*
//*
//*
//* Informacoes do CVS
//* $Source: /root/migracaocvs/bdpa-web/rebae/WebContent/web/js/tree.js,v $
//* $Name: not supported by cvs2svn $
//* $Revision: 1.1 $
//* $Author: isaque $
//* $Date: 2006-05-12 13:41:36 $
//*
//* EMBRAPA/CNPTIA, Equipe AINFO, Isaque Vacari
*/
/*
Modo de usar:
No HTML:
Customer Support
Texto expandido.
*/
imgout=new Image(9,9);
imgin=new Image(9,9);
imgout.src="web/images/mais.png";
imgin.src="web/images/menos.png";
//troca de imagens
function trocar(imagename,objectsrc){
if (document.images){
document.images[imagename].src=eval(objectsrc+".src");
}
}
//exibir ou ocultar elemento
function expandir(id) {
if (document.getElementById) { // DOM3 = IE5, NS6
if (document.getElementById(id).style.display == "none"){
document.getElementById(id).style.display = 'block';
trocar(("img"+id),'imgin');
} else {
trocar(("img"+id),'imgout');
document.getElementById(id).style.display = 'none';
}
} else {
if (document.layers) {
if (document.id.display == "none"){
document.id.display = 'block';
trocar(("img"+id),'imgin');
} else {
trocar(("img"+id),'imgout');
document.id.display = 'none';
}
} else {
if (document.all.id.style.visibility == "none"){
document.all.id.style.display = 'block';
} else {
trocar(("img"+id),'imgout');
document.all.id.style.display = 'none';
}
}
}
}