//<SCRIPT LANGUAGE="JavaScript">

Array.prototype.Append = function( item )
{
	this[this.length] = item;
}

Array.prototype.Remove = function (index)
{
	for ( var i= index; i<this.length-1 ; i++ )
		this[i] = this[i+1];
	
	this.length--;
}

Array.prototype.InsertAfter = function (index, val)
{
	for ( var i= this.length; i>index+1 ; i--)
		this[i] = this[i-1];
	
	this[index+1] = val;
	
}

Array.prototype.MaxVal = function( prop )
{
	var m=0;
	for ( var i= 0; i<this.length ; i++ )
	{
		var cand = eval( 'this[i].' + prop )
		
		if ( i==0 || cand > m )
			m=cand;
	}
	return m;
}

Array.prototype.MinVal = function( prop )
{
	var m=0;
	for ( var i= 0; i<this.length ; i++ )
	{
		var cand = eval( 'this[i].' + prop )
		
		if ( i==0 || cand < m )
			m=cand;
	}
	return m;
}

Array.prototype.last = function()
{
	return this[this.length-1];
}


//</SCRIPT>
