<?php get_header(); ?>

<div id="content">

	<div id="homepage">
    
    	<?php // Check for the 'gallery_styles' function. if it's there, then include it. If not, do nothing ?>
		<?php if (function_exists('gallery_styles')) : ?>
		
        <div id="homepagetop">
			
            <div class="featuredtop">
            
				<?php include (ABSPATH . '/wp-content/plugins/featured-content-gallery/gallery.php'); ?>
                
			</div>
            
		</div>
        
		<?php endif; ?>
					
		<div id="homepageleft">
				
			<div class="hpfeatured">
			<h3>Supplement</h3>
                
				<?php $recent = new WP_Query("cat=121&showposts=3"); while($recent->have_posts()) : $recent->the_post();?>
				<?php if( get_post_meta($post->ID, "thumbnail", true) ): ?>
				    <a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;" src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" /></a>
				<?php else: ?>
				<a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;"  src="<?php bloginfo('template_url'); ?>/images/thumbnail.png" /></a>
				<?php endif; ?>					
                
				<strong><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></strong>
				<?php the_content_limit(100, ""); ?>
				
				<hr/>
				
				<?php endwhile; ?>
				<?php $cat = get_category(get_theme_mod('featured_top_left')); ?>				
				<strong><a href="<?php echo get_category_link(get_theme_mod('featured_top_left')); ?>" rel="bookmark"><?php echo __("Read More Posts From ", 'studiopress')." ".$cat->name; ?></a></strong>
				
			</div>			
				
		</div>

		<div id="homepageright">
		
			<div class="hpfeatured">
			<h3>Workout</h3>

				<?php $recent = new WP_Query("cat=120&showposts=3"); while($recent->have_posts()) : $recent->the_post();?>
				<?php if( get_post_meta($post->ID, "thumbnail", true) ): ?>
				    <a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;" src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" /></a>	
				<?php else: ?>
				<a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;"  src="<?php bloginfo('template_url'); ?>/images/thumbnail.png" /></a>
				<?php endif; ?>		
                		
				<strong><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></strong>				
				<?php the_content_limit(100, ""); ?>
								
				<hr/>
				
				<?php endwhile; ?>
				<?php $cat = get_category(get_theme_mod('featured_top_right')); ?>
				<strong><a href="<?php echo get_category_link(get_theme_mod('featured_top_right')); ?>" rel="bookmark"><?php echo __("Read More Posts From ", 'studiopress')." ".$cat->name; ?></a></strong>
				
			</div>		
			
		</div>
		
		<div id="homepagebottom">
		
			<div class="hpbottom">
			<h3>Articles</h3>
				
				<?php $recent = new WP_Query("cat=1&showposts=7"); while($recent->have_posts()) : $recent->the_post();?>
				<?php if( get_post_meta($post->ID, "hpbottom", true) ): ?>
				    <a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;" src="<?php echo get_post_meta($post->ID, "hpbottom", true); ?>" /></a>	
				<?php else: ?>
				<a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;"  src="<?php bloginfo('template_url'); ?>/images/thumbnail.png" /></a>
				<?php endif; ?>				
				
                <strong><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></strong>
				<?php the_content_limit(350, __("[Read more of this review]", 'studiopress')); ?>
					
				<hr/>
					
				<?php endwhile; ?>
						
				<?php $cat = get_category(get_theme_mod('featured_bottom')); ?>
				<strong><a href="<?php echo get_category_link(get_theme_mod('featured_bottom')); ?>" rel="bookmark"><?php echo __("Read More Posts From ", 'studiopress')." ".$cat->name; ?></a></strong>
			
			</div>
		
		</div>
		
	</div>
	
<?php include(TEMPLATEPATH."/sidebar.php");?>
		
</div>

<?php // The main column ends  ?>

<?php get_footer(); ?>