<?php 
function theme_comments($comment, $args, $depth) {
	$GLOBALS['comment'] = $comment; ?>
		<li id="comment-<?php comment_ID() ?>">
			<div class="comment-gravatar">
				<?php echo get_avatar( $comment, $size='60',$default='' ); ?>
			</div>	
			<div class="comment-data">
				<div class="comment-author alignleft"><?php comment_author_link() ?></div>
				<div class="comment-meta alignright"><?php comment_date() ?></div>
				<div class="clear"></div>
<?php if ($comment->comment_approved == '0') { ?><span class='unapproved'>your comment is awaiting moderation.</span><?php } ?>
<?php comment_text() ?>
<?php if ($comment->comment_approved == '0') : ?>
					<span class="unapproved"><?php _e('your comment is awaiting moderation.',theme_front_domain) ?></span>
<?php endif; ?>
				<div class="reply">
					<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
				</div>
			</div>
		</li>
	<?php
		/* Changes every other comment to a different class */
}
?>
<?php 
$default_comment = theme_get_option('blog','default_comment');
if(! $default_comment || have_comments()):
?>
<section id="comments">
<div class="comments-top"><!--  --></div>
<div class="comments-body">

<?php if ( post_password_required() ) : ?>
	<p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', THEME_FRONT_DOMAIN ); ?></p>
</section><!-- #comments -->
<?php
	return;
	endif;	
if ( have_comments() ) : ?>
	<h3 class="section-title">
<?php
	printf( _n( 'One Response to %2$s', '%1$s Responses to %2$s', get_comments_number(), THEME_FRONT_DOMAIN ),
	number_format_i18n( get_comments_number() ), '<em>' . get_the_title() . '</em>' );
?>
	</h3>
	<ol class="comment-list">
<?php
	wp_list_comments(array('callback' => 'theme_comments'));
?>

	</ol>
<?php else: ?>
	<div class="no-comments">
		<h3 class="section-title mb0"><?php _e( 'No Comments on this Post.Be the first', THEME_FRONT_DOMAIN ); ?></h3>
	</div> 
<?php endif;?>
</div>
<div class="comments-btm"><!--  --></div>
<?php endif;?>
<?php if ( comments_open() ) :// Comment Form ?>

	<div id="respond">
		<h3><?php comment_form_title( __('Leave a Reply',THEME_FRONT_DOMAIN), __('Leave a Reply to %s',THEME_FRONT_DOMAIN) ); ?></h3>
		<div class="cancel_comment_reply">
			<?php cancel_comment_reply_link(); ?>
		</div>
<?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?>
		<p><?php printf(__('You must be <a href="%s">logged in</a> to post a comment',THEME_FRONT_DOMAIN),wp_login_url( get_permalink() )); ?></p>
<?php else : ?>
   		<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="comment-form">
<?php if ( is_user_logged_in() ) : ?>
			<p class="logged"><?php printf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>',THEME_FRONT_DOMAIN), admin_url( 'profile.php' ), $user_identity, wp_logout_url( get_permalink()  ) )?></p>
<?php else : ?>	
	<label for="author"><?php _e('Name',THEME_FRONT_DOMAIN);  if ($req) echo " *"; ?></label></p>
			<p><input type="text" name="author" class="text_input" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1"  />
		
		<label for="email"><?php _e('Email',THEME_FRONT_DOMAIN);  if ($req) echo " *"; ?></label></p>
			<p><input type="text" name="email" class="text_input" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
		
		<label for="url"><?php _e('Website',THEME_FRONT_DOMAIN); ?></label></p>
			<p><input type="text" name="url" class="text_input" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
		
	
<?php endif; ?>
			<p><textarea class="textarea" name="comment" id="comment" cols="70" rows="10" tabindex="4"></textarea></p>
			<p>
			<a class="button small white" href="#" onclick="jQuery('#comment-form').submit();return false;">
				<span class="button-glare"></span>
				<span class="text"><?php _e('Post Comment',THEME_FRONT_DOMAIN);?></span>
			</a>
			<?php comment_id_fields(); ?>
			</p>
			<p><?php do_action('comment_form', $post->ID); ?></p>
		</form>
<?php endif; // If registration required and not logged in ?>
	</div><!--/respond-->

<?php endif; ?>

</section><!-- #comments -->
