$(document).ready(function() {
	
	var switchType = 'start';
	
	switchContent = function() {
	
		if(switchType == 'start'){
		
			$('#introContent').fadeOut('fast');
			
			$('#intro').animate({
				'height' : '3px'
				
			}, function(){
				$('#intro').animate({'width' : '1002px'});
			});
			
			$('#startContent').slideUp('fast');
			
			switchType = 'main';
			
		}else if (switchType == 'backToStart'){
			$('.mainContent').fadeOut('fast');
			//$('#topBar').slideDown('fast');
			$('#introContent').fadeIn('slow');
			/*$('#topBar').animate({
				'width' : '100%',
				'padding': '0'
			});*/
			$('#intro').animate({
				'width' : '100%'
			}, function(){
				$('#intro').animate({
					'height' : '150px'
					//'margin' : '40px 0'
				});
			});
			$('#startContent').slideDown('fast');
			$('.activeNav').removeClass('activeNav');
			switchType = 'start';
			
		}else if(switchType == 'main'){
			$('.mainContent').fadeOut('fast');
			$('.activeNav').removeClass('activeNav');
		};
	};
	
	$('a#navWeb').click(function(){
		switchContent();
		$(this).addClass('activeNav');
		$('.websites').slideDown('fast');
	});
	$('a#navEmail').click(function(){
		switchContent();
		$(this).addClass('activeNav');
		$('.emails').slideDown('fast');
	});
	$('a#navFlash').click(function(){
		switchContent();
		$(this).addClass('activeNav');
		$('.flash').slideDown('fast');
	});
	$('a#navPM').click(function(){
		switchContent();
		$(this).addClass('activeNav');
		$('.pm').slideDown('fast');
	});
	$('a#navContact').click(function(){
		switchContent();
		$(this).addClass('activeNav');
		$('.contact').slideDown('fast');
	});
	
	$('a#logoLink').click(function(){
		switchType = 'backToStart';
		switchContent();
	});

	$('a#navRes').CreateBubblePopup({
		position: 'bottom',
		innerHtml: 'May take a moment to load.',
		themeName: 	'blue',
		themePath: 	'images/jquerybubblepopup-theme'
	});

});
