/*
	Image Cross Fade Redux
	Version 1.0
	Last revision: 02.15.2006
	steve@slayeroffice.com

	Rewrite of old code found here: http://slayeroffice.com/code/imageCrossFade/index.html
*/

var d=document, imgs = new Array(), zInterval = null, current=0, pause=false;

window.addEvent('domready',function(){
	imgs = $$('#slideshow img');
	
	for(i=1;i<imgs.length;i++) { 
		imgs[i].xOpacity = 0;
	}
	imgs[0].setStyle('display','block');
	imgs[0].xOpacity = .99;
		

	so_xfade.periodical(4000);
},'javascript');

function so_xfade()
{
	nIndex = imgs[current+1]?current+1:0;
	imgs[current].tween('opacity',1,0);
	imgs[nIndex].tween('opacity',0,1).setStyles({'opacity':0,'display':'block'});
	current = nIndex;
}
