    var bgimages=new Array();
    var pathToImg=new Array();
    var link=new Array();
    var inc=-0;
    bgimages[0] = "images/top-bild-0.jpg"
    bgimages[1] = "images/top-bild-1.jpg"
    bgimages[2] = "images/top-bild-2.jpg"
    bgimages[3] = "images/top-bild-3.jpg"
    bgimages[4] = "images/top-bild-4.jpg"
    bgimages[5] = "images/top-bild-5.jpg"
    
    link[0] = "#.php"
    link[1] = "#.php"
    link[2] = "#.php"
    link[3] = "#.php"
    link[4] = "#.php"
    link[5] = "#.php"
    //Images vorladen
    for (i=0; i < bgimages.length; i++) {
            pathToImg[i]=new Image();
            pathToImg[i].src=bgimages[i];
    }
    
    function bgfade() {
            if (inc < bgimages.length-1) {
                    
                    inc++
            } else {
                    inc=0
                   
            }
            document.getElementById("topbild").style.backgroundImage = "url("+pathToImg[inc].src+")";
			document.getElementById("topbild").onclick=new Function("window.location='"+link[inc]+"';");
            fade();
    }
    
    function fade(step) {
            step = step || 60;
            document.getElementById("topbild").style.opacity = step/100;
            document.getElementById("topbild").style.filter = "alpha(opacity=" + step + ")";
            step = step + 1;
            if (step <= 100) {
                    window.setTimeout(function () { fade(step); }, 1);
            } else {
                    step = 60;
            }
    }
    
    if (document.all||document.getElementById) window.onload=new Function('setInterval("bgfade()",5000)')
