/* ------------------------------------------------------------------------------------- */
/*
   Autor   : Andreas Zierhut
   Stand   : 18.04.2000, V2.00
   Homepage: http://www.dhtml-now.de/
   E-Mail  : Andreas.Zierhut@t-online.de
   Hinweis : Das Script darf kostenlos weiterverwendet werden, solange dieser Kommentar
             im Script verbleibt. Evtl. Updates sind auf meiner Homepage zu finden.
             Bei Fehlern bitte ein E-Mail an mich schreiben.
                                                                                         */
/* ------------------------------------------------------------------------------------- */
/*
   Modifizierte Variante für Frames
   
   Autor   : Magnus Buschatz
   Stand   : 01.12.2000
   E-Mail  : magnus@buschatz.com
                                                                                         */
/* ------------------------------------------------------------------------------------- */
function checkBrowser()
{
	/*  Autor, Entwicklung 2003-2008 Kristof Lipfert Duesseldorf    */
	/*  Version 20080522                                            */
	
	check=[
	['window.postMessage',
	 'window.XMLHttpRequest&&(document.postMessage||window.external)',
	 'document.compatMode',
	 '(document.detachEvent||document.contentType)'],
	['window.execScript','window.pkcs11','window.opera','window.navigator&&window.navigator.vendor'],
	[['ie 8','ff 3','op 9.5','KDE?'],
	 ['ie 7','ff 2','op 9','KDE?'],
	 ['ie 6','ff 1.5','op 8','KDE/Safari 3'],
	 ['ie 5x','nn 7','op 7','KDE/Konqu. 3']]];
	var j; var b; for(n=0;n<check[1].length;n++){if(!eval(check[1][n])==0)b=n;}
	for(n=check[0].length;n>-1;n--){if(!eval(check[0][n])==0)j=n;}
	return ((j>-1&&b>-1)?check[2][j][b].substring(0, 2):'--');

}

function Menu(links, oben)
{
  mList[mList.length] = this.name;

  this.itemList = new Array();

  this.bgColor = '#BBBBBB';
  this.aborderColor = '#3366FF';
  this.aborderWidth = 1;

  this.iborderColor = this.bgColor;
  this.iborderWidth = 2;

  this.paddingLeft = 5;
  this.paddingRight = 5;
  this.paddingTop = 2;
  this.paddingBottom = 2;

  this.align = 'left';
  this.valign = 'top';
  this.alignTD = 'left';
  this.menuAlign = 'horizontal';
  this.submenuAlign = 'vertikal';

  this.color = '#000000';
  this.fontFamily = 'Verdana,Arial,Helvetica,Sans-Serif';
  this.fontSize = '9pt';
  this.textDecoration = 'none';
  this.fontStyle = 'normal';
  this.fontWeight = '600';

  this.hoverOn = true;
  this.hoverColor = this.bgColor;
  this.hoverbgColor = this.color;
  if (links && oben) {
    this.left = links;
    this.top = oben;
  }
  else {
    this.left = 0;
    this.top = 0;
  }

  this.SP = '<img src="spacer.gif" width='+this.iborderWidth+' height='+this.iborderWidth+' alt="">';
  this.addMenu = parent.paddMenu;
  this.addMenuItem = parent.paddMenuItem;
  this.build = parent.pbuild;
  this.create = parent.pcreate;
}

function initVars()
{

   with(document) {
    ns = document.layers ? true : false;
    ie = document.all ? true : false;
    ff = checkBrowser() == "ff";
    mCount = 0;
    mList = new Array();
    HoverObj = null;
    HoverObj2 = null;
    offen = '0,';
    hoverMenuOn = -1;
    hoverMenuAktuell = -1;
    frameAktuell = 2;
    init = -1;
  }
  if (ns) document.captureEvents(Event.CLICK);
  document.onclick = new Function ('parent.hideHoverMenu(); parent.checkMenu(0)');
}

