var HonoursRoll = new Class.create();

HonoursRoll.prototype =
{
	id: "",
	position: 0,
	people: null,
	
	initialize: function(id)
	{
		this.people = new Array();
		this.id = id;
	},
	
	addPerson: function(person)
	{
		this.people.push(person);
	},
	
	nextPerson: function()
	{
		this.position++;
		if(this.position > this.people.length - 1)
		{
			this.position = 0;
		}
		
		this.display(this.position);
	},	
	
	
	display: function(index)
	{
		var person = this.people[index];

		$(this.id).hide();		
		$(this.id).down(".picture").innerHTML = "";
		$(this.id).down(".student").innerHTML = "";

		$(this.id).down(".picture").appendChild(person.picture.element);
		new Insertion.Bottom($(this.id).down(".student"), "<b>" + person.career + "</b><br />" );
		new Insertion.Bottom($(this.id).down(".student"), person.name + "<br />" );
		new Insertion.Bottom($(this.id).down(".student"), "Promedio: " + person.average ); 
		Effect.Appear(this.id);				
	}			
	
}