var Flies = new Object;
Flies['nav'] = new Object;

function FlyOver(id,type) {
  for (var i in Flies[type]) {
    FlyKill(i);
    clearTimeout(Flies[type][i]);
  }
  Flies[type] = new Object;
  var n = ID(id);
  n.style.display = 'block';
  n.style.opacity = 1;
  n.style.filter = "alpha(opacity=100)";
  Flies[type][id] = true;
}

function FlyOut(id,type) {
  var n = ID(id);
  Flies[type][id] = setTimeout("FlyFade('"+id+"','"+type+"')", 200);
}

function FlyKill(id) {
  var n = ID(id);
  n.style.display = 'none';
}

function FlyFade(id,type) {
  var n = ID(id);
  var op = n.style.opacity;
  if (op < 0.1) {
    FlyKill(id);
    return;
  }
  op -= op / 10;
  n.style.filter = "alpha(opacity=" + (op * 100) + ")";
  n.style.opacity = op;
  Flies[type][id] = setTimeout("FlyFade('"+id+"','"+type+"')", 10);
}

function ID(id) {
  return document.getElementById(id);
}
