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)
{
	if(isNN4)
	{
		this.x=this.y=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;
	}
}

function setView(n, s)
{
	var obj=getStyle(n);

	if(isNN4)
		obj.visibility=(s)?'show':'hide';
	else
		obj.visibility=(s)?'visible':'hidden';
}

var Wnd=new Array();
function openWnd(n, url, futr)
{
	if(!Wnd[n] || Wnd[n].closed)
		Wnd[n]=window.open(url, n,'resizable=yes'+futr);
	else
		Wnd[n].location.replace(url);
	
	Wnd[n].focus();
}

window.onunload=new Function('for(var i in Wnd) if(!Wnd[i].closed) Wnd[i].close()');