matching position within an array within an associative array
<p>I'm wondering if it's possible to get the position of an element within an array that's within an associative array that's within another array.  For example, if i have the value "test1" stored in a variable is it possible to get the index of test1 then match that up with the values in the url key and pull the value that's in that same position (in this case www.test.com/test1.html?  Thanks in advance.</p>

<p>Edit:  I think posting more of the code might help.  I'm in so far over my head here I couldn't even really explain it properly.  I attempted to hack something together myself but it's not quite working. The important part is the "update the link" section.  So let's say that randomlink_i = test1 and it's a string.  When I try to pass randomlink_i to the indexOf function I get a -1 for that alert that's just below it.  However, if I just pass in 'test1' directly, instead of the variable then I get 0 which is the correct position.  Am I way off base here?</p>

<pre><code>var _SERIAL = new Array(
        { done: false, initialized: false, market: '', submarket: '' },
        { done: false, value: '', type: '' },
        { done: [false, false], value: '', initialized: [false, false], visited: [false, false], darkbackground: [false,false] },
        { done: false, value: '' }
);

var _MARKETS = new Array('', 
{
    title: 'first set',
    url: new Array('http://www.test.com/1.html','http://www.test.com/2.html','http: //www.test.com/3.html','http://www.test.com/4.html'),
    anchortext: new Array('test1','test2','test3','test4'),
    label: 'Register Now!'
},
{
    title: 'second set',
    url: new Array('http://www.test2.com/1.html','http://www.test2.com/2.html','http://www.test2.com/3.html','http://www.test2.com/4.html'),
    anchortext: new Array('test12','test22','test32','test42'),
    label: 'Register Now!'
}
</code></pre>

<p>)</p>

<pre><code>function initMarket() {
_DEBUG ? debugWrite('initMarket()') : '';
var randomlink_i;

// if there are sub markets
_OPEN_RADIOS[_SERIAL[0].market] ? randomlink_i = randomPop(_MARKETS[_SERIAL[0].market].anchortext[_SERIAL[0].submarket].anchortext) : randomlink_i = randomPop(_MARKETS[_SERIAL[0].market].anchortext);

// update the link on step 3
var marketlinks = $$('#btn_foot a');
marketlinks[0].innerHTML = randomlink_i;
alert(randomlink_i);
alert(typeof(randomlink_i));
var marketlinkposition = _MARKETS[_SERIAL[0].market].anchortext.indexOf(randomlink_i);
alert(marketlinkposition);
marketlinks[0].href = _MARKETS[_SERIAL[0].market].url[marketlinkposition];
alert(_MARKETS[_SERIAL[0].market].url[marketlinkposition]);

// removal of "_counted" attribute
for (var i=0; i&lt;marketlinks.length; i++) {
    marketlinks[i]._counted = undefined;
    marketlinks[i].removeAttribute('_counted');
}
</code></pre>

<p>}</p>