function makeVars()
{
    with(document) {
    ns = document.layers ? true : false;
    ie = document.all ? true : false;
    ff = checkBrowser() == "ff";

    mCount = 0;
    mList = new Array();
    HoverObj = null;
    HoverObj2 = null;
    offen = '0,';
    hoverMenuOn = -1;
    hoverMenuAktuell = -1;
    frameAktuell = 1;
    init = -1;
  }
  with (parent.frames.frame1.document) {
     write('<HTML>\n<HEAD>\n</HEAD>\n<BODY BGCOLOR="#BBBBBB" leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>\n'); 
     write('<TABLE><TR><TD VALIGN="top"><NOBR><NOBR><A href="../index.html" target="_top"><IMG SRC="images/jupiter/jupiterlogo_28.gif" valign="top" border="0" height="28"></A></NOBR></TD></TR></TABLE>\n'); 
     Daten();
     write('</BODY>\n</HTML>\n'); }

  if (ns) document.captureEvents(Event.CLICK);
  document.onclick = new Function ('parent.hideHoverMenu(); parent.checkMenu(0)');
  //alert ('Make Vars - End');

}

function MenuInit()
{
    if (ns){
      //alert(parent.frames.frame1.document.layers.Menue0.document.anchors.aM0Pos0.y);
      parent.frames.frame1.document.layers.Menue0.pageY=parent.frames.frame1.window.innerHeight-parent.frames.frame1.document.layers.Menue0.document.anchors.aM0Pos0.y-1
      parent.frames.frame1.document.layers.Menue0.visibility="visible";
      yoffset = parent.frames.frame2.window.pageYOffset; 
      setInterval('parent.HideMenu()',100);
      }
    else if (ie||ff) {
     var Menue0 = parent.frame1.document.getElementById("Menue0");
    
     Menue0.style.visibility="visible";
     Menue0.style.posTop=parent.frames.frame1.document.body.clientHeight - Menue0.offsetHeight;
      //top.document.all.rahmen.rows=parent.frames.frame1.document.all["Menue0"].offsetHeight+",*";
      }

    if (lMenu.align == 'center') {
    if (ns){
      parent.frames.frame2.document.layers.Menue0.visibility="hidden";
      parent.frames.frame1.document.layers.Menue0.left = document.Menue0.pageX + (window.innerWidth - document.Menue0.pageX) / 2 - (document.Menue0.document.width / 2);}
    else if (ie||ff) {
      Menue0.style.visibility="hidden";
      Menue0.style.left = parent.frames["frame2"].document.getElementById('MenuePosition').offsetLeft + (document.body.clientWidth - document.getElementById('MenuePosition').offsetLeft) / 2 - (Menue0.offsetWidth / 2); }
  }
  else if (ie||ff)
    Menue0.style.left = parent.frames["frame2"].document.getElementById('MenuePosition').offsetLeft;

  //if (lMenu.valign == 'center') {
  //  if (ns)
      //parent.frames.frame2.document.layers.Menue0.top = document.Menue0.pageY + (window.innerHeight - document.Menue0.pageY) / 2 - (document.Menue0.document.height / 2);
  //  else if (ie)
      //parent.frames["frame1"].document.all.Menue0.style.posTop = parent.frames["frame1"].document.all.MenuePosition.offsetTop + (document.body.clientHeight - document.all.MenuePosition.offsetTop) / 2 - (document.all.Menue0.offsetHeight / 2);
  //}
  //else if (ie)
    //parent.frames["frame2"].document.all.Menue0.style.posTop = parent.frames["frame2"].document.all.MenuePosition.offsetTop;
}

function paddMenu(Name, Link, Target, Bezeichnung)
{
  window[Name] = new Menu();
  this.itemList[this.itemList.length] = window[Name];

  window[Name].link = Link;
  window[Name].target = Target;
  window[Name].bez = Bezeichnung;
}

