/*
 * http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:indexOf
 */
if (!Array.prototype.indexOf) {
	Array.prototype.indexOf = function(elt /*, from*/)
	{
		var len = this.length;
		
		var from = Number(arguments[1]) || 0;
		from = (from < 0)
			? Math.ceil(from)
			: Math.floor(from);
		if (from < 0)
		from += len;
		
		for (; from < len; from++)
		{
			if (from in this &&
			this[from] === elt)
			return from;
		}
		return -1;
	};
}


/*
 * Dean Edwards version
 */
if (!Array.prototype.indexOf) {
	Array.prototype.indexOf = function(item, fromIndex) {
		var length = this.length;
		if (fromIndex == null) {
			fromIndex = 0;
		} else if (fromIndex < 0) {
			fromIndex = Math.max(0, length + fromIndex);
		}
		for (var i = fromIndex; i < length; i++) {
			if (this[i] === item) return i;
		}
		return -1;
	}
}

