а так?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<title>ttt</title>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1251">
<script type="text/javascript">
onload=function(){
var allPic, k;
allPic=document.getElementById("cont").getElementsByTagName("img");
k=allPic.length;
while(k--){allPic[k].onclick=myClick;};
};
function myClick(){
document.getElementById("elem").innerHTML='<img src="'+this.src+'" alt="">';
};
</script>
</head>
<body>
<div id="elem"></div>
<br>
<div id="cont">
<img src="1.gif" alt="">
<img src="pict1.jpg" alt="">
<img src="pict2.jpg" alt="">
</div>
</body>
</html>