/* Two functions are defined: getDocObj() and getStyleObj. The getDocObj() function creates the document object for 
the browser in use depending on whether it recognizes document.layers, document.all or document.getElementById(). 
Use in conjunction with any cross-browser script where you must account for Netscape 4.x, IE 4.x and W3C DOM compliant browsers.
If the browser in use is Netscape 4.x and it recognizes the document.layers property, the script then looks to see if 
the argument, parent, is specified. If it is, then the string of "document."+parent+".document.+elem is returned. If 
parent is NOT specified, then the string of "document."+elem is returned. Otherwise, if the browser is IE 4.x and up,
and it recognizes the document.all method, the string of "document.all."+elem is returned. Otherwise, if the browser
in use is W3C-DOM compliant (and not IE), the string of "document.getElementById('"+elem+"')" is returned.

The getStyleObj() function gets the style object of a document object. To invoke each, use like this:

variablename = eval(getDocObj(elementidvalue));  * returns the document object of the element for the id specified
or 
variablename = eval(getStyleObj(elementidvalue)); 

Note: variablename = getDocObj(elementidvalue);  * returns only the text string */

window.onerror=null;

var ztop = 30;
var zlow = 21;

var lastcenter = 0;
function focusObject(target, center) {
	
	if (center != lastcenter) {
		eval(getStyleObj(target+center)).zIndex = ztop; 
		if (center > 0) {
			eval(getDocObj(target+center)).className='abs02 imageBox visYes'; 
			eval(getDocObj(target+lastcenter)).className='abs02 imageOut visNo';
			}
		else {
			eval(getDocObj(target+center)).className='abs02 imageBox visYes'; 
			eval(getDocObj(target+lastcenter)).className='abs02 imageOut visNo';
			}
		if (lastcenter > 0) {	
			eval(getStyleObj(target+lastcenter)).zIndex = zlow; 
			eval(getDocObj(target+lastcenter)).className='abs02 imageOut visNo';
		}		
		lastcenter = center;
	}
}

function parentTop() {
	window.parent.scroll(0,0);
	return true;
}

function getDocObj(elem,parent) {
	if (document.layers) {
	    if (parent) {
	    	return "document."+parent+".document."+elem;   }
	    else {
			return "document."+elem; }
	 } 
	    else if (document.all) {
				return "document.all."+elem; } 
	    else if (document.getElementById) {
				return "document.getElementById('"+elem+"')";	}
}

function getStyleObj(elem,parent) {
	if (document.layers) {
	    if (parent) {
	    	return "document."+parent+".document."+elem;  }
	    else {
			return "document."+elem + ".style";   }
	} 
	    else if (document.all) {
				return "document.all."+elem + ".style";   } 
	    else if (document.getElementById) {
				return "document.getElementById('"+elem+"').style";	}
}



