function IsEmpty( text )
{
    if( text.value.length == 0 ) 
        return( true );
    for( var i=0; i<text.value.length; ++i )  
    {
        var ch = text.value.charAt(i);
        if( ch != ' ' && ch != '\t' ) 
            return( false );
    }
    return( true );
}


function IsEmail( text )
{
    if( text.value.length == 0 ) 
        return( false );
    if( text.value.indexOf("@") == -1 || text.value.indexOf(".") == -1 )
        return( false );
    return( true );
}


function ValidateForm(F)
{
    if ( IsEmpty(F.Name) )
        {
        alert("Please enter your name.");
        F.Name.focus();
        }
    else 
    if ( IsEmpty(F.School) )
        {
        alert("Please enter your school.");
        F.School.focus();
        }
    else 
    if ( IsEmpty(F.Grade) )
        {
        alert("Please enter what grade you teach.");
        F.Grade.focus();
        }
    else 
	if ( IsEmpty(F.netname) || !IsEmail(F.netname) )
        {
        alert("Please enter a valid e-mail address.");
        F.netname.focus();
        }
    else     
    if ( IsEmpty(F.Comments) )
        {
        alert("Please enter a question or comment.");
        F.Comments.focus();
        }
    else 		 
    return( true );
    
    return( false );
}

