// Create objects from spans and assign the following functions:
//	theSpans.objGetVisibility	find the object's visibility 
//	theSpans.objHide			hide the object 
//	theSpans.objShow			show the object
//	theSpans.objReplaceHTML		replaced the HTML code in the object
//	theSpans.objSetBGC			set the object's background color
//	theSpans.objSetColor		set the object's foreground color

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


// BEGIN For IE, pull Spans into object array
function createIESpanObjects() {
	allSpans = document.all.tags("span");
	theSpans = new Array();
	for (var i = 0; i < allSpans.length; i++) {
		if (allSpans[i].id.indexOf("dynamic") == 0) {
			theSpans[allSpans[i].id] = new spanObject(allSpans[i]);
			sNames[sNumAll] = allSpans[i].id;
			sNumAll ++;
		}
	}
} // END createIESpanObjects()


// BEGIN For W3C DOM (Navigator 6.x, Mozilla), pull Spans into object array
function createDOMSpanObjects() {
	allSpans = document.getElementsByTagName("span");
	theSpans = new Array();
	for (var i = 0; i < allSpans.length; i++) {
		var obj = allSpans[i];
		if (obj.id.indexOf("dynamic") == 0) {
			theSpans[obj.id] = new spanObject(obj); 
			sNames[sNumAll] = obj.id;
			sNumAll ++;
		}
	}
} // END createDOMSpanObjects()


// BEGIN Establish properities of the DOM; also works for IE 4.x and 5.x Object
function spanObject(obj) {
	this.css2 = obj;
	this.name = obj.id;
	this.objHide = spanHide; 
	this.objShow = spanShow;
	this.objReplaceHTML = spanReplaceHTML;
	this.objSetBGC = spanSetBGC;
	this.objSetColor = spanSetColor;
} // END spanObject(obj)


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


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


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


// BEGIN Set span background color
function spanSetBGC(hex) {
	this.css2.style.backgroundColor = hex;
} // END domReplaceHTML


// BEGIN Set span foreground color
function spanSetColor(hex) {
	this.css2.style.color = hex;
} // END domReplaceHTML


