<!--
var divName;

function addComment(num){
	divName = "ac"+num;
	new fx.Height(divName).hide();
	new ajax ("addcomment.php?ID="+num, {update: divName, onComplete: addCommentHandle}).request();
}

function addCommentHandle(){
	//var divName = "ac"+num;
	var showCommentForm = new fx.Height(divName, {duration:500});
	showCommentForm.hide();
	showCommentForm.toggle();
}

function showComments(IDwithQ){
	IDwithQ = IDwithQ.toString();
	if(IDwithQ.indexOf("&")!=-1){
		ID = IDwithQ.split("&");
		divName = "c"+ID[0];
	}else{
		ID = IDwithQ;
		divName = "c"+ID;
	}
	//new fx.Height(divName).hide();
	new ajax ("showcomment.php?ID="+IDwithQ, {onComplete: commentToggle, update: divName}).request();
}

function showCommentHandle(ID){
	//var divName = "c"+ID;
	var showCommentForm = new fx.Height(divName, {duration:500});
	showCommentForm.hide();
	showCommentForm.toggle();
}

function commentToggle(ID){
	//var divName = "c"+ID;
	var showCommentForm = new fx.Height(divName, {duration:500});
	//showCommentForm.hide();
	showCommentForm.toggle();
}

function shrinkAddComment(){
	//divName = "ac"+ID;
	
	var ID = divName.split("c");
	ID = ID[1];
	
	var showCommentForm = new fx.Height(divName, {duration:500});
	showCommentForm.show();
	showCommentForm.toggle();
	//setTimeout("new fx.Height(divName2, {duration:500}).toggle()",1000);
	divName = "c"+ID;
	//alert("Comment Added!");
	sendOut = new ajax ("showcomment.php?ID="+ID, {onComplete: showCommentHandle, update: divName});
	//ugly hack
	setTimeout("sendOut.request()",500);
}

function handleAddedComment(form, id){
	divName = "ac"+id;
	$(form).send({update: divName, onComplete:shrinkAddComment});
}

function handleAddedPost(form){
	tinyMCE.triggerSave(true,true);
	$(form).send({update: 'footer'});
}
//-->
