/*!
 * cce Util Javascript Library 0.1
 * http://www.calvarychapeleast.com
 *
 * Copyright 2010, Justin G Becker
 *
 * Date: Mon Mar 15 22:33:48 2010
 */

function Hash() {
	for ( var i = 0; i < arguments.length; i++)
		for (n in arguments[i])
			if (arguments[i].hasOwnProperty(n))
				this[n] = arguments[i][n];
}

Hash.version = 1.04; // Missed some 'var' declarations (thanks Twey)

Hash.prototype = new Object();

Hash.prototype.keys = function() {
	var rv = [];
	for ( var n in this)
		if (this.hasOwnProperty(n))
			rv.push(n);
	return rv;
}

Hash.prototype.length = function() {
	return this.keys().length();
}

Hash.prototype.values = function() {
	var rv = [];
	for ( var n in this)
		if (this.hasOwnProperty(n))
			rv.push(this[n]);
	return rv;
}

Hash.prototype.slice = function() {
	var rv = [];
	for ( var i = 0; i < arguments.length; i++)
		rv.push((this.hasOwnProperty(arguments[i])) ? this[arguments[i]]
				: undefined);
	return rv;
}

Hash.prototype.concat = function() {
	for ( var i = 0; i < arguments.length; i++)
		for ( var n in arguments[i])
			if (arguments[i].hasOwnProperty(n))
				this[n] = arguments[i][n];
	return this;
}

