<?php get_header(); ?>

			<!-- BEGIN MAIN -->
			<div id="main">
			
				<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
				
				<?php if(get_option('pyre_posts_navigation') == 'On'): ?>
				<div class="navigation clearfix">
					<div class="alignleft"><?php previous_post_link('%link', __('&larr; Previous Post', 'Broadway')); ?></div>
					<div class="alignright"><?php next_post_link('%link', __('Next Post &rarr;', 'Broadway')); ?></div>
				</div>
				<?php endif; ?>
				
				<div class="post-heading">
					<h1><?php the_title(); ?></h1>
					<div class="post-meta clearfix">
						<span class="author"><?php the_author_posts_link(); ?></span> 
						<span class="date"><?php the_date(); ?></span>
						<?php if(get_option('pyre_categories') == 'On'): ?>
						<span class="category"><?php the_category(', '); ?></span>
						<?php endif; ?>
					</div>
				</div>
				
				<?php if(has_post_thumbnail()): ?>
				
				<?php
				if(get_option('pyre_posts_featured') == 'Off') {
					$show_image = false;
				} else {
					$show_image = true;
				}
				?>
				
				<?php if($show_image == true): ?>
				<div class="post-thumb">
					<?php $fullImage = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full'); ?>
					<?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'post-image'); ?>
					<a class='lightbox' href='<?php echo $fullImage[0]; ?>'><img src="<?php echo $image[0]; ?>" alt="<?php the_title(); ?>" width='580' height='360' /></a>
				</div>
				<?php endif; ?>
				<?php endif; ?>
				
				<div class="post-entry clearfix">
					<?php if(
					(
						get_post_meta($post->ID, 'pyre_overall_score', true) ||
						(get_post_meta($post->ID, 'pyre_critera_1', true) && get_post_meta($post->ID, 'pyre_critera_1_score', true)) ||
						(get_post_meta($post->ID, 'pyre_critera_2', true) && get_post_meta($post->ID, 'pyre_critera_2_score', true)) ||
						(get_post_meta($post->ID, 'pyre_critera_3', true) && get_post_meta($post->ID, 'pyre_critera_3_score', true)) ||
						(get_post_meta($post->ID, 'pyre_critera_4', true) && get_post_meta($post->ID, 'pyre_critera_4_score', true)) ||
						(get_post_meta($post->ID, 'pyre_critera_5', true) && get_post_meta($post->ID, 'pyre_critera_5_score', true))
					)
					): ?>
					<div class="post-review clearfix">
						<?php if(get_post_meta($post->ID, 'pyre_overall_score', true)): ?>
						<div class="overall-score"><img src="<?php bloginfo('template_directory'); ?>/images/stars/big_<?php echo get_post_meta($post->ID, 'pyre_overall_score', true); ?>.png" alt="" /></div>
						<?php endif; ?>
						<ul class="clearfix">
							<?php if(get_post_meta($post->ID, 'pyre_critera_1', true)): ?>
							<li class="clearfix"><?php echo get_post_meta($post->ID, 'pyre_critera_1', true); ?><span class="score"><img src="<?php bloginfo('template_directory'); ?>/images/stars/<?php echo get_post_meta($post->ID, 'pyre_critera_1_score', true); ?>.png" alt="" /></span></li>
							<?php endif; ?>
							<?php if(get_post_meta($post->ID, 'pyre_critera_2', true)): ?>
							<li class="clearfix"><?php echo get_post_meta($post->ID, 'pyre_critera_2', true); ?> <span class="score"><img src="<?php bloginfo('template_directory'); ?>/images/stars/<?php echo get_post_meta($post->ID, 'pyre_critera_2_score', true); ?>.png" alt="" /></span></li>
							<?php endif; ?>
							<?php if(get_post_meta($post->ID, 'pyre_critera_3', true)): ?>
							<li class="clearfix"><?php echo get_post_meta($post->ID, 'pyre_critera_3', true); ?> <span class="score"><img src="<?php bloginfo('template_directory'); ?>/images/stars/<?php echo get_post_meta($post->ID, 'pyre_critera_3_score', true); ?>.png" alt="" /></span></li>
							<?php endif; ?>
							<?php if(get_post_meta($post->ID, 'pyre_critera_4', true)): ?>
							<li class="clearfix"><?php echo get_post_meta($post->ID, 'pyre_critera_4', true); ?> <span class="score"><img src="<?php bloginfo('template_directory'); ?>/images/stars/<?php echo get_post_meta($post->ID, 'pyre_critera_4_score', true); ?>.png" alt="" /></span></li>
							<?php endif; ?>
							<?php if(get_post_meta($post->ID, 'pyre_critera_5', true)): ?>
							<li class="clearfix"><?php echo get_post_meta($post->ID, 'pyre_critera_5', true); ?> <span class="score"><img src="<?php bloginfo('template_directory'); ?>/images/stars/<?php echo get_post_meta($post->ID, 'pyre_critera_5_score', true); ?>.png" alt="" /></span></li>
							<?php endif; ?>
						</ul>
						<div id="user-rating" class="clearfix">
							<span><?php _e('User rating', 'Broadway'); ?></span>
							<div class="user-rating"></div>
						</div>
					</div>
					<?php endif; ?>
					
					<?php the_content(); ?>
					<?php wp_link_pages(); ?>

					<?php if(get_option('pyre_tags') == 'On'): ?> 
					<p class="post-tags">
						<?php the_tags('', ''); ?>
					</p>
					<?php endif; ?>
					
					<div class='clear'></div>
				</div>
				
				<?php if(
					get_option('pyre_twitter') == 'On' ||
					get_option('pyre_facebook') == 'On' ||
					get_option('pyre_digg') == 'On' ||
					get_option('pyre_stumbleupon') == 'On' ||
					get_option('pyre_reddit') == 'On' ||
					get_option('pyre_tumblr') == 'On' ||
					get_option('pyre_email') == 'On' ||
					get_option('pyre_google') == 'On'
				): ?>
				<div class='post-share'>
					<?php if(get_option('pyre_twitter') == 'On'): ?>
					<div class='twitter-share share-widget'>
						<a href="http://twitter.com/share" class="twitter-share-button" data-text='<?php the_title(); ?>' data-count="vertical">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
					</div>
					<?php endif; ?>
					<?php if(get_option('pyre_facebook') == 'On'): ?>
					<div class='facebook-share share-widget'>
						<iframe src="http://www.facebook.com/plugins/like.php?app_id=149766198425277&amp;href=<?php echo urlencode(get_permalink($post->ID)); ?>&amp;send=false&amp;layout=box_count&amp;width=450&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=62" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:62px;" allowTransparency="true"></iframe>
					</div>
					<?php endif; ?>
					<?php if(get_option('pyre_digg') == 'On'): ?>
					<div class='digg-share share-widget'>
						<script type="text/javascript">
						(function() {
						var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0];
						s.type = 'text/javascript';
						s.async = true;
						s.src = 'http://widgets.digg.com/buttons.js';
						s1.parentNode.insertBefore(s, s1);
						})();
						</script>
						<a class="DiggThisButton DiggMedium" href="http://digg.com/submit?url=<?php echo urlencode(get_permalink($post->ID)); ?>&amp;title=<?php echo urlencode(get_the_title()); ?>"></a>
					</div>
					<?php endif; ?>
					<?php if(get_option('pyre_stumbleupon') == 'On'): ?>
					<div class='stumbleupon-share share-widget'>
						<script src="http://www.stumbleupon.com/hostedbadge.php?s=5"></script>
					</div>
					<?php endif; ?>
					<?php if(get_option('pyre_reddit') == 'On'): ?>
					<div class='reddit-share share-widget'>
						<script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script>
					</div>
					<?php endif; ?>
					<?php if(get_option('pyre_tumblr') == 'On'): ?>
					<div class='tumblr-share share-widget'>
						<a href="http://www.tumblr.com/share" title="Share on Tumblr" style="display:inline-block; text-indent:-9999px; overflow:hidden; width:62px; height:20px; background:url('http://platform.tumblr.com/v1/share_2.png') top left no-repeat transparent;">Share on Tumblr</a>
					</div>
					<?php endif; ?>
					<?php if(get_option('pyre_email') == 'On'): ?>
					<div class='email-share share-widget'>
						<a href="mailto:?subject=<?php the_title(); ?>&amp;body=<?php the_permalink(); ?>"><img src='<?php bloginfo('template_url'); ?>/images/email-share.png' alt='Email Share' /></a>
					</div>
					<?php endif; ?>
					<?php if(get_option('pyre_google') == 'On'): ?>
					<div class='google-share share-widget'>
						<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
						<g:plusone size="tall"></g:plusone>
					</div>
					<?php endif; ?>
				</div>
				<?php endif; ?>
				
				<?php if(get_option('pyre_author') == 'On'): ?>
				<div class="homepage-widget">
					<div class="post-author block full">
						<h3><?php _e('About the Author', 'Broadway'); ?>: <?php the_author_posts_link(); ?><span></span></h3>
						<div class="block-content clearfix">
							<?php echo get_avatar(get_the_author_meta('email'), '75'); ?>
							<div class="author-description">
							<p class="desc"><?php the_author_meta("description"); ?></p>
							<?php if(get_the_author_meta('twitter') || get_the_author_meta('facebook')): ?>
							<p class="clearfix">
								<?php if(get_the_author_meta('twitter')): ?>
								<a class="twitter" href='http://twitter.com/<?php echo get_the_author_meta('twitter'); ?>'>Twitter</a>
								<?php endif; ?>
								
								<?php if(get_the_author_meta('facebook')): ?>
								<a class="facebook" href='http://facebook.com/<?php echo get_the_author_meta('facebook'); ?>'>Facebook</a>
								<?php endif; ?>
							</p>
							<?php endif; ?>
							</div>
						</div>
					</div>
				</div>
				<?php endif; ?>
				
				<?php $related = get_related_posts($post->ID); ?>
				<?php if($related->have_posts() && get_option('pyre_related') == 'On'): ?>
				<div class='related-posts homepage-widget'>
					<div class="block full">
						<h3><?php _e('Related Posts', 'Broadway'); ?><span></span></h3>
							<div class="block-content clearfix">
								<div class="jcarousel-skin-media">
									<ul>
										<?php while($related->have_posts()): $related->the_post(); ?>
										<?php if(has_post_thumbnail()): ?>
										<li>
											<div class="post-thumb-container">
												<?php
												if(has_post_format('video') || has_post_format('audio') || has_post_format('gallery')) {
													$icon = '<span class="post-format ' . get_post_format($post->ID) . '"></span>';
												} else {
													$icon = '';
												}
												echo $icon;
												?>
												<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="post-thumbnail">
													<?php the_post_thumbnail('carousel', array('alt' => get_the_title(), 'title' => get_the_title())); ?>
												</a>
												<?php if(get_post_meta($post->ID, 'pyre_overall_score', true)): ?>
												<div class="post-score"><img src="<?php bloginfo('template_directory'); ?>/images/stars/<?php echo get_post_meta($post->ID, 'pyre_overall_score', true); ?>.png" alt="" /></div>
												<?php endif; ?>
											</div>
										</li>
										<?php endif; endwhile; ?>
									</ul>
								</div>
							</div>
					</div>
				</div>
				<?php endif; ?>
				<?php wp_reset_query(); ?>
				
				<div id="comments">
				
					<?php comments_template(); ?>
					
				</div>
				
				<?php endwhile; endif; ?>
			
			</div>
			<!-- END MAIN -->
			
<?php get_sidebar(); ?>
			
<?php get_footer(); ?>