function trim( str )
{
	for( lspace=0 ; lspace<str.length ; lspace++ )
		if( str.charAt(lspace)!=' ' )
			break;
	str = str.substring( lspace );
	for( rspace=str.length-1 ; rspace>=0 ; rspace-- )
		if( str.charAt(rspace)!=' ' )
			break;
	str = str.substring( 0, rspace+1 );
	return str;
}
function check()
{
	username = trim(document.form1.USERNAME.value);
	password = trim(document.form1.PASSWORD.value);
	if( (username.length==0 || username=="") && (password.length==0 || password=="") )
	{
		alert( "Please fill in the Username and Password to continue." );
		document.form1.USERNAME.value = "";
		document.form1.USERNAME.focus();
		return false;
	}
	else if( username.length==0 || username=="" )
	{
		alert( "Please fill in the Username to continue." );
		document.form1.USERNAME.value = "";
		document.form1.USERNAME.focus();
		return false;
	}
	else if( password.length==0 || password=="" )
	{
		alert( "Please fill in the Password to continue." );
		document.form1.PASSWORD.value = "";
		document.form1.PASSWORD.focus();
		return false;
	}
}