I'm a littel confused as to what your trying to do.
So you want to open a new window from say page.html
But in that window you want to load the same page.html file, but you want an image in page.html to be displayed randomly from a list of images?
Yes, it's possible, but I should point out that this could cause some really confusing problems. Having a page that opens a new window with the same page means the use could end up opening that page in hundreds of different windows.
Anyways, if you still want to do this you'll need to do a couple of things for the random image display.
Firstly you'll need to name your <img> tag with a name="whatever" and an id="whatever", like so:
<img id="image1" name="image1" height="100" width="200" src="images/myDog.jog" />
Then you'll need to make a list of the images you'l want to random;y display in it's place. You'll need to make an array of strings that contain the path to those images:
randomImage = new Array()
randomImage[0] = "images/myDog.jpg"
randomImage[1] = "images/myCat.jpg"
randomImage[2] = "images/myChicken.jpg"
randomImage[3] = "images/myGoose.jpg"
randomImage[4] = "images/mySwampBear.jpg"
Then you'll need to generate a random number for that array:
randomNumber = Math.round(Math.random()*randomImage.length)
Then you'll need to set that random image to the <img> tag:
document.images("image1").src = randomImage[randomNumber]
Put it all in a function and call it on page load, which should look something like this when your finished:
<html>
<head><title>My Page</title>
<script type="text/css">
onload = setRandomImage
randomImage = new Array()
randomImage[0] = "images/myDog.jpg"
randomImage[1] = "images/myCat.jpg"
randomImage[2] = "images/myChicken.jpg"
randomImage[3] = "images/myGoose.jpg"
randomImage[4] = "images/mySwampBear.jpg"
function setRandomImage() {
randomNumber = Math.round(Math.random()*randomImage.length)
document.images("image1").src = randomImage[randomNumber]
}
</head>
<body>
<img id="image1" name="image1" height="100" width="200" src="images/myDog.jog" />
</body>
</html>