ExecQueue = 
{
	index: -1,
	count: 0,
	items: [],
	startTimer: null,
	add: function(task)
	{
		 this.items[this.count++] = task;
         if(this.count == 1) 
         {
            clearTimeout(this.startTimer);
            this.startTimer = setTimeout("ExecQueue.next()", 100); // async call
         }
	},
	next: function()
	{
	    if(++ExecQueue.index < ExecQueue.count)
	    {
	       var task = ExecQueue.items[ExecQueue.index];
	       if(task !== undefined) 
	       {
	          task(ExecQueue.next);
	       }
	       delete ExecQueue.items[ExecQueue.index];
	    } else {
	       ExecQueue.count = 0;
	       ExecQueue.index = -1; 
	    }		
	}
}	
