/**
* Simple Horizontal Scroll v0.1
* By: me@daantje.nl
* last update: Sun Dec 24 00:13:19 CET 2006
*
*	Documentation: Copy & paste
*	License: LGPL
*	Support: some.
*/

var scrllTmr;
function scrollerinit(anzahl){
	for (i=1;i<=anzahl;i++) {
		anid = 'stelle'+i;
		document.getElementById(anid).style.height = '0px';
	}

	fadeproz=0.0;
	anid = 'stelle1';
	document.getElementById(anid).style.opacity=fadeproz;
	document.getElementById(anid).style.height = Ht[anid]+'px';
	scrollStep(1,anzahl,fadeproz,0.02);
}
function scrollStep(idx,anzahl,fadeproz,increment){
//alert (idx+','+anzahl+','+fadeproz+','+increment);
	if (increment > 0) {
		if 	(fadeproz < 1)	{
			anid = 'stelle'+idx;
			document.getElementById(anid).style.opacity=fadeproz;
			fadeproz+=increment;
			scrllTmr = setTimeout('scrollStep('+(idx)+','+(anzahl)+','+(fadeproz)+','+(increment)+')',50);
		} else {
			anid = 'stelle'+idx;
			document.getElementById(anid).style.opacity=1;
			increment=-increment;
			scrllTmr = setTimeout('scrollStep('+(idx)+','+(anzahl)+','+(fadeproz)+','+(increment)+')',50);
		}
	} else {
		if 	(fadeproz > 0)	{
			anid = 'stelle'+idx;
			document.getElementById(anid).style.opacity=fadeproz;
			fadeproz+=increment;
			scrllTmr = setTimeout('scrollStep('+(idx)+','+(anzahl)+','+(fadeproz)+','+(increment)+')',50);
		} else {
			anid = 'stelle'+idx;
			document.getElementById(anid).style.opacity=0;
			document.getElementById(anid).style.height = '0px';
			if (idx < anzahl) { idx++; } else { idx=1; }
			anid = 'stelle'+idx;
			document.getElementById(anid).style.opacity=0;
			document.getElementById(anid).style.height = Ht[anid]+'px';
			increment=-increment;
			fadeproz=0.0;
			scrllTmr = setTimeout('scrollStep('+(idx)+','+(anzahl)+','+(fadeproz)+','+(increment)+')',50);
		}
	}
/*
	if 	(fadeproz < 1)	{
//		alert('fadeproz: '+fadeproz);
		if (oldid !='') {
			document.getElementById(oldid).style.opacity=(1-fadeproz);
		}
		anid = 'stelle'+idx;
		document.getElementById(anid).style.opacity=fadeproz;
		fadeproz+=0.02;
		scrllTmr = setTimeout('scrollStep('+(idx)+','+(anzahl)+','+(fadeproz)+',"'+(oldid)+'")',50);
	} else {
		if (oldid !='') {
			document.getElementById(oldid).style.opacity=(0.0);
			document.getElementById(oldid).style.height = '0px';
		}
		anid = 'stelle'+idx;
		document.getElementById(anid).style.opacity=1.0;
		oldid = anid;

		if (idx < anzahl) { idx++; } else { idx=1; }
		anid = 'stelle'+idx;
		fadeproz=0.01;
		document.getElementById(anid).style.opacity=fadeproz;
		document.getElementById(anid).style.height = Ht[anid]+'px';

		scrllTmr = setTimeout('scrollStep('+(idx)+','+(anzahl)+','+(fadeproz)+',"'+(oldid)+'")',50);
/*
		if (oldid !='') {
			document.getElementById(oldid).style.height = '0px';
		}
		anid = 'stelle'+idx;
//		alert('next: '+anid);
		fadeproz=1;
		document.getElementById(anid).style.opacity=fadeproz;
		document.getElementById(anid).style.height = Ht[anid]+'px';
//		oldid = anid;

		//wait and do next...
		if(scrllTmr)
			clearTimeout(scrllTmr);
		if (idx < anzahl) { idx++; } else { idx=1; }
		scrllTmr = setTimeout('scrollStep('+(idx)+','+(anzahl)+','+(fadeproz)+',"'+(oldid)+'")',2000);
	}
*/
}


