// Create objects from divs and assign the following functions:
//	theObjs.objGetVisibility	find the object's visibility 
//	theObjs.objHide				hide the object 
//	theObjs.objShow				show the object
//	theObjs.objGetTop			find the object's top coordinate (y)
//	theObjs.objGetLeft			find the object's left coordinate (x)
//	theObjs.objSetTop			set the object's top coordinate (y)
//	theObjs.objSetLeft			set the object's top coordinate (x)
//	theObjs.objMoveAbsolute		move the object to coordinate x,y
//	theObjs.objMoveRelative		move the object x and/or y pixels
//	theObjs.objSetZIndex		reset the objet's z-index
//	theObjs.objGetWidth			find the object's width
//	theObjs.objGetHeight		find the object's height
//	theObjs.objReplaceHTML		replaced the HTML code in the object
//	theObjs.objSetBGC			set the object's background color
//	theObjs.objSetColor			set the object's foreground color


// BEGIN Create objects from Divs
function createObjects() {
	if (domData.isIE4Up) { 
		createIEObjects(); 
	} else if (domData.isNN6Up) { 
		createDOMObjects(); 
	}
} // END createObjects() function


// BEGIN For IE, pull DIV blocks into object array
function createIEObjects() {
	theDivs = document.all.tags("div");
	theObjs = new Array();
	for (var i = 0; i < theDivs.length; i++) {
		if (theDivs[i].id.indexOf("dynamic") == 0) {
			theObjs[theDivs[i].id] = new domObject(theDivs[i]);
			mNames[mNumAll] = theDivs[i].id;
			mNumAll ++;
		}
	}
} // END createIEObjects()


// BEGIN For W3C DOM (Navigator 6.x, Mozilla), pull DIV blocks into object array
function createDOMObjects() {
	theDivs = document.getElementsByTagName("div");
	theObjs = new Array();
	for (var i = 0; i < theDivs.length; i++) {
		var obj = theDivs[i];
		if (obj.id.indexOf("dynamic") == 0) {
			theObjs[obj.id] = new domObject(obj); 
			mNames[mNumAll] = obj.id;
			mNumAll ++;
		}
	}
} // END createDOMObjects()


// BEGIN Establish properities of the DOM; also works for IE 4.x and 5.x Object
function domObject(obj) {
	this.css2 = obj;
	this.name = obj.id;
	this.objHide = domHide; 
	this.objShow = domShow;
	this.objGetTop = domGetTop;
	this.objGetLeft = domGetLeft;
	this.objSetTop = domSetTop;
	this.objSetLeft = domSetLeft;
	this.objMoveAbsolute = domMoveAbsolute;
	this.objMoveRelative = domMoveRelative;
	this.objSetZIndex = domSetZIndex;
	this.objGetWidth = domGetWidth;
	this.objGetHeight = domGetHeight;
	this.objReplaceHTML = domReplaceHTML;
	this.objSetBGC = domSetBGC;
	this.objSetColor = domSetColor;
} // END domObject(obj)


// BEGIN Get element's top position
function domGetTop(top) {
	var tp = parseInt(this.css2.style.top);
	return tp;
} // END domGetTop(top)


// BEGIN Get element's left position
function domGetLeft(left) {
	var lt = parseInt(this.css2.style.left);
	return lt;
} // END domGetLeft()


// BEGIN Set element's top position
function domSetTop(top) {
	this.css2.style.top = top + "px";
} // END domSetTop(top)


// BEGIN Set element's left position
function domSetLeft(left) {
	this.css2.style.left = left + "px";
} // END domSetLeft(left)


// BEGIN Hide element
function domHide() {
	this.css2.style.visibility = "hidden";
} // END domHide()


// BEGIN Show element
function domShow() {
	this.css2.style.visibility = "visible";
} // END domShow()


// BEGIN Get element's width
function domGetWidth() {
	var wd = parseInt(this.css2.style.width);
	return wd;
} // END domGetWidth


// BEGIN Get element's height
function domGetHeight() {
	var ht = parseInt(this.css2.style.height);
	return ht;
} // END domGetHeight()


// BEGIN Set element's zindex order
function domSetZIndex(zindex) {
	this.css2.style.zIndex = zindex;
} // END domSetZIndex(zindex)


// BEGIN Make absolute move
function domMoveAbsolute(newleft, newtop) {
	this.objSetLeft(newleft);
	this.objSetTop(newtop);
} // END domMoveAbsolute


// BEGIN Make relative move
function domMoveRelative(left, top) {
	this.objSetLeft(left + this.objGetLeft());
	this.objSetTop(top + this.objGetTop());	 
} // END domMoveRelative


// BEGIN Replace contents of object
function domReplaceHTML(stuffing) {
	this.css2.innerHTML = stuffing;
} // END domReplaceHTML


// BEGIN Set object background Color
function domSetBGC(hex) {
	this.css2.style.backgroundColor = hex;
} // END domReplaceHTML


// BEGIN Set object foreground Color
function domSetColor(hex) {
	this.css2.style.color = hex;
} // END domReplaceHTML

