// COLLECTIONS Core Code
//Extend the Array object to act like a "Collection"
// Author RJ Wallace, NYC, rjw@bway.net

Array.prototype.Add=
	function (Item) { // VB Style Add method (requires no index)
		var iNext=this.length;
		Item.index=iNext;

		var name;
		var What;

		if (arguments.length==2) {
			name=Item;
			What=arguments[1];
		} else {
			What=Item;
		}
		this[iNext]=What;
		return this[iNext]; };
Array.prototype.Delete=function (Item) { delete this[Item]; };
Array.prototype.Randomize=
	function () { // returns an index array of array randomly sorted
		var i=0, random, considered=new Array(), sorted=new Array();
		//while all of array elements haven't been cycled thru
		while (i<this.length){
			random=Math.floor(Math.random()*this.length)
			if (!considered[random]){
				sorted[i]=random;
				considered[random]=true;
				i++;
			}
		}
		return sorted;
	};


