var aniLaeuft = 0;
var Schritt = 10;

function ani() {
 NullCount = 0;
 aniLaeuft = 1;
 for(i=1; i<=menuMaxHoehe.length-1; i++) {
  obj = document.getElementById(i).style;
  richtung = Number(menuAniRichtung[i]);
  MaxHoehe = Number(menuMaxHoehe[i]);
  AktuelleHoehe = Number(menuAktuelleHoehe[i]);
  NeueHoehe = AktuelleHoehe + (richtung*Schritt);
  if(richtung == 1) {
   obj.visibility = 'visible';
   if(NeueHoehe < MaxHoehe) {
    menuAktuelleHoehe[i] = NeueHoehe;
    obj.height = NeueHoehe+'px';
   } else {
    obj.height = MaxHoehe+'px';
    richtung[i] = 0;
   }

  } else if (richtung == -1) {

   if(NeueHoehe > 0) {
    menuAktuelleHoehe[i] = NeueHoehe;
    obj.height = NeueHoehe+'px';
   } else {
    obj.height = '0px';
    obj.visibility = 'hidden';
    richtung[i] = 0;
   }


  } else NullCount++;
 }

 // Für das Weiterlaufen sorgen
 if(NullCount <= menuMaxHoehe.length) {
  setTimeout('ani()', 50);
 } else {
  aniLaeuft = 0;
 }
}

function aniStarten(id, richtung) {
 menuAniRichtung[id] = richtung;
 if(aniLaeuft == 0) {
  ani();
 }
}

function zeigen(id) {
//document.getElementById(id).style.visibility = 'visible';
 aniStarten(id, 1);
}

function verstecken(id) {
//document.getElementById(id).style.visibility = 'hidden';
 aniStarten(id, -1);
}

