<div class="homeVideos">
<div id="latestPostsTop">
<div id="latestPostsTitle" style="float:none; width:100%; ">
        <h2><?php _e('Latest Videos','lioit') ?></h2>
</div><!--End Latest PostsTitle-->
<span class="titleArrow"></span>
</div>
<div class="mainVideos">
	<div class="mainVideo">
    	<?php query_posts(array('post_type' => 'videos','showposts' => '1')); ?>
        <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    	<div class="homeVideo mainBorder">
        	<div class="homeVideoThumb">
				<?php
                $video_type = get_post_meta($post->ID, 'lioit_video_type', true);
                $video_id = get_post_meta($post->ID, 'lioit_video_id', true);
                $video_thumb = get_post_meta($post->ID, 'lioit_video_thumb', true);
                $featured_image = get_post_meta($post->ID, 'featured_image', true);
                $video = get_post_meta($post->ID, 'video', true);
                ?> 
                <?php if($video_thumb == 'video') { ?>
                    <?php if($video_type == 'Youtube') { ?>
                    <iframe width="350" height="315" src="http://www.youtube.com/embed/<?php echo $video_id; ?>?rel=0" frameborder="0" allowfullscreen></iframe>
                    <?php } elseif($video_type == 'Vimeo') { ?>
                    <iframe src="http://player.vimeo.com/video/<?php echo $video_id; ?>?title=0&amp;byline=0&amp;portrait=0&amp;color=ba0d16" width="350" height="315" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
                    <?php } elseif($video_type == 'Dialymotion') { ?>
                    <iframe frameborder="0" width="350" height="315" src="http://www.dailymotion.com/embed/video/<?php echo $video_id ?>?logo=0"></iframe>
                    <?php } ?>
                <?php } elseif($video_thumb == 'featured_image') { ?>
                    <div class="homeVThumb ThumbCover">
                    	<div class="cover" style="top: 100%;">
                                            <a class="postype" href="<?php the_permalink(); ?>"></a>
                                            <a class="detail" href="<?php the_permalink(); ?>" title="View detail"></a>										
                                        </div>
                        <?php $img = catch_that_image($post->ID); ?>
                        <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
                        <img src="<?php echo Lioit_URI; ?>/scripts/timthumb.php?src=<?php echo $img ?>&amp;w=350&amp;h=315&amp;zc=1" alt="<?php the_title(); ?>" />
                        </a>
                    </div><!--End HomeVideo Thumb-->
                <?php } ?>
            </div><!--End Home Video Thumb-->
        	<div class="homeVideoContent">
            	<h3 class="videoTitle"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
                <p><?php the_excerpt_max_charlength('100'); ?> ...</p>
            </div><!--End Video Content-->
            
        </div><!--End Video-->
        <?php endwhile; ?>
		<?php  else:  ?>
        <!-- Else in here -->
        <?php  endif; ?>
        <?php wp_reset_query(); ?>
    </div><!--End Main Video-->
    <div class="VideosList">
    	<ul>
        	<?php query_posts(array('post_type' => 'videos','showposts' => '2','offset' => 1)); ?>
        	<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
        	<li class="smallVideo mainBorder">
            	<div class="smallVideoitem">
                	<?php
					$video_type = get_post_meta($post->ID, 'lioit_video_type', true);
					$video_id = get_post_meta($post->ID, 'lioit_video_id', true);
					$video_thumb = get_post_meta($post->ID, 'lioit_video_thumb', true);
					$featured_image = get_post_meta($post->ID, 'featured_image', true);
					$video = get_post_meta($post->ID, 'video', true);
					?> 
					<?php if($video_thumb == 'video') { ?>
						<?php if($video_type == 'Youtube') { ?>
						<iframe width="275" height="169" src="http://www.youtube.com/embed/<?php echo $video_id; ?>?rel=0" frameborder="0" allowfullscreen></iframe>
						<?php } elseif($video_type == 'Vimeo') { ?>
						<iframe src="http://player.vimeo.com/video/<?php echo $video_id; ?>?title=0&amp;byline=0&amp;portrait=0&amp;color=ba0d16" width="275" height="169" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
						<?php } elseif($video_type == 'Dialymotion') { ?>
						<iframe frameborder="0" width="275" height="169" src="http://www.dailymotion.com/embed/video/<?php echo $video_id ?>?logo=0"></iframe>
						<?php } ?>
					<?php } elseif($video_thumb == 'featured_image') { ?>
						<div class="homeVThumb ThumbCover">
                        	<div class="cover" style="top: 100%;">
                                            <a class="postype" href="<?php the_permalink(); ?>"></a>
                                            <a class="detail" href="<?php the_permalink(); ?>" title="View detail"></a>										
                                        </div>
							<?php $img = catch_that_image($post->ID); ?>
							<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
							<img src="<?php echo Lioit_URI; ?>/scripts/timthumb.php?src=<?php echo $img ?>&amp;w=275&amp;h=169&amp;zc=1" alt="<?php the_title(); ?>" />
							</a>
						</div><!--End HomeVideo Thumb-->
					<?php } ?>
                    <div class="listVideoContent">
                    <h3 class="videoTitle"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
                </div><!--End Video Content-->
                </div><!--End Small Video item-->
            </li>
            <?php endwhile; ?>
			<?php  else:  ?>
            <!-- Else in here -->
            <?php  endif; ?>
            <?php wp_reset_query(); ?>
        </ul>
    </div><!--End Video List-->
    
</div><!--End Main Videos-->
	<div class="otherVideos">
    	<ul>
        	<?php query_posts(array('post_type' => 'videos','showposts' => '5','offset' => 3)); ?>
        	<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
        	<li class="mainBorder"><h3 class="videoTitle"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3></li>
            <?php endwhile; ?>
			<?php  else:  ?>
            <!-- Else in here -->
            <?php  endif; ?>
            <?php wp_reset_query(); ?>
        </ul>
    </div><!--End OtherVideos-->
</div><!--End HomeVideos-->