<?php get_header(); ?>
	<?php
    $mySearch =& new WP_Query("s=$s & showposts=-1");
    $num = $mySearch->post_count;
    echo '<h1 class="catheader">'.$num. __(' search results for', "moderno").' "'; the_search_query(); echo '"</h1>';
    ?>
	<div class="cattop"><img src="<?php echo THEME_URL; ?>/images/cattop.png" alt="" width="<?php echo $content-40; ?>" height="78" /></div>
	<?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 the_title_attribute(); ?>"><?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_cats') == '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_cats') == '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_cats') == '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_cats') == '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 if(function_exists('pagination')) { pagination(); } ?>      
    <?php else : ?>
    	<p><?php _e("Sorry, but you are looking for something that isn't here.", "moderno"); ?></p>
    <?php endif; ?>
</div>
<?php get_footer(); ?>