I have this posted in another thread completely, but now I think I just need help with this section.

I want the images linked to buttons to swap images and hyperlinks in the same div. The images swap, but the learner video link is the only one that works, no matter which image is in the div. Can someone please review this and let me know what I need to do to make this work?

Code:
<script type="text/javascript">

$(document).ready(function(){ 
	$('a').click(function () { 
		var divname= this.name; $("#"+divname).show("fast").siblings().hide("fast"); 
		var n = divname.replace("div",""); 
		$("img").attr("src", "images/video"+n+".png"); 
		$("img").attr('href',"video"+n.attr('href'));		
	});
 

		var popupWindow = null;
			function centeredPopup(url,winName,w,h,scroll){
				LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
				TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
				settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
				popupWindow = window.open(url,winName,settings)
		}
});
 </script>
 
<div id="content">
    	<div id="header"></div>
    		<div id="buttons">
    			<div class="learner"><a href="#" name="div1">Learner</a><br />
        		<div class="mgrsup"><a href="#" name="div2">Manager/Supervisor</a>
            		</div>
        		</div>
    		</div>
    	<div id="video">
			<a class="video1" href="http://#.html" ><img onclick="centeredPopup(this.href,'myWindow','800','600','yes');return false"></a></div>
                       <a class="video2" href="http:#.html"><img onclick="centeredPopup(this.href,'myWindow','800','600','yes');return false"></a></div>
        </div>
Thanks so much for taking the time to view this post.
T.