<script>
var addComment = {
settings: function( parentId, postId ) {
var
t = $(this),
commentDivName = $('#comment-'+parentId),
formDivName = $('#commentForm-'+postId),
formReplyDivName = $('#commentReplyForm-'+parentId),
postDivName = $('#post-'+postId),
theform = formDivName.find('form.comment-form');
if( !t.length || !commentDivName.length || !formDivName.length || !postDivName.length ) {
return;
}
if(!theform.length){
$(postDivName).find('[id^=commentReplyForm-]').each(function(){
if($(this).find('form.comment-form').length){
formDivName = $('#'+$(this).attr('id'));
}
});
theform = formDivName.find('form.comment-form');
}
theform.find('input[name=parent]').val(parentId);
theform.appendTo(formReplyDivName);
var cancel = formReplyDivName.find('.cancel')
cancel.show();
}
};
</script>