Hola
Prueba con esto, que es muy sencillo y comentas si funcionó
js.html Código PHP:
<html>
<head>
<script type="text/javascript" src="js2.js"></script>
</head>
<body>
<table bgcolor="#ffffff" border="0" cellspadding="0px" cellspacing="1px" width="550px">
<tr>
<td class="foro_ini_seccion" height="30px">
<a style="float:right" href="#" onclick="recoge_despliega('datos_globales');return false"><img id="datos_globales" width="11px" height="12px" src="./imagen.gif" border="0" /></a>
Datos Globales de Mensajes Internos</td>
</tr>
<tbody id="muestra_ocultaobj_datos_globales" style="">
<tr>
<td class="fuentepeq">
Bandeja de Entrada:
<strong>10</strong>
<br />
Bandeja de Salida:
<strong>32</strong>
<br />
Total de Mensajes almacenados: <strong>42</strong> de un total de 50 permitidos<br />
</td>
</tr>
</table>
</body>
</html>
js1.js Código PHP:
var ns6 = (document.getElementById)? true:false
var ie4 = (document.all)? true:false
var ns4 = (document.layers)? true:false
function captura_objeto(idnombre) {
if (ns6)
{
return document.getElementById(idnombre);
}
else if (ie4)
{
return document.all[idnombre];
}
else if (ns4)
{
return document.layers[idnombre];
}
else
{
return null;
}
}
js2.js
Código PHP:
document.write("<script type='text/javascript' src='js1.js'></script>");
function recoge_despliega(objid) {
obj = captura_objeto('muestra_ocultaobj_' + objid);
img = captura_objeto('muestra_ocultaimg_' + objid);
cel = captura_objeto('muestra_ocultacel_' + objid);
if (obj) {
obj.style.display = (obj.style.display == 'none') ? "block" : "none";
}
if (img) {
img.style.display = (img.style.display == 'none') ? "block" : "none";
}
if (cel) {
cel.style.display = (cel.style.display == 'none') ? "block" : "none";
}
}
Suerte