Ver Mensaje Individual
  #3 (permalink)  
Antiguo 13/08/2005, 02:49
Avatar de tunait
tunait
Moderadora
 
Fecha de Ingreso: agosto-2001
Ubicación: Terok Nor
Mensajes: 16.805
Antigüedad: 23 años
Puntos: 381
Qué tal,

no especificas qué imagen es la que quieres cambiar, pero suponiendo que sea esta

<img src="../imatges/ct.gif" border="0">

puedes asignarle un id

<img id="c1" src="../imatges/ct.gif" border="0" />

y agregar un segundo parámetro a recibir en tu función

Código:
<script language="JavaScript">
function cambiaEstado(iden,el){
  var elhtml = document.getElementById(iden);
  var elhtml2 = document.getElementById(el);
  if (elhtml.style.display == 'block'){
      elhtml.style.display = 'none';
      elhtml2.src = '../imatges/ct.gif';
  }
  else{
       elhtml.style.display = 'block';
       elhtml2.src = '../imatges/co.gif'; 
   } 
}
y llamas a la función con cambiaEstado('e1','c1')




un saludo