var Dogs = new Array();
Dogs[0] = "Raven";
Dogs[1] = "Arek";
Dogs[2] = "Demo";
Dogs[3] = "Haley";
// Images = number of images
var Images = new Array();
Images[0] = 5;
Images[1] = 7;
Images[2] = 8;
Images[3] = 4;

function initDog(dog) {
if(dog === "") { dog='Raven'; }
imgSetNum = Dogs.indexOf(dog);
imgMax = Images[imgSetNum];
imgSetNum ++;
}

in the function initDog, imgSetNum = Dogs.indexOf(dog) always return -1 (not found). I verified that the "dog" value is correctly set to a dog name in the Dogs array.

What am I doing wrong?