var isDOM = (document.getElementById ? true : false); 
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);

var HIDDEN = (isNS4) ? 'hide' : 'hidden';
var VISIBLE = (isNS4) ? 'show' : 'visible';

function getRef(id) {
	if (isDOM) return document.getElementById(id);
	if (isIE4) return document.all[id];
	if (isNS4) return document.layers[id];
}
function getStyle(id) {
	return (isNS4 ? getRef(id) : getRef(id).style);
} 