isIE=document.all;
isNN=!document.all&&document.getElementById;

function FlyLayer_hideMe(){
  l = document.getElementById( this.name);
  l.innerHTML = "";
  l.style.visibility="hidden";
  this.open = false;
}
function FlyLayer_showMe(){
    this.Layer.innerHTML = this.content;
    this.Layer.style.visibility="visible";
    o = document.body;
    this.m_pos_y = isIE ? (o.scrollTop+o.clientHeight/2)-(this.Layer.clientHeight/2): (o.scrollTop+o.clientHeight/2)-(this.Layer.scrollHeight/2);
    this.m_pos_x = isIE ? (o.scrollLeft+o.clientWidth/2)-(this.Layer.clientWidth/2): (o.scrollLeft+o.clientWidth/2)-(this.Layer.scrollWidth/2);
    this.Layer.style.left = this.m_pos_x;
    this.Layer.style.top = this.m_pos_y;
    this.Layer.style.width = this.width;
    this.open = true;
}
function FlyLayer_onScroll()
{
  offset_y = document.body.scrollTop - this.scrollPosition;
  this.scrollPosition = document.body.scrollTop;
  this_layer = document.getElementById( this.name);
  y = parseInt( this_layer.style.top);
  this_layer.style.top = (y+offset_y<this.min_y)?this.min_y:(y+offset_y);
}

function FlyLayer( name, content)
{
  //-------------------------------------
  //          Local Variables
  //-------------------------------------
  this.name = name;
  this.m_pos_y = 0;
  this.m_pos_x = 0;
  this.open = false;
  this.width = 100;
  this.content = content;
  this.scrollPosition=document.body.scrollTop;
  this.Layer = isIE ? document.all[name] : document.getElementById(name);
  //-------------------------------------
  //              Methods
  //-------------------------------------
  this.hideMe = FlyLayer_hideMe;
  this.showMe = FlyLayer_showMe;
  this.onScroll = FlyLayer_onScroll;
}