Hi everyone

What is the best way to update a subfolder name using javascript?

I have 3 buttons (this is a quick example)

Code:
<ul id="menu">
<li>button1</li>
<li>button2</li>
<li>button3</li>
</ul>

<ul id="nav">
<li><img src="images/subfolder/image.jpg" alt="image"/></li>
<li><img src="images/subfolder/image2.jpg" alt="image2"/></li>
<li><img src="images/subfolder/image3.jpg" alt="image3"/></li>
</ul>
If the user clicks button1 I want to update "subfolder" to "button1" like this:
Code:
<ul id="nav">
<li><img src="images/button1/image.jpg" alt="image"/></li>
<li><img src="images/button1/image2.jpg" alt="image2"/></li>
<li><img src="images/button1/image3.jpg" alt="image3"/></li>
</ul>
and if the user clicks button1 I want to update "button1" to "button2":
Code:
<ul id="nav">
<li><img src="images/button2/image.jpg" alt="image"/></li>
<li><img src="images/button2/image2.jpg" alt="image2"/></li>
<li><img src="images/button2/image3.jpg" alt="image3"/></li>
</ul>
.. and so on.

So the subfolder name changes depending on what button was clicked.

Can anyone help me?

Many thanks