function Gallery(){
	this.total = 0;
	this.currentIndex = 0;
	this.imgs = new Array();
	this.prev = prev;
	this.next = next;
	this.display = display;
}

function next(){
	this.currentIndex++;
	if(this.currentIndex>this.total){this.currentIndex = 0;}
	this.display(this.currentIndex);
}
	
function prev(){
	this.currentIndex--;
	if(this.currentIndex<0){this.currentIndex = this.total;}
	this.display(this.currentIndex);
}

function display(index){
	this.currentIndex = index;
	var img = "<img src='http://www.wheelsnews.com/galleries/"+this.imgs[this.currentIndex]+"' border='0'/>";
	$('#imgcontainer').html(img);
	$('#currentIndex').html(this.currentIndex+1);
}
