<?php if(ts_get_option('ts_home_con') != 'Pages') : ?>

<?php $featured = new WP_Query('cat='.get_cat_id(ts_get_option('ts_featured_cat')).'&showposts='.ts_get_option('ts_featured_items')); ?>
<?php $i=1; while ($featured->have_posts()) : $featured->the_post(); ?>
	
    <?php if($i%2==0) : add_filter('post_class','ts_post_class_alt'); endif; ?>
    
    <div <?php post_class(); ?>>
    
    	<?php if((function_exists('has_post_thumbnail')) && (has_post_thumbnail())) : ?>
				
		<div class="post-image"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_post_thumbnail('dl-thumb', array('alt' => ''.get_the_title().'', 'title' => ''.get_the_title().'')); ?><span class="overlay2"><img src="<?php echo TS_IMG; ?>overlay2.png" alt="<?php the_title(); ?>" width="280" height="160"/></span></a></div>
		
		<?php elseif(get_post_meta($post->ID, 'image_value', true)) : ?>
		
		<div class="post-image"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php bloginfo('template_url'); ?>/lib/scripts/thumb.php?src=<?php echo ts_image(get_post_meta($post->ID, "image_value", true)); ?>&amp;w=260&amp;h=140&amp;zc=1&amp;q=95" alt="<?php the_title(); ?>" width="260" height="140"/><span class="overlay2"><img src="<?php echo TS_IMG; ?>overlay2.png" alt="<?php the_title(); ?>" width="280" height="160"/></span></a></div>
		
		<?php endif; // endif post thumbnail ?>
    
    	<h3><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>

    	<?php the_content('',TRUE); ?>
    	
    	<?php the_more(); ?>
    	
	</div><!-- end post -->
    
    <?php if($i%2==0) : remove_filter('post_class','ts_post_class_alt'); ?>
    
    <div class="content-space"></div>
    
    <?php endif; ?>
    
<?php $i++; endwhile; ?>

	<?php if(!ts_get_option('ts_featured_items')) include(TEMPLATEPATH . '/lib/inc/paging.php'); ?>

<?php else : ?>

<?php $featured_pages = new WP_Query('post_type=page&meta_value=home&orderby=menu_order&order=ASC&showposts='.ts_get_option('ts_featured_items')); ?>
<?php $i=1; while ($featured_pages->have_posts()) : $featured_pages->the_post(); ?>
	
    <?php if($i%2==0) : add_filter('post_class','ts_post_class_alt'); endif; ?>
    
    <div <?php post_class(); ?>>
    
    	<?php if((function_exists('has_post_thumbnail')) && (has_post_thumbnail())) : ?>
				
		<div class="post-image"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_post_thumbnail('dl-thumb', array('alt' => ''.get_the_title().'', 'title' => ''.get_the_title().'')); ?><span class="overlay2"><img src="<?php echo TS_IMG; ?>overlay2.png" alt="<?php the_title(); ?>" width="280" height="160"/></span></a></div>
		
		<?php elseif(get_post_meta($post->ID, 'image_value', true)) : ?>
		
		<div class="post-image"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php bloginfo('template_url'); ?>/lib/scripts/thumb.php?src=<?php echo ts_image(get_post_meta($post->ID, "image_value", true)); ?>&amp;w=260&amp;h=140&amp;zc=1&amp;q=95" alt="<?php the_title(); ?>" width="260" height="140"/><span class="overlay2"><img src="<?php echo TS_IMG; ?>overlay2.png" alt="<?php the_title(); ?>" width="280" height="160"/></span></a></div>
		
		<?php endif; // endif post thumbnail ?>
    
    	<h3><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>

    	<?php the_content('',TRUE); ?>
    	
    	<?php the_more(); ?>
    	
	</div><!-- end post -->
    
    <?php if($i%2==0) : remove_filter('post_class','ts_post_class_alt'); ?>
    
    <div class="content-space"></div>
    
    <?php endif; ?>
    
<?php $i++; endwhile; ?>

<?php endif; // endif posts/pages ?>