/*pic_anzahl > 3!!*/
var pic_anzahl=2;
var count_index=1;
var pic_name = "2.jpg";



document.observe('dom:loaded', function() {
Bild02 = new Image();
Bild02.src = "js_fading_home/2.jpg";

setTimeout("fade1()", 3000);
});


function fade1(){

//$('mood1').fade({ duration: 4.0, from: 1, to: 0});
//$('fade_navi').appear({ duration: 4.0, from: 0, to: 1});

$('mood1').fade({ duration: 4.0, from: 1, to: 0});
$('mood2').appear({ duration: 4.0, from: 0, to: 1});

setTimeout("fade2()", 6000);
}


function fade2(){
$('mood2').fade({ duration: 4.0, from: 1, to: 0});
$('mood1').appear({ duration: 4.0, from: 0, to: 1});

setTimeout("fade1()", 6000);
}

/*
function fade1(){
new Effect.Opacity('mood1', { from: 1.0, to: 0, duration: 3.6 }); 
new Effect.Opacity('mood2', { from: 0, to: 1, duration: 3.6 });
setDivs();
}

function fade2(){
new Effect.Opacity('mood2', { from: 1.0, to: 0, duration: 3.6 }); 
new Effect.Opacity('mood1', { from: 0, to: 1, duration: 3.6 });
setDivs();
}

function setDivs(){
if (count_index == pic_anzahl){
count_index=1;
pic_name = count_index+".jpg";
document.getElementById("mood1").style.backgroundImage ="url(js_fading_home/"+pic_name+")";
setTimeout("fade1()", 8000);
}

else if (count_index %2 == 0){
count_index ++;
pic_name = count_index+".jpg";
document.getElementById("mood1").style.backgroundImage ="url(js_fading_home/"+pic_name+")";
setTimeout("fade1()", 8000);
//alert("gerade");
}

else{
count_index ++;
pic_name = count_index+".jpg";
document.getElementById("mood2").style.backgroundImage ="url(js_fading_home/"+pic_name+")";
setTimeout("fade2()", 8000);
}

}
*/

