<?php if ( !empty($post->post_password) && $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) : ?>
<?php return; endif; ?>

<a id="comments"></a>

<?php if ( $comments ) : ?>

<?php foreach ($comments as $comment) : ?>

<div class="blogbefore"></div>
<div class="blog">
<h3><?php comment_author_link(); ?></h3>
<p class="headertext"><?php comment_type(); ?> on <?php comment_time('F jS, Y'); ?>. <?php edit_comment_link('e', '', ''); ?></p>
<?php comment_text(); ?>
</div>
<div class="blogafter"></div>

<?php endforeach; ?>

<?php else : ?>

<?php if ('open' == $post->comment_status) : ?>

<?php else : ?>

<?php endif; ?>
<?php endif; ?>

<a name="postcomment" id="respond"></a>

<?php if ( comments_open() ) : ?>

<div class="blogbefore"></div>
<div class="blog">
<h3>Leave a comment</h3>
<p class="headertext">Comments can contain some xhtml. Names and emails are required (emails aren't displayed), url's are optional.</p>
<form id="commentform" action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post">

	<div>
	<textarea name="comment" id="comment" cols="40" rows="6" tabindex="4"></textarea>
	<input type="hidden" name="comment_post_ID" value="<?php echo $post->ID; ?>" />
	<input type="hidden" name="redirect_to" value="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>" />
	</div>

<?php if(!$user_ID) : ?>

	<div id="inputcontainer">
	<div id="namefield">
	  <input type="text" name="author" id="author" class="textarea" value="" size="15" tabindex="1" /><br />
	  <label for="author">Name</label>
	</div>
	<div id="emailfield">
	  <input type="text" name="email" id="email" value="" size="15" tabindex="2" /><br />
	  <label for="email">E-mail</label>
	</div>
	<div id="urlfield">
	  <input type="text" name="url" id="url" value="" size="15" tabindex="3" /><br />
	   <label for="url"><acronym title="Uniform Resource Identifier">URI</acronym></label>
	</div>
	</div>

<?php else : ?>

        <p>
          You are logged in as <?php echo($user_identity); ?>.
        </p>

<?php endif; ?>

	<p id="submitter">
	  <input name="submit" id="submit" type="submit" value="I'm done, post it." />
	</p>

	<?php do_action('comment_form', $post->ID); ?>
	
</form>
</div>
<div class="blogafter"></div>

<?php else : // Comments are closed ?>

<?php endif; ?>