function pageCheck(){
var currentPage = "Image17"
var myPages = new Array()
myPages[0]="Image17"
myPages[1]="Image21"
myPages[2]="Image18"
myPages[3]="Image19"
myPages[4]="Image22"
myPages[5]="Image23"
myPages[6]="Image27"
myPages[7]="Image25"
myPages[8]="Image30"
myPages[9]="Image29"
myPages[10]="Image28"
myPages[11]="Image26"
for(i=0;i<=myPages.length;i++){
if(myPages*==currentPage){
document.myPages*.src = "VH_Images/buttons/visiting/visiting"+i+".gif"
}else{
document.myPages*.src = "VH_Images/buttons/visiting/default"+i+".gif"
}
}
}
Right so the above is a function situated in my head tag (in between js tags of course), and is called by the body onLoad property.
The function is meant to determine what page the user is viewing dependent on the value of the currentPage variable, and assign a certain button state to the button associated with the page and ensure that all the other buttons for the other pages are set to their default state.
As far as I can figure out by sticking alert boxes at random points in the code to debug, the function seems to be called fine, and executed fine until it hits the if statements inside the for loop. My guess is that’s where the problem must be…a problem with the array perhaps? I really don’t know what could be wrong :puzzled:.
Any help would be greatly appreciated
Thanks
Fargate