Index: comment-template.php
===================================================================
--- comment-template.php	(revision 13047)
+++ comment-template.php	(working copy)
@@ -1176,7 +1176,7 @@
  * @param string $replytext Optional. Text to display when replying to a comment. Accepts "%s" for the author of the comment being replied to.
  * @param string $linktoparent Optional. Boolean to control making the author's name a link to their comment.
  */
-function comment_form_title( $noreplytext = false, $replytext = false, $linktoparent = TRUE ) {
+function comment_form_title( $noreplytext = false, $replytext = false, $linktoparent = TRUE, $echo = true ) {
 	global $comment;
 
 	if ( false === $noreplytext ) $noreplytext = __( 'Leave a Reply' );
@@ -1185,12 +1185,16 @@
 	$replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
 
 	if ( 0 == $replytoid )
-		echo $noreplytext;
+		$out = $noreplytext;
 	else {
 		$comment = get_comment($replytoid);
 		$author = ( $linktoparent ) ? '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author() . '</a>' : get_comment_author();
-		printf( $replytext, $author );
+		$out = $replytext . $author;
 	}
+	if ( $echo )
+		echo $out;
+	else
+		return $out;
 }
 
 /**
@@ -1465,42 +1469,30 @@
 
 	$req = get_option( 'require_name_email' );
 	$aria_req = ( $req ? " aria-required='true'" : '' );
-	$defaults = array( 'fields' => apply_filters( 'comment_form_default_fields', array( 'author' => '<div id="form-section-author" class="form-section">
-																										<div class="form-label"><label for="author">' . __( 'Name', 'twentyten' ) . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) . '</div>
-																										<div class="form-input"><input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" tabindex="1"' . $aria_req . ' /></div>
-																									</div><!-- #form-section-author .form-section -->',
-																							'email' => '<div id="form-section-email" class="form-section">
-																											<div class="form-label"><label for="email">' . __( 'Email', 'twentyten' ) . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) . '</div>
-																											<div class="form-input"><input id="email" name="email" type="text" value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30" tabindex="2"' . $aria_req . ' /></div>
-																										</div><!-- #form-section-email .form-section -->', 
-																							'url' => '<div id="form-section-url" class="form-section">
-																											<div class="form-label"><label for="url">' . __( 'Website', 'twentyten' ) . '</label></div>
-																											<div class="form-input"><input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" tabindex="3" /></div>
-																										</div><!-- #form-section-url .form-section -->' ) ),
-						'comment_field' => '<div id="form-section-comment" class="form-section">
-												<div class="form-label"><label for="comment">' . __( 'Comment', 'twentyten' ) . '</label></div>
-												<div class="form-textarea"><textarea id="comment" name="comment" cols="45" rows="8" tabindex="4" aria-required="true"></textarea></div>
-											</div><!-- #form-section-comment .form-section -->',
-						'must_log_in' => '<p>' .  sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
-						'logged_in_as' => '<p>' . sprintf( __( 'Logged in as <a href="%s">%s</a>. <a href="%s" title="Log out of this account">Log out?</a></p>' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ),
-						'comment_notes_before' => '<p id="comment-notes">' . __( 'Your email is <em>never</em> published nor shared.' ) . ( $req ? __( ' Required fields are marked <span class="required">*</span>' ) : '' ) . '</p>', 
-						'comment_notes_after' => '<div id="form-allowed-tags" class="form-section">
-													<p><span>' . __( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:' ) . '</span> <code>' . allowed_tags() . '</code></p>
-												</div>',
-						'id_form' => 'commentform',
-						'id_submit' => 'submit',
-						'title_reply' => __( 'Leave a Reply' ),
-						'title_reply_to' => __( 'Leave a Reply to %s'),
-						'cancel_reply_link' => __( 'Cancel reply' ),
-						'label_submit' => __( 'Post Comment' ),
-				);
+	$defaults = array( 
+		'fields' => apply_filters( 'comment_form_default_fields', array( 
+			'author' => '<p id="form-section-author" class="form-section"><label for="author">' . __( 'Name', 'twentyten' ) . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) . ' <input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" tabindex="1"' . $aria_req . ' /></p><!-- #form-section-author .form-section -->',
+			'email' => '<p id="form-section-email" class="form-section"><label for="email">' . __( 'Email', 'twentyten' ) . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) . ' <input id="email" name="email" type="text" value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30" tabindex="2"' . $aria_req . ' /></p><!-- #form-section-email .form-section -->', 
+			'url' => '<p id="form-section-url" class="form-section"><label for="url">' . __( 'Website', 'twentyten' ) . '</label> <input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" tabindex="3" /></p><!-- #form-section-url .form-section -->' ) 
+		),
+		'comment_field' => '<p id="form-section-comment" class="form-section"><label for="comment">' . __( 'Comment', 'twentyten' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" tabindex="4" aria-required="true"></textarea></p><!-- #form-section-comment .form-section -->',
+		'must_log_in' => '<p class="log-in">' .  sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
+		'logged_in_as' => '<p class="logged-in">' . sprintf( __( 'Logged in as <a href="%s">%s</a>. <a href="%s" title="Log out of this account">Log out?</a></p>' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ),
+		'comment_notes_before' => '<p id="comment-notes">' . __( 'Your email is <em>never</em> published nor shared.' ) . ( $req ? __( ' Required fields are marked <span class="required">*</span>' ) : '' ) . '</p>', 
+		'comment_notes_after' => '<p id="form-allowed-tags" class="form-section"><span>' . __( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:' ) . '</span> <code>' . allowed_tags() . '</code></p>',
+		'id_form' => 'commentform',
+		'form_title' => '<h3 id="reply-title">' . comment_form_title( __( 'Leave a Reply' ), __( 'Leave a Reply to %s'), true, false ) . '</h3>',
+		'cancel_reply' => '<p class="cancel-reply">' . get_cancel_comment_reply_link( __( 'Cancel reply' ) ) . '</p>',
+		'submit' => '<p class="form-submit"><input name="submit" type="submit" id="submit" value="' . __( 'Post Comment' ) . '" /></p>'
+	);
 	$args = wp_parse_args( $args, apply_filters( 'comment_form_defaults', $defaults ) );
 
 	?>
 		<?php if ( comments_open() ) : ?>
 			<?php do_action( 'comment_form_before' ); ?>
 			<div id="respond">
-				<h3 id="reply-title"><?php comment_form_title( $args['title_reply'], $args['title_reply_to'] ); ?> <small><?php cancel_comment_reply_link( $args['cancel_reply_link'] ); ?></small></h3>
+				<?php echo $args['form_title']; ?>
+				<?php echo $args['cancel_reply']; ?>
 				<?php if ( get_option( 'comment_registration' ) && !is_user_logged_in() ) : ?>
 					<?php echo $args['must_log_in']; ?>
 					<?php do_action( 'comment_form_must_log_in_after' ); ?>
@@ -1522,11 +1514,11 @@
 						<?php endif; ?>
 						<?php echo apply_filters( 'comment_form_field_comment', $args['comment_field'] ); ?>
 						<?php echo $args['comment_notes_after']; ?>
-						<div class="form-submit">
-							<input name="submit" type="submit" id="<?php echo esc_attr( $args['id_submit'] ); ?>" tabindex="<?php echo ( count( $args['fields'] ) + 2 ); ?>" value="<?php echo esc_attr( $args['label_submit'] ); ?>" />
+						<?php echo $args['submit']; ?>
+						<div class="form-action">
 							<?php comment_id_fields(); ?>
+							<?php do_action( 'comment_form', $post_id ); ?>
 						</div>
-						<?php do_action( 'comment_form', $post_id ); ?>
 					</form>
 				<?php endif; ?>
 			</div>
