function start_slideshow(key, total, delay, container, auto_size) 
{
	//
	var time = 5.0;
	var height 		= 0;
	var min_height 	= $(key + 0).getHeight();
	
	// get min/max heights
	for (var i = 0; i < total; i++)
	{
		// alert($(key + i).getHeight());
		
		var height = $(key + 0).getHeight();
		
		// current items height lesser assign
		if (height < min_height)
		{
			min_height = height;
		}
	};
	// centre
	var height = 0;
	// 
	for (var i = 0; i < total; i++)
	{
		// height of target
		var height = $(key + i).getHeight();
		
		var diff = (height - min_height) / 2;

		// if the difference is greater than 2, center the image vertically
		if (diff > 2)
		{
			$(key+i).setStyle({top: '-'+diff+'px'});
		}
	}
	
	// should we resize the container?
	if (auto_size == true)
	{
		// resize container
		$(container).setStyle({height: min_height+'px'});
	}
	
	// start interval loop
    setTimeout(switch_slides(key, 0, total, delay, time), delay+time);
}

function switch_slides(key, frame, total, delay, time) {
    return (function() {
		// alert('frame: '+frame+' | total: '+total);
        
		Effect.Fade(key + frame, { duration: 5.0 });
        
		if (frame == (total)-1) 
		{
			frame = 0; 
		} 
		else 
		{ 
			frame = frame + 1; 
		}
		
		Effect.Appear(key + frame, { duration: 5.0 });
        // setTimeout("Effect.Appear('" + key + frame + "');", 850);
        setTimeout(switch_slides(key, frame, total, delay), delay + 5000);
    })
}