ой.. я просто подумал о jQuery "live" примочке..
вот примитивный код для копипаста в htm документ:
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'></script>
<style type="text/css">
body {
margin: 10px auto;
width: 570px;
font: 75%/120% Arial, Helvetica, sans-serif;
}
.accordion {
width: 480px;
border-bottom: solid 1px #c4c4c4;
}
.accordion h3 {
background: #e9e7e7;
padding: 7px 15px;
margin: 3px;
cursor: pointer;
}
</style>
<script type="text/javascript">
$(document).ready(function(){
$(".accordion h3").addClass("active");
$(".accordion p").hide();
$(".accordion h3").click(function(){
$(this).next("p").slideToggle("slow")
.siblings("p:visible").slideUp("slow");
$(this).toggleClass("active");
$(this).siblings("h3").removeClass("active");
});
});
function updatemenu() { document.getElementById('id1').innerHTML="<h3>Транспорт</h3><p>Велосипед</p>" }
</script>
<div class=accordion>
<div id=id1><h3>Заголовок1</h3><p>Текст1</p></div>
<div id=id2><h3>Заголовок2</h3><p>Текст2</p></div>
<div id=id3><h3>Заголовок3</h3><p>Текст3</p></div>
<div id=id4><h3>Заголовок4</h3><p>Текст4</p></div>
</div>
<br><br>
<a href="javascript:updatemenu();void(0);">Изменить меню</a>