/* Select the portraits to show */

var portrait_array = new Array();

Array.prototype.remove = function(from, to) {
	var rest = this.slice((to || from) + 1 || this.length);
	this.length = from < 0 ? this.length + from : from;
	return this.push.apply(this, rest);
};

function init_portraits()
{
	var nb = 0;
	var i = 1;
	while(i<=3 && portrait_array.length > 0)
	{
		nb = Math.round( Math.random() * (portrait_array.length-1) );
		img_src = portrait_array[nb][0];
		url = portrait_array[nb][1];
		title = portrait_array[nb][2];
		portrait_array.remove(nb);
		portrait = document.getElementById('portrait_'+i);
		portrait.style.display = 'block';
		portrait.getElementsByTagName('img')[0].src = img_src;
		portrait.getElementsByTagName('a')[0].href = url;
		portrait.getElementsByTagName('a')[0].title = title;
		i++;
	}
}