Toggle help

Toggle help

Hi there,

I'm trying to open a div that holds several images when the user clicks on a link. Each clicked link will open the div and display a specific pic. Plus each time a link is clicked the div should close before opening the div with the appropriate pic. Since I'm new to jquery I'm a bit lost on this one.

I found this bit of code but am having difficulty putting into use for my situation:

$(document).ready(function(){

//Hide (Collapse) the toggle containers on load
$(".toggle_container").hide();

//Switch the "Open" and "Close" state per click
$("a.trigger").toggle(function(){
$(this).addClass("active");
}, function () {
$(this).removeClass("active");
});

//Slide up and down on click
$("h2.trigger").click(function(){
$(this).next(".toggle_container").slideToggle("slow");
});

});

html:
<a href="#">Open pic1</a>
<a href="#">Open pic2</a>
<a href="#">Open pic3</a>
<
<div id="photos">
<img id="pic1" src="pic1.jpg />
<img id="pic2" src="pic2.jpg />
<img id="pic3" src="pic3.jpg />
</div>

Thank you in advance.