After I create another window, I want to be able to click on a link and change an image on the parent window. I was only able to change the image from the parent itself. But this is not what I want.

parent.html contains:

<html>
<head>
<script language="javascript1.2">
<!-- hide from old browsers

window.name = "QuizWindow";

function NewWindow(mypage, myname, w, h, scroll)
{
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable,dependent=yes'
optWindow = window.open(mypage, myname, winprops);
if (parseInt(navigator.appVersion) >= 4) { optWindow.window.focus(); }
}

//-- stop hiding--->
</script>
</head>
<body>
<a href="child.html" onClick="NewWindow(this.href,'optWindow','300','400','yes'); return false;">Create a window</a>
<a href="javascript:" onMouseOver="window.document.img1.src='ss.gif'" onMouseOut="window.document.img1.src='so.gif'"><img name="img1" src="so.gif" border=0></a>
<p>
<a href="javascript://"><img name="img2" src="so.gif" border=0></a>
</body>
</html>

--------------

child.html contains:

<html>
<head>
<script language="javascript1.2">
<!-- hide from old browsers

function NewWindow(mypage, myname, w, h, scroll)
{
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
optWindow = window.open(mypage, myname, winprops);
if (parseInt(navigator.appVersion) >= 4) { optWindow.window.focus(); }
}

function writeBack(Obj,imgName)
{
//var win = window.opener.name;
//win.document.open();
//win.document.img2.src = imgName;
parent.document.img2.src = imgName;
//win.document.close();
//alert ("parent: " + win + " - self.name: " + self.name);
}

//-- stop hiding--->

</script>

</head>
<body>
<a href="javascript://" onClick="writeBack('img2','ss.gif'); return false;">Write image</a>
</body>
</html>

------

The comment parts are things that I have tried, but they don't work either. Any help will be greatly appreciated.

Thanks!