// Creates a MoreView object.
// @param offClass	CSS class when in off state.
// @param onClass	CSS class when in on state.
var MoreView = function(offClass, onClass) {
	this.offClass = offClass;
	this.onClass = onClass;
	
	this.offHtml = "more";
	this.onHtml = "less";

	// Toggles whether more or less of the content is shown.
	// @param source	the element that was clicked/source of the action.
	// @param id		id of the content that is toggled.
	this.toggle = function(source, id) {
		if ($(id).hasClassName(this.offClass)) {
			$(id).removeClassName(this.offClass);
			$(id).addClassName(this.onClass);
			source.innerHTML = this.onHtml;
		} else {
			$(id).removeClassName(this.onClass);
			$(id).addClassName(this.offClass);
			source.innerHTML = this.offHtml;
		}
	};
};

// The default MoreView object ready to use.
// Just override the CSS classes.
var MORE = new MoreView("more_content_off", "more_content_on");