/******************************** lavalampe.js ********************************
* written by Johannes Bouchain - Stadtkreation - http://www.stadtkreation.de *
*                           (c) Stadtkreation 2009                           *
******************************************************************************/

var myBgColor=new Array();

// Hier so viele Farben wie gewünscht mit RGB-Wertenangeben (den Zähler bei myBgColor nicht vergessen - aufsteigend und ohne Lücke)
myBgColor[0]=new Array(225,125,167);
myBgColor[1]=new Array(225,125,167);
myBgColor[2]=new Array(225,125,167);
myBgColor[3]=new Array(255,255,51);
myBgColor[4]=new Array(255,255,51);
myBgColor[5]=new Array(255,255,51);
myBgColor[6]=new Array(167,199,43);
myBgColor[7]=new Array(167,199,43);
myBgColor[8]=new Array(167,199,43);
myBgColor[9]=new Array(27,46,50);
myBgColor[10]=new Array(27,46,50);
myBgColor[11]=new Array(27,46,50);
myBgColor[12]=new Array(49,150,255);
myBgColor[13]=new Array(49,150,255);
myBgColor[14]=new Array(49,150,255);

// Hier die Geschwindigkeit einstellen: je größer, desto langsamer
var stoptime=30;

// Ab hier sollten keine Änderungen mehr vorgenommen werden
var currentColor=0; var count=0;

function lavaLampe() {
	var nextColor=currentColor+1;
	if(!myBgColor[nextColor]) nextColor=0;
	var rgbChange=new Array(Math.round((myBgColor[currentColor][0]-myBgColor[nextColor][0])/255*count,0),Math.round((myBgColor[currentColor][1]-myBgColor[nextColor][1])/255*count,0),Math.round((myBgColor[currentColor][2]-myBgColor[nextColor][2])/255*count,0));
	document.getElementsByTagName("body")[0].style.background="rgb("+Math.round(myBgColor[currentColor][0]-rgbChange[0],0)+","+Math.round(myBgColor[currentColor][1]-rgbChange[1],0)+","+Math.round(myBgColor[currentColor][2]-rgbChange[2],0)+")";
	count++;
	if(count==255) {
		currentColor++;
		if(!myBgColor[currentColor]) currentColor=0;
		count=0;
	}
	window.setTimeout("lavaLampe()",stoptime);
}