var cfmParent='';

function movecfm(Id){
	var cfm = document.getElementById(vcommentform);

	if(cfm == null){
	  	alert("ERROR:\nThreaded Comments can't find the '"+vcommentform+"' div.\nThis is probably because you have changed\nthe comments.php file.\nMake sure there is a tag around the form\nthat has the id 'addcomment'");
		return;
	}

	var reRootElement = document.getElementById("reroot");

	if(reRootElement == null){
		alert("Error:\nThere is no anchor tag called 'reroot' where\nthe comment form starts.\nPlease compare your comments.php to the original\ncomments.php and copy the reroot anchor tag over.");
		return;
	}
	
	var replyId = document.getElementById("comment_reply_ID");
	
	if(replyId == null){
		alert("Error:\nThere is no hidden form field called\n'comment_reply_ID'. This is probably because you\nchanged the comments.php file and forgot\nto include the field. Please take a look\nat the original comments.php and copy the\nform field over.");
		return;
	}

	if(Id){
		replyId.value = Id;

		if(cfmParent == '')
			cfmParent = cfm.parentNode;

		var OId = document.getElementById("comment-"+Id);

		cfm.parentNode.removeChild(cfm);
		OId.appendChild(cfm);

		reRootElement.style.display = "block";
		cfm.style.display = "block";
	}else{
		replyId.value = "0";

		reRootElement.style.display = "none";
		cfm.parentNode.removeChild(cfm);
		cfmParent.appendChild(cfm);
	}
	return;
}