/***************************************************************************
*
*   Datei-Name       : menue2.js
*   Erstellt am      : 24.10.2004 - 10:06
*   Letze aenderung  : 23.11.2004 - 23:26
*   Made By          : M. Raith
*   I-Net            : www.m-raith.de.vu, www.raith.tk
*   E-Mail           : mia87@web.de
*   Copyright        : (c) by M. Raith 2004
*
***************************************************************************/

/**** Konfiguration des Menues ****/

// Hier wird in Millisekunden angeben, wie lange die Menues noch geoeffnet sein duerfen
var stayOpen = 0;

/**** Hauptscript ****/

//Classe für Browser check erstellen
function browser_check()
{
 this.ver = navigator.appVersion;
 this.agent = navigator.userAgent;
 this.dom = document.getElementById?1:0;
 this.opera = (navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?1:0;
 this.ie5 = (this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
 this.ie6 = (this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
 this.ie4 = (document.all && !this.dom && !this.opera5)?1:0;
 this.ie  = this.ie4||this.ie5||this.ie6;
 this.ns6 = (this.dom && parseInt(this.ver) >= 5) ?1:0;
 this.ns4 = (document.layers && !this.dom)?1:0;
 this.ns  = this.ns4 || this.ns6;
 this.mac = this.agent.indexOf("Mac")>-1
 this.browser = (this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera);
 return this;
}

// browser_check mit Variable abkuerzen
var br = browser_check();

/** Browser optimiertes CSS **/

if(br.ie) {
  document.write('<link href="menu_css/ie.css" rel="stylesheet"></link><!-- Internet Explorer -->');
}
else if(br.opera) {
  document.write('<link href="menu_css/opera.css" rel="stylesheet"></link><!-- Opera -->');
  }
else if(br.ns6) {
  document.write('<link href="menu_css/ns6.css" rel="stylesheet"></link><!-- Netscape 6 -->');
}
else {
  document.location.href = "angebot.html";
}

// In dieser wird waerend des Menue auf/zu Prozesses abgespeichert,
// ob das Sub-Menue geoeffnet oder geschlossen werden soll
var close_sub = new Array();

function ShowMenu(Menu, Id, Show)
{
    var obj = null;
    var vis;

    if(document.getElementById) {
       obj = document.getElementById(Menu + Id);
    }
    else if(document.layers) {
       obj = doucment.layers[Menu + Id];
    }
    else if(document.all) {
       obj = document.all[Menu + Id];
    }

    if(!obj) return false;

    if(close_sub[Id])
    {
       if(document.layers)
       {
          if(Show) vis = 'show';
          else vis = 'hidden';

          obj['visibility'] = vis;
          return obj['visibility'];
       }

       if(Show) vis = 'visible';
       else vis = 'hidden';

       var vis = Show ? 'visible' : 'hidden';
       return obj.style['visibility'] =  vis;
    }
}