<?php
if(file_exists('../../../../wp-load.php')) :
	include '../../../../wp-load.php';
else:
	include '../../../../../wp-load.php';
endif; 
?> 
                
                
                <?php
				
				$postId = $_GET['id'];
				$next = $_GET['next'];
				$prev = $_GET['prev'];
				
				if($next == $postId)
					$next = 'hidden';
				
				//Query the database
				query_posts( array (
					'post_type' => 'photo',
					'p' => $postId,
					)
				);
				?>
                
                <?php 
					if (have_posts()) : while (have_posts()) : the_post(); 
				?>
                <!-- BEGIN #gallery-container -->
                <div id="gallery-container">
                    
                    <!-- BEGIN #gallery-header -->
                    <div id="gallery-header" class="clearfix">
                    
                        <!-- BEGIN #gallery-title-wrap -->
                        <div id="gallery-title-wrap">
                            <h1 class="gallery-title"><?php the_title(); ?> <span>/ </span></h1>
                            <?php the_content(); ?>
                        <!-- END #gallery-title-wrap -->
                        </div>
                        
                        <!-- BEGIN #gallery-nav -->
                        <div id="gallery-nav">
                            <ul>
                                <li class="gallery-prev"><a id="prev-post" class="<?php echo $next; ?>" data-id="<?php echo $prev; ?>" href="#">Previous</a></li>
                                <li class="gallery-next"><a id="next-post" class="<?php echo $next; ?>" data-id="<?php echo $next; ?>" href="#">Next</a></li>
                                <li class="gallery-close"><a href="#">Close</a></li>
                            </ul>
                        <!-- END #gallery-nav -->
                        </div>
                    
                    <!-- END #gallery-header -->
                    </div>
                    
                    <!-- BEGIN #gallery-photo -->
                    <div id="gallery-photo">
                    
                        	<?php
							if (  (function_exists('has_post_thumbnail')) && (has_post_thumbnail())  ) : ?>
							<?php the_post_thumbnail('full'); ?>
							<?php endif; ?>
                    
                    <!-- END#gallery-photo -->
                    </div>
                    
                <!-- END #gallery-container -->
                </div>
                
                <!-- BEGIN #gallery-footer-wrap -->
                <div id="gallery-footer-wrap">
                
                    <!-- BEGIN #gallery-footer -->
                    <div id="gallery-footer">
                    
                        <p class="copyright">&copy; Copyright <?php echo date( 'Y' ); ?> <?php bloginfo( 'name' ); ?>. <?php _e('Powered by', 'framework') ?> <a href="http://wordpress.org/">WordPress</a><br /> <a href="http://www.premiumpixels.com/viewfinder">Viewfinder Theme</a> by <a href="http://www.premiumpixels.com">Orman Clark</a></p>
                        
                        <!-- BEGIN #gallery-footer -->
                        <div id="gallery-footer-desc">
                            
                            <?php $desc = get_post_meta(get_the_ID(), 'tz_image_desc', TRUE); ?>
                            <?php if($desc != '') : ?>
                            <p>
                            	<?php echo $desc; ?>
							</p>
                            <?php endif; ?>
                            
                            <?php if(get_option('tz_exif') == 'true') : ?>
                            <p>
                            	<?php
								$image_id = get_post_thumbnail_id();
								echo tz_grab_exif_data_from_wp($image_id);
								?>
							</p>
                            <?php endif; ?>
                            
                        <!-- END #gallery-footer-desc -->
                        </div>
                    
                    <!-- END #footer -->
                    </div>
                    
                <!-- END #gallery-footer-wrap -->   
                </div>
                
                <?php endwhile; endif; ?>