
AjaxMessage = function(responseJSON){
  this.responseJSON = responseJSON;
}

AjaxMessage.isValid = function(t){
  if (t.responseJSON == null || typeof t.responseJSON.Status != 'string'){
    return false;
  } 
  
  return true;
}

AjaxMessage.fromResponse = function(t){
  return new AjaxMessage(t.responseJSON);
}

AjaxMessage.prototype.isSuccess = function(){
  return this.responseJSON.Status == 'success';
}

AjaxMessage.prototype.getMessage = function(){
  return this.responseJSON.Message;
}

AjaxMessage.prototype.getData = function(){
  return this.responseJSON;
}

AjaxMessage.prototype.growlThis = function(){
  var g = new k.Growler();
  
  if (this.responseJSON.Status == 'success'){
    g.info(this.responseJSON.Message, {life: 10});
  } else {
    g.error(this.responseJSON.Message, {life: 10});
  }
}


