var t = 0;
var myChain = new Chain();

var createDiv = function()
{
	var img = new Element('div');
	img.setProperty('id', 'roster'+(t+3));
	img.setProperty('class', 'rosterhomepic');
	img.injectInside($('rosterhomecontainer'));
}

var updateContentDiv = function()
{
	var options = Object.extend({
	method: 'get',
	evalScripts: false
	}, options || {});
	
	new Ajax('rosterartist.php', {
	method: options.method,
	evalScripts: options.evalScript,
	update: $('roster'+(t+3))}).request();
}

var fadeEffect = function()
{
	var myEffect = new Fx.Styles('roster'+t, {duration: 500});
	myEffect.start({'opacity':[1, 0]})
}

var widthEffect = function()
{
	divWidth = $('roster'+t).getStyle('width').toInt();
	var myEffect = new Fx.Styles('roster'+t, {duration: 500});
	myEffect.start({'width':[divWidth, 0]})
}

var deleteDiv = function()
{
	$('roster'+t).remove()
}

var effectChain = function()
{
	t++;
	createDiv();
	updateContentDiv();
	fadeEffect();
	widthEffect.delay(500);
	deleteDiv.delay(1000);
}


var rostereffect = function()
{
  effectChain.periodical(7000);
}