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 ValidateCareerForm(F)
    {
    var boolOKToSubmit = false;
    
    if ( IsEmpty(F.txtFirstName) )
        {
        alert("Please enter your first name.");
        F.txtFirstName.focus();
        }
    else
    if ( IsEmpty(F.txtLastName) )
        {
        alert("Please enter your last name.");
        F.txtLastName.focus();
        }
//  else
//  if ( IsEmpty(F.txtAddress) )
//      {
//      alert("Please enter your street address.");
//      F.txtAddress.focus();
//      }
//  else
//  if ( IsEmpty(F.txtCity) )
//      {
//      alert("Please enter your city.");
//      F.txtCity.focus();
//      }
//  else
//  if ( F.txtState.selectedIndex == 0 )
//      {
//      alert("Please select your state.");
//      F.txtState.focus();
//      }
//  else
//  if ( IsEmpty(F.txtZip) )
//      {
//      alert("Please enter your zip code.");
//      F.txtZip.focus();
//      }
    else
    if ( IsEmpty(F.txtPhone) )
        {
        alert("Please enter your phone number.");
        F.txtPhone.focus();
        }
    else
    if ( IsEmpty(F.txtEmail) || !IsEmail(F.txtEmail) )
        {
        alert("Please enter a valid e-mail address.");
        F.txtEmail.focus();
        }
//  else
//  if ( IsEmpty(F.upload) )
//      {
//      alert("Please upload your resume.");
//      F.upload.focus();
//      }

    else 		 
        boolOKToSubmit = true;
    
    return(boolOKToSubmit);
    }
