
var STI_imageShowPause = 5000;
var STI_imageShowFader = 2000;

var STI_imageShowSlide = new Array();
var STI_imageShowIndex = 0;
var STI_imageShowCount = 0;

function STI_imageShow( id ) {
	var config = { 'property': 'opacity', 'fps': 25, 'duration': STI_imageShowFader };
	var wrap = $( id );
	var height = 0;
	var slides = wrap.getChildren( 'div' );
	for ( var i = 0; i < slides.length; i ++ ) {
		slides[ i ].setStyle( 'opacity', i ? 0 : 1 );
		STI_imageShowSlide.push( new Fx.Tween( slides[ i ], config ) );
		height = Math.max( height, slides[ i ].firstChild.height );
	}
	STI_imageShowCount = slides.length;
	wrap.setStyle( 'height', height );
	window.setTimeout( "STI_imageShowStep()", STI_imageShowPause );
}

function STI_imageShowStep() {
	STI_imageShowSlide[ STI_imageShowIndex ].start( 0 );
	STI_imageShowIndex ++;
	if ( STI_imageShowIndex == STI_imageShowCount ) {
		STI_imageShowIndex = 0;
	}
	STI_imageShowSlide[ STI_imageShowIndex ].start( 1 );
	window.setTimeout( "STI_imageShowStep()", STI_imageShowPause + STI_imageShowFader );
}

