  /////////////////////////////////////////////
 // Tritonus2k Software - JS toolkit source //
/////////////////////////////////////////////

// visszaad egy div pointert - crossbrowser
var ns4 = (self.document.layers) ? true : false;
var ie4 = (self.document.all) ? true : false;
var dom = (self.document.getElementById) ? true : false;
var _MYX_ = 0;
var _MYY_ = 0;

function wopen(l)
{
	var path = (hun) ? "hun/" : "eng/";
	path += (l) ? "introload.html" : "menuload.html";
	window.open (path, '', 'width=760,height=500,left=0,top=30,toolbar=no,status=no,location=no,menubar=no,directories=no,scrollbars=no,resizable=no');
}

function wopen_norm()
{
	var path = "html/";
	path += (hun) ? "hun/" : "eng/";
	path += "index.html";
	window.open (path, '', 'width=800,height=540,left=30,top=30,toolbar=yes,status=yes,location=yes,menubar=yes,directories=no,scrollbars=yes,resizable=yes');
}

function getPtr (id)
{
	if (!inited) return;
	if (ns4)
	{
		return eval("self.document."+id);
	}
		else if (ie4) 
		{
			return eval (id+".style");
		}
			else if (dom)
			{
				return eval("self.document.getElementById('"+id+"').style");
			}
}

function strechWin(toolbars)
{
	if (!inited) return;
	self.resizeTo(_MYX_, _MYY_);
	self.resizeBy(_MYX_-getWinWidth(), _MYY_-getWinYSeg());
	win2cen(toolbars);
}

function win2cen(toolbars)
{
	if (!inited) return;
	var bar = (toolbars) ? 112 : 0;
	var x = (screen.availWidth-getWinWidth())/2;
	var y = (screen.availHeight-getWinYSeg()-bar)/2;
	self.moveTo(x, y);
}

function setCenter(id)
{
	if (!inited) return;
	var x = 0;
	var y = 0;
	var ptr = getPtr(id);
	if (ptr.width) x = getWinWidth() / 2 - parseInt(ptr.width) / 2;
	if (ptr.height) y = getWinYOff() + getWinYSeg() / 2  - parseInt(ptr.height) / 2;
	if (y < 0) y = 0;
	if (x < 0) x = 0;
	ptr.top = y;
	ptr.left = x;
}

function getWinWidth()
{
	if (!inited) return;
	if (ie4) return parseInt(self.document.body.offsetWidth);
	else return parseInt(window.innerWidth);
}

function getWinYOff()
{
	if (!inited) return;
	if (ie4) return parseInt(self.document.body.scrollTop);
	else return parseInt(self.pageYOffset);
}

function getWinYSeg()
{
	if (!inited) return;
	if (ie4) return parseInt(self.document.body.offsetHeight);
	else return parseInt(window.innerHeight);
}

function resize()
{
	if (!inited) return;
	if (ns4)
	{
		if (document.px != window.innerWidth || document.py != window.innerHeight) location.reload();
	}
	else setCenter ("d0");
}
