/*function push()
{
  for (var i=0; i < push.arguments.length; ++i)
    this[this.length] = push.arguments[i];
  return (this.length);
}

if (typeof Array.push == "undefined")
  Array.prototype.push = push;
*/
var DHTML = 0, DOM = 0, MS = 0, NS = 0, OP = 0, SHOW = "visible", HIDE = "hidden";

if (typeof window.opera != "undefined")
  OP = 1;
if(document.getElementById)
{
 DHTML = 1;
 DOM = 1;
}
if(typeof document.all != "undefined" && !OP)
{
 DHTML = 1;
 MS = 1;
}
if (window.netscape && window.screen && !DOM && !OP)
{
   DHTML = 1;
   NS = 1;
   SHOW = "show";
   HIDE = "hide";
}

function getObj(id) {
var Elem = void(0);
 if(DOM) {
   if (typeof document.getElementById(id) == "object")
     Elem = document.getElementById(id);
 } else if(MS) {
   if (typeof document.all[id] == "object")
     Elem = document.all[id];
 } else if(NS) {
   if (typeof document[id] == "object")
     Elem = document[id];
 }
 return(Elem);
};

function setVisibility(id, Value) {
 if(DOM || MS)
  getObj(id).style.visibility = Value;
 if(NS)
  getObj(id).visibility = Value;
};

function addDHTML(id) {
var obj = getObj(id);
  obj.css = (NS)?  obj : obj.style;
  obj.show = function()
  {
    this.css.visibility = SHOW;
  }
  obj.hide = function()
  {
    this.css.visibility = HIDE;
  }
  obj.isVisible = function()
  {
    return (this.css.visibility.toLowerCase().indexOf("h") == 0)? false : true;
  }
  obj.getWidth = function()
  {
    if(OP) return (this.css.pixelWidth);
    if(DOM) return (this.offsetWidth);
    if(NS) return (this.document.width);
    return window.alert("getWidth not suportet");
  }
  obj.getLeft = function()
  {
    window.alert("getLeft not implementet");
  }
  obj.moveX = function(x)
  {
    if(DOM || MS)
    {
     if(MS) {
        this.css.left = x;
     }
     if (OP) {
        this.css.pixelLeft = x;
     }
    }
    else
     if(NS) this.css.left = x;
  }
  obj.moveY = function(y)
  {
    if(DOM || MS)
    {
     if(MS) {
        this.css.top = y;
     }
     if (OP) {
        this.css.pixelTop = y;
     }
    }
    else
     if(NS) this.css.top = y;
  }
  obj.move = function(x, y)
  {
    this.moveX(x);
    this.moveY(y);
  }
  obj.setColor = function(c)
  {
    this.css.color = c;
  }
  obj.setbgColor = function(c)
  {
    if(DOM) this.css.backgroundColor = c;
    if(NS) this.css.bgColor = c;
  }
  obj.getbgColor = function()
  {
    if(DOM) return (this.css.backgroundColor);
    if(NS) return (this.css.bgColor);
    return window.alert("getbgColor not suportet");
  }
  obj.zIndex = function(x)
  {
    this.css.zIndex = x;
  }
  return (obj);
}

function getLeft(l)
{
  if (l.offsetParent) return (l.offsetLeft + getLeft(l.offsetParent));
  else return (l.offsetLeft);
};

function getTop(l)
{
  if (l.offsetParent) return (l.offsetTop + getTop(l.offsetParent));
  else return (l.offsetTop);
};