<?php get_header(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
		<h2><a href="<?php the_permalink() ?>" title="<?php printf(__("Permanent Link to %s", "moderno"), the_title_attribute('echo=0')); ?>"><?php the_title(); ?></a></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">
                <img src="<?php echo THEME_URL; ?>/images/imagebg2.png" alt="" class="imgbg" />
                <?php echo resize((CONTENT_WIDTH-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 class="readmore"><a href="<?php the_permalink() ?>"><?php echo theme_option('more_link_text'); ?></a></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 
			if(theme_option('frontpage_exorcon') == '2') { 
				theme_content(theme_option('more_link_text'));
			} else {
				the_excerpt();
			}	
			?>
		</div>
		<div class="meta">
			<?php if(theme_option('authors_front') == 'on') { echo '<div class="author">'; _e("Posted by", "moderno"); echo " "; the_author_posts_link(); echo '&nbsp;</div>'; } ?> 
			<?php if(theme_option('comment_count') == 1 && comments_open()) { ?>
				<?php comments_popup_link(__('0 Comments', "moderno"),__('1 Comment', "moderno"),__('% Comments', "moderno"),'ind-comments'); ?>
			<?php } ?>
		</div>
        <div class="bottomline"></div>
	</div>
	<?php endwhile; ?>
	<?php endif; ?>

<?php if(function_exists('pagination')) { pagination(); } ?>
</div>
<?php get_footer(); ?>