tendrias que añadir un parametro a tu funcion para detectar el enlace y lo cambias con el parametro .text
Código javascript
:
Ver originalfunction showhide(id,enlace){
el = document.getElementById(id);
el.style.display = (el.style.display != 'block')? 'block' : 'none';
enlace.text = (enlace.text != 'Abrir')? 'Abrir' : 'Cerrar';
}
en el html paso el 2do parametro como this...
Código HTML:
<a onclick="showhide('miDiv',this);return false;"href="">Abrir</a>