var Testimonials = {
	item_index: 0,
	item_list: null,
	text_delay: 3,
	logo_delay: 6,
	
	Start: function(list, ldelay, tdelay) 
	{
		this.item_list = $(list).select('ol').first();
		this.item_list.childElements().each( function(item){ item.hide(); }	);
		this.item_list.childElements().first().show();
		this.text_delay = tdelay;
		this.logo_delay = ldelay;
		new PeriodicalExecuter(function(pe) { Testimonials.Next(); Testimonials.Restart(pe); }, this.logo_delay);
	},
	
	Restart: function(pe)
	{
		pe.stop();
		var delay = ((this.item_index % 2) == 0) ? this.logo_delay : this.text_delay;
		new PeriodicalExecuter(function(pe) { Testimonials.Next(); Testimonials.Restart(pe)}, delay);
	},
	
	Next: function()
	{
		Effect.Fade(this.item_list.childElements()[this.item_index], { duration:1, from:1.0, to:0.0 });
		this.item_index++;
		if (this.item_index >= (this.item_list.childElements().size())) this.item_index = 0;
		Effect.Appear(this.item_list.childElements()[this.item_index], { duration:1, from:0.0, to:1.0 });
		
	},
	
	Previous: function()
	{
		Effect.Fade(this.item_list.childElements()[this.item_index], { duration:1, from:1.0, to:0.0 });
		this.item_index--;
		if (this.item_index < 0) this.item_index = this.item_list.childElements().size() - 1;
		Effect.Appear(this.item_list.childElements()[this.item_index], { duration:1, from:0.0, to:1.0 });
	}
	
}