Hello! I need help. I'm still learning javascript and stuck. I have a script to click on a thumnail and have the larger image open in a new window with some text. Here's the script I'm using:

function image1() {
myWin= open("", "displayWindow", "width=300,height=450,status=no,toolbar=no,menubar=no");
myWin.document.open();

myWin.document.write("<html><body bgcolor=black><img src=1_300x388.jpg><br>");

myWin.document.write("<font size=4><font color=white>");

myWin.document.write("This is image 1 ");

myWin.document.write("</font></body></html>");

myWin.document.close();
}


The problem is, I have about 30 thumbnails. Do I need to rewrite this function for each thumnail? the only thing that will change is the image src in the new window and the text (this is image 1, this is image 2, etc) written to the new window.

I know theres a simpler solution but cant find it. thanks in advance for anyone's help.