function paddMenuItem(Link, Target, Bezeichnung)
{
   //alert('pMenuItem');
   this.itemList[this.itemList.length] = Link + ';' + Target + ';' + Bezeichnung;
}

function pbuild()
{
  //alert ('pbuild'+mCount);

  this.idx = mCount;
  this.name = 'Menue' + mCount;

  window['Menue' + mCount++] = this;

  if (!this.idx) {
    this.ModX = (ie||ff ? parent.frames['frame2'].document.getElementById('MenuePosition').offsetLeft : parent.frames['frame2'].document.getElementById('MenuePosition').pageX);
    this.ModY = (ie||ff ? parent.frames['frame2'].document.getElementById('MenuePosition').offsetTop : parent.frames['frame2'].document.getElementById('MenuePosition').pageY);
  }

  this.Style = '<style type="text/css">\n';

  this.Dok = '';
  this.create(-1);

  if (ns && this.hoverOn)
    for (var i=0; i < this.itemList.length; i++)
      this.create(i);

  this.Style += '  .L' + this.name + ' { color: ' + this.color + '; font-family: ' + this.fontFamily + '; font-size: ' + this.fontSize + '; text-decoration: ' + this.textDecoration + '; font-style: ' + this.fontStyle + '; font-weight: ' + this.fontWeight + '; }\n';
  this.Style += '  a.L' + this.name + ':link { color: ' + this.color + '; font-family: ' + this.fontFamily + '; font-size: ' + this.fontSize + '; text-decoration: ' + this.textDecoration + '; font-style: ' + this.fontStyle + '; font-weight: ' + this.fontWeight + '; }\n';
  this.Style += '  a.L' + this.name + ':visited { color: ' + this.color + '; font-family: ' + this.fontFamily + '; font-size: ' + this.fontSize + '; text-decoration: ' + this.textDecoration + '; font-style: ' + this.fontStyle + '; font-weight: ' + this.fontWeight + '; }\n';
  this.Style += '  a.L' + this.name + ':active { color: ' + this.color + '; font-family: ' + this.fontFamily + '; font-size: ' + this.fontSize + '; text-decoration: ' + this.textDecoration + '; font-style: ' + this.fontStyle + '; font-weight: ' + this.fontWeight + '; }\n';
  this.Style += '  a.L' + this.name + ':hover { background-color : '+ (this.hoverOn ? this.hoverbgColor : this.bgColor) + '; color: ' + this.color + '; font-family: ' + this.fontFamily + '; font-size: ' + this.fontSize + '; text-decoration: ' + this.textDecoration + '; font-style: ' + this.fontStyle + '; font-weight: ' + this.fontWeight + '; }\n';
  this.Style += '  .H' + this.name + ' { color: ' + this.hoverColor + '; font-family: ' + this.fontFamily + '; font-size: ' + this.fontSize + '; text-decoration: ' + this.textDecoration + '; font-style: ' + this.fontStyle + '; font-weight: ' + this.fontWeight + '; }\n';
  this.Style += '</style>';
  
  if (frameAktuell==1 && !this.idx) {
  parent.frames["frame1"].document.write(this.Style + this.Dok); }
  parent.frames["frame2"].document.write(this.Style + this.Dok); 

}

