

function Queue()
{

	this.construct = function()
	{
		this._q = new Array();
	}

        this._q = null;
	this._qCnt = 0;

	this.queue = function( data )
	{
		this._q.push( data );

		//document.getElementById('dbg').innerHtml += data.obj.getId();
	
		this._qCnt++;
	}



	this.retrieve = function()
	{
		var tmp = this.peek( 0 );
		this.advance();
		return tmp;
	}

	this.peek = function( index )
	{
		return this._q[ index ];
	}

	this.advance = function()
	{
                this._q.splice( 0, 1 );
		this._qCnt--;
	}

	this.count = function()
	{
		//return this._q.length;
		return this._qCnt;
	}



	this.construct();
}
