$(document).ready(function(){

	var url = '';

	Cufon.replace('h1,h2,h3,h4,h5,h6,#project_title,#project_title,#project_description,#content_nav ul li a,#lines_of_code',{hover: 'true'});  	
	/* Load the first content page */
	$('#main_content').fadeOut();
	$('#main_content').load('about.php', function(){ $('#main_content').fadeIn("slow") });
	$('#slider_inner').load('playVideo.php');
	$('#logo').animate({'margin-right':'300px'},8000);
	
	/*load code lines */
	$('#lines_of_code').load('showCodeLines.php');
	
	/* Page Load */
	var main_content_height = $('#main_content').height();
	$('#content_nav a,.freelance_link').click(function(e){
		$('#content_nav li').removeClass();
		$(this).parent().addClass('active');
		if($(this).attr('class')=='freelance_link'){
			$('#content_nav a:last').parent().addClass('active');
		}
		url = $(this).attr('href');
		
		loadContent();
	
		e.preventDefault();
		if(url == 'portfolio.php'){
			$('#main_content').animate({'height':'445px'},1000);
		}else if(url == 'contact.php')
		{
			$('#main_content').animate({'height':'420px'},1000);
		}else
		{
			$('#main_content').animate({'height': main_content_height},1000);
		}
		
	});
	
	function loadContent(toLoad){
	
		$('.loader').animate({bottom:0},600);
		$('#main_content').load(url, '', showContent);
	
	}
	
	function showContent(){

		$('.loader').animate({bottom:'-58px'},600);

	}
	
});/* end of document ready*/


