<?php /*
Template Name: Archives
*/ ?>

<?php get_header(); ?>

<?php if (have_posts()) : ?>

	<?php while (have_posts()) : the_post(); ?>
	    
	    <div <?php if(function_exists('post_class')) : post_class(); else : echo 'class="post clearfix"'; endif; ?>>
	
	    	<h2 class="post-title"><?php the_title(); ?></h2>
	    	
	    	<?php if((function_exists('has_post_thumbnail')) && (has_post_thumbnail())) : ?>
				
			<div class="post-image"><?php the_post_thumbnail('dl-large', array('alt' => ''.get_the_title().'', 'title' => ''.get_the_title().'')); ?><span class="overlay3"><img src="<?php echo TS_IMG; ?>overlay3.png" alt="<?php the_title(); ?>" width="580" height="320"/></span></div>
			
			<?php elseif(get_post_meta($post->ID, 'image_value', true)) : ?>
			
			<div class="post-image"><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=560&amp;h=300&amp;zc=1&amp;q=95" alt="<?php the_title(); ?>" width="560" height="300"/><span class="overlay3"><img src="<?php echo TS_IMG; ?>overlay3.png" alt="<?php the_title(); ?>" width="580" height="320"/></span></div>
			
			<?php endif; // endif post thumbnail ?>
	
	    	<?php the_content(); ?>
	    
	    </div><!-- end post -->
	
	<?php endwhile; ?>
	
	<div class="content-space"></div>
	
	<?php include(TEMPLATEPATH .'/archives.php'); ?>
	
	<?php else : ?>
	
	<div class="post">

	    <h3><?php _e('Error 404, no posts found!',TS_DOMAIN); ?></h3>
	    <p><?php _e('Sorry, no posts matched your criteria.',TS_DOMAIN); ?></p>
	    <?php include (TEMPLATEPATH . "/searchform.php"); ?>
	
	</div>

<?php endif; ?>
	
<?php get_footer(); ?>