// www.javarea.de
// http://www.javarea.de/index.php3?opencat=Javascript&subcat=Bild-Effekte&id=47
// erweitert von Martin Wagner
var i = 1
AnzPic = (images.length-1);
// alert("anzAHL" + AnzPic);

function previmg()
{
	if (i != 1)
	{
		i --
		document.img.src = images[i]
		document.getElementById('next').firstChild.nodeValue = "Nächstes >"
	}
	if (i == 1)
		document.getElementById('previous').firstChild.nodeValue="<                 "
}


function pickrand()
{
	var rand1 = Math.round( (AnzPic-1) * Math.random()) + 1;
	document.img.src = images[rand1]
	i = rand1
	if (i == 1)
		document.getElementById('previous').firstChild.nodeValue="<                 ";
	else
		document.getElementById('previous').firstChild.nodeValue="< Vorheriges";

	if (i == AnzPic)
		document.getElementById('next').firstChild.nodeValue="               >";
	else
		document.getElementById('next').firstChild.nodeValue="Nächstes >";
}

function firstimg()
{
	i = 1
	document.img.src = images[i];
	document.getElementById('previous').firstChild.nodeValue="<                 ";
	document.getElementById('next').firstChild.nodeValue="Nächstes >"
}

function lastimg()
{
	i = AnzPic
	document.img.src = images[i];
	document.getElementById('next').firstChild.nodeValue="               >";
	document.getElementById('previous').firstChild.nodeValue="< Vorheriges";
}

function nextimg()
{
	if (i != AnzPic)
	{
		i ++;
		document.img.src = images[i];
		document.getElementById('previous').firstChild.nodeValue="< Vorheriges";
	}

	if (i ==AnzPic)
		document.getElementById('next').firstChild.nodeValue="               >";

}


