
function club_fotofrei(id) {
	erg = httpRequest('club/fotofrei_ajax.php?id='+id);
	if (document.getElementById('fotofrei'+id)) document.getElementById('fotofrei'+id).src='images/club/club_'+erg+'.gif';
}

function club_fotodel(id) {
	if (confirm('Foto wirklich loeschen?')) {
		httpRequest('club/fotodel_ajax.php?id='+id);
		if (document.getElementById('fotocard'+id)) document.getElementById('fotocard'+id).style.display='none';
	}
}


function club_videofrei(id) {
	erg = httpRequest('club/videofrei_ajax.php?id='+id);
	if (document.getElementById('videofrei'+id)) document.getElementById('videofrei'+id).src='images/club/club_'+erg+'.gif';
}

function club_videodel(id) {
	if (confirm('Video wirklich entfernen (Wird nicht von YouTube geloescht)?')) {
		httpRequest('club/videodel_ajax.php?id='+id);
		if (document.getElementById('videocard'+id)) document.getElementById('videocard'+id).style.display='none';
		if (document.getElementById('videocardtext'+id)) document.getElementById('videocardtext'+id).style.display='none';
	}
}

function club_blogdel(id) {
	if (confirm('Blogeintrag wirklich loeschen?')) {
		httpRequest('club/blogdel_ajax.php?id='+id);
		if (document.getElementById('blogbox'+id)) {
			document.getElementById('blogbox'+id).style.display='none';
		} else if (document.getElementById('bloganswerbox'+id)) {
			document.getElementById('bloganswerbox'+id).style.display='none';
		}
	}
}

function club_bewerten(id,aktivitaet,stars,gross,id_cb,txt) {
	
	if (gross+''=='1'){gross='_gross';}else{gross='';}
	for (n=1;n<=5;n++) {
		v = '_leer';
		if (n<=stars) v = '_voll';
		if (document.getElementById(id+'star'+n)) document.getElementById(id+'star'+n).src='images/club/stern'+gross+v+'.gif';
	}
	if (document.getElementById(id+'startext'+id_cb)) document.getElementById(id+'startext'+id_cb).innerHTML=txt;
	httpRequest('club/bewerten_ajax.php?id='+id+'&id_cb='+id_cb+'&aktivitaet='+aktivitaet+'&stars='+stars,leer);
}

function leer() {
  //für Ajax Asyncronität	
}

function club_kontodel(id_user,text,link) {
	if (confirm(text)==true) {
		document.location.href=link;
	}
}

function club_switchBlogAnswerForm(id) {
	if (document.getElementById('answerform'+id)) {
		if (document.getElementById('answerform'+id).style.display=='') {
			club_closeBloganswerForm(id);
			//document.getElementById('answerform'+id).style.display='none';
		} else {
			document.getElementById('answerform'+id).style.display='';
			document.getElementById('answerform'+id).style.height='0px';
			club_expandBloganswerForm(id);
		}
	}
}

function club_expandBloganswerForm(id) {
	height = parseInt(document.getElementById('answerform'+id).style.height);
	if (height<200) {
		if (height==0) height=1;
		height = height*2;
		if (height>200) height = 200;
		document.getElementById('answerform'+id).style.height = height+'px';
		setTimeout('club_expandBloganswerForm('+id+')',40);
	} 
}

function club_closeBloganswerForm(id) {
	height = parseInt(document.getElementById('answerform'+id).style.height);
	if (height>1) {
		height = parseInt(height/2);
		document.getElementById('answerform'+id).style.height = height+'px';
		setTimeout('club_closeBloganswerForm('+id+')',40);
	} else {
		document.getElementById('answerform'+id).style.height = '0px';
		document.getElementById('answerform'+id).style.display='none';
		document.getElementById('answerformfields'+id).style.display='';
		document.getElementById('answerformthanks'+id).style.display='none';
		document.getElementById('answerfield'+id).value='';
	}
}

function club_saveBlogAnswerForm(id) {
	if (document.getElementById('answerfield'+id)) {
		if (replace(document.getElementById('answerfield'+id).value,' ','')!='') {
			saveid = document.getElementById('saveid'+id).value;
			text = encodeURIComponent(document.getElementById('answerfield'+id).value);
			postdata = '&saveid='+saveid+'&text='+text;
			httpPostRequest('club/bloganswersave_ajax.php?id='+id,postdata,club_afterBlogAnswerFormSave(id));
		}
	}
}

function club_afterBlogAnswerFormSave(id) {
	document.getElementById('answerfield'+id).style.backgroundColor='#E6E6E6';
	setTimeout('club_afterBlogAnswerFormSave2('+id+')',500);
}


function club_afterBlogAnswerFormSave2(id) {
	document.getElementById('answerfield'+id).style.backgroundColor='white';
	document.getElementById('answerformfields'+id).style.display='none';
	document.getElementById('answerformthanks'+id).style.display='';
	setTimeout('club_updateAnswer('+id+')',750);
}

function club_updateAnswer(id) {
	if (document.getElementById('anzantw'+id)) {
		document.getElementById('anzantw'+id).innerHTML = parseInt(document.getElementById('anzantw'+id).innerHTML)+1;
	}	
	if (document.getElementById('answerlist')) httpRequest('club/bloggetlastanwser_ajax.php?id='+id,club_insertLastAnswer);	
}

function club_insertLastAnswer(ht) {
	if (document.getElementById('answerlist')) {
		document.getElementById('answerlist').innerHTML = document.getElementById('answerlist').innerHTML + ht;
	}
}