var TIMEOUT = 3000;
var slideshowTimeout = 0;
var slideshow_images = null;
var slideshow_project = "";

function showImage (obj,ndx, ss) {
	if (slideshow_images == null)
		return;
	
	var img_path = "projects/"+slideshow_project+"/images/";

	blendImages('slideshow',obj,img_path + slideshow_images[ndx],2000);
	
	if (ss) {
		if (ndx < slideshow_images.length)
			ndx++;
		else
			ndx = 0;
		slideshowTimeout = setTimeout('showImage("'+obj+'",'+ndx+', true);',TIMEOUT);
	}
}

function slideshow(fg, slideshow_name) {
	if (slideshowTimeout != 0) {
		clearTimeout(slideshowTimeout);
		slideshowTimeout = 0;
	}

	slideshow_project = slideshow_name;
	if (slideshow_name)
		slideshow_images = images[slideshow_name];
	else
		slideshow_images = images;	

	slideshowTimeout = setTimeout('showImage("'+fg+'",0,true);',TIMEOUT*0.5);
}