function checkForm()
{
	var fout = false;
	f = document.forms[0];

	login		= trim( f.login.value );
	wachtwoord	= trim( f.wachtwoord.value );

	if ( login.length == 0 )
	{
		if ( !fout )
		{
			melding = 'Please fill in the field loginname';
			f.login.focus();
			fout = true;
		}
	}

	if ( wachtwoord.length == 0 )
	{
		if ( !fout )
		{
			melding = 'Please fill in the field password';
			f.wachtwoord.focus();
			fout = true;
		}
	}

	if ( fout )
	{
		alert( melding );
		return false;
	}

	return true;
}

function trim( strText )
{
	while ( strText.substring(0,1) == ' ' ) 
		strText = strText.substring(1, strText.length);

	while (strText.substring(strText.length-1,strText.length) == ' ')
		strText = strText.substring(0, strText.length-1);

	return strText;
}
