var topMargin = 10;
var slideTime = 1200;
var w3c = (!document.all && document.getElementById); 
        
function menue_start()
{ 
  if (w3c)this.obj = document.getElementById('menue').style;
  else this.obj = document.all['menue'].style;
  if (w3c) hoehe = innerHeight;
  else hoehe = document.body.clientHeight;
  if (hoehe < 560)
  {
    this.obj.position = static;
    return;
  }
  this.obj.top = -145 + "px";
  setInterval("main()", 10); 
}
function main()
{
  if (w3c)
  {
    this.currentY = parseInt(document.getElementById('menue').style.top); 
    this.scrollTop = scrollY;
  }
  else
  {
    this.currentY = menue.style.pixelTop; 
    this.scrollTop = document.body.scrollTop;
  }
  var newTargetY = this.scrollTop + topMargin;
  if (this.currentY != newTargetY)
    if (newTargetY != this.targetY)
    { 
      this.targetY = newTargetY; 
      floatStart();
    } 
    animator();  
}
function floatStart()
{ 
  var now = new Date(); 
  this.A = this.targetY - this.currentY; 
  this.B = Math.PI / (2 * slideTime); 
  this.C = now.getTime(); 
  if (Math.abs(this.A) > hoehe)
  { 
    this.D = this.A > 0 ? this.targetY - hoehe : this.targetY + hoehe; 
    this.A = this.A > 0 ? hoehe : -hoehe; 
  } 
  else this.D = this.currentY; 
}
function animator()
{ 
  var now = new Date(); 
  var newY = this.A * Math.sin(this.B * (now.getTime() - this.C)) + this.D; 
  newY = Math.round(newY); 
  if ((this.A > 0 && newY > this.currentY) || (this.A < 0 && newY < this.currentY))
  { 
    if (w3c) document.getElementById('menue').style.top = newY + "px";
    else document.all.menue.style.pixelTop = newY; 
  }
}
