var CodaDisplay = new Class({
	// URLs to the images (TOTAL MUST EQUAL 'links')
	pics: ['/images/coda-community.jpg', '/images/coda-housingstats.jpg', '/images/coda-library.jpg'],
	// Click-through links (TOTAL MUST EQUAL 'pics')
	links: ['/community_service.cfm', 'javascript:openFrame(329);', '/library.cfm'],
	currentPos: 0,
	// The element to write output in
	canvas: null,
	next: function(){
		this.currentPos++;
		if (this.currentPos>=this.pics.length){this.currentPos=0;}
		this.drawImg(this.currentPos);
	},
	prev: function(){
		this.currentPos--;
		if (this.currentPos<0){this.currentPos=this.pics.length-1;}
		this.drawImg(this.currentPos);
	},
	drawImg: function(pos){
		var coda_anchor = new Element('a', {'href':this.links[pos]});
		var coda_img = new Element('img', {'src':this.pics[pos], 'alt':''});
		
		this.canvas.empty();
		coda_anchor.inject(this.canvas);
		coda_img.inject(coda_anchor);
	},
	initialize: function(el){
		this.canvas = $(el);
		this.drawImg(this.currentPos);
		return this;
	}
});

