var shortText = {
 	closeTimer: 0,

	initialize: function() {
		var textShort = $$('#content #text p span.short');
		var hash = document.URL.split("#")[1];
		
		for(var i=0; i < textShort.length; i++) {
			textShort[i].insert({
				after: '&#160;<a class="moreLink">Mehr...</a>'
			});
			var link = textShort[i].next('a');
			link.observe("click", this.moreText.bind(this, link));
			
			if(textShort[i].identify() == hash)
				this.moreText(link);
		}
	},
	
	moreText: function(link) {
		var textLong = link.next('span.long');
		textLong.setStyle({display: 'block'});
		textLong.insert({
			after: ' <a class="moreLink">Einklappen</a>'
		});
		link.remove();		
		var newLink = textLong.next('a');
		newLink.observe("click", this.lessText.bind(this, newLink));

	},
	
	lessText: function(link) {
		var textLong = link.previous('span.long');
		textLong.setStyle({ display: 'none'});
		textLong.insert({
			before: '&#160;<a class="moreLink">Mehr...</a>'
		});
		link.remove();
		var newLink = textLong.previous('a');
		newLink.observe("click", this.moreText.bind(this, newLink));
	}
	
}

var faqText = {
 	closeTimer: 0,

	initialize: function() {
		var textShort = $$('#content #text p span.faqShort');
		for(var i=0; i < textShort.length; i++) {
			textShort[i].observe("click", this.moreText.bind(this, textShort[i]));
		}
	},
	
	moreText: function(link) {
		var textLong = link.next('span.faqLong');
		textLong.setStyle({display: 'block'});
		textLong.insert({
			after: ' <a class="moreLink">Einklappen</a>'
		});
		var newLink = textLong.next('a');
		newLink.observe("click", this.lessText.bind(this, newLink));
		link.stopObserving();

	},
	
	lessText: function(link) {
		var textLong = link.previous('span.faqLong');
		var textShort = link.previous('span.faqShort');
		textLong.setStyle({ display: 'none'});
		textShort.observe("click", this.moreText.bind(this, textShort));
		link.remove();
	}
	
}
