function so_xfade2() {
	cOpacity2 = bilder2[aktuell2].xOpacity;
	nIndex2 = bilder2[aktuell2+1]?aktuell2+1:0;
	nOpacity2 = bilder2[nIndex2].xOpacity;
	
	cOpacity2-=.05; 
	nOpacity2+=.05;
	
	bilder2[nIndex2].style.display = "block";
	bilder2[aktuell2].xOpacity = cOpacity2;
	bilder2[nIndex2].xOpacity = nOpacity2;
	
	setOpacity2(bilder2[aktuell2]); 
	setOpacity2(bilder2[nIndex2]);
	
	if(cOpacity2<=0) {
		bilder2[aktuell2].style.display = "none";
		aktuell2 = nIndex2;
		setTimeout(so_xfade2,geschwindigkeit2);
		neuesBild2();
	} else {
		setTimeout(so_xfade2,50);
	}
	
	function setOpacity2(obj) {
		if(obj.xOpacity>.99) {
			obj.xOpacity = .99;
			return;
		}
		obj.style.opacity = obj.xOpacity;
		obj.style.MozOpacity = obj.xOpacity;
		obj.style.filter = "alpha(opacity=" + (obj.xOpacity*100) + ")";
	}	
}

function neuesBild2() {
	// immer ein Bild vorausladen
	if ( (aktuell2 < (bilderAnzahl2-2)) && (bilder2.length < bilderAnzahl2) ) {
		bilder2[aktuell2+2] = new Image();
		bilder2[aktuell2+2].src =  bilderPfad2 + "0" + ((aktuell2+3)<10 ? "0" + (aktuell2+3) : (aktuell2+3)) + ".jpg"
		bilder2[aktuell2+2].xOpacity = 0;
		d2.getElementById("bw2").appendChild(bilder2[aktuell2+2]);
	}
}
