/*
  Internet Explorer 4.x subclass converter object code for
  cross-browser DHTML functionality. Feel free to add methods
  as need be for functionality. However note that the method must
  also be added in the ns4.js file as well.
  
  Code modified from parts of "Dynamic HTML: by Shelly Powers"
  examples
*/
  
  
function setup()
	{
   	divs = document.all.tags("DIV");
	//for accessing in an array
   	divsNumed = new Array(divs.length);
	//for accessing by name
   	namedDivs = divsNumed;
    for (i = 0; i < divs.length; i++)
	  	{
      	divsNumed[i] = new ieSubclass(divs[i]);
		namedDivs[divs[i].id] = new ieSubclass(divs[i]);
		}
	}

// create IE DHTML converter object
function ieSubclass(obj)
	{
	this.ieDIV = obj;
	this.document = obj.document;
	this.hide = hide_me;
	this.show = show_me;
	this.getVisibility = getVisibility;
	this.getLeft = getLeft;
	this.getTop = getTop;
	this.setLeft = setLeft;
	this.setTop = setTop;
	this.move = move_object;
	this.moveBy = moveBy;
	this.getWidth = getWidth;
	this.getHeight = getHeight;
	this.setWidth = setWidth;
	this.setHeight = setHeight;
	this.setZindex = setZindex;
	this.getZindex = getZindex;
	this.clipObj = clipObj;
	this.getClipRight = getClipRight;	
	this.getClipTop = getClipTop;
	this.getClipLeft = getClipLeft;
	this.getClipBottom = getClipBottom;
	this.getClipWidth = getClipWidth;
	this.getClipHeight = getClipHeight;
	this.chgImg = chgImg;
	}


// image swapper
function chgImg(img,src)
	{
	this.document.images[img].src = src;
	}

function getID()
	{
	return this.ieDIV.id;
	}

function getClipHeight()
	{
	return this.ieDIV.clientHeight;
	}

function getClipWidth()
	{
	return this.ieDIV.clientWidth;
	}

// hide element
function hide_me()
	{
	this.ieDIV.style.visibility = "hidden";
	}

// show element
function show_me()
	{
	this.ieDIV.style.visibility = "visible";
	}

// return element's visibility
function getVisibility()
	{
	return this.ieDIV.style.visibility;
	}

// element's left position
function getLeft()
	{
	var left = this.ieDIV.style.pixelLeft;
	return left;
	}

// element's top position
function getTop ()
	{
	var top = this.ieDIV.style.pixelTop;
	return top;
	}

// set element's top position
function setTop (top)
	{
	this.ieDIV.style.top = top;
	}

// set element's left position
function setLeft(left)
	{
	this.ieDIV.style.left = left;
	}

// make absolute move
function move_object(newleft, newtop)
	{
	this.ieDIV.style.left = newleft;
	this.ieDIV.style.top = newtop;
	}

// move relative to current location
function moveBy(left, top)
	{
	this.ieDIV.style.left= this.ieDIV.style.pixelLeft + left;
	this.ieDIV.style.top = this.ieDIV.style.pixelTop + top;
	}

// get element's width
function getWidth()
	{
	return this.ieDIV.style.pixelWidth;
	}

// get element's height
function getHeight()
	{
	return this.ieDIV.style.pixelHeight;
	}

// get element's height
function setHeight(height)
	{
	this.ieDIV.style.pixelHeight = height;
	}

// set element's width
function setWidth(width)
	{
	this.ieDIV.style.pixelWidth = width;
	}

// set element's zindex order
function setZindex(zindex)
	{
	this.ieDIV.style.zIndex = zindex;
	}

// get element's current zindex order
function getZindex(zindex)
	{
	return this.ieDIV.style.zIndex;
	}

// clip object
function clipObj(top,left, bottom, right)
	{
	var rectstring = "rect(" + top + "," + right + "," + bottom + "," + left + ")";
	this.ieDIV.style.clip = rectstring;
	}

// get current clip right 
function getClipRight()
	{
	var tmp = this.getWidth();
	return tmp;
	}

// get current clip left
function getClipLeft()
	{
	return this.getLeft();
	}

// get current clip top
function getClipTop()
	{
	return this.getTop();
	}

// get current clip bottom
function getClipBottom()
	{
	return this.getHeight();
	}
 