var routeSum = 0;
var start_value;
var end_value; 

function changeRoute(wert){

    if(routeSum == 0){
        start_value = document.routenplaner.start.value;
        end_value = document.routenplaner.end.value; 
        routeSum++;
    }

    if(wert == 0){
        document.getElementById("calendar_events_route_from").style.color = "rgb(32, 63, 126)";
        document.getElementById("calendar_events_route_from").style.textDecoration = "underline";
        document.getElementById("calendar_events_route_to").style.color = "rgb(0, 0, 0)";
        document.getElementById("calendar_events_route_to").style.textDecoration = "none";

        document.routenplaner.start.value = end_value;
        document.routenplaner.end.value = start_value;
    }
    
    if(wert == 1){
        document.getElementById("calendar_events_route_from").style.color = "rgb(0, 0, 0)";
        document.getElementById("calendar_events_route_from").style.textDecoration = "none";
        document.getElementById("calendar_events_route_to").style.color = "rgb(32, 63, 126)";
        document.getElementById("calendar_events_route_to").style.textDecoration = "underline";

        document.routenplaner.start.value = start_value;
        document.routenplaner.end.value = end_value;
    }
}


var aktiv = 0;
var newsboxCount = 0;
var to = 1;
var box_aktiv = 1;
var mediabox_aktiv = 1;
var mediabox_view_aktiv = 1;
var countImg = 0;
var countImgView = 0;
var countImgViewOnce = 0;
var mediabox_status = 1;
var mediabox_img_per_page = 10;

/************************************************************************************************/
/*                                                                                              */
/*                             Voreinstellungen auf der Website                                 */
/*                                                                                              */
/************************************************************************************************/

function init(){
    
    headGaleryImg = 1;
    
    while (document.getElementById("head_img_"+headGaleryImg)) {
       headGaleryImg++;
    }
    
    headGaleryImg--;

    var aktiv = window.setInterval("headerGaleryAnimation("+headGaleryImg+")", 6000);
}

var gImg = 1;

function headerGaleryAnimation(GaleryImages){
    gImg++;
    
    if(gImg <= GaleryImages){
       headerGaleryChange(gImg);   
    }else{
       gImg = 1;
       headerGaleryChange(gImg);   
    }
}

function headerGaleryChange(box){
    
    if(box_aktiv != box){
        if(document.getElementById('head_img_'+box)){
        
            new Effect.Fade('head_img_'+box_aktiv, { duration: 0.3 }); 
            
            if(document.getElementById('head_block_'+box_aktiv)){
                new Effect.Fade('head_block_'+box_aktiv, { duration: 0.3 }); 
            }
            
            new Effect.Appear('head_img_'+box, { duration: 0.3 });
            
            if(document.getElementById('head_block_'+box)){
                new Effect.Appear('head_block_'+box, { duration: 0.3 });
            }
        
            if(document.getElementById('head_link_'+box_aktiv) && document.getElementById('head_link_'+box)){
                document.getElementById('head_link_'+box_aktiv).style.backgroundColor = "#a19f9d";
                document.getElementById('head_link_'+box).style.backgroundColor = "#ffffff";
            }

            box_aktiv = box;   
            gImg = box_aktiv;
        }
    }
}




