function visit(index, self)
{
	if(current = document.getElementById("visited"+index))
	{
		current.className = "visited";
		current.id = "";
	}
	self.className = "active";
	self.id = "visited"+index;
}

function nextImage(shoti)
{
	if(shoti > 0)
	{
		src = parent.document.getElementById("visited"+shoti);
		if(src)
		{
			next = src.nextSibling;
			if(next && (next.tagName == "A"))
			{
				parent.visit(shoti, next);
				document.location.href = next.href;
			}
		}
	}
}
