Hi, I've some problem with arrays and hope someone here could help.

I have a dynamically generated array below:

Code:
var ar = new Array( );
ar[4] = new Array( );
ar[4][0] = new Option( "Main Disk", "0" );
ar[4][1] = new Option( "Root folder", "1" );
ar[4][2] = new Option( "Inside Root Folder", "3" );
ar[4][3] = new Option( "inside Inside Root", "4" );
For example, when I choose "Inside Root Folder", I need to loop thru the above array from the start and ends after it meets "Inside Root Folder".

My problem is, I need to first know what ar[x] will contain during dynamic (in this case, its 4). if not, I've no idea how to loop it. Anyone know a way to solve this?

Thanks in advanced.