setTimeout not executing
<p>My setTimeout function does not want to work. I am not getting any of the alerts, so I'm assuming I did something incredibly stupid.</p>

<pre><code>var timeout = 1000;
for(k=0;k&lt;pages.length;k++)
{
    randomnumber=Math.floor(Math.random()*pages[k].length);
    setTimeout(function() {
        $.ajax({
            type: 'GET',
            url: pages[k][randomnumber],
            success: function(data) {
                alert(data);
                if(data.indexOf('VIDEO_LENGTH') &gt; 0)
                {
                    timeouttext = data.substr(data.indexOf('VIDEO_LENGTH')+12);
                    timeouttext = timeouttext.substr(timeouttext.indexOf('.'));
                    timeout = parseInt(timeouttext);
                    alert(timeout);
                }
                else
                    timeout = 1000;
                $('#loader').hide('fast','fade');
                $('#information').html(data);
                $('#information').show('fast','fade');
            }
        })
    },timeout);
    alert("PAGE " + k + " RandomNumber " + randomnumber + " : " + pages[k][randomnumber]);
    if(k==3) {
        k = 0;
    }
}
</code></pre>

<p>Can anyone assist me.</p>
