$(document).ready( function() {
	$('a.commentReply').click( function () {

		var comment_id = $(this).attr('val');
		var membername = $('input[name=comment_name]').val();
		var form_id = $('input[name=form_id]').val();
		form = '<form method="post" action="">' +
			'<label for="comment_name">Name:</label> <input type="text" name="reply_name" value="'+membername+'"/>' +
			'<label for="comment">Comment:</label> <textarea name="comment" cols=30 rows=7></textarea>' +
			'<input type="hidden" name="comment_id" value="'+comment_id+'"/>' +
			'<input type="hidden" name="reply_form_id" value="'+form_id+'"/>' +
			'<input type="submit" name="submit_comment" value="Leave Reply" class="comment_button" />' +
			'</form>';
		$(form).appendTo($(this).parent());
		$(this).remove();
		return false;
	})
});
