// JavaScript Document

// open a window with the given side, size, and pos in the middle of the screen
function openPopUpWindow( side, width, height, scrolling )
{
	var left = (screen.width-width)/2;
	var top  = (screen.height-height-50)/2;
	if (side && side != null)
	{
		var parameters = "";
		if ( width != null )
		{
			parameters += ",width=" + width;
		}
		if ( height != null )
		{
			parameters += ",height=" + height;
		}
		if ( top != null )
		{
			parameters += ",top=" + top;
		}
		if ( left != null )
		{
			parameters += ",left=" + left;
		}
		if ( scrolling == "true" )
		{
			parameters += ",scrollbars=auto";
			parameters += ",scrollbars=yes";
		}
		else
		{
			parameters += ",scrollbars=no";
		}
		var newWindow = window.open( side, "_blank","toolbar=no,status=no,location=no,menubar=no,directories=no,resizable=no " + parameters );  
		newWindow.focus();
	}
	return;
}
