$(document).ready(function() {

	var loading = $('#loading'),
		link = $('.anchor'),
		header = $('#header'),
		content = $('#content'),
		footer = $('#footer'),
		panels = $('#panels'),
		features = $('#featurePanels'),
		feature = $('#features ul a');

	$(window).load(function(){
		loading.slideUp(1000,function(){
			var t = $(this);
			
			t.remove();
			header.fadeIn(1000,function(){
				content.fadeIn(1000, function(){
					footer.fadeIn(1000);
				});
			});
		});
	});
	
	link.click(function(e){
		
		e.preventDefault();
	
		var t = $(this),
			rel = t.attr('href').substr(1);
			
		panels.scrollTo( '#'+rel, 1000, {queue:true} );
		
		link.removeClass('active');
		t.addClass('active');
		
	});
	
	feature.click(function(e){
		
		e.preventDefault();
	
		var t = $(this),
			rel = t.attr('href').substr(1);
			
		features.scrollTo( '#'+rel, 1000, {queue:true} );
		
		feature.removeClass('active');
		t.addClass('active');
		
	});
	
});
