/* list all items */
var a_items = [
	'<img src="images/new1.gif">',
	'<img src="images/new2.gif">',
	'<img src="images/new3.gif">',
	'<img src="images/new4.gif">',
	'<img src="images/new5.gif">',
	'<img src="images/new6.gif">',
	'<img src="images/new7.gif">',
	'<img src="images/new8.gif">'
];

function randomize (a_items, n_count) {
	var n_index, s_html = '<table cellpadding="0" cellspacing="0" border="0"><tr>';
	while (a_items.length && n_count) {
		n_index = Math.ceil(Math.random() * a_items.length) - 1;
		s_html += '<td>' + a_items[n_index] + '</td>';
		a_items[n_index] = a_items[a_items.length - 1];
		a_items.length = a_items.length - 1;
		n_count--;
	}
	return s_html + '</tr></table>';
}

// call randomizer
// param 1 - list of items
// param 2 - number of items to display
document.write(randomize (a_items, 1));
