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 ValidateContactForm(F)
{
    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.txtemail) || !IsEmail(F.txtemail) )
        {
        alert("Please enter a valid e-mail address.");
        F.txtemail.focus();
        }
    else 
   if ( IsEmpty(F.txtinspot) )
        {
        alert("Please enter a valid IN Spot");
        F.txtinspot.focus();
        }
    else 
	if ( ! (F.chkdining.checked || F.chkart.checked || F.chkentertainment.checked || F.chknightlife.checked || F.chkshopping.checked || F.chkoutdoors.checked || F.chkattractions.checked || F.chkother.checked) )
        {
		alert("Please select a category.");
		F.chkdining.focus();
   	}
    else
	if ( IsEmpty(F.txawhy) )
        {
        alert("Please enter a reason for why you love your IN Spot");
        F.txawhy.focus();
        }
    else 
	 
    return( true );
    
    return( false );
}



