here is the array and relevent code:

```
galleryTypes = [];
galleryTypes[0] = ['basements', 3];
galleryTypes[1] = ['bathrooms', 8];
galleryTypes[2] = ['customcarpentry', 7];
galleryTypes[3] = ['desksporches', 8];
galleryTypes[4] = ['flooring', 5];
galleryTypes[5] = ['historicrestoration', 6];
galleryTypes[6] = ['kitchens', 6];

$(document).ready(function () {

    startNow = setInterval(forwardImage, 4000);

    var GalleryName = $('.GalTitle').attr('id');
        alert(GalleryName);

for( var galResult = 0, len = galleryTypes.length; galResult < len; galResult++ ) {
    if( galleryTypes[i][0] === GalleryName ) {
        return galResult;
        break;
    }
}

    alert(galResult);

```

I would like to find a function that will allow me to find the index of the first array in which the string sits. IE: basements would return 0 and flooring would return 4.

I will go on to use the index to get at the second part of the second array, like basements would eventually lead me to 3 and flooring to 5. I don't want to go directly there as I need to use the index to find items in yet another array later on.

Thank you very much for any help you can give me. I would like to use code that will be supported by most browsers. This current code does not even post the second alert.