var AJAXResponse =
{
	data: null,
	status: false,
	errors: [],
	
	unserialize: function(response)
	{
	
		eval('this.data = '+response.responseText+';');
		this.status = this.data.status;
		
		// Raise errors
		if (!this.status && this.data.errors)
		{
			this.errors = this.data.errors;
			for (var i = 0; (i < this.errors.length); i ++) {
				error(this.errors[i]);
			}
		}
		
		//alert(response.responseText);
		return {data: this.data, errors: this.errors};
	}
	
}
