$(document).ready(function() {
		
		// Fade page container in
													 
		$('#container').fadeIn(600);
		
		//Hide stuffs
		
		$('#contact').hide();
		
		// Thumbnail hover animations
		
		$('.content a').hover(
			function() {
				$("img", this).stop(true, false).fadeTo(100, 0.4);
			},
			function() {
				$("img", this).stop(true, false).fadeTo(300, 1);
		});
		
		// Contact expando/collapso 
		
		$('.contact').click(function() {
			$('#contact').slideToggle(300);
			return false;
		});
		
		// Contact close
		
		$('#contact a.close-contact').click(function() {
			$('#contact').slideUp(300);
			return false;
		});
		
		// Projects view toggle
											 	 
		$('a.grid').click(function() {
			$('#projects').fadeOut("fast", function() {
				$(this).fadeIn(800).removeClass().addClass("grid");	
				});
			return false;
		});
		
		$('a.thumb').click(function() {
			$('#projects').fadeOut("fast", function() {
				$(this).fadeIn(800).removeClass().addClass("thumb");	
				});
			return false;
		});
		
		$('a.list').click(function() {
			$('#projects').fadeOut("fast", function() {
				$(this).fadeIn(800).removeClass().addClass("list");	
				});
			return false;
		});
		
		// Stream hover animations
		
		$('.stream .content').hover(
			function() {
				$("article", this).stop(true, false).fadeTo(100, .8);
			},
			function() {
				$("article", this).stop(true, false).fadeTo(300, 1);
		});
		
		$('.stream .content article').hover(
			function() {
				$(this).stop(true, false).fadeTo(100, 1);
			},
			function() {
				$(this).stop(true, false).fadeTo(300, .8);
		});	
		
		// Gallery open
		
		$('#project-images').fadeOut(10);
		
		$('.gallery-open').click(function() {
			$('#project-images').slideDown(300);
			return false;
		});
		
		// Gallery close
		
		$('.gallery-close').click(function() {
			$('#project-images').slideUp(300);
			return false;
		});
		
		// Hide/show grids 
		
		$('.show-grids').click(function() {
			$('.grid-actions').slideToggle(300);
			return false;
		});
	
});
