I found that in IE6 at least (I'm not sure about the more recent versions), the built-in Array type didn't have an indexOf method. If you're testing in IE, perhaps that's why you couldn't get started. I wrote this little addition to include in all my code:
if(!Array.prototype.indexOf){
Array.prototype.indexOf = function(obj){
for(var i=0; i<this.length; i++){
if(this[i]===obj){
return i;
}
}
return -1;
};
}
I can't really take credit for this. It's probably a fairly generic piece of code I found in some tutorial or one of Doug Crockford's articles. I'm quite sure someone will come along with a better way of writing it.
I find working in Firefox is a good place to start because you can install the Firebug console and get a better idea where things are going wrong. I admit that doesn't solve cross-browser problems, but at least it allows you to get a start on your project.
This little piece of code will ensure you can use the indexOf method to find where a given value is in a one-dimensional array. With your 2-dimensional array, each element in the outer array is an array not a single value. I'm going to do a little test to see exactly how that works and get back to you, unless someone else comes in with a better answer.
I hope this at least gets you started.
UPDATE
Assuming you have a browser that implements Array.indexOf, I've tried every which way to pass one of the array elements in your outer array.
alert(array.indexOf([3,56]))
alert(array.indexOf("3,56"))
just return -1.
Oddly,
alert(array.indexOf(array[1]))
correctly returns 1. But you need to know the index of the inner array to get the index! I can't see a way of passing an array to the indexOf method.