var errorCollection = Class.create();
errorCollection.prototype = {
   initialize: function(){
   	 this.errors = [];
   },
   addError: function(error){
     this.errors.push(error);           
   },
   getError: function(index){
   	 var index = index || 0;
   	 return this.errors[index];          
   },
   getErrors: function(){
   	 return this.errors;          
   },
   removeError: function(index){
     this.errors.splice(index,1);
   },
   count: function(){
   	 return this.errors.length;
   },
   hasErrors: function(){
     var bool = false;
     if (this.count() > 0) { bool = true; }
     return bool; 
   },
   clear: function(){
   	 this.errors.clear();
   }
}