<?php // Do not delete these lines
if ( !defined( 'ABSPATH' ) )
die( 'Eh! What you doin in here?' );
$ag_post['post_content_color'] = get_post_meta( $post->ID, 'ag_post_content_bg_color', true );

if ( post_password_required() ) { ?>

    <p class="nocomments"><?php _e( 'This post is password protected. Enter the password to view comments.', 'themewich' ); ?></p>
	<?php
	return;
}
?>

<div class="commentwrapper">
    <!-- You can start editing here. -->
	<?php if ( have_comments() ) : ?>
        <div class="commentsheader" id="comments">
            <div class="section-title">
                <span><?php _e( 'Comments', 'themewich' ); ?></span>
            </div>
        </div>
        <ol class="listcomments <?php echo ( $ag_post['post_content_color'] == '#fff' || $ag_post['post_content_color'] == '#ffffff' ) ? 'greybackground' : ''; ?>">
			<?php wp_list_comments( 'type=all&callback=themewich_comment' ); ?>
        </ol>
        <div class="navigation-comments">
            <div class="alignleft">
                <p>
					<?php previous_comments_link() ?>
                </p>
            </div>
            <div class="alignright">
                <p>
					<?php next_comments_link() ?>
                </p>
            </div>
        </div>
        <div class="clear"></div>
	<?php else : // this is displayed if there are no comments so far ?>
		<?php if ( 'open' == $post->comment_status ) : ?>
		<?php else : // comments are closed ?>
            <h4 class="nocomments"><?php _e( 'Comments are closed.', 'themewich' ); ?></h4>
		<?php endif; ?>
	<?php endif; ?>

	<?php
	/*-----------------------------------------------------------------------------------*/
	/*	Comment Form
	/*-----------------------------------------------------------------------------------*/

	if ( comments_open() ) : ?>
        <!-- Submit Comment Form -->
        <div class="commentsform">
            <div class="section-title">
                <span><?php _e( 'Submit a Comment', 'themewich' ); ?></span>
            </div>
			<?php
			$comments_args = array(
				'fields'        => apply_filters( 'comment_form_default_fields',
					array(
						'author' => '<div>
                                                 <label for="author">' . __( 'Name', 'themewich' ) . ( $req ? '<span class="required">*</span>' : '' ) . '</label>
                                                 <input type="text" name="author"  id="author" value="' . $comment_author . '" size="22" tabindex="1" ' . ( $req ? 'class="required"' : '' ) . '/>
                                            </div>',
						'email'  => '<div>
                                                 <label for="email">' . __( 'Mail', 'themewich' ) . ( $req ? '<span class="required">*</span>' : '' ) . '</label>
                                                 <input type="text" name="email"  id="email" value="' . $comment_author_email . '" size="22" tabindex="2" ' . ( $req ? 'class="required email"' : '' ) . '/>
                                            </div>',
						'url'    => '<label for="url">' . __( 'Website', 'themewich' ) . '</label>
                                            <input type="text" name="url" id="url" value="' . $comment_author_url . '" size="44" tabindex="3" />',

					) ),
				'comment_field' => '<label for="comment">' . __( 'Message', 'themewich' ) . '<span>*</span></label>' .
				                   '<textarea name="comment" id="comment" cols="58" rows="8" tabindex="4" ' . ( $req ? 'class="required"' : '' ) . '></textarea>',

				'must_log_in'          => '',
				'logged_in_as'         => '<p>' . __( "Logged in as", "themewich" ) . ' <a href="' . get_option( 'siteurl' ) . '/wp-admin/profile.php">' . $user_identity . '</a>. <a href="' . get_option( 'siteurl' ) . '/wp-login.php?action=logout" title="Log out of this account">' . __( "Logout.", "themewich" ) . ' &raquo;</a></p>',
				'id_form'              => 'commentsubmit',
				'comment_notes_before' => '',
				'comment_notes_after'  => '',
				'id_submit'            => 'submit',
				'title_reply'          => '',
				'title_reply_to'       => '',
				'cancel_reply_link'    => __( 'Cancel reply', 'themewich' ),
				'label_submit'         => __( 'Post Comment', 'themewich' )
			);
			comment_form( $comments_args ); ?>
        </div>
	<?php endif; // If registration required and not logged in ?>
</div>