/* Javascript for Ramprasad's Webpages */
/* Functions defined for navigating between pictures on my phtoblog*/
/* Implements a navigation scheme for my photoblog*/
/* Script modifid from post by Ed Powell (www.myboogpages.com)
at http://www.myboogpages.com/Archive/2003_10_09_index.html */

/* Created: 12 July 2005 */

/*
Function List
	function findNeighborPosts()
	function writePrev()
	function writeNext()
*/

var ArchiveArray = new Array();
var ArchiveLength;
var PostName = '';
var PostIndex;
var PrevIndex;
var NextIndex;

/* Script to populate archive array and determine the current post is in the photoblog template */

function findNeighborPosts() {
	var Index;
	ArchiveLength = ArchiveArray.length;
	PostIndex = -1;
	for(Index = 0; Index < ArchiveLength; Index++)
		if (ArchiveArray[Index] == PostName) PostIndex = Index;
	if (PostIndex != -1)
	{
		PrevIndex = PostIndex - 1;
		NextIndex = PostIndex + 1;
		if (PrevIndex < 0) PrevIndex = -1;
		if (NextIndex >= ArchiveLength) NextIndex = -1
	}
}

function writePrev() {
	linkName = "mainFoto";
	if (PrevIndex != -1)
		document.write('<a href="' + ArchiveArray[PrevIndex] + '" title="Previous Pic">&laquo;&nbsp;Prev</a>');
	else
		document.write('<span class="strikeThro" title="This is the first photo">&laquo;&nbsp;Prev</span>');
}

function writeNext() {
	if (NextIndex != -1)
		document.write(' :: <a href="' + ArchiveArray[NextIndex] + '" title="Next Pic">Next&nbsp;&raquo;</a>');
	else
		document.write(' :: <span class="strikeThro" title="This is the last photo">Next&nbsp;&raquo;</span>');
}