/**
 * This script hides text element (p etc.) which use the class "versteckmich"
 * After hiding the text can be shown with clicking on the generated link.
 */
function hideElements(){
	idCounter = 0;
	jQuery(function(){
		var inputFields = jQuery(".versteckmich");
		inputFields.each(function(){
			inputField = jQuery(this);
			inputField.attr('id', 'input_area_'+idCounter);
			inputField.css('display', 'none');
			inputField.prev().html('<span id="opener_'+idCounter+'" class="opener">'+inputField.prev().html()+'</span>');
			inputField.prev().bind('click', null, function(e){
			    var targetId = e.target.id.substr(7);
				jQuery("#input_area_"+targetId).css('display', 'block');
			});
			idCounter++;
		});
	});
}

hideElements();
