The reason that all of the div's are being affected is that you have passed the "global" class to the jQuery sliding methods.
There are a number of ways to fix this but I would recommend re-evaluating how you are triggering the changes.
In order for jQuery to modify the elements inside the same div that was clicked, you need to give jQuery some idea of where the event has been triggered on the page. By handling all of the triggering inside jQuery, you reduce the complexity of the function structure on the page and refine the amount of code at the same time.
First of all, remove all of the onclick functions from the <a> links and assign a class to the tag instead (i.e. <a class="img_extended">). We will tell jQuery that clicking any <a> element of the class img_extended, means that we want to modify the div of the same class (inside the same contining div).
<script type="text/javascipt">
$(document).ready(funciton(){
$('a.img_extended').click(function(){
showHideDiv($(this).parent().find('div.img_extended'));
});
});
function showHideDiv(theDiv) {if ($('theDiv').is(':visible')) {$('theDiv').slideDown('slow');
} else {$('theDiv').slideUp('slow');
};
});
</script>
The important code is on line 4:
showHideDiv($(this).parent().find('div.img_extended'));
Here we tell jQuery to move its focus from the <a> element that was clicked, to its parent div and then look for the child div by class. Now jQuery can modify the div but only inside the same parent div as the link tag.
I have had to rush this a bit and the code can still be refined, but it should give you some idea of a different approach to take. What you need to do is repeat lines (3-5) so that you have a block of code for each <div> class.
I hope this helps, good luck with the project,
Dan