function showText(nr) {
	document.getElementById("anz" + nr).style.display = 'none';
	document.getElementById("text" + nr).style.display = '';
}
function hideText(nr) {
	document.getElementById("anz" + nr).style.display = '';
	document.getElementById("text" + nr).style.display = 'none';
}

function showMenu(name) {
	hideMenu();
	document.getElementById("menu_"+name).style.display = 'block';
}

function hideMenu() {
	document.getElementById("menu_mails").style.display = 'none';
	document.getElementById("menu_fun").style.display = 'none';
	document.getElementById("menu_community").style.display = 'none';
	document.getElementById("menu_mein").style.display = 'none';
}

function checkKapitel() {
	if (document.getElementById("kapitel").value.length < 500) {
		alert("Du musst mindestens 500 Zeichen schreiben, sonst wird die Geschichte ja langweilig...");
		return false;
	}
}

function bildaendern() {
	window.open('bildaendern.php','BildAendern','width=300,height=150,scrollbars=yes');
}

function profilPic(nickname) {
	window.open('profilbild.php?nick='+encodeURIComponent(nickname),'profilPic','width=550,height=550,scrollbars=no');
}

function showOnlineUser() {
	window.open('onlineuser.php','showOnline','width=150,height=300,scrollbars=yes');
}


var http = null;
if (window.XMLHttpRequest) { http = new XMLHttpRequest(); } 
else if (window.ActiveXObject) { http = new ActiveXObject("Microsoft.XMLHTTP"); }

function closeMessage(id) {	
	document.getElementById("message"+id).style.display = 'none';
	http.open("GET", 'close_message.php?id='+id, true);
	http.send(null);
}