/**
 * @version $Id$
 * @requires jQuery
 */

Array.prototype.in_array = function(p_val) {
    for(var i = 0, l = this.length; i < l; i++) {
        if(this[i] == p_val) {
            return true;
        }
    }
    return false;
}

function countProperties(obj) {
	var count = "__count__",
	hasOwnProp = Object.prototype.hasOwnProperty;
	
	if (typeof obj[count] === "number" && !hasOwnProp.call(obj, count)) {
		return obj[count];
	}
	count = 0;
	for (var prop in obj) {
		if (hasOwnProp.call(obj, prop)) {
			count++;
		}
	}
	return count;
};
