/* modified from comment-reply.dev.js */
/* this theme loads jQuery by default, might as well use it */
addComment = {
	moveForm : function(commId, parentId, respondId, postId) {
		var t = this, comm = t.I(commId), respond = t.I(respondId), cancel = t.I('cancel-comment-reply-link'), parent = t.I('comment_parent'), post = t.I('comment_post_ID');

		if ( ! comm || ! respond || ! cancel || ! parent )
			return;

		post.value = postId;
		parent.value = parentId;
		cancel.style.display = '';
		
		t.resetReplyText();
		jQuery('#' + commId + ' a.comment-reply-link').text('Replying >>>');
		
		cancel.onclick = function() {
			var t = addComment;

			t.I('comment_parent').value = '0';
			this.style.display = 'none';
			this.onclick = null;
			
			t.resetReplyText();
			
			return false;
		}

		try { t.I('comment').focus(); }
		catch(e) {}

		return false;
	},
	
	I : function(e) {
		return document.getElementById(e);
	},
	
	resetReplyText : function() {
		jQuery('#comments ul.commentlist a.comment-reply-link').text('Reply');
	}
}