p = Array.prototype;

p.indexOf = function (find) {
	for(var i = this.length - 1; i >= 0; i--) {
		if(this[i] == find)
			return i;
	}
	
	return i;
}

p.has = function (find) {
	return this.indexOf(find) >= 0;
}

p.remove = function (find) {
	return this.splice(this.indexOf(find), 1);
}

p.getById = function (sId) {
	return this.getByProperty('id', sId);
}

p.getByProperty = function (sProperty, sValue) {
	for(var i = this.length - 1; i >= 0; i--) {
		if(this[i][sProperty] == sValue)
			return this[i];
	}
	
	return null;
}