function Gallery() {
    var displays = new Array();

    this.getDisplays = function() {
	return displays;
    };

    this.addDisplay = function(i, d) {
	display = new Display(i, d);
	displays.push(display);
    };
    
    this.getDefaultDisplay = function() {
    	return displays[0];
    };
    
    this.getNextDisplay = function(imageName) {
    	var matchedIndex = -1;
	$.each(displays, function(index, display) {
	    if(imageName == display.getImage()) {
		matchedIndex = index + 1;
		return false;
	    }
	});
	return (matchedIndex != displays.length)? displays[matchedIndex] : displays[0];
    };
    
    this.getDisplay = function(imageName) {
	// If this exists in our collection, return it
	matchedDisplay = null;
	$.each(displays, function() {
	    if(imageName == this.getImage()) {
	        matchedDisplay = this;
	        return false;
	    }
	});
	if(matchedDisplay) return matchedDisplay;
	// Hmm, not in the thumbnail record? Return a new Display
	return new Display(imageName, "");
    };
};


