<!--
//----- 03-04-04,03-14-04
//----- slideshw.js was copied from showit.js
//----- A side show presenter/dispayer, sequential

//----- Start code here...

//----- Globals
var n         = theItems.length;
var max       = n;
var timeoutId = null;
var myPanel   = "";
var stopped   = true;
var whichItem = 0;

//----- Size of display screen panel
var myWidth   = 800;
var myHeight  = 525;

//----- 3 second delay between images...
var timeInterval = 3000;

//----- Load all images into the preload cache...
preLoadImages(n);


//----- Start of function area...
function setDisplayType(panel)
{
//----- Define "myPanel" here and display first image...
//----- You coud do this in the html doc too
	myPanel = panel;

        var imageType = '<img name="' + myPanel + '" border="0" width="' + myWidth + '" height="' + myHeight + '">';
        document.write(imageType);
}

function getNextImage()
{
//----- Local counter is advanced and reset...
//----- Reset the counter if out of range...
	if ( (whichItem + 1)  > n )
	{
		whichItem = 0;
	}

//----- This displays the image in the assigned panel
	document[myPanel].src = theItems[whichItem++];	
}

function singleAdvance()
{
	if ( stopped )
	{	
		getNextImage();
	}
}

function singleReverse()
{
//----- Counter is pre-advanced...
	if ( stopped )
	{
		whichItem--;
		whichItem--;

		if ( whichItem < 0 )
		{
			whichItem = (n - whichItem - 2 );
		}
	getNextImage();
	}
}

function preLoadImages(max)
{
//----- Load the prefetch buffer... or basically the image cache
//----- NOTE: By specifying a size, they display *MUCH* faster!
        var preBuffer   = new Array();

        for (var i = 0; i < max; i++)
        {
                preBuffer[i]     = new Image(myWidth, myHeight);
                preBuffer[i].src = theItems[i];
        }
}

function startShow()
{
//----- Begin the side show...

//----- This must be "forward"
	if ( document.slidecontrol.direction[0].checked )
	{
		getNextImage();
	}
	else
	{
		whichItem--;
		whichItem--;

		if ( whichItem < 0 )
		{
			whichItem = (n - whichItem - 2 );
		}
		getNextImage();
	}
	timeoutId = setTimeout("startShow()", timeInterval);
	stopped = false;
}

function stopShow()
{
	clearTimeout(timeoutId);
	stopped = true;
}

//-->
