var NS = (document.layers) ? 1 : 0;
var IE = (document.all) ? 1 : 0;
var NEW = (document.getElementById) ? 1 : 0;
var IE4 = (IE && !NEW) ? 1 : 0;
var IE5 = (IE && NEW) ? 1 : 0;
var IE6 = ((IE5) && (navigator.userAgent.indexOf("6\.0") != -1)) ? 1 : 0;
var NS6up = (NEW && !IE) ? 1 : 0;
var NS6 = ((NS6up) && (navigator.userAgent.indexOf("6\.") != -1)) ? 1 : 0;
var NS7 = ((NS6up) && (navigator.userAgent.indexOf("7\.") != -1)) ? 1 : 0;
/* alert(
	'IE = '+IE+'\n'+
	'NEW = '+NEW+'\n'+
	'IE4 = '+IE4+'\n'+
	'IE5 = '+IE5+'\n'+
	'IE6 = '+IE6+'\n'+
	'NS = '+NS+'\n'+
	'NS6up = '+NS6up+'\n'+
	'NS6 = '+NS6+'\n'+
	'NS7 = '+NS7
); */

//if ((top.frames.length>0) && (typeof frameset == "undefined")) { top.location = self.document.location }

function getElementById(id, windowName) {
	if (IE4) {
		return windowName ? windowName.document.all[id] : document.all[id];
	} else if (NS6up || IE5 || IE6) {
		return windowName ? windowName.document.getElementById(id) : document.getElementById(id);
	} else if (NS) {
		return document.layers[id];
	}
}
