/*
	global.js: global javascript functions
*/


/*
	This function creates a centered popup
 	based on a given url, width and height.
*/
function winOpen(url, width, height)
{
      // popup zentrieren
      var left = (screen.width / 2) - (width / 2);
      var top = (screen.height / 2) - (height / 2);

      window.open(url, 'popup', 'height='+height+',width='+width+',status=no,toolbar=no,menubar=no,location=no,resizable=no,titlebar=no,scrollbars=no,fullscreen=no,top='+top+',left='+left);
}


/*
	This function returns an XHR-Object.
	If the browser doesn't support XHR,
	a message box with a warning is created.
*/
function get_xml_http_request_object()
{
	if (window.XMLHttpRequest)
		return new XMLHttpRequest();
	else if (window.ActiveXObject)
	{
		try
		{
			return new ActiveXObject('Microsoft.XMLHTTP');
		}
		catch (e) {}
	}
	return false;
}


function toggleInfo(caller, id)
{
	node = document.getElementById(id);
	node.style.display = node.style.display == 'none' ? 'block' : 'none' ;
}