<?php
	/**
	 * archive-dslc_projects.php
	 * The project archive used in Ainex
	 * @author Vu Ngoc Linh
	 * @package Ainex
	 * @since 1.0.0
	 */
	get_header();
	global $ainex;
?>

    <?php if(!is_home() && !is_front_page()){ ?>
	    <div class="page_title">
	      <div class="container">
	        <div class="title">
	          <h1><?php echo get_queried_object()->name; ?></h1>
	        </div>
	        <div class="pagenation"><?php ts_breadcrumbs(); ?><?php echo get_queried_object()->name; ?></div>
	      </div>
	    </div>
	<?php } ?>

	<div class="container">
		<?php if ($ainex['portfolio_switch_filter'] == true): ?>
			<div class="clearfix mar_top7"></div>
			<div class="portfolio_page">
				<div class="portfolioFilter">
		            <a href="#" data-filter="*" class="current">All</a>
		            <?php
		            	$filters = get_categories('taxonomy=dslc_projects_cats');
	                	foreach( $filters as $filter ){ 
	                		echo ' <a href="#" data-filter=".'. $filter->slug .'">'. $filter->name .'</a>';
	                	}
		            ?>
		        </div>
				<div class="clearfix mar_top5"></div>
		        <div class="portfolioContainer">
					<?php get_template_part('loop/loop-portfolio', 'filter'); ?>
				</div>
				<div class="clearfix mar_top4"></div>

				<!-- isotope -->
				<script type="text/javascript">
				/* <![CDATA[ */
					jQuery(document).ready(function($) {
						var container = $('.portfolioContainer');
					    container.isotope({
					        filter: '*',
					        animationOptions: {
					            duration: 750,
					            easing: 'linear',
					            queue: false
					        }
					    });

					    $('.portfolioFilter a').click(function(){
					        $('.portfolioFilter .current').removeClass('current');
					        $(this).addClass('current');
					        var selector = $(this).attr('data-filter');
					        container.isotope({
					            filter: selector,
					            animationOptions: {
					                duration: 750,
					                easing: 'linear',
					                queue: false
					            }
					         });
					         return false;
					    });
					});
				/* ]]> */
				</script><script type="text/javascript">
				/* <![CDATA[ */
					jQuery(document).ready(function($) {
				        /* Simple image gallery. Uses default settings */
				        $('.fancybox').fancybox();
				        /* media effects*/
				        $(document).ready(function() {
				            $('.fancybox-media').fancybox({
				                openEffect  : 'none',
				                closeEffect : 'none',
				                helpers : {
				                    media : {}
				                }
				            });
				        });
				        $(".fancybox.iframe").fancybox({
							maxWidth	: 800,
							maxHeight	: 600,
							fitToView	: false,
							width		: '70%',
							height		: '70%',
							autoSize	: false,
							closeClick	: false,
							openEffect	: 'none',
							closeEffect	: 'none'
						});
				    });
				/* ]]> */
				</script>
			</div>
		<?php else: ?>
			<div class="content_fullwidth">
				<?php get_template_part('loop/loop-portfolio', 'lightbox'); ?>
			</div>
			<script type="text/javascript">
			/* <![CDATA[ */
				jQuery(document).ready(function($) {
			        /* Simple image gallery. Uses default settings */
			        $('.fancybox').fancybox();

			        /* media effects*/
			        $(document).ready(function() {
			            $('.fancybox-media').fancybox({
			                openEffect  : 'none',
			                closeEffect : 'none',
			                helpers : {
			                    media : {}
			                }
			            });
			        });
			        $(".fancybox.iframe").fancybox({
						maxWidth	: 800,
						maxHeight	: 600,
						fitToView	: false,
						width		: '70%',
						height		: '70%',
						autoSize	: false,
						closeClick	: false,
						openEffect	: 'none',
						closeEffect	: 'none'
					});

			    });
			/* ]]> */
			</script>
		<?php endif ?>
  	</div><!-- .container -->
  	<div class="clearfix"></div>

<?php get_footer();