( function () {
  if (document.getElementById) {
    var to = null;
    var me = document.getElementById("menue");
    var mel = document.getElementById("menueleft");
    me.onmouseover = function() {
      window.clearTimeout(to);
      me.className = "menue_auf";
    }
    me.onmouseout = function() {
      to=window.setTimeout(function(){me.className='menue_zu';},2000);
    }
    mel.onclick = function() {
      me.className = "menue_auf";
      window.setTimeout(function(){me.className='menue_zu';},2000);
      return false;
    }
    if(navigator.appName.search("Explorer")!=-1) {
      var verstr = navigator.appVersion;
      var p = verstr.search("MSIE");
      if(p!=-1) {
        var ver = parseFloat(verstr.substr(p+4,5));
        if(ver<7) return;
      }
    }
    var getRect = function (o){
      var r = { top:0, left:0, width:0, height:0 };
      if(!o) return r;
      else if(typeof o == 'string' ) o = document.getElementById(o);
      if( typeof o != 'object' ) return r;
      if(typeof o.offsetTop != 'undefined') {
        r.height = o.offsetHeight;
        r.width = o.offsetWidth;
        r.left = r.top = 0;
        while (o && o.tagName != 'BODY') {
          r.top  += parseInt( o.offsetTop );
          r.left += parseInt( o.offsetLeft );
          o = o.offsetParent;
        }
      }
      return r;
    }
    var getWinsize = function(){
      var r = { width:0, height:0 };
      if (document.documentElement && document.documentElement.clientWidth) r.width = document.body.clientWidth;
      else if (window.innerWidth) r.width = window.innerWidth;
      if (document.documentElement && document.documentElement.clientHeight) r.height = document.documentElement.clientHeight;
      else if (window.innerHeight) r.height = window.innerHeight;
      return r;
    }
    window.onresize = function() {
      me.className="menue_auf";
      var fenster = getWinsize(document.body);
      var navi = getRect(me);
      me.className="menue_zu";
      if(fenster.height>(navi.top+navi.height)) me.style.position = "fixed";
      else                                      me.style.position = "absolute";
    }
    window.onresize();
  }
} ) ();
