var txt = new Array('txt1','txt2','txt3','txt4','txt5');
var img = new Array('img30','img20','img10');
var txtCopy = txt;
var imgCopy = img;
txt.each(function(el){
	$(el).hide();
	new Effect.Opacity(el,{duration:0.0,from:1.0,to:0.0});
	$(el).show();
});


function nextStep() {
	if (img.length>0) {
		new Effect.Opacity(img.shift(), {duration:2.0, from:1.0, to:0.0});
		setTimeout('nextStep()',2000);
	} else if (txt.length>0) {
		new Effect.Opacity(txt.shift(), {duration:1.5, from:0.0, to:1.0});
		setTimeout('nextStep()',1000);
	} else {
		imgCopy.each(function(el){
			$(el).hide();
		});
		txtCopy.each(function(el){
			$(el).style.zIndex='0';
		});
	}
}

nextStep();
