
function moveNext(id,imagePath)
{
	changeDisplay(id,imagePath);
	changeLink(id);

	changeNext(id,imagePath);
	changePrevious(id,imagePath);
}


function movePrevious(id,imagePath)
{
	changeDisplay(id,imagePath);
	changeLink(id);
	
	changeNext(id,imagePath);
	changePrevious(id,imagePath);
}


function changeDisplay(id,imagePath)
{
	if (document.getElementById)	// this is the way the standards work
	{
		var contentBlock = document.getElementById('displayImage');
		var imageRef = document.getElementById('imageRef');
	}
	else if (document.all)	// this is the way old msie versions work
	{
		var contentBlock = document.all['displayImage'];
		var imageRef = document.all['imageRef'];
	}
	else if (document.layers)	// this is the way nn4 works
	{
		var contentBlock = document.layers['displayImage'];
		var imageRef = document.layers['imageRef'];
	}
	contentBlock.innerHTML = "<img src='" + imagePath + fileList[id] + "' border='0' class='thumb' />";
	imageRef.innerHTML = fileList[id];
}


function changeLink(id)
{
	if (document.getElementById)	// this is the way the standards work
		var contentBlock = document.getElementById('linkBox');
	else if (document.all)	// this is the way old msie versions work
		var contentBlock = document.all['linkBox'];
	else if (document.layers)	// this is the way nn4 works
		var contentBlock = document.layers['linkBox'];

	contentBlock.innerHTML = '<a href="index.php?i=' + fileList[id] + '&id=' + id + '">Link to this Image</a>';
}


function changePrevious(id,key,imagePath)
{
	if (document.getElementById)	// this is the way the standards work
		var contentBlock = document.getElementById('previousBox');
	else if (document.all)	// this is the way old msie versions work
		var contentBlock = document.all['previousBox'];
	else if (document.layers)	// this is the way nn4 works
		var contentBlock = document.layers['previousBox'];

	if((id-1) >= 0) 
	{	
		this_file = fileList[id - 1]; 
		previous_file = fileList[id - 2]; 
		contentBlock.innerHTML = '<a href="Javascript:movePrevious(' + (id-1) + ',\'' + webfolderLarge + '\');">&lt; Previous</a>';

	} else {
		contentBlock.innerHTML = "&nbsp;";
	}


}

function changeNext(id,key,imagePath)
{
	if (document.getElementById)	// this is the way the standards work
		var contentBlock = document.getElementById('nextBox');
	else if (document.all)	// this is the way old msie versions work
		var contentBlock = document.all['nextBox'];
	else if (document.layers)	// this is the way nn4 works
		var contentBlock = document.layers['nextBox'];

	if((id+1) < (numElements)) 
	{	
		this_file = fileList[id + 1]; 
		next_file = fileList[id + 2]; 
		contentBlock.innerHTML = '<a href="Javascript:moveNext(' + (id+1) + ',\'' + webfolderLarge + '\');">Next &gt;</a>';
	} else {
		contentBlock.innerHTML = "&nbsp;";
	}


}



/*
imageRef
*/
