var linkTimeout = "";

var arrowSpeed = 120;		/* Milliseconds to wait before showing next arrow */
var arrowColour = "#cbcb8f";	/* Colour of a visible arrow */
function showArrow(nextArrowID, linkName) {
	
	i = 0;
	while (document.all[linkName][i]) {
		if (i == nextArrowID) {
			/* Show the arrow */
			document.all[linkName][i].style.color = arrowColour;
		}
		else {
			/* Hide the arrow */
			document.all[linkName][i].style.color = "";
		}
		i++;
	}
	/* Remember which arrow is to be displayed next. */
	nextArrowID++;
	/* Check if we need to start at the beginning again. */
	if (nextArrowID == i) { nextArrowID = 0; }

	/* Setup a timeout for arrowSpeed milliseconds that will show the next arrow. */
	linkTimeout = setTimeout("showArrow(" + nextArrowID + ', "' + linkName + '"' + ")", arrowSpeed);
}

function startAnimatedLinkArrows(linkName) {
	/* Start the animation by showing arrow zero - the first arrow. */
	showArrow(0, linkName);
}

function stopAnimatedLinkArrows(linkName) {
	/* Hide the arrows */
	i = 0;
	while (document.all[linkName][i]) {
		document.all[linkName][i].style.color = "";
		i++;
	}

	/* Stop the pending call to showArrow() */
	clearTimeout(linkTimeout);
}
