//Sets variables to keep track of what's happening
var bScroll, objTimer;
var ns = (document.layers)? true:false;
var ie = (document.all)? true:false;

//Object constructor
function makeObj(obj, level){
  level = (!level) ? "" :"document." + level + ".";
  this.docelem  = (ie) ? document.all[obj] : eval(level + "document." + obj);
  this.docstyle = (ie) ? document.all[obj].style : eval(level + "document." + obj);//document.layers[obj];
  this.scrollHeight = (ie) ? this.docelem.offsetHeight : this.docstyle.document.height;
  this.clipHeight = (ie) ? this.docelem.offsetHeight : this.docstyle.clip.height;
  this.up = scrollUp;
  this.down = scrollDown;
  this.setPosition = setPosition;
    eval(this.obj + "= this")
    return this
}

function setPosition(x,y){
  this.x = x; this.y = y;
  this.docstyle.left = this.x;
  this.docstyle.top = this.y;
}

// gives the appearance of 'scrolling' down the text
// by moving the object up the screen
function scrollDown(move){
  if(this.y > -(this.scrollHeight) + oCont.clipHeight){
    this.setPosition(0,this.y - move)
      if(bScroll) setTimeout(this.obj+".down("+move+")", 50)
  }
}
// gives the appearance of 'scrolling' up the text
// by moving the object down the screen
function scrollUp(move){
  if(this.y < 0){
    this.setPosition(0, this.y + move)
    if(bScroll) setTimeout(this.obj + ".up("+move+")", 50)
  }
}

//Calls the scrolling functions.
function scroll(objText, speed){
    bScroll = true;
    if(speed > 0) objText.down(Math.abs(speed));
    else objText.up(Math.abs(speed));
}

//Stops the scrolling (called on mouseout)
function stopScroll(){
  bScroll = false;
  if(objTimer) clearTimeout(objTimer);
}

function getRealLeft(objImage) {
  xPos = objImage.offsetLeft;
  tempEl = objImage.offsetParent;
    while (tempEl != null) {
      xPos += tempEl.offsetLeft;
      tempEl = tempEl.offsetParent;
    }
  return xPos;
}

function getRealTop(objImage) {
  yPos = objImage.offsetTop;
  tempEl = objImage.offsetParent;
  while (tempEl != null) {
      yPos += tempEl.offsetTop;
      tempEl = tempEl.offsetParent;
    }
  return yPos;
}

//Makes the object

