/* This script doesn't care about anything other than NS and IE
 * If you need to do stuff with Opera or Gecko expand on it...
 * see cross-browser.com for the cbe api
 */
var isNew = (document.getElementById)? true:false;
var isNS4 = (document.layers)? true:false;
var isIE4 = (document.all)? true:false;
var isIE5 = false;
var isNS6 = false;
docObj = (isIE4) ? 'document.all' : 'document';
styleObj = (isNS4) ? '' : '.style';

//detect newer versions
if (isIE4 && isNew){
	//IE4 is still true because of backwards compatibility
	isIE5=true;
} else if (isNew) {
	isNS6=true;
}

//returns style element of the element
function checkDOM(oldName) {
	return getStyleElementById(oldName);
}

function getElementById(id) {
	elem = 0;
	if (isNew) {
		elem = document.getElementById(id);
	} else if (isNS4 || isIE4) {
		elem = eval(docObj + "." + id);
	}
	return elem;
}

function getElementStyleById(id) {
	elem = 0;
	if (isNew) {
		elem = document.getElementById(id).style;
	} else if (isNS4 || isIE4) {
		elem = eval(docObj + "." + id + styleObj);
	}
	return elem;
}
