var sto, sto1;
var picS = new Array;
var picGeladen = new Array;
var anzPics=6;
var aktPic=1;
var zIndex=1;
var aktH=1;
var aktB=1;
var maxH=379;
var maxB=900;
var schritte=30;
var schrittH=parseInt(maxH/schritte);
var schrittB=parseInt(maxB/schritte);
var pos=1;
function initPics() {
	for (var i=1;i<=anzPics;i++) {
		picGeladen[i]=0;
		picS[i]=new Image();
		picS[i].src="images/rezepte/pic"+i+".jpg";
		cur=getElement('wechselPic'+i);
		cur.className=('wechselPic'+pos);
		if (pos==4) pos=1;
		else pos+=1;
	}
	pos=0;
	sto = setTimeout("picWechseln()",1000);
}

function initStartPics() {
	for (var i=1;i<=anzPics;i++) {
		picGeladen[i]=0;
		picS[i]=new Image();
		picS[i].src="images/start/pic"+i+".jpg";
		cur=getElement('wechselPic'+i);
		cur.className=('wechselPic'+pos);
		if (pos==4) pos=1;
		else pos+=1;
	}
	pos=0;
	sto = setTimeout("picWechseln()",1000);
}

dummy=1;
var nextPic=1;
function picWechseln() {
	var cur;
	clearTimeout(sto);
	clearTimeout(sto1);
	if (aktPic==anzPics) nextPic=1;
	else nextPic=aktPic+1;
	if (picS[nextPic] && picS[nextPic].complete) {
		aktPic=nextPic;
		if (pos==4) pos=1;
		else pos+=1;
		cur=getElement('wechselPic'+aktPic);
		cur.className=('wechselPic'+pos);
		cur=getStyle('wechselPic'+aktPic);
		cur.width=1+'px';
		cur.height=1+'px';
		zIndex+=1;
		cur.zIndex=zIndex;
		cur.display="block";
		aktH=1;
		aktB=1;
		beschl=schritte
		sto1 = setTimeout("movePic()",2000);
	} else sto = setTimeout("picWechseln()",10);
}

var beschl=schritte
function movePic() {
	var cur;
	clearTimeout(sto1);
	aktB+=schrittB;
	if (aktB>maxB) aktB=maxB;
	aktH+=schrittH;
	if (aktH>maxH) aktH=maxH;
	beschl=1;
	if (beschl<1) beschl=1;
	cur=getElement('wechselPic'+aktPic);
	cur.className=('wechselPic'+pos);
	cur=getStyle('wechselPic'+aktPic);
	if (aktH<maxH && aktB<maxB) {
		cur.width=aktB+'px';
		cur.height=aktH+'px';
		sto1 = setTimeout("movePic()",beschl);
	} else {
		cur.width=maxB+'px';
		cur.height=maxH+'px';
		sto = setTimeout("picWechseln()",1);
	}
}

var isNav=(navigator.appName == "Netscape") ? true : false;

function getStyle(welches) {
	return (document.getElementById) ? document.getElementById(welches).style : (isNav) ? eval("document."+welches) : eval("document.all."+welches+".style");
}
function getElement(welches) {
	return (document.getElementById) ? document.getElementById(welches) : (isNav) ? eval("document."+welches) : eval("document.all."+welches);
}
var top=new Image
top.src="images/top.gif";

var top1=new Image
top1.src="images/top1.gif";


function topOver(welches) {
	var x=getElement("top"+welches);
	x.src=top1.src
}

function topOut(welches) {
	var x=getElement("top"+welches);
	x.src=top.src
}


