$(function() {
 	$('header').localScroll({
		duration: 250,
		easing: 'easeInOutQuint',
		offset: 0
	});
	
	$('.projects').localScroll({
		duration: 250,
		easing: 'easeInOutQuint',
		offset: 0
	});
	
	$('.thumbnail-info > h6 > a').click(function() { // write if statement for if selected
		var $active = $(this);
		
		$('.thumbnail-active').removeClass('thumbnail-active');
		$active.addClass('thumbnail-active');
		
		$('.detail-slider').slideToggle();
		
	});
	
	// Register each section as a waypoint
	$(".portfolio-section").waypoint({ 
		offset: '5%' 
	});
	
	// The same for all waypoints
	$('body').delegate(".portfolio-section", 'waypoint.reached', function(event, direction) {
		var $active = $(this);
		
		if (direction === "up") {
			$active = $active.prev();
		}
		
		if (!$active.length) $active.end();
		
		$('.section-active').removeClass('section-active');
		$active.addClass('section-active');
		
		$('.link-active').removeClass('link-active');
		$('a[href=#'+$active.attr('id')+']').addClass('link-active');	
	});
	
	$(".thumbnail-info a").prettyPhoto({
		theme: 'dark_square',
		social_tools: false
	});
	
	if(navigator.platform == 'iPad' || navigator.platform == 'iPhone' || navigator.platform == 'iPod')
	{
	    $("header").css("position", "static");
		$("#contact").css("position", "static");
	};

});



