picrecent = new Array(0,0,0,0,0,0,0,0);
var numpicframes = 8;
var filmdelay = 300;
var filmhoehe = 900;
var curpic = 1;
var filmstop = 0;
function mover(novar) {
	var i = 1;
	var j = 0;
	var a = 0;
	var k = filmhoehe / 2;
	while( i < (numpicframes + 1) ) {
		j = document.getElementById("frame"+i).style["top"];
		j = parseInt(j) + 5;
		if ( j > filmhoehe ) {
			changeonepic(i);
			j = j - (numpicframes * 128);
		}
		a = Math.round(0.5 + ( 400 * Math.random()));
		if ( a < 1 ) { a = 1; }
		if ( a == 1 ) {
			changeonepic(i);
		}
		j = j + "px";
		document.getElementById("frame"+i).style.top = j;
		i = i + 1;
	}
	j = filmstop;
	if ( j >= 0 ) { j = -130; }
	j = j + 5;
	filmstop = j;
	document.getElementById("filmstreifen").style.top = j + "px";
	window.setTimeout("mover(0)",filmdelay);
	return	true;
}
function rochange(pnum) {
	var p = pnum - 1;
	if ( p < 1 )  { p = numpicframes; }
	changeonepic(p);
	window.setTimeout("rochange("+p+")",7800);
	return true;
}
function changeonepic(picn) {
	var a = 0;
	var b = 0;
	if ( picn < 1 ) { return true; }
	if ( picn > numpicframes ) { return true; }
	curpic = picn;
	while ( ( a == picrecent[curpic-1] ) || ( a == 0 ) ) {
		a = Math.round(0.5 + (numpics * Math.random()));
		if ( a < 1 ) { a = 1; }
		if ( a > numpics ) { a = numpics; }
		for ( b = 0; b < numpicframes; ++b ) {
			if ( a == picrecent[b] ) {
				a = 0;
			}
		}
	}
	picrecent[picn-1] = a;
	ima = new Image();
	ima.src = "/shirts/pictures/" + picfilename[a-1];
	document.getElementById("pic" + picn).src = ima.src;
	document.getElementById("pic" + picn).alt = picinfotext[a-1];
	return true;
}
function changepic(ovar) {
	var a = 0;
	var b = 0;
	while ( ( a == picrecent[curpic-1] ) || ( a == 0 ) ) {
		a = Math.round(0.5 + (numpics * Math.random()));
		if ( a < 1 ) { a = 1; }
		if ( a > numpics ) { a = numpics; }
		for ( b = 0; b < 5; ++b ) {
			if ( a == picrecent[b] ) {
				a = 0;
			}
		}
	}
	picrecent[curpic-1] = a;
	ima = new Image();
	ima.src = "/shirts/pictures/" + picfilename[a-1];
	document.getElementById("pic" + curpic).src = ima.src;
	document.getElementById("pic" + curpic).alt = picinfotext[a-1];
	curpic = curpic + 1;
	if ( curpic > numpicframes ) { curpic = 1; }
	if ( numpics < 3 ) { return; }
	if ( ovar > 5 ) {
		window.setTimeout("mover(0)",250);
		return	true;
	}
	window.setTimeout("changepic("+(ovar+1)+")",filmdelay);
}
function deferredstartup(novar) {
	var i = 0;
	while ( i < numpicframes ) {
		i = i + 1;
		changeonepic(i);
	}
	return true;
}
function filmstartup(novar) {
	window.setTimeout("deferredstartup(0)",100);
	window.setTimeout("mover(0)",1000);
	return true;
}
function displaynote(BildNr) {
	document.getElementById("descrip").firstChild.nodeValue="";
}
