

var myLayers = new Array();

function add2myLayers(layerIn)
{ myLayers[layerIn] = null;
}

/**************************************
 * add methods to layer object for IE *
 **************************************/
function ie_methods(obj)
{ this.currLayer = obj;
  this.name = obj.id;
}

if (!isNavigator)
{ ie_methods.prototype.objResizeBy = ieobjResizeBy;
  ie_methods.prototype.objHide = ieobjHide;
  ie_methods.prototype.objShow = ieobjShow;
  ie_methods.prototype.objMoveAbsolute = ieobjMoveAbsolute;
  ie_methods.prototype.objMoveRelative = ieobjMoveRelative;
  ie_methods.prototype.objGetLeft = ieobjGetLeft;
  ie_methods.prototype.objSetLeft = ieobjSetLeft;
  ie_methods.prototype.objGetTop = ieobjGetTop;
  ie_methods.prototype.objSetTop = ieobjSetTop;
  ie_methods.prototype.objGetHeight = ieobjGetHeight;
  ie_methods.prototype.objSetHeight = ieobjSetHeight;
  ie_methods.prototype.objGetWidth = ieobjGetWidth;
  ie_methods.prototype.objSetWidth = ieobjSetWidth;
  ie_methods.prototype.objGetZIndex = ieobjGetZIndex;
  ie_methods.prototype.objSetZIndex = ieobjSetZIndex;
  ie_methods.prototype.objGetVisibility = ieobjGetVisibility;
}

/*******************************
 * function definitions for IE *
 *******************************/
function ieobjGetVisibility()
{ return this.currLayer.style.visibility;
}

function ieobjResizeBy(width, height)
{ this.currLayer.style.pixelLeft -= width / 2;
  this.currLayer.style.pixelWidth += width / 2;
  this.currLayer.style.pixelTop -= height / 2;
  this.currLayer.style.pixelHeight += height / 2;
}

function ieobjHide()
{ this.currLayer.style.visibility = "hidden";
}

function ieobjShow()
{ this.currLayer.style.visibility = "visible";
}

function ieobjGetLeft()
{ return this.currLayer.offsetLeft;
}

function ieobjGetTop ()
{ return this.currLayer.offsetTop;
}

function ieobjSetTop (top)
{ this.currLayer.style.pixelTop = top;
}

function ieobjSetLeft(left)
{ this.currLayer.style.pixelLeft = left;
}

function ieobjMoveAbsolute(left, top)
{ this.objSetLeft(left);
  this.objSetTop(top);
}

function ieobjMoveRelative(left, top)
{ this.objSetLeft(left + this.objGetLeft());
  this.objSetTop(top + this.objGetTop());
}

function ieobjGetWidth()
{ return this.currLayer.clientWidth;
}

function ieobjGetHeight()
{ return this.currLayer.clientHeight;
}

function ieobjSetHeight(height)
{ this.currLayer.style.pixelHeight = height;
}

function ieobjSetWidth(width)
{ this.currLayer.style.pixelWidth = width;
}

function ieobjSetZIndex(zindex)
{ this.currLayer.style.zIndex = zindex;
}

function ieobjGetZIndex()
{ return this.currLayer.style.zIndex;
}

/********************************************
 * add methods to layer object for Netscape *
 ********************************************/
function ns_methods(obj)
{ this.currLayer = obj;
  this.name = obj.name;
}

if (isNavigator)
{ ns_methods.prototype.objResizeBy = nsobjResizeBy;
  ns_methods.prototype.objHide = nsobjHide;
  ns_methods.prototype.objShow = nsobjShow;
  ns_methods.prototype.objMoveAbsolute = nsobjMoveAbsolute;
  ns_methods.prototype.objMoveRelative = nsobjMoveRelative;
  ns_methods.prototype.objGetLeft = nsobjGetLeft;
  ns_methods.prototype.objSetLeft = nsobjSetLeft;
  ns_methods.prototype.objGetTop = nsobjGetTop;
  ns_methods.prototype.objSetTop = nsobjSetTop;
  ns_methods.prototype.objGetWidth = nsobjGetWidth;
  ns_methods.prototype.objSetWidth = nsobjSetWidth;
  ns_methods.prototype.objGetHeight = nsobjGetHeight;
  ns_methods.prototype.objSetHeight = nsobjSetHeight;
  ns_methods.prototype.objSetZIndex = nsobjSetZIndex;
  ns_methods.prototype.objGetZIndex = nsobjGetZIndex;
  ns_methods.prototype.objGetVisibility = nsobjGetVisibility;
}

/*************************************
 * function definitions for Netscape *
 *************************************/
function nsobjGetVisibility()
{ return this.currLayer.visibility;
}

function nsobjResizeBy(width, height)
{ this.currLayer.left -= width / 2;
  this.currLayer.width -= width / 2;
  this.currLayer.top += height / 2;
  this.currLayer.height += height / 2;
}

function nsobjHide()
{ this.currLayer.visibility = "hidden";
}

function nsobjShow()
{ this.currLayer.visibility = "visible";
}

function nsobjGetLeft()
{ return this.currLayer.left;
}

function nsobjGetTop()
{ return this.currLayer.top;
}

function nsobjSetTop(top)
{ this.currLayer.top = top;
}

function nsobjSetLeft(left)
{ this.currLayer.left = left;
}

function nsobjMoveAbsolute(left, top)
{ this.objSetLeft(left);
  this.objSetTop(top);
}

function nsobjMoveRelative(left, top)
{ this.objSetLeft(left + this.objGetLeft());
  this.objSetTop(top + this.objGetTop());
}

function nsobjGetWidth()
{ return this.currLayer.clip.width;
}

function nsobjGetHeight()
{ return this.currLayer.clip.height;
}

function nsobjSetWidth(width)
{ this.currLayer.clip.width = width;
}

function nsobjSetHeight(height)
{ this.currLayer.clip.height = height;
}

function nsobjSetZIndex(zindex)
{ this.currLayer.zIndex = zindex;
}

function nsobjGetZIndex()
{ return this.currLayer.zIndex;
}

/****************************************
 * function to add layer methods for IE *
 ****************************************/
function add_ie_methods()
{ for (thisLayer in myLayers)
    myLayers[thisLayer] = new ie_methods(document.all[thisLayer]);
}

function add_ns_methods()
{ for (thisLayer in myLayers)
    myLayers[thisLayer] = new ns_methods(document.layers[thisLayer]);
}

function add_methods()
{ if (isNavigator)
    add_ns_methods();
  else
    add_ie_methods();
}

