//
// Author: Shelley Powers
// copyright: 1997
// IDG's Professional Book on Dynamic HTML
//

// function to instantiate equalizer objects
function setup() {
   thegroup = new Array(document.layers.length);
   thenamedgrp = new Array(document.layers.length);
   for (i = 0; i < document.layers.length; i++){
	thegroup[i] = new ns_object(document.layers[i]);
   	thenamedgrp[document.layers[i].name] = new ns_object(document.layers[i]);
	}
}

// create NS DHTML equalizer object
function ns_object(obj) {
	this.style = obj;
	this.hide = hide_me;
	this.show = show_me;
	this.get_visibility = get_visibility;
	this.get_left = get_left;
	this.get_top = get_top;
	this.set_left = set_left;
	this.set_top = set_top;
	this.move = move_object;
	this.moveby = moveby;
	this.get_width = get_width;
	this.get_height = get_height;
	this.set_width = set_width;
	this.set_height = set_height;
	this.set_zindex = set_zindex;
	this.get_zindex = get_zindex;
	this.clip_obj = clip_obj;
	this.get_clip_right = get_clip_right;	
	this.get_clip_top = get_clip_top;
	this.get_clip_left = get_clip_left;
	this.get_clip_bottom = get_clip_bottom;
	this.get_clip_height = clip_height;
	this.get_clip_width = clip_width;
}

// hide element
function hide_me() {
	this.style.visibility = "hidden";
}

// show element
function show_me() {
	this.style.visibility = "inherit";
}

// return element's visibility
function get_visibility() {
	return this.style.visibility;
}

// element's left position
function get_left() {
	var left = this.style.left;
	return left;
}

// element's top position
function get_top () {
	var top = this.style.top;
	return top;
}

// set element's top position
function set_top(top) {
	this.style.top = top;
}

// set element's left position
function set_left(left) {
	this.style.left = left;
}

// make absolute move
function move_object(newleft, newtop) {
	this.style.left = newleft;
	this.style.top = newtop;
}

// move relative to current location
function moveby(left, top) {
	this.style.left = this.style.left + left;
	this.style.top = this.style.top + top;
}

// get element's width
function get_width() {
	return this.style.width;
}

// get element's height
function get_height() {
	return this.style.height;
}

// set element's width
function set_width(width) {
	this.style.width = width;
}

// set element's height
function set_height(height) {
	this.style.height = height;
}

// set element's zindex order
function set_zindex(zindex) {
	this.style.zIndex = zindex;
}

// get element's current zindex order
function get_zindex() {
	return style.zIndex;
}

// clip object
function clip_obj (top,left,bottom,right) {
	this.style.clip.left = left;
	this.style.clip.right = right;
	this.style.clip.Top = top;
	this.style.clip.Bottom = bottom;
}

// get current clip right 
function get_clip_right() {
	return this.style.clip.right;
}

// get current clip left
function get_clip_left() {
	return this.style.clip.left;
}

// get current clip top
function get_clip_top() {
	return this.style.clip.top;
}

// get current clip bottom
function get_clip_bottom() {
	return this.style.clip.bottom;
}

// clip height
function clip_height() {
	return this.style.clip.height;
}

// clip width
function clip_width() {
	return this.style.clip.width;
}

