/*
* 
* imgArray(div id, src);
* 
*/

function imageLoaderQueue(){
	this.imgArray=new Array();
	this.c=-1;
	
	/*
	* @param img	reference	reference to a dom object
	* @param imgSrc	string		url to image to load
	*/
	this.add=function(img,imgSrc){
		this.imgArray.push(new Array(img,imgSrc));
	}

	this.start=function(){
		this.c=-1;
		this.next();
		
	}
	
	this.clear = function(){
		this.imgArray=null;
		this.imgArray=new Array();
	}
	
	this.next=function(){
		this.c++;
		this.imgDone();
	}
	
	this.imgDone=function(){
		if(this.c < this.imgArray.length){
			var img = this.imgArray[this.c];
			img[0].loader=this;
			img[0].onload=function(){this.loader.next()};
			img[0].src=img[1];
		}
	}	
}