var i = 1;
function wechsel(max) {
	document.getElementById('loader').style.display = "none";
	if(i==1) {
		if(document.getElementById('pic'+max).style.display != "none") {
			Effect.Fade('pic'+max,{duration:2});	/*SONDERFALL LETZTES BILD: AUSBLENDEN ERST AB 2. DURCHLAUF*/
		}
	}
	else {
		Effect.Fade('pic'+(i-1),{duration:2});	/*AUSBLENDEN DES VORHERIGEN*/
	}
	Effect.Appear('pic'+i,{duration:2});		/*EINBLENDEN AKTUELLES BILD*/
	i = i+1;
	if(i>=(max+1)) {
		i = 1;
	}
	var func = 'wechsel('+max+')';
	window.setTimeout(func, 4000);
}
