var List_Effects = Class.create();
List_Effects.prototype = {
	initialize: function(elID) {
		this.contentEl = $(elID);
		this.contentElID = elID;

		// hide all ul's
		this.hideAll();

		// add onclick handler to the anchor inside the div tag
		this.addOnClickHandler();
	},

	hideAll : function() {
		$$('#' + this.contentElID + ' div.event div.text').each(function(el) {
			el.hide();
		});
	},

	addOnClickHandler : function() {
		$$('#' + this.contentElID + ' div.event').each(function(el) {
			var anchor  = el.down('a');
			var content = el.down('div.text');
			if(content != undefined) {
				el.observe('click', this.toggle.bindAsEventListener(this));
			}
		}.bind(this));
	},

	toggle : function(event) {
		var content = event.target.up(1).down('div.text');
		if(content.visible()) {
			new Effect.BlindUp(content);
		} else {
			new Effect.BlindDown(content, {
				afterFinish: function(effect) {
					content.setStyle({
						height: 'auto'
					});
				}
			});
		}
	}

};
