<!--

// THE NEW DYNAMIC API BASED ON ORIGINAL CODE BY BOB CLARY, NETSCAPE COMMUNICATIONS.

if ((navigator.bw == 'ie5') && navigator.ns5) {
	document.getElementById = new Function("id", "return document.all[id];");
} else if (navigator.ns4 || navigator.ie4) {
	document.getElementById = ns4GetLayerById;
}


//----------------------------------------------------------//

function newStyle(obj) {
	if  (navigator.isIE || navigator.ns5) {
		this.styleObj = obj.style;
	} else if (navigator.ns4) {
		this.styleObj = obj;
	}
	this.object = obj;
}

newStyle.prototype.styleObj = null;
newStyle.prototype.object = null;

//----------------------------------------------------------//

function ns4GetLayerById(id) {
	if (navigator.ns4) {
		return ns4FindLayer(this, id);
	} else if (navigator.ie4) {
		return ie4FindLayer(this, id);
	}
}

//----------------------------------------------------------//

function ns4FindLayer(doc, id) {
	var i;
	var subdoc;
	var obj;

	for (i = 0; i < doc.layers.length; ++i) {
		if (doc.layers[i].id && id == doc.layers[i].id) {
			return doc.layers[i];
		}
		subdoc = doc.layers[i].document;
		obj    = ns4FindLayer(subdoc, id);
		if (obj != null) {
			return obj;
		}
	}
	return null;
}

function ie4FindLayer(doc, id) {
	return doc.all[id];
}

//-->
