/**
 * opens a popup with default-options
 *
 * @param string filename the name of the file to display in the popup
 * @param string title the title of the popup
 * @param int width the width of the popup
 * @param int height the height of the popup
 */
function openDefaultPopup(filename,title,width,height)
{
	var options = 'toolbar=no,status=no,menubar=no,width=' + width + ',height=' + height;
	options += ',resizable=yes,scrollbars=yes,left=0,top=0,screenX=0,screenY=0';
	window.open(filename,title,options);
}

/**
 * opens a popup with the given parameters
 *
 * @param string filename the name of the file to display in the popup
 * @param string title the title of the popup
 * @param string options the options of die popup
 */
function openPopup(filename,title,options)
{
	window.open(filename,title,options);
}

/**
 * trims the given string
 *
 * @param string input the input-string
 * @return string the trim`ed string
 */
function trim(input)
{
	if(input == "")
		return "";

	// determine the first not-whitespace-character
	var i = 0;
	for(;i < input.length;i++)
	{
		if(input[i] != '\n' && input[i] != '\r' && input[i] != '\t' && input[i] != ' ')
			break;
	}

	// determine the last not-whitespace-character
	var a = input.length - 1;
	for(;a >= 0;a--)
	{
		if(input[a] != '\n' && input[a] != '\r' && input[a] != '\t' && input[a] != ' ')
			break;
	}

	return input.substr(i,a - i + 1);
}