var Pic = new Array()
var picLength = 23;
currentPicture = 0;

for (var i=0; i <= picLength; i++)
	Pic[i] = '/images/slideshow/'+ i + '.gif'
		
var preLoad = new Array()
for (i = 0; i < Pic.length; i++){
	preLoad[i] = new Image()
	preLoad[i].src = Pic[i]
}

function showNextPict () {
	new Effect.Opacity('slideshow', 
	{	duration:0.5,
		from:1.0,
		to:0,
		afterFinish: switchPict });
}
function switchPict (oObj) {
	currentPicture = ( currentPicture == (preLoad.length -1) ) ? 0 : currentPicture + 1;
	$('slideshow').src = preLoad[currentPicture].src;
	new Effect.Opacity('slideshow',
	{	duration:2.5,
		from:0,
		to:1.0 });
	setTimeout('showNextPict()', 7000);
}
