//************************************************************************************************* 
// Design           	: FvdM Design Studio's 2003-2010
// Initial file date	: 10 May, 2003
// Function(s)			: Next and previous photo functions
// Change history		:	Date		By		Revision	Description
//							10-05-2003	FvdM	1.0			Initial version.
//							17-09-2005	FvdM	1.1			Added function "ShowSelectedPhoto", to
//															get the first photo correct when accessing
//															Photopage.html for the first time.
//							13-07-2007	FvdM	1.2			Added function "PreloadPhotos" with
//															corresponding variables "PhotoBuffer" and 
//															"ZoomOutDummy".
//							12-03-2010	FvdM	1.3			Added "document.CurrentPhoto.title" in
//															functions "ShowSelectedPhoto()" and
//															"ShowPhoto()" to view alt-texts in IE8.
//*************************************************************************************************

//Array declarations
var PhotoBuffer	= new Array(LastPhotoNumber + 1);

//Initialisation of variables
ZoomOutDummy		=	"Images/Zoom_out.jpg";

//Function definitions
function ShowSelectedPhoto()	{
	    document.write('<img name="CurrentPhoto">');
		document.CurrentPhoto.src= PhotoSource[PhotoCounter];
		document.CurrentPhoto.alt= PhotoText[PhotoCounter];
		document.CurrentPhoto.title= PhotoText[PhotoCounter];
}

function NextPhoto()	{
		if (PhotoCounter == LastPhotoNumber) {
			PhotoCounter= FirstPhotoNumber;
			}
		else {
			PhotoCounter= PhotoCounter + 1;
		}
		ShowPhoto();
}

function PrevPhoto()	{
		if (PhotoCounter == FirstPhotoNumber) {
			PhotoCounter= LastPhotoNumber;
			}
		else {
			PhotoCounter= PhotoCounter - 1;
		}
		ShowPhoto();
}

function ShowPhoto() {
		document.CurrentPhoto.src= PhotoSource[PhotoCounter];
		document.CurrentPhoto.alt= PhotoText[PhotoCounter];
		document.CurrentPhoto.title= PhotoText[PhotoCounter];
		document.all.TextLeft.innerHTML= PhotoSubscript[PhotoCounter] + '...';
		document.all.TextRight.innerHTML= Photographer[PhotoCounter] + '.';
}

function PreLoadPhotos()	{
	PhotoZoom		= new Image();
	PhotoZoom.src	= ZoomOutDummy;
	for (DimCntr = 1; DimCntr <= LastPhotoNumber; DimCntr++)	{
		PhotoBuffer[DimCntr] 		= new Image();
		PhotoBuffer[DimCntr].src	= PhotoSource[DimCntr];
		}
}
