var scrollerwidth=600
var scrollerheight=30
var hoehefenster=30 


if (messages.length>1) {
	if (messages.length==2) {
		i=0;
	} else {
		i=2;
	}
} else {
	i=0;
}


// Netscape 6
function move1(whichlayer) {
	tlayer=eval(whichlayer);
	if (parseInt(tlayer.style.top)>0&&parseInt(tlayer.style.top)<=5) {
		tlayer.style.top=0;
		setTimeout("move1(tlayer)",3500);
		setTimeout("move2(document.getElementById('second2'))",3500);
		return;
	}
	if (parseInt(tlayer.style.top)>=-30) {
		tlayer.style.top=parseInt(tlayer.style.top)-5;
		setTimeout("move1(tlayer)",125);
	} else {
		tlayer.style.top=scrollerheight+16;
		tlayer.innerHTML=messages[i];
		if (i==messages.length-1) {
			i=0;
		} else {
			i++;
		}
	}
}

function move2(whichlayer) {
	tlayer2=eval(whichlayer);
	if (parseInt(tlayer2.style.top)>0&&parseInt(tlayer2.style.top)<=5) {
		tlayer2.style.top=0;
		setTimeout("move2(tlayer2)",3500);
		setTimeout("move1(document.getElementById('first2'))",3500);
		return;
	}
	if (parseInt(tlayer2.style.top)>=-30) {
		tlayer2.style.top=parseInt(tlayer2.style.top)-5;
		setTimeout("move2(tlayer2)",125);
	} else {
		tlayer2.style.top=scrollerheight+16;
		tlayer2.innerHTML=messages[i];
		if (i==messages.length-1) {
			i=0;
		} else {
			i++;
		}
	}
}


// IE
function move3(whichdiv) {
	tdiv=eval(whichdiv);
	if (tdiv.style.pixelTop >0 && tdiv.style.pixelTop <= 5) {
		tdiv.style.pixelTop=0;
		setTimeout("move3(tdiv)",3500);
		setTimeout("move4(second2)",3500);
		return;
	}
	if (tdiv.style.pixelTop >= tdiv.offsetHeight*-1) {
		tdiv.style.pixelTop-=5;
		setTimeout("move3(tdiv)",125);
	} else {
		tdiv.style.pixelTop=scrollerheight+16;
		tdiv.innerHTML=messages[i];
		if (i == messages.length-1) {
			i=0;
		} else {
			i++; 
		}
	}
}

function move4(whichdiv) {
	tdiv2=eval(whichdiv);
	if (tdiv2.style.pixelTop >0 && tdiv2.style.pixelTop <= 5) {
		tdiv2.style.pixelTop=0;
		setTimeout("move4(tdiv2)",3500);
		setTimeout("move3(first2)",3500);
		return;
	}
	if (tdiv2.style.pixelTop >= tdiv2.offsetHeight*-1) {
		tdiv2.style.pixelTop-=5;
		setTimeout("move4(tdiv2)",125);
	} else {
		tdiv2.style.pixelTop=scrollerheight+16;
		tdiv2.innerHTML=messages[i];
		if (i == messages.length-1) {
			i=0;
		} else {
			i++;
		}
	}
}

function startscroll() {
	if (messages.length > 0) {
		if (document.all) {
			document.all.first2.innerHTML=messages[0];
			if (messages.length > 1) {
				document.all.second2.innerHTML=messages[1];
			} else {
				document.all.second2.innerHTML=messages[0];	
			}
			move3(first2);
		} else if (document.getElementById) {
			document.getElementById('first2').innerHTML=messages[0];
			if (messages.length > 1) {
					document.getElementById('second2').innerHTML=messages[1];
				} else {
					document.getElementById('second2').innerHTML=messages[0];
				}
			move1(document.getElementById('first2'));
		}
	}
}

window.onload=startscroll


