How to display Facebook Like Box-like list of logged in users

Hello everybody,
I’m trying to build a Facebook’s Like Box-like widget.
I’ve an array of users I want to display at random along with their associative pictures.
Here’s the code I’ve been done so far:

<ul id=myList>


var myList = document.querySelectorAll('#myList li'),
	users = [user1, user2, user3, user4, user5],
	images = [image1, image2, image3, image4, image5];
myList[0].innerHTML = '<img src="' + images[0] + '" />';

How do I do this in a for loop, provided that I don’t know how many user logged in and if I want to pick just only five at a time.

Thank you,

I get it done. For loop won’t work. It can be done in if clause thingy with a slice function.