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

// function to instantiate equalizer objects
function setup() {
   thegrp = document.all.tags("DIV");
   thegroup = new Array(thegrp.length);
   thenamedgrp = new Array(thegrp.length);
   for (i = 0; i < thegrp.length; i++){
      thegroup[i] = new ie_object(thegrp[i]);
	thenamedgrp[thegrp[i].id] = new ie_object(thegrp[i]);
	}
}

// create IE DHTML equalizer object
function ie_object(obj) {
	this.css1 = 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_width = get_clip_width;
	this.get_clip_height = get_clip_height;
}

function get_clip_height() {
	return this.css1.clientHeight;
}

function get_clip_width(){
	return this.css1.clientWidth;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// clip object
function clip_obj(top,left, bottom, right) {
	var rectstring = "rect(" + top + "," + right + "," + bottom + "," + left + ")";
	this.css1.style.clip = rectstring;
}

// get current clip right 
function get_clip_right() {
	var tmp = this.get_width();
	return tmp;
}

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

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

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

