// Opens a popup for the generic form
function OpenGenericFormWindow(entityId, entityLevel)
{
	var url = "../GenericForm/GenericForm.aspx?entityId=" + entityId + "&entityLevel=" + entityLevel;
	url = resolveUrl(url);
	var title = "GenericForm";
	var options = "width=600,height=525,toolbar=no,menubar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no";
	OpenWindow(url, title, options);
}

// The OpenWindow function handles the opening of the window and additional properties.
function OpenWindow(url, title, options)
{
	var newwindow = window.open(url, title, options);
	
	if(newwindow != null)
	{
		try
		{
			var x = (newwindow.screen.availWidth - document.body.clientWidth) / 2;
			var y = (newwindow.screen.availHeight - document.body.clientHeight) / 2;
		}
		catch(ex)	{ } // Setting the window top and left may never generate an error.
		newwindow.opener = this;
		newwindow.focus();
	}
}
