$(document).ready(function(){
	
	//NOT SO AJAX...
	//$('#flag_content').load('carousel.html');
	$('.flag_link').addClass('bg_reason');
	$('.button_reason').addClass('click_reason');
	$('#carousel').show();
	$('#pitch_area').hide();
	$('#projects_container').hide();
	
	$('.button_reason').click(function(){
		//$('#flag_content').load('carousel.html');
		$('.flag_link').removeClass('bg_pitch bg_project');
		$('.flag_link').addClass('bg_reason');
		$('.button_pitch').removeClass('click_pitch');			//probably the most unefficient way of doing this, need simpler solution!
		$('.button_project').removeClass('click_project');
		$('#pitch_area').hide();
		$('#projects_container').hide();
		$('.flash-replaced').empty();
		$('#carousel').show();
		$('.more').show();
		$(this).addClass('click_reason');
	});
	
	$('.button_pitch').click(function(){
		//$('#flag_content').load('pitch.html');
		$('.flag_link').removeClass('bg_reason bg_project');
		$('.flag_link').addClass('bg_pitch');
		$('.button_reason').removeClass('click_reason');
		$('.button_project').removeClass('click_project');
		$('#carousel').hide();
		$('.more').hide();										//this goes with the carousel!
		$('#projects_container').hide();
		$('#pitch_area').show();
		$('.pitch_border').flash({								//when this loads with the page jump at the same time, the loader on the flash doesn't show. The jump and load MUST be separate.
    		src: '/_flash/pitch/pitch.swf',
    		width: 740,
    		height: 550
		});
		//setTimeout('location.href=\'#flag_anchor_two\'',100);	//HACK. this tells the page to the flag section timeout for 1 100th of a second otherwise the loader won't show up.
		$(this).addClass('click_pitch');
		});
	
	$('.button_project').click(function(){
		//$('#flag_content').load('project.html');
		$('.flag_link').removeClass('bg_pitch bg_reason');
		$('.flag_link').addClass('bg_project');
		$('.button_reason').removeClass('click_reason');
		$('.button_pitch').removeClass('click_pitch');
		$('#pitch_area').hide();
		$('#carousel').hide();
		$('.flash-replaced').empty();
		$('.more').hide();
		$('#projects_container').show();
		$(this).addClass('click_project');
	});
	
});