function pcreate(Index)
{
  //alert ('pcreate');
  var LayerName = (Index == -1 ? this.name : this.name + 'Item' + Index);
  //alert (this.idx+'#'+Index+'#'+this.ModY+'#'+LayerName);
  this.Style += '  #' + LayerName + ' { position: absolute; left: ' + (this.idx ? 0 : this.left + this.ModX) + '; top: ' + (this.idx ? 0 : this.top + this.ModY) + '; width: 1; visibility: ' + (this.idx || Index != -1 || frameAktuell == 2 ? 'hidden' : 'hidden') + '; z-Index: 2; }\n';
//this.Style += '  #' + LayerName + ' { position: absolute; left: ' + (this.idx ? 0 : this.left + this.ModX) + '; top: ' + (this.idx ? 0 : this.top + this.ModY) + '; width: 1; visibility: ' + (this.idx || Index != -1 || frameAktuell == 2 ? 'hidden' : 'visible') + '; z-Index: 2; }\n';

  var vm = (this.idx && this.submenuAlign=='vertikal') || (!this.idx && this.menuAlign=='vertikal');
  this.Dok += '<span id="' + LayerName + '" >\n' +
              '<table border=0 cellspacing=0 cellpadding=' + this.aborderWidth + '><tr><td bgColor="' + this.aborderColor + '">\n' +
              '  <table border=0 cellspacing=0 cellpadding=0>\n' +
              '    <tr>\n' +
              (!vm ? '      <td colspan="' + (this.itemList.length*2+1) + '" bgColor="' + this.iborderColor + '">' + this.SP + '</td>\n' +
              '    </tr>\n' +
              '    <tr>\n' : '');

  for (var i=0; i < this.itemList.length; i++) {

    this.Dok += (vm ? '      <td bgColor="' + this.iborderColor + '">' + this.SP + '</td><td bgColor="' + this.iborderColor + '">' + this.SP + '</td><td bgColor="' + this.iborderColor + '" align="right"><a id="aM' + this.idx + 'Pos' + i + '" name="aM' + this.idx + 'Pos' + i + '">' + this.SP + '</a></td>\n' +
                '    </tr>\n' +
                '    <tr>\n' : '') +
                '      <td bgColor="' + this.iborderColor + '" valign="bottom">' + (!vm ? '<a id="aM' + this.idx + 'Pos' + i + '" name="aM' + this.idx + 'Pos' + i + '">' : '') + this.SP + '</a></td>\n';

    if (i != Index) {
      this.Dok += '      <td align="' + this.alignTD + '" ' + (ns ? 'bgColor="' + this.bgColor + '"' : 'id="' + this.name + 'Hintergrund' + i + '" style="background-color: ' + this.bgColor + ';"') + '><nobr>'; }
    else {
      this.Dok += '      <td align="' + this.alignTD + '" bgColor="' + this.hoverbgColor + '"><nobr>'; }


    this.Dok += sp(1,this.paddingTop)+'<br>'+sp(this.paddingLeft,1);

    if (typeof(this.itemList[i]) == 'string')
      this.Dok += '<a href="' + this.itemList[i].split(';')[0] + '" target="' + this.itemList[i].split(';')[1] + '" class="' + (i != Index ? 'L' : 'H') + this.name + '"' + (Index == -1 ? ' onMouseOver=" if (parent.window.Menue' + this.idx + '.hoverOn) parent.hoverMenu(' + this.idx + ', ' + i + ');parent.checkMenu(' + this.idx + ')"' : '') + ' id="' + this.name + 'A' + i + '" name="' + this.name + 'A' + i + '">' + this.itemList[i].split(';')[2] + '</a>';

    else {
      this.Dok += '<a href="' + this.itemList[i].link + '" target="' + this.itemList[i].target + '" class="' + (i != Index ? 'L' : 'H') + this.name + '"' + (Index == -1 ? ' onMouseOver="if (parent.window.Menue' + this.idx + '.hoverOn) parent.hoverMenu(' + this.idx + ', ' + i + ');parent.checkMenu(' + this.idx + ');parent.showMenu(' + this.idx + ', ' + i + ', ' + mCount + ')"' : '') + ' id="' + this.name + 'A' + i + '" name="' + this.name + 'A' + i + '">' + this.itemList[i].bez + '</a>';
      if (Index == -1)
        this.itemList[i].build();
    }

    this.Dok += sp(this.paddingRight,1)+'<br>'+sp(1,this.paddingBottom)+'</nobr></td>\n' +
                (vm ? '      <td bgColor="' + this.iborderColor + '">' + this.SP + '</td>' +
                '    </tr>\n' : '');

  }

  this.Dok += (vm ? '    <tr>\n' +
              '      <td bgColor="' + this.iborderColor + '" colspan="3">' + this.SP + '</td>\n' : '<td bgColor="' + this.iborderColor + '">' + this.SP + '</td>') +
              (!vm ? '    <tr>\n' +
              '      <td colspan="' + (this.itemList.length*2+1) + '" bgColor="' + this.iborderColor + '">' + this.SP + '</td>\n' : '') +
              '    </tr>\n' +
              '  </table>\n' +
              '</td></tr></table>\n' +
              '</span>\n';

}

