
function addNews(){
	$('#addNews').slideToggle('slow',function(){
		makeCK('newsBlurb');
	});
	
}
function cancelEditNews(newsId){$('#newsBox'+newsId).slideDown('slow');$('#newsEdit'+newsId).slideUp('slow');}
function editNews(newsId){
	$('#newsBox'+newsId).slideUp('slow');
	$('#newsEdit'+newsId).slideDown('slow',function(){makeCK('editNewsBlurb'+newsId);});
}
function deleteNews(newsId){if(confirm("Are you sure you wish to delete this news?"))$.getJSON("/action.html?cln=1&act=news.delete&newsId="+newsId,function(){	$("#newsBox"+newsId).slideUp(); });}
function postComment(id){txt = $('#postCommentT'+id).val();if(!txt) return false;$.getJSON("/action.html?cln=1&act=news.comments.add&nid="+id+"&txt="+txt,function(f){if(f.good){var tid = $random(1000,10000);$("#newsComments"+id).append($('<li></li>').attr({'id':'newComment_'+tid}).html("<img src="+$('#postCommentI'+id).attr('src')+" /> <b class=class"+$('#postCommentI'+id).attr('title')+">"+$('#postCommentI'+id).attr('alt')+"</b> <span>"+txt+"</span><br/></li>").hide());window.setTimeout(function(){$("#newComment_"+tid).slideDown('slow');},500);$('#postCommentT'+id).val('');$('#postComment'+id).slideUp();} else alert('Oops, something broke! Please report a bug if this lasts longer then a few minutes.');});}
function deleteComment(id){if(confirm("Are you sure you wish to remove this comment?")){$('#comment'+id).slideUp();$.getJSON("/action.html?cln=1&act=news.comments.delete&ncid="+id);}}
