<?php get_header(); ?>



	<?php if(of_get_option('display_home_slideshow') == '1') { ?>



	    <!-- BEGIN #slideshow -->

	    <div id="slideshow">

	    

	    	<!-- BEGIN .row -->

	        <div class="row">

	            

	            <!-- BEGIN .flexslider -->

	            <div class="flexslider loading" data-speed="<?php echo of_get_option('transition_interval'); ?>">

	            

	                <!-- BEGIN ul.slides -->

	                <ul class="slides">

	                    <?php $wp_query = new WP_Query(array('cat'=>of_get_option('category_home_slideshow'),'posts_per_page'=>of_get_option('postnumber_home_slideshow'))); ?>

	                    <?php if($wp_query->have_posts()) : while($wp_query->have_posts()) : $wp_query->the_post(); ?>

	                    <?php $meta_box = get_post_custom($post->ID); $video = $meta_box['custom_meta_video'][0]; ?>

	                    <?php global $more; $more = 0; ?>

	                    <li>

	                        <?php if ( $video ) : ?>

	                            <div class="feature_vid"><?php echo $video; ?></div>

	                        <?php else: ?>

	                        	<?php if ( has_post_thumbnail()) { ?>

	                            	<a class="feature_img" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail( 'slideshow' ); ?></a>

	                            <?php } else { ?>

	                            	<a class="feature_img" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><img src="<?php bloginfo('template_directory'); ?>/images/default-slide.png" alt="<?php the_title(); ?>" /></a>

	                            <?php } ?>

	                        <?php endif; ?>

	                        <?php if(of_get_option('display_home_slide_info') == '1') { ?>

		                        <div class="slide-info">

		                            <h2 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>

		                            <?php the_excerpt(); ?>

		                        </div>

	                        <?php } else { ?>

	                        <?php } ?>

	                    </li>

	                    <?php endwhile; ?>

	                    <?php else : // do not delete ?>

	                    <?php endif; // do not delete ?>

	

	                <!-- END ul.slides -->

	                </ul>

	                

	            <!-- END .flexslider -->

	            </div>

	    

	        <!-- END .row -->

	        </div>

	            

	    <!-- END #slideshow -->

	    </div>

    

    <?php } else { ?>

    <?php } ?>



    <?php if(of_get_option('display_home_posts') == '1') { ?>

    

        <!-- BEGIN #homepage -->





<div class="row">

			<div id="banner"></div>

		</div>





        <div id="homepage">

        	



        	<!-- BEGIN .row -->

        	<div class="row">

                    

                <?php $wp_query = new WP_Query(array('cat'=>of_get_option('category_home'),'posts_per_page'=>of_get_option('postnumber_home'),'paged'=>$paged)); ?>

                <?php $post_class = 'first'; ?>

                <?php if($wp_query->have_posts()) : while($wp_query->have_posts()) : $wp_query->the_post(); ?>

                <?php $meta_box = get_post_custom($post->ID); $video = $meta_box['custom_meta_video'][0]; ?>

                <?php global $more; $more = 0; ?>

                

                    <!-- BEGIN .three columns -->

                    <div class="three columns <?php echo $post_class; ?>">

                        

                        <?php

                            if ('first' == $post_class){

                              $post_class = 'second';

                            }elseif ('second' == $post_class){

                              $post_class = 'third';

                            }elseif ('third' == $post_class){

                              $post_class = 'fourth';

                            }else{

                              $post_class = 'first';

                            }

                        ?>

                        

                        <?php if ( has_post_thumbnail()) { ?>

                        	<a class="feature_img" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail( 'home-thumb' ); ?></a>

                        <?php } else { ?>

                        	<a class="feature_img" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><img src="<?php bloginfo('template_directory'); ?>/images/default-home.png" alt="<?php the_title(); ?>" /></a>

                        <?php } ?>

                        

                        <?php if(of_get_option('display_home_info') == '1') { ?>

	                        <div class="home_info">

	                            <h2 class="title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

	                            <?php the_excerpt(); ?>

	                        </div><!-- .homeboxinfo -->

                        <?php } else { ?>

                        <?php } ?>

                    

                    <!-- END .three columns -->



                    </div>





          

               

                <?php endwhile; ?>







                <?php else : // do not delete ?>

                <?php endif; // do not delete ?>





       

            <!-- END .row -->   

            </div>







        

        <!-- END #homepage -->        

        </div>







    <?php } else { ?>

    <?php } ?>







<div="lineatrasphome">





</div>





<?php get_footer(); ?>