Hello all,

For the life of me I cannot figure out how to counter to sync up with images for this slideshow. The images scroll correctly to the next and previous but the counter starts at "1" and then goes to "1" again and then properly in sequence. When I click previous the numbers jump incorrectly once and then goes in sequence correctly but does not correspond with the images correctly. HELP!

Here's the script. Thanks!

<script type='text/javascript'>

var imagelist=new Array(
"images/2008_Galileo/Galileo_1.jpg",
"images/2008_Galileo/Galileo_2.jpg",
"images/2008_Galileo/Galileo_3.jpg",
"images/2008_Galileo/Galileo_4.jpg",
"images/2008_Galileo/Galileo_5.jpg",
"images/2008_Galileo/Galileo_6.JPG",
"images/2008_Galileo/Galileo_7.jpg",
"images/2008_Galileo/Galileo_8.jpg"
)
// INITIALIZE COUNTER
var counter=0;
// IMAGE SWITCH
function SwapImage(theName,theSource) {
document.images[theName].src=theSource;
}
// NEXT IMAGE
function NextImage() {
counter=((counter<imagelist.length-1)?counter+1:0);
SwapImage("slide",imagelist[counter]);
}
// BACK IMAGE
function BackImage() {
counter=((counter>0)?counter-1:imagelist.length-1);
SwapImage("slide",imagelist[counter]);
}
function slideShow(direction){

if (direction == 'NextImage' && counter <=8){
counter++;
}

if (direction == 'BackImage' && counter >=0){
counter --;
}

document.getElementById("show").innerHTML = (counter+1)+"/8"
}
</script>