// validate contact form

function  _CF_checkcontact(_CF_this)
    {
        //reset on submit
        _CF_error_exists = false;
        _CF_error_messages = new Array();
        _CF_error_fields = new Object();
        _CF_FirstErrorField = null;

        //form element name required check
        if( !_CF_hasValue(_CF_this['name'], "TEXT", false ) )
        {
            _CF_onError(_CF_this, "name", _CF_this['name'].value, "Error in name text.");
            _CF_error_exists = true;
        }

        //form element title required check
        if( !_CF_hasValue(_CF_this['title'], "TEXT", false ) )
        {
            _CF_onError(_CF_this, "title", _CF_this['title'].value, "Error in title text.");
            _CF_error_exists = true;
        }

        //form element company required check
        if( !_CF_hasValue(_CF_this['company'], "TEXT", false ) )
        {
            _CF_onError(_CF_this, "company", _CF_this['company'].value, "Error in company text.");
            _CF_error_exists = true;
        }

        //form element email required check
        if( _CF_hasValue(_CF_this['email'], "TEXT", false ) )
        {
            //form element email 'EMAIL' validation checks
            if (!_CF_checkEmail(_CF_this['email'].value, true))
            {
                _CF_onError(_CF_this, "email", _CF_this['email'].value, "Error in email text.");
                _CF_error_exists = true;
            }

        }else {
            _CF_onError(_CF_this, "email", _CF_this['email'].value, "Error in email text.");
            _CF_error_exists = true;
        }

        //form element phone required check
        if( _CF_hasValue(_CF_this['phone'], "TEXT", false ) )
        {
            //form element phone 'TELEPHONE' validation checks
            if (!_CF_checkphone(_CF_this['phone'].value, true))
            {
                _CF_onError(_CF_this, "phone", _CF_this['phone'].value, "Error in phone text.");
                _CF_error_exists = true;
            }

        }else {
            _CF_onError(_CF_this, "phone", _CF_this['phone'].value, "Error in phone text.");
            _CF_error_exists = true;
        }

        //form element fax 'TELEPHONE' validation checks
        if (!_CF_checkphone(_CF_this['fax'].value, false))
        {
            _CF_onError(_CF_this, "fax", _CF_this['fax'].value, "Error in fax text.");
            _CF_error_exists = true;
        }

        //form element zip 'ZIPCODE' validation checks
        if (!_CF_checkzip(_CF_this['zip'].value, false))
        {
            _CF_onError(_CF_this, "zip", _CF_this['zip'].value, "Error in zip text.");
            _CF_error_exists = true;
        }

        //form element howHear required check
        if( !_CF_hasValue(_CF_this['howHear'], "TEXT", false ) )
        {
            _CF_onError(_CF_this, "howHear", _CF_this['howHear'].value, "Error in howHear text.");
            _CF_error_exists = true;
        }


        //display error messages and return success
        if( _CF_error_exists )
        {
            if( _CF_error_messages.length > 0 )
            {
                // show alert() message
                _CF_onErrorAlert(_CF_error_messages);
                // set focus to first form error, if the field supports js focus().
                if( _CF_this[_CF_FirstErrorField].type == "text" )
                { _CF_this[_CF_FirstErrorField].focus(); }

            }
            return false;
        }else {
            return true;
        }
    }