function _CF_hasValue(obj, obj_type) {
    if (obj_type == "TEXT" || obj_type == "PASSWORD")
	{
    	if (obj.value.length == 0) 
      		return false;
    	else 
      		return true;
    	}
}

function isEmailAddr(email){
	var result = false
	var theStr = new String(email)
	var index = theStr.indexOf("@");
	if (index > 0)	{
		var pindex = theStr.indexOf(".",index);
		if ((pindex > index+1) && (theStr.length > pindex+1)) {result = true;}
	}
	return result;
}

function _CF_onError(form_object, input_object, object_value, error_message) {
	alert(error_message);
       	return false;	
}


function  _CF_checkappform(_CF_this) 
{
	if  (!_CF_hasValue(_CF_this.fname, "TEXT" )) 
		{
        		if  (!_CF_onError(_CF_this, _CF_this.fname, _CF_this.fname.value, "Please enter your first name."))
            		{
			return false; 
			}
		}
	if  (!_CF_hasValue(_CF_this.lname, "TEXT" )) 
		{
        		if  (!_CF_onError(_CF_this, _CF_this.lname, _CF_this.lname.value, "Please enter your last name."))
            		{
			return false; 
			}
		}
	if  (!_CF_hasValue(_CF_this.email, "TEXT" )||!isEmailAddr(_CF_this.email.value)) 
		{
			if  (!_CF_onError(_CF_this, _CF_this.email, _CF_this.email.value, "Please enter your email address"))
			{
			return false; 
			}
		}
	if  (!_CF_hasValue(_CF_this.address1, "TEXT" )) 
		{
        		if  (!_CF_onError(_CF_this, _CF_this.address1, _CF_this.address1.value, "Please enter your address."))
            		{
			return false; 
			}
		}
	if  (!_CF_hasValue(_CF_this.city, "TEXT" )) 
		{
        		if  (!_CF_onError(_CF_this, _CF_this.city, _CF_this.city.value, "Please enter your city."))
            		{
			return false; 
			}
		}
	if  (!_CF_hasValue(_CF_this.state, "TEXT" )) 
		{
        		if  (!_CF_onError(_CF_this, _CF_this.state, _CF_this.state.value, "Please enter your state or province."))
            		{
			return false; 
			}
		}
	if  (!_CF_hasValue(_CF_this.zip, "TEXT" )) 
		{
        		if  (!_CF_onError(_CF_this, _CF_this.zip, _CF_this.zip.value, "Please enter your postal code."))
            		{
			return false; 
			}
		}
	if  (!_CF_hasValue(_CF_this.country, "TEXT" )) 
		{
        		if  (!_CF_onError(_CF_this, _CF_this.country, _CF_this.country.value, "Please enter your country."))
            		{
			return false; 
			}
		}
	if  (!_CF_hasValue(_CF_this.what_project, "TEXT" )) 
		{
        		if  (!_CF_onError(_CF_this, _CF_this.what_project, _CF_this.what_project.value, "Please enter What project are you applying for."))
            		{
			return false; 
			}
		}
	if  (!_CF_hasValue(_CF_this.when_available, "TEXT" )) 
		{
        		if  (!_CF_onError(_CF_this, _CF_this.when_available, _CF_this.when_available.value, "Please enter when are you available to volunteer."))
            		{
			return false; 
			}
		}
	if  (!_CF_hasValue(_CF_this.why_apply, "TEXT" )) 
		{
        		if  (!_CF_onError(_CF_this, _CF_this.why_apply, _CF_this.why_apply.value, "Please enter why are you applying for this project."))
            		{
			return false; 
			}
		}
}