var readMoreBox = Class.create({
	initialize: function(id, options){
		this.id = id;
		this.moreBox = $(this.id);
		this.options = {
			text: {
				open: 'Mehr',
				close: 'Weniger'
			}
		};
		Object.extend(this.options, options);
		
		
		this.prepare();
	},
	prepare: function(){
		this.link = new Element('a', {'class':'moreLink', href:'#'+this.id}).update(this.options.text.open);
		this.content = new Element('div', {'class':'moreContent', 'style':'display:none'}).update(this.moreBox.innerHTML);
		this.moreBox.update(this.content);
		this.moreBox.insert({'top':this.link});
		this.setLinkListener();
	},
	setLinkListener: function(){
		this.link.observe('click', function(evt){
			evt.stop();
			if(this.content.style.display == 'none') {
				this.open();
			} else {
				this.close();
			}
		}.bind(this));
	},
	open: function(){
		this.content.blindDown({duration:0.2,afterFinish:function(){
			this.moreBox.fire('moreBox:done');
		}.bind(this)});
		this.link.update(this.options.text.close);
		this.moreBox.addClassName('open');
	},
	close: function(){
		this.content.blindUp({duration:0.2,afterFinish:function(){
			this.moreBox.fire('moreBox:done');
		}.bind(this)});
		this.link.update(this.options.text.open);
		this.moreBox.removeClassName('open');
	}
});