	//  These customg scripts replace the CFFORM client validation scripts
	//  because validating a CFSELECT does not work correctly
	// suresh marupilla 10/25/2006 - removed checks for city and state for type dod
function  _CF_checkCFForm_1(_CF_this)
    {
        //reset on submit
        _CF_error_exists = false;
        _CF_error_messages = new Array();
        _CF_error_fields = new Object();
        _CF_FirstErrorField = null;


        //form element blah required check
        if( !_CF_hasValue(_CF_this['prod_id'], "CHECKBOX", false ) &&  !_CF_hasValue(_CF_this['prod_id_es'], "CHECKBOX", false ))
        {
            _CF_onError(_CF_this, "prod_id", _CF_this['prod_id'].value, "- Must choose at least one product");
            _CF_error_exists = true;
        }
		
        //form element firstname required check
        if( !_CF_hasValue(_CF_this['firstname'], "TEXT", false ) )
        {
			
            _CF_onError(_CF_this, "firstname", _CF_this['firstname'].value, "- First Name is required");
            _CF_error_exists = true;
        }
		
		//form element lastname required check
        if( !_CF_hasValue(_CF_this['lastname'], "TEXT", false ) )
        {
            _CF_onError(_CF_this, "lastname", _CF_this['lastname'].value, "- Last Name is required");
            _CF_error_exists = true;
        }

        //form element address_ln1 required check
        if( !_CF_hasValue(_CF_this['address_ln1'], "TEXT", false ) )
        {
            _CF_onError(_CF_this, "address_ln1", _CF_this['address_ln1'].value, "- Address 1 is required");
            _CF_error_exists = true;
        }

        //form element city required check
        if( !_CF_hasValue(_CF_this['city'], "TEXT", false ) && _CF_this['type'].value != 'dod' )
        {
            _CF_onError(_CF_this, "city", _CF_this['city'].value, "- City is required");
            _CF_error_exists = true;
        }
		
        //form element state or State/Province/Region required check
        if(_CF_this['state'].type == "text")
		{
			//if(!_CF_hasValue(_CF_this['state'], "TEXT", false ) )
			//{
				//_CF_onError(_CF_this, "state", _CF_this['state'].value, "- State/Province/Region is required");
           		//_CF_error_exists = true;
			//}
		}
		else if (_CF_this['state'].selectedIndex == "0")
        {
            _CF_onError(_CF_this, "state", _CF_this['state'].value, "- State is required");
            _CF_error_exists = true;
        }
		
		
        //form element zip required check, if internationl or domestic
        if(_CF_this['state'].type != "text")
		{		
			//form element country required check		
			if( !_CF_hasValue(_CF_this['zip'], "TEXT", false ) )
			{
				_CF_onError(_CF_this, "zip", _CF_this['city'].value, "- Zip/Postal Code is required");
				_CF_error_exists = true;
			}		
	
			//form element email 'REGULAR_EXPRESSION' validation checks
			var zipRegExp = /^([0-9]){5,5}$|(([0-9]){5,5}(-| ){1}([0-9]){4,4}$)/;
			if (!_CF_checkregex(_CF_this['zip'].value, zipRegExp, false))
			{
				_CF_onError(_CF_this, "zip", _CF_this['zip'].value, "- Zip/Postal code Invalid ");
				_CF_error_exists = true;
			}	
		}
		else
		{
			//form element country required check		
			if( !_CF_hasValue(_CF_this['zip'], "TEXT", false ) )
			{
				_CF_onError(_CF_this, "zip", _CF_this['city'].value, "- Postal Code is required");
				_CF_error_exists = true;
			}		
		}

        //form element country required check
        if(_CF_this['country'].selectedIndex == 0)
        {
            _CF_onError(_CF_this, "country", _CF_this['country'].value, "- Country is required");
            _CF_error_exists = true;
        }

        //form element email 'REGULAR_EXPRESSION' validation checks
		var emailRegExp = /^([a-zA-Z0-9_\-])+(\.([a-zA-Z0-9_\-])+)*@((\[(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5]))\]))|((([a-zA-Z0-9])+(([\-])+([a-zA-Z0-9])+)*\.)+([a-zA-Z])+(([\-])+([a-zA-Z0-9])+)*))$/;
        if (!_CF_checkregex(_CF_this['email'].value, emailRegExp, false))
        {
            _CF_onError(_CF_this, "email", _CF_this['email'].value, "- Email Address Invalid ");
            _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;
        }
    }
