
// éáűúőöüó

var clubBlillboardState=false;
var clubUserJoinedState=false;
var editorinit=true;
function clubBillboardNewMessage() {
	if(!clubBlillboardState) { alert('A falújságra csak klubtagok írhatnak'); return; }
	$('domessage_content').toggle();
	$('domessage_button').hide();
	if(editorinit) {
		editorinit=false;
		generate_wysiwyg.delay(0.2,'formtext',400,130);
	}
	Element.show.delay(3,'submit_button');
}
function clubBillboardSend() {
	if(!clubBlillboardState) { alert('A falújságra csak klubtagok írhatnak'); return; }
	Form.Element.disable('submit_button').update('Folyamatban...');
	updateTextArea('formtext');
	$('global_billboard_new_message_form').submit();
}
function clubBillboardReply(id) {
	if(!clubBlillboardState) { alert('A falújságra csak klubtagok írhatnak'); return; }
	$('reply_area_'+id).hide()
		.update(
			 '<textarea id="reply_text_'+id+'"></textarea>'
			+'<button type="button" class="button3g" onClick="clubBillboardReplySend('+id+');" id="reply_submit_button_'+id+'">Mehet</button>'
			+'<button type="button" class="button2o" onClick="clubBillboardReplyHide('+id+');">Mégse</button>'
		);
	generate_wysiwyg.delay(0.3,'reply_text_'+id,400,130);
	Element.show.delay(0.5,'reply_area_'+id)
}

function clubBillboardReplySend(id) {
	Form.Element.disable('reply_submit_button_'+id).update('Folyamatban...');
	updateTextArea('reply_text_'+id);
	$('formtext').value=$F('reply_text_'+id);
	$('replyid_js').value=id;
	$('global_billboard_new_message_form').submit();
}

function clubBillboardReplyHide(id) {
	$('reply_area_'+id).hide()
}

function clubBillboardRepliedToggle(id) {
	$('replied_area_'+id).toggle();
}

function clubBlogShowComments(_id) {
	var cont=$('comment_conatiner_'+_id);
	if(!cont.visible() && cont.innerHTML.blank()) {
		// nincsenek kommentek lehívva
		new Ajax.Updater(cont,'/club.php?act=blogcomments&itemid='+_id, {
			onComplete:function(_t) {
				cont.show();
			}
		});
	} else cont.toggle();
}

function clubBlogCommentCreateToggle(_id) {
	if(!clubUserJoinedState) { alert('Blogbejegyzésre csak tagok írhatnak kommentet!'); return; }
	$('club_blog_new_comment_'+_id).toggle();
}

function clubBlogCommentSend(_id) {
	if(!clubUserJoinedState) { alert('Blogbejegyzésre csak tagok írhatnak kommentet!'); return; }
	new Ajax.Updater('comment_conatiner_'+_id, '/club.php', {
		 parameters: $('club_blog_send_form_'+_id).serialize()
		,onComplete: function(_t) {
			$('club_blog_commentcount_'+_id).hide();
			$('club_blog_send_form_text_'+_id).value='';
			$('club_blog_new_comment_'+_id).hide();
			$('comment_conatiner_'+_id).show();
		}
	});
}

function clubEditSend() {
	updateTextArea('info_id');
	$('club_edit_form').submit();

}

function clubBlogIgnoreButton(blogid) {
	$('club_ignore_button_'+blogid).hide();
	new Ajax.Request('/club.php',{
		parameters: {
			 'act':'blogignore'
			,'blogid':blogid
		}
	});
}

