<?php get_header(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
	<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
		<h2 class="single"><?php the_title(); ?></h2>
		<?php if(function_exists('has_post_thumbnail') && has_post_thumbnail()) { ?>
		<div class="postimage">
            <img src="<?php echo THEME_URL; ?>/images/imagebg2.png" alt="" class="imgbg" />
			<?php the_post_thumbnail('main-thumb', array('class'=>'aligncenter')); ?>
			<?php if(theme_option('dates_front') == 'on') { echo '<div class="datecirc">'; the_time('M'); echo '<br />'; the_time('d'); echo '</div>'; } ?>
        	<div class="readmore"><a href="<?php the_permalink() ?>"><?php echo theme_option('more_link_text'); ?></a></div>
        </div>
	<?php } elseif(resize(1,1)) { ?>
		<div class="postimage">
            <?php 
			$full = get_post_meta($post->ID, 'pbt_single_layout', true);
			if($full==2) {
				$content = theme_option('site_width') - 60; 
			} else {		
				$content = CONTENT_WIDTH;
				}
			?> 
            <img src="<?php echo THEME_URL; ?>/images/imagebg2.png" alt="" class="imgbg" />
			<?php echo resize(($content-60), 210, 'aligncenter'); ?>
			<?php if(theme_option('dates_front') == 'on') { echo '<div class="datecirc">'; the_time('M'); echo '<br />'; the_time('d'); echo '</div>'; } ?>
        </div>
		<?php 
			} else { 
				if(theme_option('dates_front') == 'on') { echo '<div class="datecirc nopic">'; the_time('M'); echo '<br />'; the_time('d'); echo '</div>'; } 
			}
		?>
		<div class="storycontent">
			<?php the_content(''); ?>
  			<?php wp_link_pages(array('before' => '<p><strong>'.__('Pages', "moderno").':</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
            <?php the_tags(__('<small class="tags"><strong>Tags:</strong> ', "moderno"), '&nbsp;', '</small>'); ?>
		</div>

        <div class="bottomline"></div>
	</div>
	<div id="commenttemplate"><?php comments_template(); ?></div>
	<?php endwhile; ?>
	<?php endif; ?>
</div>
<?php get_footer(); ?>
