<?php 
get_header(); 
while(have_posts()):
the_post();
$next_vimeo      =  get_post_meta($post->ID,'next_port_vimeo',true); 
$next_youtube    =  get_post_meta($post->ID,'next_port_youtube',true); 
$next_slider     =  get_post_meta($post->ID,'next_port_sliderimages',false); 
?>
<div id="portfolio_item">
     <!-- Content -->
     <div id="item_content">

          <!-- Control buttons -->
          <div id="control_buttons" class='clearfix'>
               <a href="#" id="close">X</a>
               <!-- <a href="youtube_item.htm" id="next">&gt;</a>
               <a href="vimeo_item.htm" id="prev">&lt;</a> -->
          </div>


<?php if($next_vimeo !=''): ?>
          <div id="item_video_wrapper">
               <div id="item_video">
                    <iframe src="http://player.vimeo.com/video/<?php echo $next_vimeo; ?>" width="500" height="281" allowFullScreen></iframe>
               </div>
          </div>
<?php endif; ?>
<?php if($next_youtube !=''): ?>
          <div id="item_video_wrapper">
               <div id="item_video">
                    <iframe width="620" height="360" src="http://www.youtube.com/embed/<?php echo $next_youtube; ?>?feature=player_detailpage" allowfullscreen></iframe>
               </div>
          </div>
<?php endif; ?>          
<?php if(!empty($next_slider)): ?>  
          <div id="item_slider">
            <ul class="slides">
              <?php
                $slides = count($next_slider);
                if($slides > 0):
                 for($i=0;$i<$slides;$i++)
                 {
                    $imurl = wp_get_attachment_image_src($next_slider[$i],'full');
                    echo '<li><img src="'.$imurl[0].'" alt="" /></li>';
                 }
                endif; 
              ?>
            </ul>
          </div>
<?php endif; ?> 

<!-- Text Content -->
          <div id="text_content">
               
               <h3><?php the_title(); ?></h3>

              <?php the_content(); ?>
          </div>
        

     <div class="clear"></div>
     </div>
     <!-- End: Content -->
</div>


<?php 
endwhile;
get_footer();