var isDOM,isIE,isNN4,isOpera,isIE4;

if (navigator.userAgent.indexOf('Opera')!=-1) isOpera=1;
if (document.getElementById) isDOM=1;
if (document.all && !isOpera) isIE=1;
if (document.layers) isNN4=1;
if (!isDOM && document.all) isIE4=1;

function getObj(n) {
	if (isIE) return document.all[n];
	if (isDOM) return document.getElementById(n);
	return document.layers[n];
}

function getStyle(n) {
	var obj=getObj(n);
	if (obj) {
		if(isNN4) return obj;
		return obj.style;
	}
}

function getPosObj(n, e) {
	if (isNN4) {
		this.x=e.pageX;
		this.y=e.pageY;
		this.w=this.h=0;
		return;
	}
	var obj=getObj(n);
	this.x=obj.offsetLeft;
	this.y=obj.offsetTop;
	this.w=obj.offsetWidth;
	this.h=obj.offsetHeight;
	while((obj=obj.offsetParent)!=null && obj.tagName!='BODY') {
		this.x+=obj.offsetLeft;
		this.y+=obj.offsetTop;
		if(isNaN(obj.border)) continue;
		this.x+=parseInt(obj.border);
		this.y+=parseInt(obj.border);
	}
}

function setView(n, s) {
	var obj=getStyle(n);
	if (obj) {
		if (isNN4) obj.visibility=(s)?'show':'hide';
		else obj.visibility=(s)?'visible':'hidden';
	}
}

