
// Anfahrtskizze
        var bildPfad2 = '/img/anfahrt/';

        maps = new Array();

        // Bilder vorladen und ggf. richtige 3rd Level Navigation einschalten
        function preloadMap()
        {
                 if (document.images)
                 {
                         for (i =1; i<=4;i++)
                        {
                                 maps[i] = new Image();
                                maps[i].src = bildPfad2 + 'skizze_anfahrt_' + i + '.gif';
                         }
                 }
         }

         mapZoom=1;

        function swapMap(which)
        {
                which = parseInt(which);
                mapZoom += which;

                if(mapZoom<1) mapZoom=1;
                else if(mapZoom>=1 && mapZoom <=4) document.images.map.src=maps[mapZoom].src;
                else if(mapZoom>4) mapZoom=4;
        }

//Neue Navigation
        var which='';
        var which2 ='';
        var last='';
        var wait=false;
        var newNav = 0;


function navigate(which)
{
        newNav = 1;
        if (last =='' || last == which)
        {
                if(document.layers && document.layers[which]) document.layers[which].visibility="show";
                if((!document.all)&&(document.getElementById)) document.getElementById(which).style.visibility="visible";
                //if(document.all) document.all[which].style.visibility="visible";
                if((document.all)&&(document.all[which]))document.all[which].style.visibility="visible";
                last = which;
        }
        else
        {
                navigateout(last);
                if(document.layers && document.layers[which]) document.layers[which].visibility="show";
                if((!document.all)&&(document.getElementById)) document.getElementById(which).style.visibility="visible";
                if((document.all)&&(document.all[which])) document.all[which].style.visibility="visible";
                last = which;
        }

}


function colorOn(which)
{
        newColor="#6F9EC0";
        if(document.layers) document.layers[which].color=newColor;
        if((!document.all)&&(document.getElementById)) document.getElementById(which).style.backgroundColor = newColor;
        if(document.all)document.all[which].style.background=newColor;
}

function colorOff(which)
{
        defaultColor="#235E88";
        if(document.layers) document.layers[which].color=defaultColor;
        if((!document.all)&&(document.getElementById)) document.getElementById(which).style.backgroundColor = defaultColor;
        if(document.all) document.all[which].style.background=defaultColor;
}


function navigateout(which)
{
        //which2=which
        //newNav = 0;
        //window.setTimeout('navigateoutwait(which2)',1);
        if(document.layers  && document.layers[which]) document.layers[which].visibility="hide"
        if((!document.all)&&(document.getElementById)) document.getElementById(which).style.visibility="hidden";
        if(document.all) document.all[which].style.visibility="hidden";
}

//Browser ueberpruefen
function check_browser(){

if (navigator.appName.indexOf("Microsoft") != -1){
                if (navigator.userAgent.indexOf("3.") != -1 ) return 1 ;
                if (navigator.userAgent.indexOf("4.") != -1 ) return 5 ;
                if (navigator.userAgent.indexOf("5.") != -1 ) return 6 ;
        }
        else if (navigator.appName == "Netscape"){
                if (navigator.userAgent.indexOf("2.") != -1 ) return 2 ;
                if (navigator.userAgent.indexOf("3.") != -1 ) return 3 ;
                if (navigator.userAgent.indexOf("4.") != -1 ) return 4 ;
        }
    alert(navigator.appName);
                return 0;
 }


var bildPfad = '/img/';

buttonOn = new Array();
buttonOff = new Array();

// Bilder vorladen und ggf. richtige 3rd Level Navigation einschalten
function preloadImages()
{
         if (document.images)
         {
                 for (i =0; i<document.images.length;i++)
                {
                         if (document.images[i].name.indexOf('_button')!=-1)
                        {
                                stopPoint = document.images[i].name.indexOf('_button');
                                bildName =document.images[i].name.substring(0,stopPoint);

                                buttonOn[document.images[i].name] = new Image();
                                buttonOn[document.images[i].name].src = bildPfad + bildName + '_on.gif';
                                buttonOff[document.images[i].name] = new Image();
                                 buttonOff[document.images[i].name].src = bildPfad + bildName + '_off.gif';
                         }
                 }
         }
 }

//onMouseOver -> einschalten
function lightup(which)
{
        if (document.images)
        {
                whichButton = which +"_button";
                newButton =  buttonOn[whichButton];
                 if(buttonOn[whichButton]) document.images[whichButton].src=buttonOn[whichButton].src;
                return true;
         }
         else return false;
}

//onMouseOut  -> ausschalten
function darken(which)
{
        if (document.images)
        {
                whichButton = which +"_button";
                newButton = buttonOff[whichButton];
                if(buttonOff[whichButton]) document.images[whichButton].src=buttonOff[whichButton].src;
                return true;
        }
        else return false;
}

// Pop_up Fenster
function pop_up(which, title, width, height, scrollbars)
{
        my_pop_up= window.open(which, title,'width='+ width +',height=' + height + ',scrollbars=' + scrollbars + ',resizable=yes');
    if (my_pop_up != null)
        {
            if (my_pop_up.opener == null)
                {
                      my_pop_up.opener = self
                   }
                my_pop_up.window.focus();
        }
}

