function morph_related(id, up) {
	if(up)
		$(id).morph('top:0px; height:183px;', {duration: 0.3} );
	else
		$(id).morph('top:106px; height:77px;', {duration: 0.3} );
}

function clear_ta(id) {
	by_elem(id).value = "";
}

function need_refresh(id_topic) {
	var urlz = "/article/check_nb_posts?id_topic=" + id_topic;
	new Ajax.Request(urlz, {
		method: 'get',
		onSuccess: function(transport) {
			return transport.responseText != by_elem('nb_com').value;
		}
	});
	return "0";
}

function switch_com(id) {
	if(by_elem("post_form_"+id).style.display == 'none') {
		Element.hide("post_content_"+id);
		Element.show("post_form_"+id);
	} else {
		Element.show("post_content_"+id);
		Element.hide("post_form_"+id);
	}
}