<?php // Do not delete these lines
	if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
		die ('Please do not load this page directly. Thanks!');

        if (!empty($post->post_password)) { // if there's a password
            if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {  // and it doesn't match the cookie
				?>
				
				<p class="nocomments">This post is password protected. Enter the password to view comments.<p>
				
				<?php
				return;
            }
        }

		/* This variable is for alternating comment background */
		$oddcomment = 'alt';
?>

<?php if ('open' == $post->ping_status) : ?> 
	<div id="trackbacks" class="trackbacks">
		<h2 class="trackbacks-header">トラックバック</h2> 
		<div class="trackbacks-info">
		<p>このブログ記事に対するトラックバックURL: <input type="text" value="<?php trackback_url(true); ?>" size="60" readonly="readonly" id="trackbackurl" tabindex="1" accesskey="t" onfocus="this.select()" /></p>
		</div>
	</div>
<?php endif; ?>


<?php if (('open' == $post->comment_status) || ('open' == $post->ping_status)) : ?> 
<div id="comments" class="comments">

<h2 class="comments-header">コメント &amp; トラックバック</h2> 
	<div class="comments-content">

	<?php if ($comments) : ?>
	
		<?php foreach ($comments as $comment) : ?>	
			<div id="comment-<?php comment_ID() ?>" class="comment">
			<div class="inner">
				<div class="comment-header">
				<?php comment_author_link() ?> :
				</div>
				<div class="comment-content">
				<?php comment_text() ?>
				</div>

				<div class="comment-footer">
				<?php if ($comment->comment_approved == '0') : ?>
					<p class="wait">あなたのコメントは管理者の承認待ちです。</p>
				<?php endif; ?>
				
				(<?php comment_date('Y年m月j日') ?> <?php comment_time('H:i') ?>) <?php if ( $user_ID ) : ?><?php edit_comment_link('編集','',''); ?><?php endif; ?>
				</div>
			</div>
			</div>
		<?php endforeach; ?>
	
	<?php else : ?>
		<p class="nocomments">コメントはまだありません。</p>
	<?php endif; ?>

	</div>

	<?php if ('open' == $post->comment_status) : ?>
	<div class="comments-open" id="comments-open">
	<h2 class="comments-open-header">コメントする</h2>
	<div class="comments-open-content">
		
		<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
		<p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">logged in</a> to post a comment.</p>
		<?php else : ?>
		
		<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
				
			<?php if ( $user_ID ) : ?>
			<div id="comment-form-external-auth">
			<a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>さん、コメントをどうぞ。(<a href="<?php echo wp_logout_url(); ?>">ログアウト</a>)
			</div>
			<?php else : ?>	
			<div id="comments-open-data">
				<div id="comment-form-name">
					<label for="comment-author">名前<?php if ($req) echo "(必須)"; ?></label>
					<input type="text" name="author" id="comment-author" alue="<?php echo $comment_author; ?>" size="22" tabindex="1" />
				</div>
				<div id="comment-form-email">
					<label for="comment-email">電子メール<?php if ($req) echo "(必須)"; ?></label>
					<input type="text" name="email" id="comment-email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
				</div>
				<div id="comment-form-url">
					<label for="comment-url">URL</label>
					<input type="text" name="url" id="comment-url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
				</div>	
			</div>
			<?php endif; ?>
			
		<div id="comments-open-text">
			<label for="comment-text">コメント(スタイル用のHTMLタグを使うことができます)</label>
			<textarea name="comment" id="comment-text" rows="15" cols="50"></textarea>
		</div>
		
		<div id="comments-open-footer">
			<input type="submit" accesskey="s" name="submit" tabindex="5" id="comment-submit" value="投稿" />
		</div>
		
		<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
		
		<?php do_action('comment_form', $post->ID); ?>
		
		</form>
		<?php endif; ?>	
	</div>
	</div>

	<?php endif; ?>

</div>
<?php endif; ?>
