// JavaScript Document

function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
} 

function fahrt(){
dw_scrollObj.scrollTo('wn', fahrtstrecke, 0);
}

function einblenden(){
initScrollLayer();
	
window.setTimeout("opacity('scrollbar2', 0, 100, 500)",500);
window.setTimeout("opacity('xxxx', 100, 20, 1500)",3000);
window.setTimeout("opacity('xxxx', 20, 100, 1500)",4500);
window.setTimeout("opacity('xxxx', 100, 20, 1500)",6000);
window.setTimeout("opacity('xxxx', 20, 100, 1500)",7500);
window.setTimeout("opacity('xxxx', 100, 20, 1500)",9000);
window.setTimeout("opacity('xxxx', 20, 100, 1500)",10500);
window.setTimeout("opacity('xxxx', 100, 20, 1500)",12000);
window.setTimeout("opacity('xxxx', 20, 100, 1500)",13500);
/*window.setTimeout("opacity('hauptmenu', 0, 100, 500)",3500);*/
window.setTimeout("opacity('fusszeile', 0, 100, 500)",3200);

window.setTimeout("fahrt()", 2000);
/*diese funktion findet sich in menu_03.js, basiert auf prototype und scriptaculous*/
/*window.setTimeout("menu_einblenden()", 2500);*/
}
