Utilities = {};

Utilities.getElement = function(i)
{
  return document.getElementById(i);
}

Utilities.DivLathato = function(i)
{
  
  Utilities.getElement(i).style.visibility="visible";
}

Utilities.DivNemLathato = function(i)
{
  
  Utilities.getElement(i).style.visibility="hidden";
}

Utilities.BeKapcsolas = function(o)
{
  Utilities.getElement(o).disabled=false;
}

Utilities.KiKapcsolas = function(o)
{
  Utilities.getElement(o).disabled=true;
}

Utilities.Atlatszosag = function(atl, o)
{
	var object = Utilities.getElement(o).style;
	object.opacity = (atl / 100);
	object.MozOpacity = (atl / 100);
	object.KhtmlOpacity = (atl / 100);
	object.filter = "alpha(opacity=" + atl + ")";
}

Utilities.OpenWin = function(url, ablaknev, width, height)
{
	var l = Math.round((screen.availWidth - width) / 2);
	var t = Math.round((screen.availHeight - height) / 2);
  var prop = "";
	prop += "dependent=yes,";
  prop += "directories=no,";
  prop += "location=no,";
  prop += "menubar=no,";
  prop += "resizable=no,";
  prop += "scrollbars=no,";
  prop += "status=no,";
  prop += "toolbar=no,";
  prop += "height="+height+",";
  prop += "width="+width+",";
	prop += "left="+l+",";
	prop += "top="+t+",";
	prop += "screenX="+l+",";
	prop += "screenY="+t;

  ablak = window.open(url,ablaknev,prop);
  ablak.focus();
}

Utilities.OpenWinResiz = function(url, ablaknev, width, height)
{
	var l = Math.round((screen.availWidth - width) / 2);
	var t = Math.round((screen.availHeight - height) / 2);
  var prop = "";
	prop += "dependent=yes,";
  prop += "directories=no,";
  prop += "location=no,";
  prop += "menubar=no,";
  prop += "resizable=yes,";
  prop += "scrollbars=yes,";
  prop += "status=no,";
  prop += "toolbar=no,";
  prop += "height="+height+",";
  prop += "width="+width+",";
	prop += "left="+l+",";
	prop += "top="+t+",";
	prop += "screenX="+l+",";
	prop += "screenY="+t;

  ablak = window.open(url,ablaknev,prop);
  ablak.focus();
}

Utilities.LoadingCenter = function()
{
	var w;
	var h;
	var l;
	var t;

	if (window.innerWidth)
	{
	  w = window.innerWidth;
		h = window.innerHeight;
	}
	else
	{
		w = document.body.clientWidth;
		h = document.body.clientHeight;
	}
	l = Math.round((w - 200) / 2);
	t = Math.round((h - 40) / 2);
	
	Utilities.getElement("loading").style.top = t;
	Utilities.getElement("loading").style.left = l;
}

Utilities.FelsoPozicio = function()
{
if (navigator.appName == "Microsoft Internet Explorer")
	{
	  return document.body.scrollTop;
	}
	else
	{
	  return self.pageYOffset;
	}
}
