// JavaScript Document

var ImageList = 0;
var ImageIndex = 0;
var ImageGroup = 3;

function AddImage( filename )
{
	if (ImageList == 0)
		ImageList = new Array();
	ImageList[ ImageList.length ] = filename;
}

function NextImageGroup()
{
	if ( (ImageIndex + ImageGroup) < ImageList.length )
		ImageIndex += ImageGroup;
	ImageUpdate();
}

function PreviousImageGroup()
{
	if ( ImageIndex  >= ImageGroup )
		ImageIndex -= ImageGroup;
	ImageUpdate();
}

function ImageUpdate()
{
	for (cnt =0; cnt < ImageGroup; cnt++)
		{
			obj = document.getElementById("ImageHolder" + cnt)
			if ( (cnt + ImageIndex) < ImageList.length )
				obj.src = ImageList[ cnt + ImageIndex ];
			else
				obj.src = "layout/1p.gif";
		}
}