/**
 * Class to hold error information
 */
PACIFICFOX.Error = function() { 
	/**
	 * Public variables
	 */
	this.errorCollection = new Array();
	this.type = { required:false, minimumLength:false, maximumLength:false, invalidCharacter:false, invalidFormat:false }
	this.firstObject = null;
};
/**
 * Public methods
 */
PACIFICFOX.Error.prototype.hasError = function() { 
	var result = false;
	if ( this.errorCollection.length != 0 ) {
		result = true;
	}
	return result;
};
PACIFICFOX.Error.prototype.hasErrorType = function( type ) { 
	var result = false;
	if ( typeof this.type[ type ] != "undefined" ) {
		result = this.type[ type ];
	}
	return result;
};
PACIFICFOX.Error.prototype.addError = function( arg ) { 
	this.errorCollection.push( arg.message );
	if ( typeof this.type[ arg.type ] != "undefined" ) {
		this.type[ arg.type ] = true;
	}
	return true;
};
PACIFICFOX.Error.prototype.getAsList = function( errorMessage ) { 
	var result = new String();
	for ( var i = 0; i < this.errorCollection.length; i++ ){
		result += ( i + 1 ) + ". " + this.errorCollection[ i ] + "\n";
	}
	return result;
};
PACIFICFOX.Error.prototype.getAsString = function( errorMessage ) { 
	var result = new String();
	for ( var i = 0; i < this.errorCollection.length; i++ ){
		result += this.errorCollection[ i ];
		if ( i != this.errorCollection.length ) {
			result += ". ";
		}
	}
	return this.errorCollection.toString();
};
PACIFICFOX.Error.prototype.reset = function() { 
	this.errorCollection = new Array();
};