var nn4 = ( document.layers) ? true:false ;
var nn6 = ( document.getElementById ) ? true:false ;
var ie4 = ( document.all ) ? true:false ;
var schmal = 0 ;

 function  hide(id)     { 
     if ( id == 'schmal_Bahnen' )
            schmal = 0 ;
    if ( nn4 )   
           document.layers[id].visibility = 'hide' ;
    if ( nn6 )  
           document.getElementById(id).style.visibility = 'hidden' ;
    if ( ie4 )  
           document.all[id].style.visibility = 'hidden';
    } 

/* -----------------  Versteckt die  großen  Bilder der  Schmalspurbahnen  ---------------------------- */
 function hide_schmal_bild()  { 
          hide('bild1');     hide('bild2');        hide('bild3'); 
          hide('bild4');     hide('bild5');        hide('bild6'); 
          hide('bild7');     hide('bild8');        hide('bild9'); 
          hide('bild10');   hide('bild11');      hide('bild12');
          hide('switch_button');
         } 

/*  --------------------------  Macht die  versteckte   Bilder sichtbar   -------------------------- */
function  show( id )    {
          if (nn4) 
                 document.layers[id].visibility = 'show';
           if ( nn6 ) 
                    document.getElementById(id).style.visibility = 'visible';
           if (ie4) 
                    document.all[id].style.visibility = 'visible';
            }

/*  ------------------------  Macht  das Menü für alle Bahnen   sichtbar   --------------------------  */
function  zeige( id )    {
          schmal = 0 ; 
          hide('schmal_Bahnen') ;
          if (nn4) 
                 document.layers[id].visibility = 'show';
           if ( nn6 )  
                    document.getElementById(id).style.visibility = 'visible';
           if (ie4) 
                    document.all[id].style.visibility = 'visible';
            }

/*  --------------------------  Macht  das Menü für  Schmal Bahnen  sichtbar   --------------------------  */
function  Bahnschmal( id )    {
          schmal = 1;
          if (nn4) 
                 document.layers[id].visibility = 'show';
           if ( nn6 )  
                    document.getElementById(id).style.visibility = 'visible';
           if (ie4) 
                    document.all[id].style.visibility = 'visible';
            }

/*  ---------------------------  Verstecken des Menüs   -----------------------  */
function Close_Menu  ( Ereignis )   {
       if ( !Ereignis )
                 Ereignis = window.event ;
       if ( document.all )  {
                 posx = Ereignis.clientX ;
                 posy = Ereignis.clientY ;
                 }
             else
                  if   ( document.getElementById ) {
                         posx = Ereignis.clientX ;
                         posy = Ereignis.clientY ;
                         }
       if  ( schmal ==0 ) {
                if  (  posx<25  ||  posx>210  ||   posy>180  )    {
                          hide('alle_Bahnen') ;
                         }
                }
       if  (  posx>360 || posy<95  || posy >165 )    {
                hide('schmal_Bahnen') ;
                }
                      //  window.status="X-Wert "+posx+ "  Y-Wert "+posy;         
      }  

/*  ---------------  Kontinuierliche Überwachung der Mausposition  -  Für Verstecken des Menüs ------- */
document.onmousemove=Close_Menu ;
