I posted yesterday about adding captions to a slideshow, and recieved a speedy answer (thanks very much). Now, the powers that be would like to add a new section to each slideshow image (in addition to the rotating text) that will hold thumbnails of images that will pop in new windows. I've copied the code that I ordinarily use to pop these windows and attempted to do my own javascript to make this happen (see extraPics ID below) -- unfortunately, I've failed at one or both of these issues. Could someone please take a look at my code and figure out where I went wrong? The Mozille Javascript console is only confusing me even further. Thanks very much:

<html>
<body>
<script language="Javascript">

var myPix = new Array(1,2,3);

var thisPic = 0;

var Pic1="pic 1 text";
var Pic2="pic 2 text";
var Pic3="pic 3 text";

var myText = new Array(Pic1,Pic2,Pic3);

var ExtraPic1 = "<a href="javascript:popSidebar('/sidebar/20050705-efrati-sb1.html','500','650')><img src="/images/buyingselling/20050711-jordan.gif" height="50" width="50" border="1"></a>;
Var ExtraPic2 = "<a href="javascript:popSidebar('/sidebar/20050705-efrati-sb2.html','500','650')><img src="/images/buyingselling/20050711-jordan.gif" height="50" width="50" border="1"></a>;
var ExtraPic3 = "<a href="javascript:popSidebar('/sidebar/20050705-efrati-sb3.html','500','650')><img src="/images/buyingselling/20050711-jordan.gif" height="50" width="50" border="1"></a>;

var myExtra = new Array (ExtraPic1,ExtraPic2,ExtraPic3);

function previous() {

thisPic --;

if (thisPic < 0) {

thisPic = 2;

}

document.myPicture.src = "/images/buyingselling/20050711-retreats-" + myPix[thisPic] + ".jpg";
document.getElementById('picText').innerHTML=myText[thisPic];
document.getElementById('extraPics').innerHTML=myExtra[thisPic];

}

function next() {

thisPic ++;

if (thisPic > 2) {

thisPic = 0;

}


document.myPicture.src = "/images/buyingselling/20050711-retreats-" + myPix[thisPic] + ".jpg";
document.getElementById('picText').innerHTML=myText[thisPic];
document.getElementById('extraPics').innerHTML=myExtra[thisPic];

}

</script>
<p>


<p>
Intro text goes here</p>

</p>

</p>

</p>
<div style="width:315px;">
<p align="center">
<font face="Arial" size="2">
<a href="javascript:previous()">&lt; Previous</a> |
<a href="javascript:next()">Next &gt;</a> </font>
</p>


<p style="text-align:center;">


<img border="0" src="/images/buyingselling/20050711-retreats-1.jpg" width="315" height="600" name="myPicture">
</p>
<p id="picText">First image text goes here</p>
<hr>
<p align="left">ADDITIONAL IMAGES</p>
<p id="extraPics"><a href="popSidebar('/sidebar/20050705-efrati-sb.html','500','650')><img src="/images/buyingselling/20050711-jordan.gif" height="50" width="50" border="1"></a></p>
<p style="text-align:center;">
<font face="Arial" size="2">
<a href="javascript:previous()">&lt; Previous</a> |
<a href="javascript:next()">Next &gt;</a> </font>
</p>
</div>
</body>

</html>