// --------- Vector Object for JScript Support ---------//

function Vector() {
	this.length = 0;
	this.addElement = addElement;
	this.removeElement = removeElement;
	this.elementAt = elementAt;
	this.size = size;
	this.array = new array();
}

function array(){}

function size(){
	return(this.length);
}

function addElement(object){
	this.array[this.length] = object;
	this.length += 1;
}

function removeElement(object){
	var new_array = new array();
	var new_size = 0;

	for(var i=0; i < this.length; i++){
		if(this.array[i] != object){
			new_array[new_size] = this.array[i];
			new_size++;
		}
	}
	this.array = new_array;
	this.length = new_size;
}

function elementAt(index){
	return(this.array[index]);
}

