<?php get_header(); ?>			
				
	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>	

		<div id="content-wrapper">
			
			<?php get_sidebar(); ?>
	
			<div id="main-content">	
	
				<?php if(!get_post_meta($post->ID, 'ghostpool_hide_page_title', true)) { ?><h1 class="page-title"><?php the_title(); ?></h1><?php } ?>
	
				<?php if(!get_post_meta($post->ID, 'ghostpool_hide_meta', true)) { ?>
					<div class="post-meta">			
						<span class="post-meta-date"><?php echo time_ago(); ?></span>
						<span class="post-meta-divider">|</span>
						<span class="post-cats"><?php echo(get_the_term_list($post->ID, 'portfolio_categories', '', ', ', '')); ?></span>	
						<?php if(get_post_meta($post->ID, 'ghostpool_view_project', true)) { ?>
						<span class="post-meta-divider">|</span>
						<span class="view-project"><a href="<?php echo get_post_meta($post->ID, 'ghostpool_view_project', true); ?>"><?php _e('View Project', 'gp_lang'); ?> &rarr;</a></span><?php } ?>
					</div>
				<?php } ?>
				
				<!--Begin Post Panel-->
				<div id="post-panel">
				
					<?php if(get_post_meta($post->ID, 'ghostpool_slider', true)) {	?>
		
						<?php include('lib/inc/slider.php'); ?>
					
					<?php } else { ?>
					
						<!--Begin Image-->
						<?php if(!get_post_meta($post->ID, 'ghostpool_hide_thumbnail', true)) { ?>
						
							<?php if(has_post_thumbnail() OR $attachments) { ?>
						
								<div class="post-thumbnail">
		
									<img src="<?php if($theme_timthumb == "0") { ?><?php echo get_template_directory_uri(); ?>/lib/scripts/timthumb.php?src=<?php } ?><?php if(has_post_thumbnail()) {
									
										$image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
										echo $image[0];
										
									} elseif($attachments) { 
									
										foreach ($attachments as $attachment) {
											echo wp_get_attachment_url($attachment->ID);
										}
										
									} ?><?php if($theme_timthumb == "0") { ?>&amp;h=<?php echo get_post_meta($post->ID, 'ghostpool_image_height', true); ?>&amp;w=<?php echo get_post_meta($post->ID, 'ghostpool_image_width', true); ?>&amp;zc=1&amp;a=c<?php } ?>" style="width: <?php echo get_post_meta($post->ID, 'ghostpool_image_width', true); ?>px;" alt="" />
										
								</div>
								
								<div class="clear"></div>
							
							<?php } ?>
							
						<?php } ?>
						<!--End Image-->			
					
					<?php } ?>					
									
					<div id="side-post-meta">
					
						<div class="meta-item meta-like"><?php printLikes(get_the_ID()); ?></div>
						<div class="meta-item meta-url"><input type="text" readonly="readonly" value="<?php echo simple_url_shortener(get_permalink(),'is.gd'); ?>"></div>
						<?php the_tags('<div class="meta-item meta-tags">Tags</div>
						<div class="meta-item meta-tag-links">', ', ' ,'</div>'); ?>
						
						<div id="sidebar-right">
							<?php if(get_post_meta($post->ID, 'ghostpool_sidebar_2', true)) { dynamic_sidebar(get_post_meta($post->ID, 'ghostpool_sidebar_2', true)); } else { dynamic_sidebar('default-right'); } ?>
						</div>
					
					</div>
				
				</div>
				<!--End Post Panel-->
				
				<?php the_content(); ?>
				
				<?php wp_link_pages('before=<div class="clear"></div><div class="post-navi">&pagelink=<span>%</span>&after=</div>'); ?>		
					
				<?php comments_template(); ?>		
	
			</div>
			
		</div>
		
	<?php endwhile; endif; ?>	
				
<?php get_footer(); ?>