function hoverMenu(Aktuell, AnkerPos)
{
  if (ns) return;
  //alert ('HoverMenu');
  if (hoverMenuOn != AnkerPos) {

    hideHoverMenu();
    hoverMenuAktuell = Aktuell;
    hoverMenuOn = AnkerPos;
    var Menue = parent.window['Menue'+Aktuell];
    if (Aktuell == 0) {var Frame='frame1';} else {var Frame='frame2';}

    if (ns) {

      var LN = Menue.name + 'Item' + AnkerPos;
      with (eval('parent.frames.'+Frame+'.document.layers.'+LN)) {
        left = eval('parent.frames.'+Frame+'.document.layers.Menue'+Aktuell+'.pageX');
        top  = eval('parent.frames.'+Frame+'.document.layers.Menue'+Aktuell+'.pageY');
        visibility = 'visible';
      }

      HoverObj = eval('parent.frames.'+Frame+'.document.layers.Menue'+Aktuell+'.document.links['+AnkerPos+']');
      HoverObj2 = eval('parent.frames.frame2.document.layers.'+LN+'.document.links['+AnkerPos+']');

    }
    else if (ie||ff) {
      parent.frames[Frame].document.getElementById('Menue'+Aktuell+'Hintergrund'+AnkerPos).style.backgroundColor = Menue.hoverbgColor;
      parent.frames[Frame].document.getElementById('Menue'+Aktuell+'A'+AnkerPos).style.color = Menue.hoverColor;
    }

    if (ns) document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove = parent.hideHoverMenu;

  }
}

function hideAllHoverMenu()
{

  if (ns) return;
  if (ie||ff) {
      var Menue = parent.window['Menue0'];
      for(var i=0; i < 5; i++) {
         parent.frames.frame1.document.getElementById('Menue0Hintergrund'+i).style.backgroundColor = Menue.bgColor;
         parent.frames.frame1.document.getElementById('Menue0A'+i).style.color = Menue.color; }
      }

   if (ns) {
      var Menue = eval('parent.frames.'+Frame+'.document.layers.Menue'+hoverMenuAktuell+'Item'+hoverMenuOn);
      Menue.visibility='hidden';}
    
    hoverMenuAktuell = -1;
    hoverMenuOn = -1;
    HoverObj = null;
    HoverObj2 = null;

}

function hideHoverMenu(evt)
{
  //alert ('hideHoverMenu'+hoverMenuAktuell);
  //alert (window.event.srcElement.style.color);

  if (ns) return;

  if (hoverMenuAktuell == 0) {var Frame='frame1';} else {var Frame='frame2';}

  if (((ie||ff) && hoverMenuAktuell != -1 ) || (ns && hoverMenuAktuell != -1 && hoverMenuOn != -1 && (!evt || evt.target != HoverObj && evt.target != HoverObj2))) {

    if (ie||ff) {

      var Menue = parent.window['Menue'+hoverMenuAktuell];
      //alert(hoverMenuAktuell);
      parent.frames[Frame].document.getElementById('Menue'+hoverMenuAktuell+'Hintergrund'+hoverMenuOn).style.backgroundColor = Menue.bgColor;
      parent.frames[Frame].document.getElementById('Menue'+hoverMenuAktuell+'A'+hoverMenuOn).style.color = Menue.color;

    }

    if (ns) {
      var Menue = eval('parent.frames.'+Frame+'.document.layers.Menue'+hoverMenuAktuell+'Item'+hoverMenuOn);
      Menue.visibility='hidden';}
    
    document.onmousemove = null;

    hoverMenuAktuell = -1;
    hoverMenuOn = -1;
    HoverObj = null;
    HoverObj2 = null;

  }

}


