 function despliega(tabla, boton) {	
	opcion=document.getElementById(tabla).style.display;
	if (opcion == 'block') {
		document.getElementById(tabla).style.display = 'none';
		document.getElementById(boton).src='/images/plus.gif';
	}
	if (opcion == 'none') {
		document.getElementById(tabla).style.display = 'block';
		document.getElementById(boton).src='/images/minus.gif';
	}
}

function cgi() {

   this.getName = new Array();
   this.getValue = new Array();
   if (document.location.search.length == 0) {
      this.parameters = 0;
   } else {
     matriu = document.location.search.slice(1).split("&");
     this.parameters = matriu.length	;
     for (n = 0; n < matriu.length; n++) {
        nom = unescape(matriu[n].substring(0,matriu[n].indexOf("=")));
        valor = unescape(matriu[n].substring(matriu[n].indexOf("=")+1));
        eval ('this.' + nom + ' = ' + 'valor');
        eval ('this.getName[' + n + '] = ' + 'nom');
        eval ('this.getValue[' + n + '] = ' + 'valor');
    }
  }

}

function init() {

   abreArbol();
}

function abreArbol() {

//ejemplo: http://www/gPublicaciones/frDisplayDefault.html?titulo=102
   var micgi = new cgi();

   if (micgi.titulo) {
      var i = micgi.titulo.length;
      do {
         if (i == 3 || i == 5 || i == 7) {
            despliega(("tabla" + micgi.titulo.substring(0,i)), ("boton" + micgi.titulo.substring(0,i)));
//          alert (i);
         } else {
//          alert (i);
            break;
         }
         i = i - 2;
      } while (i >= 3)
   }
}