
// Handle the automatic rotation of shows

// Indicates the total number of shows to cycle between
var g_iShowCount = Number( 3 );
var g_iCurrentShow = Number( 1 );
var g_iShowTimerID = Number( 0 );
var g_iShowDuration = Number( 5000 );

function CycleShow( ) {
	
	// Determine the number of the new show
	iNewShow = ( g_iCurrentShow % g_iShowCount ) + 1;
	
	if ( iNewShow != g_iCurrentShow ) {
		
		// Hide the old show contents
		DocumentObject( 'show-photo-'+g_iCurrentShow, true ).display = 'none';
		DocumentObject( 'show-info-'+g_iCurrentShow, true ).display = 'none';
		
		// Show the new show contents
		DocumentObject( 'show-photo-'+iNewShow, true ).display = 'inline';
		DocumentObject( 'show-info-'+iNewShow, true ).display = 'inline';
	
		g_iCurrentShow = iNewShow;
	
		g_iShowTimerID = setTimeout( 'CycleShow();', g_iShowDuration );
	}
}