function checkMenu(Vorgaenger)
{
  //alert('CheckMenu');

  offen = offen.substring(0, offen.length-1);
  var offeneMenues = offen.split(',');

  for (var i=offeneMenues.length-1; i >= 0; i--) {

    if (Vorgaenger == parseInt(offeneMenues[i])) {

      offen = '';
      for (var j=0; j <= i; j++)
        offen += offeneMenues[j] + ',';
      break;

    }
    else
      with (ns ? parent.frames["frame2"].document['Menue'+offeneMenues[i]] : parent.frames["frame2"].document.getElementById('Menue'+offeneMenues[i]).style)
        visibility = 'hidden';

  }
}

function showMenu(Vorgaenger, AnkerPos, Aktuell)
{
  //alert ('ShowMenu');

  var Menue = parent.window['Menue'+Aktuell];  
  var vm=(Vorgaenger && Menue.submenuAlign=='vertikal') || (!Vorgaenger && Menue.menuAlign=='vertikal');
  if (Vorgaenger == 0) {var Frame='frame1';} else {var Frame='frame2';}

  var ModX = (vm ? Menue.aborderWidth + Menue.iborderWidth : -1 * Menue.aborderWidth);
  var ModY = (vm ? -1 * Menue.aborderWidth : 2 * Menue.iborderWidth + Menue.aborderWidth);

  //var ModX = 0;
  //var ModY= 0;

  if (offen.indexOf(''+Aktuell) == -1)
    offen += Aktuell + ',';

  if (ns) {
    var MenueVorgaenger = eval('parent.frames.'+Frame+'.document.layers.Menue'+Vorgaenger);
    var anker = eval('parent.frames.'+Frame+'.document.layers.Menue'+Vorgaenger+'.document.anchors.aM'+Vorgaenger+'Pos'+AnkerPos);
    if (Vorgaenger == 0) 
        {var ankerY = 0;
         var ModY=0;
         var TopWert=parent.frames.frame2.window.pageYOffset;} 
    else 
        {var ankerY = anker.y;
         var TopWert=MenueVorgaenger.pageY;}
    with (eval('parent.frames.frame2.document.layers.Menue'+Aktuell)) {
      left = anker.x + MenueVorgaenger.pageX + ModX;
      top = ankerY + TopWert + ModY;
      visibility = 'visible';
    }

  }
  else if (ie||ff) {

    var LinksWert = 0;
    var TopWert = 0;
    var AObj = 'parent.frames.'+Frame+'.document.getElementById("aM'+Vorgaenger+'Pos'+AnkerPos+'")';
    for ( ; eval(AObj); AObj += '.offsetParent') {
      LinksWert += eval(AObj).offsetLeft;
      TopWert += eval(AObj).offsetTop;
    }
    if (Vorgaenger == 0) {TopWert=parent.frames.frame2.document.body.scrollTop;}
    var Menue = parent.frames.frame2.document.getElementById('Menue'+Aktuell);
    Menue.style.left = LinksWert + ModX;
    Menue.style.top = TopWert ;
    Menue.style.visibility = 'visible';

  }

}

function HideMenu(Vorgaenger, AnkerPos, Aktuell)
{
    if (ns && parent.frames.frame2.window.pageYOffset != yoffset) {
       yoffset = parent.frames.frame2.window.pageYOffset; 
       checkMenu(Vorgaenger)
       offen = '0,'; }   
    else if (ie||ff)
       {checkMenu(Vorgaenger)
       offen = '0,';}

}

function sp(w,h){if(ns) return('<spacer type="block" width="'+w+'" height="'+h+'">'); else return('<img src="spacer.gif" width='+w+' height='+h+' alt="">'); return;}